carbon-components-svelte/types/ComposedModal/ComposedModal.d.ts
Eric Liu 0a69f8ec74
Various features/fixes (#727)
* fix(data-table): export useStaticWidth prop

* docs(data-table): add static width example

* fix(data-table): do not render table header if title/description not provided

* feat(modal): dispatch "click:button--primary" as an alias to "submit"

* test: update DataTable types test

* test(modal): update modal type tests

* docs(data-table): add clear reminder to key headers/rows
2021-07-05 13:22:56 -07:00

63 lines
1.5 KiB
TypeScript

/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface ComposedModalProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set the size of the composed modal
*/
size?: "xs" | "sm" | "lg";
/**
* Set to `true` to open the modal
* @default false
*/
open?: boolean;
/**
* Set to `true` to use the danger variant
* @default false
*/
danger?: boolean;
/**
* Set to `true` to prevent the modal from closing when clicking outside
* @default false
*/
preventCloseOnClickOutside?: boolean;
/**
* Specify a class for the inner modal
* @default ""
*/
containerClass?: string;
/**
* Specify a selector to be focused when opening the modal
* @default "[data-modal-primary-focus]"
*/
selectorPrimaryFocus?: null | string;
/**
* Obtain a reference to the top-level HTML element
* @default null
*/
ref?: null | HTMLDivElement;
}
export default class ComposedModal extends SvelteComponentTyped<
ComposedModalProps,
{
transitionend: CustomEvent<{ open: boolean }>;
keydown: WindowEventMap["keydown"];
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
submit: CustomEvent<any>;
["click:button--primary"]: CustomEvent<any>;
close: CustomEvent<any>;
open: CustomEvent<any>;
},
{ default: {} }
> {}