Skip to content

Commit

Permalink
fix: add missing props for DateRangePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
NDOY3M4N committed Sep 3, 2024
1 parent 7539bf5 commit ffb6ec0
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
type $$Props = Props;
export let open: $$Props["open"] = undefined;
export let onOpenChange: $$Props["onOpenChange"] = undefined;
export let value: $$Props["value"] = undefined;
export let onValueChange: $$Props["onValueChange"] = undefined;
export let placeholder: $$Props["placeholder"] = undefined;
Expand Down Expand Up @@ -33,6 +35,7 @@
const {
states: {
open: localOpen,
value: localValue,
placeholder: localPlaceholder,
isInvalid: localIsInvalid,
Expand All @@ -42,6 +45,7 @@
updateOption,
ids,
} = setCtx({
defaultOpen: open,
defaultValue: value,
defaultPlaceholder: placeholder,
preventDeselect,
Expand Down Expand Up @@ -76,6 +80,13 @@
}
return next;
},
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
open = next;
}
return next;
},
});
const startFieldIds = derived(
Expand Down Expand Up @@ -197,6 +208,7 @@
localValue.set(nextValue);
}
$: placeholder !== undefined && localPlaceholder.set(placeholder);
$: open !== undefined && localOpen.set(open);
$: updateOption("disabled", disabled);
$: updateOption("isDateUnavailable", isDateUnavailable);
Expand Down

0 comments on commit ffb6ec0

Please sign in to comment.