Drop non-existent CalendarChangeEvent import
PrimeReact v10's calendar.d.ts does not export CalendarChangeEvent
(uses internal FormEvent<TValue> for onChange instead). My earlier
commit referenced the symbol and the dev bundle threw 'undefined
factory ./src/shared/hooks/useDictionaries.ts' downstream because
ScheduleFilter/ScheduleStartPage failed to load. Fall back to a
narrow inline { value: unknown } parameter type — the handler reads
e.value into a local Date | Date[] anyway.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
import { type FC, useState, useCallback, useRef, useEffect, useMemo, type FormEvent } from "react";
|
||||
import { useNavigate } from "@modern-js/runtime/router";
|
||||
import { Calendar, type CalendarChangeEvent } from "primereact/calendar";
|
||||
import { Calendar } from "primereact/calendar";
|
||||
import { Slider, type SliderChangeEvent } from "primereact/slider";
|
||||
import { useTranslation } from "@/i18n/provider.js";
|
||||
import { useLocale } from "@/i18n/useLocale.js";
|
||||
@@ -286,7 +286,7 @@ export const ScheduleFilter: FC<ScheduleFilterProps> = ({
|
||||
// the clicked day to its Mon-Sun calendar week, commit as a range,
|
||||
// and dismiss the panel. Angular parity (TZ §4.1.9.4 — the schedule
|
||||
// filter is week-granular).
|
||||
const onOutboundSelect = useCallback((e: CalendarChangeEvent): void => {
|
||||
const onOutboundSelect = useCallback((e: { value: unknown }): void => {
|
||||
const v = e.value;
|
||||
if (!v) return;
|
||||
const picked = Array.isArray(v) ? (v[0] ?? v[1]) : v;
|
||||
@@ -297,7 +297,7 @@ export const ScheduleFilter: FC<ScheduleFilterProps> = ({
|
||||
outboundCalendarRef.current?.hide();
|
||||
}, [rangeError]);
|
||||
|
||||
const onReturnSelect = useCallback((e: CalendarChangeEvent): void => {
|
||||
const onReturnSelect = useCallback((e: { value: unknown }): void => {
|
||||
const v = e.value;
|
||||
if (!v) return;
|
||||
const picked = Array.isArray(v) ? (v[0] ?? v[1]) : v;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import { type FC, useState, useCallback, useEffect, useRef, type FormEvent } from "react";
|
||||
import { useNavigate } from "@modern-js/runtime/router";
|
||||
import { useLocale } from "@/i18n/useLocale.js";
|
||||
import { Calendar, type CalendarChangeEvent } from "primereact/calendar";
|
||||
import { Calendar } from "primereact/calendar";
|
||||
import { Slider, type SliderChangeEvent } from "primereact/slider";
|
||||
import { useTranslation } from "@/i18n/provider.js";
|
||||
import { PageLayout } from "@/ui/layout/PageLayout.js";
|
||||
@@ -260,7 +260,7 @@ export const ScheduleStartPage: FC = () => {
|
||||
const returnCalendarRef = useRef<Calendar | null>(null);
|
||||
|
||||
const onOutboundDateSelect = useCallback(
|
||||
(e: CalendarChangeEvent): void => {
|
||||
(e: { value: unknown }): void => {
|
||||
const v = e.value;
|
||||
if (!v) return;
|
||||
const picked = Array.isArray(v) ? (v[0] ?? v[1]) : v;
|
||||
@@ -274,7 +274,7 @@ export const ScheduleStartPage: FC = () => {
|
||||
);
|
||||
|
||||
const onReturnDateSelect = useCallback(
|
||||
(e: CalendarChangeEvent): void => {
|
||||
(e: { value: unknown }): void => {
|
||||
const v = e.value;
|
||||
if (!v) return;
|
||||
const picked = Array.isArray(v) ? (v[0] ?? v[1]) : v;
|
||||
|
||||
Reference in New Issue
Block a user