diff --git a/web/routes/uix/components/date-picker/+page.svelte b/web/routes/uix/components/date-picker/+page.svelte index 588c07887..45bb026af 100644 --- a/web/routes/uix/components/date-picker/+page.svelte +++ b/web/routes/uix/components/date-picker/+page.svelte @@ -47,7 +47,7 @@ let value = $state(delivery); let valueInput = $state(toDateInput(delivery)); let placeholder = $state(delivery); - let open = $state(true); + let open = $state(false); let minInput = $state(toDateInput(defaultMin)); let maxInput = $state(toDateInput(defaultMax)); let required = $state(true); @@ -56,6 +56,16 @@ let closeOnDateSelect = $state(false); let mode = $state<'inline' | 'modal'>('inline'); let kind = $state<'date' | 'month' | 'year'>('date'); + + // Footer composition demo toggles. Visibility is purely structural: + // the switches decide whether each part is INCLUDED in the markup, + // not whether the part itself decides to render. Omit the part → + // nothing renders. Include it → it always renders. + let showFooter = $state(true); + let showClear = $state(true); + let showCancel = $state(true); + let showClose = $state(true); + let disableDaysOutsideMonth = $state(true); let fixedWeeks = $state(false); let pagedNavigation = $state(false); @@ -216,14 +226,6 @@ valueInput = value ? toDateInput(value) : ''; }); - // Re-open the popover whenever the kind changes — clicking the kind - // chip is outside the popover and closes it in inline mode. The demo - // wants the new view (Calendar / MonthView / YearView) visible - // immediately so the change is observable. - $effect(() => { - void kind; - open = true; - }); $effect(() => { const el = stageRef; @@ -467,18 +469,8 @@ {#if kind === 'year'} - - - - - {:else if kind === 'month'} - - - - - {:else} {#snippet children(args: DatePickerCalendarSnippetProps)} @@ -486,6 +478,7 @@ {/snippet} {/if} + {@render pickerFooter()} @@ -653,6 +646,31 @@ {/each} + +