File

src/modal/alert-modal.interface.ts

Index

Properties

Properties

buttons
buttons: Array<ModalButton>
Type : Array<ModalButton>
Optional

Array of ModalButtons

close
close: function
Type : function
Optional

Callback for non-specific close events. return false; to prevent the modal from closing Property trigger has a value of overlay or close

content
content: string
Type : string
Optional

Content for the modal body, could include HTML tags

hasScrollingContent
hasScrollingContent: boolean
Type : boolean
Optional

Specify whether the modal contains scrolling content. This property overrides the automatic detection of the existence of scrolling content. Set this property to true to force overflow indicator to show up or to false to force overflow indicator to disappear. It is set to null by default which indicates not to override automatic detection.

label
label: string
Type : string
Optional

Additional label shown over the modal

showCloseButton
showCloseButton: boolean
Type : boolean
Optional

Set to false to hide the header's close button.

size
size: "xs" | "sm" | "md" | "lg"
Type : "xs" | "sm" | "md" | "lg"
Optional

Size of the modal to display.

title
title: string
Type : string
Optional

Primary title for the modal

type
type: AlertModalType
Type : AlertModalType
Optional

type of the modal

export enum AlertModalType {
	default = "default",
	danger = "danger"
}

export interface AlertModalData {
	/**
	 * type of the modal
	 */
	type?: AlertModalType;
	/**
	 * Additional label shown over the modal
	 */
	label?: string;
	/**
	 * Primary title for the modal
	 */
	title?: string;
	/**
	 * Content for the modal body, could include HTML tags
	 */
	content?: string;
	/**
	 * Size of the modal to display.
	 */
	size?: "xs" | "sm" | "md" | "lg";
	/**
	 * Array of `ModalButton`s
	 */
	buttons?: Array<ModalButton>;
	/**
	 * Specify whether the modal contains scrolling content. This property overrides the automatic detection
	 * of the existence of scrolling content. Set this property to `true` to force overflow indicator to
	 * show up or to `false` to force overflow indicator to disappear.
	 * It is set to `null` by default which indicates not to override automatic detection.
	 */
	hasScrollingContent?: boolean;
	/**
	 * Callback for non-specific close events. `return false;` to prevent the modal from closing
	 * Property trigger has a value of `overlay` or `close`
	 */
	close?: (trigger?: "overlay" | "close") => boolean;
	/**
	 * Set to `false` to hide the header's close button.
	 */
	showCloseButton?: boolean;
}

export enum ModalButtonType {
	primary = "primary",
	secondary = "secondary",
	tertiary = "tertiary",
	ghost = "ghost",
	danger = "danger",
	danger_primary = "danger--primary"
}

export interface ModalButton {
	/**
	 * Display value of the button
	 */
	text: string;
	/**
	 * Optional unique ID for the button
	 */
	id?: string;
	/**
	 * Button type
	 */
	type?: ModalButtonType;
	/**
	 * Callback for the button `click` event
	 */
	click?: Function;
}

results matching ""

    No results matching ""