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

@react-aria/calendar

Package Overview
Dependencies
Maintainers
2
Versions
632
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/calendar - npm Package Compare versions

Comparing version 3.0.0-nightly-25f304dea-241008 to 3.0.0-nightly-262cc758b-241114

22

dist/useCalendarCell.main.js

@@ -53,3 +53,3 @@ var $df1d8e967e73ec8e$exports = require("./utils.main.js");

let isSelectable = !isDisabled && !isUnavailable;
let isInvalid = state.isValueInvalid && ('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $cuS6T$internationalizeddate.isSameDay)(state.value, date));
let isInvalid = state.isValueInvalid && Boolean('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $cuS6T$internationalizeddate.isSameDay)(state.value, date));
if (isInvalid) isSelected = true;

@@ -103,3 +103,3 @@ // For performance, reuse the same date object as before if the new date prop is the same.

let isRangeBoundaryPressed = (0, $cuS6T$react.useRef)(false);
let touchDragTimerRef = (0, $cuS6T$react.useRef)(null);
let touchDragTimerRef = (0, $cuS6T$react.useRef)(undefined);
let { pressProps: pressProps, isPressed: isPressed } = (0, $cuS6T$reactariainteractions.usePress)({

@@ -138,3 +138,3 @@ // When dragging to select a range, we don't want dragging over the original anchor

state.setDragging(true);
touchDragTimerRef.current = null;
touchDragTimerRef.current = undefined;
state.selectDate(date);

@@ -154,3 +154,3 @@ state.setFocusedDate(date);

clearTimeout(touchDragTimerRef.current);
touchDragTimerRef.current = null;
touchDragTimerRef.current = undefined;
},

@@ -203,3 +203,3 @@ onPress () {

});
let tabIndex = null;
let tabIndex = undefined;
if (!isDisabled) tabIndex = (0, $cuS6T$internationalizeddate.isSameDay)(date, state.focusedDate) ? 0 : -1;

@@ -237,5 +237,5 @@ // Focus the button in the DOM when the state updates.

role: 'gridcell',
'aria-disabled': !isSelectable || null,
'aria-selected': isSelected || null,
'aria-invalid': isInvalid || null
'aria-disabled': !isSelectable || undefined,
'aria-selected': isSelected || undefined,
'aria-invalid': isInvalid || undefined
},

@@ -248,7 +248,7 @@ buttonProps: (0, $cuS6T$reactariautils.mergeProps)(pressProps, {

role: 'button',
'aria-disabled': !isSelectable || null,
'aria-disabled': !isSelectable || undefined,
'aria-label': label,
'aria-invalid': isInvalid || null,
'aria-invalid': isInvalid || undefined,
'aria-describedby': [
isInvalid ? errorMessageId : null,
isInvalid ? errorMessageId : undefined,
descriptionProps['aria-describedby']

@@ -255,0 +255,0 @@ ].filter(Boolean).join(' ') || undefined,

@@ -47,3 +47,3 @@ import {getEraFormat as $a074e1e2d0f0a665$export$134cbb7fb09a9522, hookData as $a074e1e2d0f0a665$export$653eddfc964b0f8a} from "./utils.module.js";

let isSelectable = !isDisabled && !isUnavailable;
let isInvalid = state.isValueInvalid && ('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $dm6hl$isSameDay)(state.value, date));
let isInvalid = state.isValueInvalid && Boolean('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $dm6hl$isSameDay)(state.value, date));
if (isInvalid) isSelected = true;

@@ -97,3 +97,3 @@ // For performance, reuse the same date object as before if the new date prop is the same.

let isRangeBoundaryPressed = (0, $dm6hl$useRef)(false);
let touchDragTimerRef = (0, $dm6hl$useRef)(null);
let touchDragTimerRef = (0, $dm6hl$useRef)(undefined);
let { pressProps: pressProps, isPressed: isPressed } = (0, $dm6hl$usePress)({

@@ -132,3 +132,3 @@ // When dragging to select a range, we don't want dragging over the original anchor

state.setDragging(true);
touchDragTimerRef.current = null;
touchDragTimerRef.current = undefined;
state.selectDate(date);

@@ -148,3 +148,3 @@ state.setFocusedDate(date);

clearTimeout(touchDragTimerRef.current);
touchDragTimerRef.current = null;
touchDragTimerRef.current = undefined;
},

@@ -197,3 +197,3 @@ onPress () {

});
let tabIndex = null;
let tabIndex = undefined;
if (!isDisabled) tabIndex = (0, $dm6hl$isSameDay)(date, state.focusedDate) ? 0 : -1;

@@ -231,5 +231,5 @@ // Focus the button in the DOM when the state updates.

role: 'gridcell',
'aria-disabled': !isSelectable || null,
'aria-selected': isSelected || null,
'aria-invalid': isInvalid || null
'aria-disabled': !isSelectable || undefined,
'aria-selected': isSelected || undefined,
'aria-invalid': isInvalid || undefined
},

@@ -242,7 +242,7 @@ buttonProps: (0, $dm6hl$mergeProps)(pressProps, {

role: 'button',
'aria-disabled': !isSelectable || null,
'aria-disabled': !isSelectable || undefined,
'aria-label': label,
'aria-invalid': isInvalid || null,
'aria-invalid': isInvalid || undefined,
'aria-describedby': [
isInvalid ? errorMessageId : null,
isInvalid ? errorMessageId : undefined,
descriptionProps['aria-describedby']

@@ -249,0 +249,0 @@ ].filter(Boolean).join(' ') || undefined,

@@ -122,4 +122,4 @@ var $df1d8e967e73ec8e$exports = require("./utils.main.js");

role: 'grid',
'aria-readonly': state.isReadOnly || null,
'aria-disabled': state.isDisabled || null,
'aria-readonly': state.isReadOnly || undefined,
'aria-disabled': state.isDisabled || undefined,
'aria-multiselectable': 'highlightedRange' in state || undefined,

@@ -126,0 +126,0 @@ onKeyDown: onKeyDown,

@@ -116,4 +116,4 @@ import {hookData as $a074e1e2d0f0a665$export$653eddfc964b0f8a, useVisibleRangeDescription as $a074e1e2d0f0a665$export$31afe65d91ef6e8} from "./utils.module.js";

role: 'grid',
'aria-readonly': state.isReadOnly || null,
'aria-disabled': state.isDisabled || null,
'aria-readonly': state.isReadOnly || undefined,
'aria-disabled': state.isDisabled || undefined,
'aria-multiselectable': 'highlightedRange' in state || undefined,

@@ -120,0 +120,0 @@ onKeyDown: onKeyDown,

@@ -40,4 +40,5 @@ var $bd6dc95a3c5ee5cd$exports = require("./intlStrings.main.js");

let start, end;
var _state_value;
if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
else start = end = state.value;
else start = end = (_state_value = state.value) !== null && _state_value !== void 0 ? _state_value : undefined;
let dateFormatter = (0, $idq92$reactariai18n.useDateFormatter)({

@@ -44,0 +45,0 @@ weekday: 'long',

@@ -31,4 +31,5 @@ import $3HATx$intlStringsmodulejs from "./intlStrings.module.js";

let start, end;
var _state_value;
if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
else start = end = state.value;
else start = end = (_state_value = state.value) !== null && _state_value !== void 0 ? _state_value : undefined;
let dateFormatter = (0, $3HATx$useDateFormatter)({

@@ -35,0 +36,0 @@ weekday: 'long',

{
"name": "@react-aria/calendar",
"version": "3.0.0-nightly-25f304dea-241008",
"version": "3.0.0-nightly-262cc758b-241114",
"description": "Spectrum UI components in React",

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

"dependencies": {
"@internationalized/date": "^3.0.0-nightly-25f304dea-241008",
"@react-aria/i18n": "^3.0.0-nightly-25f304dea-241008",
"@react-aria/interactions": "^3.0.0-nightly-25f304dea-241008",
"@react-aria/live-announcer": "^3.0.0-nightly-25f304dea-241008",
"@react-aria/utils": "^3.0.0-nightly-25f304dea-241008",
"@react-stately/calendar": "^3.0.0-nightly-25f304dea-241008",
"@react-types/button": "^3.0.0-nightly-25f304dea-241008",
"@react-types/calendar": "^3.0.0-nightly-25f304dea-241008",
"@react-types/shared": "^3.0.0-nightly-25f304dea-241008",
"@internationalized/date": "^3.0.0-nightly-262cc758b-241114",
"@react-aria/i18n": "^3.0.0-nightly-262cc758b-241114",
"@react-aria/interactions": "^3.0.0-nightly-262cc758b-241114",
"@react-aria/live-announcer": "^3.0.0-nightly-262cc758b-241114",
"@react-aria/utils": "^3.0.0-nightly-262cc758b-241114",
"@react-stately/calendar": "^3.0.0-nightly-262cc758b-241114",
"@react-types/button": "^3.0.0-nightly-262cc758b-241114",
"@react-types/calendar": "^3.0.0-nightly-262cc758b-241114",
"@react-types/shared": "^3.0.0-nightly-262cc758b-241114",
"@swc/helpers": "^0.5.0"

@@ -44,3 +44,3 @@ },

},
"stableVersion": "3.5.12"
"stableVersion": "3.5.13"
}

@@ -77,3 +77,3 @@ /*

let {date, isDisabled} = props;
let {errorMessageId, selectedDateDescription} = hookData.get(state);
let {errorMessageId, selectedDateDescription} = hookData.get(state)!;
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');

@@ -93,3 +93,3 @@ let dateFormatter = useDateFormatter({

let isSelectable = !isDisabled && !isUnavailable;
let isInvalid = state.isValueInvalid && (
let isInvalid = state.isValueInvalid && Boolean(
'highlightedRange' in state

@@ -164,3 +164,3 @@ ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0

let isRangeBoundaryPressed = useRef(false);
let touchDragTimerRef = useRef(null);
let touchDragTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
let {pressProps, isPressed} = usePress({

@@ -201,3 +201,3 @@ // When dragging to select a range, we don't want dragging over the original anchor

state.setDragging(true);
touchDragTimerRef.current = null;
touchDragTimerRef.current = undefined;

@@ -222,3 +222,3 @@ state.selectDate(date);

clearTimeout(touchDragTimerRef.current);
touchDragTimerRef.current = null;
touchDragTimerRef.current = undefined;
},

@@ -277,3 +277,3 @@ onPress() {

let tabIndex = null;
let tabIndex: number | undefined = undefined;
if (!isDisabled) {

@@ -307,3 +307,3 @@ tabIndex = isSameDay(date, state.focusedDate) ? 0 : -1;

let formattedDate = useMemo(() => cellDateFormatter.formatToParts(nativeDate).find(part => part.type === 'day').value, [cellDateFormatter, nativeDate]);
let formattedDate = useMemo(() => cellDateFormatter.formatToParts(nativeDate).find(part => part.type === 'day')!.value, [cellDateFormatter, nativeDate]);

@@ -313,5 +313,5 @@ return {

role: 'gridcell',
'aria-disabled': !isSelectable || null,
'aria-selected': isSelected || null,
'aria-invalid': isInvalid || null
'aria-disabled': !isSelectable || undefined,
'aria-selected': isSelected || undefined,
'aria-invalid': isInvalid || undefined
},

@@ -326,7 +326,7 @@ buttonProps: mergeProps(pressProps, {

role: 'button',
'aria-disabled': !isSelectable || null,
'aria-disabled': !isSelectable || undefined,
'aria-label': label,
'aria-invalid': isInvalid || null,
'aria-invalid': isInvalid || undefined,
'aria-describedby': [
isInvalid ? errorMessageId : null,
isInvalid ? errorMessageId : undefined,
descriptionProps['aria-describedby']

@@ -333,0 +333,0 @@ ].filter(Boolean).join(' ') || undefined,

@@ -131,3 +131,3 @@ /*

let {ariaLabel, ariaLabelledBy} = hookData.get(state);
let {ariaLabel, ariaLabelledBy} = hookData.get(state)!;
let labelProps = useLabels({

@@ -152,4 +152,4 @@ 'aria-label': [ariaLabel, visibleRangeDescription].filter(Boolean).join(', '),

role: 'grid',
'aria-readonly': state.isReadOnly || null,
'aria-disabled': state.isDisabled || null,
'aria-readonly': state.isReadOnly || undefined,
'aria-disabled': state.isDisabled || undefined,
'aria-multiselectable': ('highlightedRange' in state) || undefined,

@@ -156,0 +156,0 @@ onKeyDown,

@@ -22,4 +22,4 @@ /*

interface HookData {
ariaLabel: string,
ariaLabelledBy: string,
ariaLabel?: string,
ariaLabelledBy?: string,
errorMessageId: string,

@@ -31,3 +31,3 @@ selectedDateDescription: string

export function getEraFormat(date: CalendarDate): 'short' | undefined {
export function getEraFormat(date: CalendarDate | undefined): 'short' | undefined {
return date?.calendar.identifier === 'gregory' && date.era === 'BC' ? 'short' : undefined;

@@ -39,7 +39,7 @@ }

let start: CalendarDate, end: CalendarDate;
let start: CalendarDate | undefined, end: CalendarDate | undefined;
if ('highlightedRange' in state) {
({start, end} = state.highlightedRange || {});
} else {
start = end = state.value;
start = end = state.value ?? undefined;
}

@@ -46,0 +46,0 @@

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

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

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

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