Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-stately/calendar

Package Overview
Dependencies
Maintainers
2
Versions
593
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-stately/calendar - npm Package Compare versions

Comparing version 3.0.0-nightly.2912 to 3.0.0-nightly.2917

18

dist/useCalendarState.main.js

@@ -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.0.0-nightly.2912+d80999e89",
"version": "3.0.0-nightly.2917+c34886769",
"description": "Spectrum UI components in React",

@@ -25,6 +25,6 @@ "license": "Apache-2.0",

"dependencies": {
"@internationalized/date": "3.5.4-nightly.4624+d80999e89",
"@react-stately/utils": "3.0.0-nightly.2912+d80999e89",
"@react-types/calendar": "3.0.0-nightly.2912+d80999e89",
"@react-types/shared": "3.0.0-nightly.2912+d80999e89",
"@internationalized/date": "3.5.5-nightly.4629+c34886769",
"@react-stately/utils": "3.0.0-nightly.2917+c34886769",
"@react-types/calendar": "3.0.0-nightly.2917+c34886769",
"@react-types/shared": "3.0.0-nightly.2917+c34886769",
"@swc/helpers": "^0.5.0"

@@ -38,3 +38,3 @@ },

},
"gitHead": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882"
"gitHead": "c34886769d3e69bb56553a02eead6a0fd877e754"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc