UNPKG

carbon-components-angular

Version:
85 lines (81 loc) 2.94 kB
/** * * carbon-angular v0.0.0 | alert-modal.component.d.ts * * Copyright 2014, 2024 IBM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AfterViewInit } from "@angular/core"; import { BaseModal } from "./base-modal.class"; import * as i0 from "@angular/core"; /** * Component to create standard modals for presenting content or asking for user's input. * It can show as a passive modal showing only text or show as a transactional modal with * multiple buttons for different actions for the user to choose from. * * Using a modal in your application requires `cds-placeholder` which would generally be * placed near the end of your app component template (app.component.ts or app.component.html) as: * * ```html * <cds-placeholder></cds-placeholder> * ``` * * Example of opening the modal: * * ```typescript * \@Component({ * selector: "app-modal-demo", * template: ` * <button class="btn--primary" (click)="openModal()">Open modal</button> * <cds-placeholder></cds-placeholder>` * }) * export class ModalDemo { * openModal() { * this.modalService.show({ * modalType: "default", * label: "optional header text", * title: "Modal title", * text: "Modal text", * buttons: [{ * text: "Button text", * type: "primary", * click: clickFunction * }] * }); * } * } * ``` */ export declare class AlertModal extends BaseModal implements AfterViewInit { type: string; label: string; title: string; content: string; size: string; hasScrollingContent: boolean; buttons: any[]; onClose: Function; showCloseButton: boolean; modalContent: { nativeElement: any; }; /** * Creates an instance of `AlertModal`. */ constructor(type: string, label: string, title: string, content: string, size: string, hasScrollingContent: boolean, buttons: any[], onClose: Function, showCloseButton?: boolean); ngAfterViewInit(): boolean; buttonClicked(buttonIndex: string | number): void; dismissModal(trigger: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<AlertModal, [{ optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration<AlertModal, "cds-alert-modal, ibm-alert-modal", never, {}, {}, never, never, false>; }