ember-bootstrap
Version:
Bootstrap components for Ember.js
91 lines (90 loc) • 2.25 kB
TypeScript
import Component from '@glimmer/component';
export type ModalSize = 'sm' | 'lg' | 'xl' | null;
export type ModalFullscreen = 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | null | false | true;
export interface DialogSignature {
Args: {
backdropClose?: boolean;
centered?: boolean;
fade?: boolean;
fullscreen?: ModalFullscreen;
inDom?: boolean;
keyboard?: boolean;
onClose?: () => void;
paddingLeft?: number;
paddingRight?: number;
scrollable?: boolean;
showModal?: boolean;
size?: ModalSize;
};
Blocks: {
default: [];
};
Element: HTMLDivElement;
}
/**
* Internal component for modal's markup and event handling. Should not be used directly.
*
* @class ModalDialog
* @namespace Components
* @extends Glimmer.Component
* @private
*/
export default class ModalDialog extends Component<DialogSignature> {
/**
* @property id
* @type null | HTMLElement
*/
_element: null;
/**
* Name of the size class
*
* @property sizeClass
* @type string
* @readOnly
* @private
*/
get sizeClass(): string | null;
/**
* The id of the `.modal-title` element
*
* @property titleId
* @type string
* @default null
* @private
*/
titleId: string | null;
/**
* Gets or sets the id of the title element for aria accessibility tags
*
* @method getSetTitleID
* @private
*/
getOrSetTitleId(modalNode: Element): void;
setInitialFocus(element: HTMLElement): void;
/**
* If true clicking on the backdrop will be ignored and will not close modal.
*
* @property ignoreBackdropClick
* @type boolean
* @default false
* @private
*/
ignoreBackdropClick: boolean;
/**
* The target DOM element of mouse down event.
*
* @property mouseDownElement
* @type object
* @default null
* @private
*/
mouseDownElement: EventTarget | null;
/**
* @event onClose
* @public
*/
handleKeyDown(e: KeyboardEvent): void;
handleClick(e: MouseEvent): void;
handleMouseDown(e: MouseEvent): void;
handleMouseUp(e: MouseEvent): void;
}