@dvcol/neo-svelte
Version:
Neomorphic ui library for svelte 5
35 lines (34 loc) • 1.8 kB
TypeScript
import type { MouseEventHandler } from 'svelte/elements';
import type { NeoConfirmProps } from '../common/neo-confirm.model.js';
import type { NeoDialogProps } from './neo-dialog.model.js';
export type NeoDialogConfirmProps<Tag extends keyof HTMLElementTagNameMap = keyof HTMLElementTagNameMap> = {
/**
* Element(s) to render inside the trigger.
*/
children?: NeoDialogProps<Tag>['children'] | string;
/**
* Element(s) to render inside the header once open.
*/
header?: NeoDialogProps<Tag>['children'] | string;
/**
* Event Handlers that fires on close.
*/
onClose?: MouseEventHandler<HTMLButtonElement>;
/**
* Event Handlers that fires on cancel.
* If a promise is returned, the loading state will be set to true until the promise resolves.
* If the function rejects, the tooltip will not close.
*/
onCancel?: MouseEventHandler<HTMLButtonElement>;
/**
* Event Handlers that fires on confirm.
* If a promise is returned, the loading state will be set to true until the promise resolves.
* If the promise rejects, the tooltip will not close.
* @param e
*/
onConfirm?: MouseEventHandler<HTMLButtonElement>;
/**
* Optional props to pass to the dialog.
*/
dialogProps?: Omit<NeoDialogProps<Tag>, 'ref' | 'open' | 'children' | 'header' | 'modal' | 'returnValue'>;
} & Pick<NeoDialogProps<Tag>, 'ref' | 'open' | 'modal' | 'moved' | 'returnValue' | 'closedby' | 'unmountOnClose' | 'placement' | 'movable' | 'outside' | 'elevation' | 'blur' | 'slide' | 'color' | 'filled' | 'tinted' | 'backdrop' | 'borderless' | 'flex' | 'align' | 'justify' | 'width' | 'height' | 'padding' | 'in' | 'out' | 'transition' | 'use' | 'backdropProps'> & Omit<NeoConfirmProps, 'children' | 'header'>;