Dialog: pass state to close snippet
This commit is contained in:
@@ -126,7 +126,7 @@
|
|||||||
/** Sets bottom alignment of controls (default: end) */
|
/** Sets bottom alignment of controls (default: end) */
|
||||||
controlsAlign?: 'start' | 'center' | 'end';
|
controlsAlign?: 'start' | 'center' | 'end';
|
||||||
/** Top-right close control */
|
/** Top-right close control */
|
||||||
close?: Snippet | Omit<DialogControlButton, 'label'> | null;
|
close?: Snippet<[state: DialogState]> | Omit<DialogControlButton, 'label'> | null;
|
||||||
/**
|
/**
|
||||||
* Callback when the dialog is opened
|
* Callback when the dialog is opened
|
||||||
* @deprecated use onopenchange instead and check the open parameter
|
* @deprecated use onopenchange instead and check the open parameter
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
<!-- Close Button -->
|
<!-- Close Button -->
|
||||||
{#if close !== null}
|
{#if close !== null}
|
||||||
{#if typeof close === 'function'}
|
{#if typeof close === 'function'}
|
||||||
{@render close()}
|
{@render close(getState())}
|
||||||
{:else}
|
{:else}
|
||||||
{@render dialogCloseButton(getState(), close)}
|
{@render dialogCloseButton(getState(), close)}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user