import { KbqModalModule } from '@koobiq/components/modal';Caption of a manually composed modal (kbqComponent). Projected into the header rendered by
KbqModalTitle, below the title, and clamped to two lines. The resulting markup matches the
header of a modal created via KbqModalService.create.
@Component({
selector: '[kbq-modal-caption], kbq-modal-caption, [kbqModalCaption]'
})
class KbqModalCaption {}@Component({ selector: 'kbq-modal' })
class KbqModalComponent<T = any, R = any> extends KbqModalRef<T, R> implements KbqModal {
readonly kbqModalType = input<ModalType>(
this.options?.kbqModalType ?? 'default'
);
readonly kbqComponent = input<Type<T> | undefined>(
this.options?.kbqComponent
);
readonly kbqContent = input<string | TemplateRef<{}> | Type<T> | undefined>(
this.options?.kbqContent
);
readonly kbqFooter = input<string | TemplateRef<{}> | IModalButtonOptions<T>[] | undefined>(
this.options?.kbqFooter
);
readonly kbqVisible = model<boolean>(
this.options?.kbqVisible ?? false
);
readonly kbqWidth = input<number | string | undefined>(
this.options?.kbqWidth
);
readonly kbqSize = input<ModalSize>(
this.options?.kbqSize ?? ModalSize.Medium
);
readonly kbqWrapClassName = input<string | undefined>(
this.options?.kbqWrapClassName
);
readonly kbqClassName = input<string | undefined>(
this.options?.kbqClassName
);
readonly kbqStyle = input<object | undefined>(
this.options?.kbqStyle
);
readonly kbqTitle = input<string | TemplateRef<{}> | undefined>(
this.options?.kbqTitle
);
readonly kbqCaption = input<string | TemplateRef<{}> | undefined>(
this.options?.kbqCaption
);
readonly kbqCloseByESC = input<boolean>(
this.options?.kbqCloseByESC ?? true
);
readonly kbqAutoFocus = input<KbqModalAutoFocus>(
this.options?.kbqAutoFocus ?? 'first-tabbable'
);
readonly kbqAriaLabel = input<string | undefined>(
this.options?.kbqAriaLabel
);
readonly kbqClosable = input<boolean>(
this.options?.kbqClosable ?? true
);
readonly kbqMask = input<boolean>(this.options?.kbqMask ?? true);
readonly kbqMaskClosable = input<boolean>(
this.options?.kbqMaskClosable ?? false
);
readonly kbqMaskStyle = input<object | undefined>(
this.options?.kbqMaskStyle
);
readonly kbqBodyStyle = input<object | undefined>(
this.options?.kbqBodyStyle
);
readonly kbqOkText = input<string | undefined>(
this.options?.kbqOkText
);
readonly kbqOkType = input<KbqButtonColor>(
this.options?.kbqOkType ?? KbqComponentColors.Contrast
);
readonly kbqRestoreFocus = input<boolean>(
this.options?.kbqRestoreFocus ?? true
);
readonly kbqOkLoading = input<boolean>(
this.options?.kbqOkLoading ?? false
);
readonly kbqOkClick = input<OnClickCallback<T> | undefined>(
this.options?.kbqOkClick
);
readonly kbqCancelText = input<string | undefined>(
this.options?.kbqCancelText
);
readonly kbqCancelLoading = input<boolean>(
this.options?.kbqCancelLoading ?? false
);
readonly kbqCancelClick = input<OnClickCallback<T> | undefined>(
this.options?.kbqCancelClick
);
readonly kbqGetContainer = input<HTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null>(
this.options ? (this.options.kbqGetContainer ?? null) : () => this.overlay.create()
);
componentColors: typeof KbqComponentColors;
readonly kbqAfterOpen: EventEmitter<void>;
readonly kbqAfterClose: EventEmitter<R | undefined>;
readonly kbqBeforeClose: EventEmitter<R | undefined>;
readonly kbqOnOk: EventEmitter<T>;
readonly kbqOnCancel: EventEmitter<T>;
readonly modalContainer: Signal<ElementRef<any>>;
readonly bodyContainer: Signal<ViewContainerRef>;
readonly titleId: string;
readonly captionId: string;
get afterOpen(): Observable<void>;
get beforeClose(): Observable<R | undefined>;
get afterClose(): Observable<R | undefined>;
get hidden(): boolean;
open(): void;
close(result?: R): void;
destroy(result?: R): void;
markForCheck(): void;
triggerOk(): void;
triggerCancel(): void;
getInstance(): KbqModalComponent;
getContentComponentRef(): ComponentRef<T>;
getContentComponent(): T;
getElement(): HTMLElement;
onClickCloseBtn(): void;
}kbqModalTypeModalType Layout the dialog renders.
kbqComponentType<T> | undefined The instance of component opened into the dialog.
kbqContentstring | TemplateRef<{}> | Type<T> | undefined Body of the dialog: text, a template or a component class. Falls back to <ng-content>.
kbqFooterstring | TemplateRef<{}> | IModalButtonOptions<T>[] | undefined Footer of the dialog: text, a template, or the buttons to render. Default modal ONLY.
kbqVisibleboolean Whether the dialog is shown. Two-way bindable as [(kbqVisible)].
kbqWidthnumber | string | undefined Explicit width, overriding the one kbqSize implies. A number is read as pixels.
kbqSizeModalSize Width preset.
kbqWrapClassNamestring | undefined Extra class names for the full-screen wrapper around the dialog.
kbqClassNamestring | undefined Extra class names for the dialog element itself.
kbqStyleobject | undefined Inline styles for the dialog element.
kbqTitlestring | TemplateRef<{}> | undefined Heading of the dialog. Also becomes its accessible name.
kbqCaptionstring | TemplateRef<{}> | undefined Secondary line under the heading. Also becomes the dialog's accessible description.
kbqCloseByESCboolean Whether Escape cancels the dialog.
kbqAutoFocusKbqModalAutoFocus Where focus lands when the dialog is shown.
kbqAriaLabelstring | undefined Accessible name for a dialog rendered without kbqTitle — a confirm or a header-less dialog.
kbqClosableboolean Whether the header renders a close button.
kbqMaskboolean Whether the page behind the dialog is dimmed.
kbqMaskClosableboolean Whether a click on the dim layer cancels the dialog.
kbqMaskStyleobject | undefined Inline styles for the dim layer.
kbqBodyStyleobject | undefined Inline styles for the body element.
kbqOkTextstring | undefined Caption of the predefined OK button. The button is not rendered without it.
kbqOkTypeKbqButtonColor Color of the predefined OK button.
kbqRestoreFocusboolean Whether focus returns to the trigger when the dialog closes.
kbqOkLoadingboolean Whether the predefined OK button renders its progress state.
kbqOkClickOnClickCallback<T> | undefined Decision handler of the predefined OK button. Returning false — or a promise of false —
keeps the dialog open; anything else closes it. Receives the body component instance when the
body is a component.
Bind this or (kbqOnOk), never both: a handler decides the close itself, so the event has
nothing left to report and is not emitted. Binding both is reported in development mode.
kbqCancelTextstring | undefined Caption of the predefined Cancel button. The button is not rendered without it.
kbqCancelLoadingboolean Whether the predefined Cancel button renders its progress state.
kbqCancelClickOnClickCallback<T> | undefined Decision handler of the predefined Cancel button, the close button, Escape and the
dim layer. Returning false — or a promise of false — keeps the dialog open.
Bind this or (kbqOnCancel), never both — see kbqOkClick.
kbqGetContainerHTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null Element or overlay the dialog is rendered into. Read once, on init.
localeOverridesKbqPartialLocaleData | undefined Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.
kbqBeforeCloseEventEmitter<R | undefined> Emitted before the modal begins its closing animation.
kbqOnOkEventEmitter<T> Emits when the predefined OK button is activated. A notification, not a decision — the dialog
closes either way. Bind [kbqOkClick] instead to decide whether it closes.
kbqOnCancelEventEmitter<T> Emits when the dialog is cancelled, by any of the controls kbqCancelClick covers. A
notification, not a decision. Bind [kbqCancelClick] instead to decide whether it closes.
titleIdstring Id of the element that names the dialog. Rendered on the title of a composed modal too.
captionIdstring Id of the element that describes the dialog. Rendered on the caption of a composed modal too.
beforeCloseObservable<R | undefined> Observable alias for kbqBeforeClose
close()void Starts the closing animation and resolves the afterClose contract with result.
Closing an already closed dialog is a no-op: afterClose emits once per actual transition.
@Component({ selector: '[kbq-modal-title], kbq-modal-title, [kbqModalTitle]' })
class KbqModalTitle {}localeOverridesKbqPartialLocaleData | undefined Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.
Scrollable body of a manually composed modal (kbqComponent). Publishes its scroll-shadow
state onto the modal instance so a sibling KbqModalTitle/KbqModalFooter can render the
matching shadow, since they have no direct template reference to this element.
@Directive({ selector: '[kbq-modal-body], kbq-modal-body, [kbqModalBody]' })
class KbqModalBody {}@Directive({
selector: '[kbq-modal-footer], kbq-modal-footer, [kbqModalFooter]'
})
class KbqModalFooter {}@Directive({ selector: '[kbq-modal-main-action]' })
class KbqModalMainAction {}@Pipe({ name: 'toCssUnit' })
class CssUnitPipe implements PipeTransform {
transform(
value: number | string | null | undefined,
defaultUnit?: string
): string | null;
}transform()string | null Returns null for a value that was never set, so the style binding it feeds is cleared.
@Injectable({ providedIn: 'root' })
class KbqModalService {
get openModals(): KbqModalRef[];
get afterAllClose(): Observable<void>;
closeAll(): void;
create<C, R = unknown>(
options?: IModalOptionsForService<C>
): KbqModalRef<C, R>;
confirm<C, R = unknown>(
options?: IModalOptionsForService<C>,
confirmType?: ConfirmType
): KbqModalRef<C, R>;
open<C, R = unknown>(
options?: IModalOptionsForService<C>
): KbqModalRef<C, R>;
success<C, R = unknown>(
options?: IModalOptionsForService<C>
): KbqModalRef<C, R>;
delete<C, R = unknown>(
options?: IModalOptionsForService<C>
): KbqModalRef<C, R>;
}create()KbqModalRef<C, R> Opens a dialog. Its lifetime is bound to options.injector — the caller's injector when one
is passed, the root environment injector otherwise — so destroying the opener closes it.
delete()KbqModalRef<C, R> Opens a confirm dialog styled for a destructive action — the warn confirm type.
API class that public to users to handle the modal instance. KbqModalRef is aim to avoid accessing to the modal instance directly by users.
abstract class KbqModalRef<C = any, R = unknown> {
abstract afterOpen: Observable<void>;
abstract beforeClose: Observable<R | undefined>;
abstract afterClose: Observable<R | undefined>;
abstract open(): void;
abstract close(result?: R): void;
abstract destroy(result?: R): void;
abstract triggerOk(): void;
abstract triggerCancel(): void;
abstract getContentComponent(): C;
abstract getElement(): HTMLElement;
abstract getInstance(): KbqModalComponent;
abstract markForCheck(): any;
}triggerOk()void Runs the OK flow exactly as the predefined OK button does: the kbqOkClick handler when one
is bound, the kbqOnOk emitter otherwise.
triggerCancel()void Runs the cancel flow exactly as the predefined Cancel button does.
getContentComponent()C Return the component instance of kbqContent when specify kbqContent as a Component Note: this method may return undefined if the Component has not ready yet. (it only available after Modal's ngOnInit)
getElement()HTMLElement Get the dom element of this Modal
getInstance()KbqModalComponent Get the instance of the Modal itself
markForCheck()any Call markForCheck for change detector
Phase of the open/close animation the dialog is in, or null between phases.
type AnimationState = 'enter' | 'leave' | null;type ConfirmType = 'confirm' | 'success' | 'warn';interface IModalButtonOptions<T = any> {
label: string;
type?: string;
shape?: string;
ghost?: boolean;
size?: string;
autoLoading?: boolean;
show?: boolean | ((this: IModalButtonOptions<T>, contentComponentInstance?: T) => boolean);
loading?: boolean | ((this: IModalButtonOptions<T>, contentComponentInstance?: T) => boolean);
disabled?: boolean | ((this: IModalButtonOptions<T>, contentComponentInstance?: T) => boolean);
autoFocus?: boolean;
kbqModalMainAction?: boolean;
onClick?(
this: IModalButtonOptions<T>,
contentComponentInstance?: T
): void | {} | Promise<void | {}>;
}showboolean | ((this: IModalButtonOptions<T>, contentComponentInstance?: T) => boolean) Whether the button is rendered.
The callable form is re-evaluated on every change-detection pass over the dialog, which is
what lets it track state the dialog knows nothing about — so it must be cheap and free of
side effects. contentComponentInstance is passed only when the body is a component.
loadingboolean | ((this: IModalButtonOptions<T>, contentComponentInstance?: T) => boolean) Whether the button renders its progress state. Re-evaluated per pass — see IModalButtonOptions.show.
disabledboolean | ((this: IModalButtonOptions<T>, contentComponentInstance?: T) => boolean) Whether the button is disabled. Re-evaluated per pass — see IModalButtonOptions.show.
interface IModalOptionsForService<T = any> extends ModalOptions<T> {
injector?: Injector;
kbqModalType?: ModalType;
kbqVisible?: boolean;
kbqWidth?: number | string;
kbqSize?: ModalSize;
kbqWrapClassName?: string;
kbqClassName?: string;
kbqStyle?: object;
kbqTitle?: string | TemplateRef<{}>;
kbqCaption?: string | TemplateRef<{}>;
kbqContent?: string | TemplateRef<{}> | Type<C>;
kbqComponent?: Type<C>;
kbqClosable?: boolean;
kbqMask?: boolean;
kbqMaskClosable?: boolean;
kbqMaskStyle?: object;
kbqBodyStyle?: object;
kbqFooter?: string | TemplateRef<{}> | IModalButtonOptions<C>[];
kbqGetContainer?: HTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null;
kbqAfterOpen?: EventEmitter<void>;
kbqAfterClose?: EventEmitter<R>;
kbqCloseByESC?: boolean;
kbqRestoreFocus?: boolean;
kbqAutoFocus?: KbqModalAutoFocus;
kbqAriaLabel?: string;
kbqOkText?: string;
kbqOkType?: KbqButtonColor;
kbqOkLoading?: boolean;
kbqOkClick?: OnClickCallback<C>;
kbqOnOk?: EventEmitter<C>;
kbqCancelText?: string;
kbqCancelLoading?: boolean;
kbqCancelClick?: OnClickCallback<C>;
kbqOnCancel?: EventEmitter<C>;
data?: unknown;
}injectorInjector The injector used to create the component that will be attached.
If specified, it overrides the injector provided by KbqModalService.
Its DestroyRef also owns the dialog: the modal is torn down when the injector is destroyed.
kbqModalTypeModalType Layout the dialog renders. Default is 'default'.
kbqVisibleboolean Whether the dialog is shown. Managed by the service on the imperative path.
kbqWidthnumber | string Explicit width, overriding the one kbqSize implies. A number is read as pixels.
kbqSizeModalSize Width preset. Default is ModalSize.Medium (640px).
kbqWrapClassNamestring Extra class names for the full-screen wrapper around the dialog.
kbqClassNamestring Extra class names for the dialog element itself.
kbqStyleobject Inline styles for the dialog element.
kbqTitlestring | TemplateRef<{}> Heading of the dialog. Also becomes its accessible name.
kbqCaptionstring | TemplateRef<{}> Secondary line under the heading. Also becomes the dialog's accessible description.
kbqContentstring | TemplateRef<{}> | Type<C> Body of the dialog: text, a template or a component class.
kbqComponentType<C> The instance of component opened into the dialog.
kbqClosableboolean Whether the header renders a close button. Default is true.
kbqMaskboolean Whether the page behind the dialog is dimmed. Default is true.
kbqMaskClosableboolean Whether a click on the dim layer cancels the dialog. Default is false.
kbqMaskStyleobject Inline styles for the dim layer.
kbqBodyStyleobject Inline styles for the body element.
kbqFooterstring | TemplateRef<{}> | IModalButtonOptions<C>[] Footer of the dialog: text, a template, or the buttons to render. Default modal ONLY.
kbqGetContainerHTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null Element or overlay the dialog is rendered into. STATIC — read once, on init.
kbqAfterOpenEventEmitter<void> Emitter that mirrors the dialog's own open event. It is subscribed to the dialog, never
substituted for it, so afterOpen on the returned KbqModalRef keeps working alongside.
kbqAfterCloseEventEmitter<R> Emitter that mirrors the dialog's own close event. It is subscribed to the dialog, never
substituted for it, so afterClose on the returned KbqModalRef keeps working alongside.
kbqCloseByESCboolean Whether Escape cancels the dialog. Default is true.
kbqRestoreFocusboolean Whether focus returns to the trigger when the dialog closes. Default is true.
kbqAutoFocusKbqModalAutoFocus Where focus lands when the dialog is shown. Default is 'first-tabbable'.
kbqAriaLabelstring Accessible name for a dialog rendered without kbqTitle — a confirm or a header-less dialog.
kbqOkTextstring Caption of the predefined OK button. The button is not rendered without it.
kbqOkTypeKbqButtonColor Color of the predefined OK button. Default is KbqComponentColors.Contrast.
kbqOkLoadingboolean Whether the predefined OK button renders its progress state.
kbqOkClickOnClickCallback<C> Decision handler of the predefined OK button. Returning false (or a promise of false)
keeps the dialog open; anything else closes it. Pair of the kbqOnOk output — bind one.
kbqOnOkEventEmitter<C> Emitter notified when the predefined OK button is activated. Pair of kbqOkClick — bind one.
kbqCancelTextstring Caption of the predefined Cancel button. The button is not rendered without it.
kbqCancelLoadingboolean Whether the predefined Cancel button renders its progress state.
kbqCancelClickOnClickCallback<C> Decision handler of the predefined Cancel button, the close button, Escape and the
dim layer. Returning false (or a promise of false) keeps the dialog open. Pair of the
kbqOnCancel output — bind one.
kbqOnCancelEventEmitter<C> Emitter notified when the dialog is cancelled. Pair of kbqCancelClick — bind one.
dataunknown Data being injected into the child component.
The members of KbqModalComponent the composition directives (kbq-modal-title,
kbq-modal-caption, kbq-modal-body, kbq-modal-footer) depend on. They are projected into the
dialog, so they inject this token instead of the concrete host component.
interface KbqModal {
readonly kbqClosable: Signal<boolean>;
readonly componentColors: typeof KbqComponentColors;
readonly titleId: string;
readonly captionId: string;
readonly bodyOverflow: Signal<KbqOverflowShadowState>;
readonly afterOpen: Observable<void>;
onClickCloseBtn(): void;
registerTitle(): void;
registerCaption(): void;
registerFooter(): void;
setBodyOverflow(state: KbqOverflowShadowState): void;
}kbqClosableSignal<boolean> Whether the dialog renders a close button in its header.
componentColorstypeof KbqComponentColors Palette the composed header binds the close-icon color from.
titleIdstring Id the dialog element points aria-labelledby at. Belongs on the rendered title element.
captionIdstring Id the dialog element points aria-describedby at. Belongs on the rendered caption element.
bodyOverflowSignal<KbqOverflowShadowState> Scroll-shadow state of the composed body, so the header and footer can render matching shadows.
afterOpenObservable<void> Emits once the dialog is fully shown.
onClickCloseBtn()void Runs the cancel flow, exactly as the templated close button does.
registerTitle()void Announces that a composed title is rendered, so the dialog can use it as its accessible name.
registerCaption()void Announces that a composed caption is rendered, so the dialog can use it as its description.
registerFooter()void Announces that a composed footer is rendered, so the body keeps its normal bottom padding.
setBodyOverflow()void Publishes the composed body's scroll-shadow state.
Where focus lands when the dialog is shown.
[cdkFocusInitial] and autofocus inside the dialog win over every value but false.
first-tabbable — the first tabbable control, which for a titled dialog is the close button;dialog — the dialog element itself, so a long scrollable body is read from its start;first-heading — the dialog title, falling back to the dialog element;false — nothing is focused, and the caller is responsible for moving focus into the dialog.type KbqModalAutoFocus = 'first-tabbable' | 'dialog' | 'first-heading' | false;interface ModalOptions<C = any, R = any> {
kbqModalType?: ModalType;
kbqVisible?: boolean;
kbqWidth?: number | string;
kbqSize?: ModalSize;
kbqWrapClassName?: string;
kbqClassName?: string;
kbqStyle?: object;
kbqTitle?: string | TemplateRef<{}>;
kbqCaption?: string | TemplateRef<{}>;
kbqContent?: string | TemplateRef<{}> | Type<C>;
kbqComponent?: Type<C>;
kbqClosable?: boolean;
kbqMask?: boolean;
kbqMaskClosable?: boolean;
kbqMaskStyle?: object;
kbqBodyStyle?: object;
kbqFooter?: string | TemplateRef<{}> | IModalButtonOptions<C>[];
kbqGetContainer?: HTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null;
kbqAfterOpen?: EventEmitter<void>;
kbqAfterClose?: EventEmitter<R>;
kbqCloseByESC?: boolean;
kbqRestoreFocus?: boolean;
kbqAutoFocus?: KbqModalAutoFocus;
kbqAriaLabel?: string;
kbqOkText?: string;
kbqOkType?: KbqButtonColor;
kbqOkLoading?: boolean;
kbqOkClick?: OnClickCallback<C>;
kbqOnOk?: EventEmitter<C>;
kbqCancelText?: string;
kbqCancelLoading?: boolean;
kbqCancelClick?: OnClickCallback<C>;
kbqOnCancel?: EventEmitter<C>;
data?: unknown;
}kbqModalTypeModalType Layout the dialog renders. Default is 'default'.
kbqVisibleboolean Whether the dialog is shown. Managed by the service on the imperative path.
kbqWidthnumber | string Explicit width, overriding the one kbqSize implies. A number is read as pixels.
kbqSizeModalSize Width preset. Default is ModalSize.Medium (640px).
kbqWrapClassNamestring Extra class names for the full-screen wrapper around the dialog.
kbqClassNamestring Extra class names for the dialog element itself.
kbqStyleobject Inline styles for the dialog element.
kbqTitlestring | TemplateRef<{}> Heading of the dialog. Also becomes its accessible name.
kbqCaptionstring | TemplateRef<{}> Secondary line under the heading. Also becomes the dialog's accessible description.
kbqContentstring | TemplateRef<{}> | Type<C> Body of the dialog: text, a template or a component class.
kbqComponentType<C> The instance of component opened into the dialog.
kbqClosableboolean Whether the header renders a close button. Default is true.
kbqMaskboolean Whether the page behind the dialog is dimmed. Default is true.
kbqMaskClosableboolean Whether a click on the dim layer cancels the dialog. Default is false.
kbqMaskStyleobject Inline styles for the dim layer.
kbqBodyStyleobject Inline styles for the body element.
kbqFooterstring | TemplateRef<{}> | IModalButtonOptions<C>[] Footer of the dialog: text, a template, or the buttons to render. Default modal ONLY.
kbqGetContainerHTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null Element or overlay the dialog is rendered into. STATIC — read once, on init.
kbqAfterOpenEventEmitter<void> Emitter that mirrors the dialog's own open event. It is subscribed to the dialog, never
substituted for it, so afterOpen on the returned KbqModalRef keeps working alongside.
kbqAfterCloseEventEmitter<R> Emitter that mirrors the dialog's own close event. It is subscribed to the dialog, never
substituted for it, so afterClose on the returned KbqModalRef keeps working alongside.
kbqCloseByESCboolean Whether Escape cancels the dialog. Default is true.
kbqRestoreFocusboolean Whether focus returns to the trigger when the dialog closes. Default is true.
kbqAutoFocusKbqModalAutoFocus Where focus lands when the dialog is shown. Default is 'first-tabbable'.
kbqAriaLabelstring Accessible name for a dialog rendered without kbqTitle — a confirm or a header-less dialog.
kbqOkTextstring Caption of the predefined OK button. The button is not rendered without it.
kbqOkTypeKbqButtonColor Color of the predefined OK button. Default is KbqComponentColors.Contrast.
kbqOkLoadingboolean Whether the predefined OK button renders its progress state.
kbqOkClickOnClickCallback<C> Decision handler of the predefined OK button. Returning false (or a promise of false)
keeps the dialog open; anything else closes it. Pair of the kbqOnOk output — bind one.
kbqOnOkEventEmitter<C> Emitter notified when the predefined OK button is activated. Pair of kbqOkClick — bind one.
kbqCancelTextstring Caption of the predefined Cancel button. The button is not rendered without it.
kbqCancelLoadingboolean Whether the predefined Cancel button renders its progress state.
kbqCancelClickOnClickCallback<C> Decision handler of the predefined Cancel button, the close button, Escape and the
dim layer. Returning false (or a promise of false) keeps the dialog open. Pair of the
kbqOnCancel output — bind one.
kbqOnCancelEventEmitter<C> Emitter notified when the dialog is cancelled. Pair of kbqCancelClick — bind one.
dataunknown Data being injected into the child component.
type ModalType = 'default' | 'confirm' | 'custom';type OnClickCallback<T> = (instance: T) => (false | void | {}) | Promise<false | void | {}>;enum ModalSize {
Small = 'small',
Medium = 'medium',
Large = 'large'
}Injection token exposing the dialog to the directives composed inside it.
const KBQ_MODAL: InjectionToken<KbqModal>;Injection token that can be used to access the data that was passed in to a modal.
const KBQ_MODAL_DATA: InjectionToken<unknown>;