@react-stately/calendar
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -35,3 +35,3 @@ var $4301262d71f567b9$exports = require("./utils.main.js"); | ||
months: 1 | ||
}, minValue: minValue, maxValue: maxValue, selectionAlignment: selectionAlignment, isDateUnavailable: isDateUnavailable, pageBehavior: pageBehavior = "visible" } = props; | ||
}, minValue: minValue, maxValue: maxValue, selectionAlignment: selectionAlignment, isDateUnavailable: isDateUnavailable, pageBehavior: pageBehavior = 'visible' } = props; | ||
let calendar = (0, $cpRwL$react.useMemo)(()=>createCalendar(resolvedOptions.calendar), [ | ||
@@ -46,3 +46,3 @@ createCalendar, | ||
]); | ||
let timeZone = (0, $cpRwL$react.useMemo)(()=>value && "timeZone" in value ? value.timeZone : resolvedOptions.timeZone, [ | ||
let timeZone = (0, $cpRwL$react.useMemo)(()=>value && 'timeZone' in value ? value.timeZone : resolvedOptions.timeZone, [ | ||
value, | ||
@@ -68,7 +68,7 @@ resolvedOptions.timeZone | ||
switch(selectionAlignment){ | ||
case "start": | ||
case 'start': | ||
return (0, $4301262d71f567b9$exports.alignStart)(focusedDate, visibleDuration, locale, minValue, maxValue); | ||
case "end": | ||
case 'end': | ||
return (0, $4301262d71f567b9$exports.alignEnd)(focusedDate, visibleDuration, locale, minValue, maxValue); | ||
case "center": | ||
case 'center': | ||
default: | ||
@@ -120,3 +120,3 @@ return (0, $4301262d71f567b9$exports.alignCenter)(focusedDate, visibleDuration, locale, minValue, maxValue); | ||
// Preserve time if the input value had one. | ||
if (value && "hour" in value) setControlledValue(value.set(newValue)); | ||
if (value && 'hour' in value) setControlledValue(value.set(newValue)); | ||
else setControlledValue(newValue); | ||
@@ -135,6 +135,6 @@ } | ||
]); | ||
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isUnavailable; | ||
let validationState = isValueInvalid ? "invalid" : null; | ||
let isValueInvalid = props.isInvalid || props.validationState === 'invalid' || isUnavailable; | ||
let validationState = isValueInvalid ? 'invalid' : null; | ||
let pageDuration = (0, $cpRwL$react.useMemo)(()=>{ | ||
if (pageBehavior === "visible") return visibleDuration; | ||
if (pageBehavior === 'visible') return visibleDuration; | ||
return $6adad0c8536fc209$var$unitDuration(visibleDuration); | ||
@@ -141,0 +141,0 @@ }, [ |
@@ -29,3 +29,3 @@ import {alignCenter as $f62d864046160412$export$f4a51ff076cc9a09, alignEnd as $f62d864046160412$export$530edbfc915b2b04, alignStart as $f62d864046160412$export$144a00ba6044eb9, constrainStart as $f62d864046160412$export$5bb865b12696a77d, constrainValue as $f62d864046160412$export$4f5203c0d889109e, isInvalid as $f62d864046160412$export$eac50920cf2fd59a, previousAvailableDate as $f62d864046160412$export$a1d3911297b952d7} from "./utils.module.js"; | ||
months: 1 | ||
}, minValue: minValue, maxValue: maxValue, selectionAlignment: selectionAlignment, isDateUnavailable: isDateUnavailable, pageBehavior: pageBehavior = "visible" } = props; | ||
}, minValue: minValue, maxValue: maxValue, selectionAlignment: selectionAlignment, isDateUnavailable: isDateUnavailable, pageBehavior: pageBehavior = 'visible' } = props; | ||
let calendar = (0, $7G4ZY$useMemo)(()=>createCalendar(resolvedOptions.calendar), [ | ||
@@ -40,3 +40,3 @@ createCalendar, | ||
]); | ||
let timeZone = (0, $7G4ZY$useMemo)(()=>value && "timeZone" in value ? value.timeZone : resolvedOptions.timeZone, [ | ||
let timeZone = (0, $7G4ZY$useMemo)(()=>value && 'timeZone' in value ? value.timeZone : resolvedOptions.timeZone, [ | ||
value, | ||
@@ -62,7 +62,7 @@ resolvedOptions.timeZone | ||
switch(selectionAlignment){ | ||
case "start": | ||
case 'start': | ||
return (0, $f62d864046160412$export$144a00ba6044eb9)(focusedDate, visibleDuration, locale, minValue, maxValue); | ||
case "end": | ||
case 'end': | ||
return (0, $f62d864046160412$export$530edbfc915b2b04)(focusedDate, visibleDuration, locale, minValue, maxValue); | ||
case "center": | ||
case 'center': | ||
default: | ||
@@ -114,3 +114,3 @@ return (0, $f62d864046160412$export$f4a51ff076cc9a09)(focusedDate, visibleDuration, locale, minValue, maxValue); | ||
// Preserve time if the input value had one. | ||
if (value && "hour" in value) setControlledValue(value.set(newValue)); | ||
if (value && 'hour' in value) setControlledValue(value.set(newValue)); | ||
else setControlledValue(newValue); | ||
@@ -129,6 +129,6 @@ } | ||
]); | ||
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isUnavailable; | ||
let validationState = isValueInvalid ? "invalid" : null; | ||
let isValueInvalid = props.isInvalid || props.validationState === 'invalid' || isUnavailable; | ||
let validationState = isValueInvalid ? 'invalid' : null; | ||
let pageDuration = (0, $7G4ZY$useMemo)(()=>{ | ||
if (pageBehavior === "visible") return visibleDuration; | ||
if (pageBehavior === 'visible') return visibleDuration; | ||
return $131cf43a05231e1e$var$unitDuration(visibleDuration); | ||
@@ -135,0 +135,0 @@ }, [ |
@@ -34,3 +34,3 @@ var $4301262d71f567b9$exports = require("./utils.main.js"); | ||
let [anchorDate, setAnchorDateState] = (0, $e7F0I$react.useState)(null); | ||
let alignment = "center"; | ||
let alignment = 'center'; | ||
if (value && value.start && value.end) { | ||
@@ -41,3 +41,3 @@ let start = (0, $4301262d71f567b9$exports.alignCenter)((0, $e7F0I$internationalizeddate.toCalendarDate)(value.start), visibleDuration, locale, minValue, maxValue); | ||
}); | ||
if (value.end.compare(end) > 0) alignment = "start"; | ||
if (value.end.compare(end) > 0) alignment = 'start'; | ||
} | ||
@@ -121,4 +121,4 @@ // Available range must be stored in a ref so we have access to the updated version immediately in `isInvalid`. | ||
]); | ||
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isInvalidSelection; | ||
let validationState = isValueInvalid ? "invalid" : null; | ||
let isValueInvalid = props.isInvalid || props.validationState === 'invalid' || isInvalidSelection; | ||
let validationState = isValueInvalid ? 'invalid' : null; | ||
return { | ||
@@ -167,3 +167,3 @@ ...calendar, | ||
// Preserve time if the input value had one. | ||
if (oldValue && "hour" in oldValue) return oldValue.set(newValue); | ||
if (oldValue && 'hour' in oldValue) return oldValue.set(newValue); | ||
return newValue; | ||
@@ -170,0 +170,0 @@ } |
@@ -28,3 +28,3 @@ import {alignCenter as $f62d864046160412$export$f4a51ff076cc9a09, constrainValue as $f62d864046160412$export$4f5203c0d889109e, isInvalid as $f62d864046160412$export$eac50920cf2fd59a, previousAvailableDate as $f62d864046160412$export$a1d3911297b952d7} from "./utils.module.js"; | ||
let [anchorDate, setAnchorDateState] = (0, $d0gbl$useState)(null); | ||
let alignment = "center"; | ||
let alignment = 'center'; | ||
if (value && value.start && value.end) { | ||
@@ -35,3 +35,3 @@ let start = (0, $f62d864046160412$export$f4a51ff076cc9a09)((0, $d0gbl$toCalendarDate)(value.start), visibleDuration, locale, minValue, maxValue); | ||
}); | ||
if (value.end.compare(end) > 0) alignment = "start"; | ||
if (value.end.compare(end) > 0) alignment = 'start'; | ||
} | ||
@@ -115,4 +115,4 @@ // Available range must be stored in a ref so we have access to the updated version immediately in `isInvalid`. | ||
]); | ||
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isInvalidSelection; | ||
let validationState = isValueInvalid ? "invalid" : null; | ||
let isValueInvalid = props.isInvalid || props.validationState === 'invalid' || isInvalidSelection; | ||
let validationState = isValueInvalid ? 'invalid' : null; | ||
return { | ||
@@ -161,3 +161,3 @@ ...calendar, | ||
// Preserve time if the input value had one. | ||
if (oldValue && "hour" in oldValue) return oldValue.set(newValue); | ||
if (oldValue && 'hour' in oldValue) return oldValue.set(newValue); | ||
return newValue; | ||
@@ -164,0 +164,0 @@ } |
{ | ||
"name": "@react-stately/calendar", | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,6 +25,6 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@internationalized/date": "^3.5.3", | ||
"@react-stately/utils": "^3.10.0", | ||
"@react-types/calendar": "^3.4.5", | ||
"@react-types/shared": "^3.23.0", | ||
"@internationalized/date": "^3.5.4", | ||
"@react-stately/utils": "^3.10.1", | ||
"@react-types/calendar": "^3.4.6", | ||
"@react-types/shared": "^3.23.1", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -38,3 +38,3 @@ }, | ||
}, | ||
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd" | ||
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
223241
0