UNPKG

primeng

Version:

PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,

709 lines (684 loc) 35.8 kB
export * from 'primeng/types/drawer'; import { NgTemplateOutlet } from '@angular/common'; import * as i0 from '@angular/core'; import { Injectable, InjectionToken, inject, input, computed, booleanAttribute, numberAttribute, model, output, viewChild, signal, contentChild, effect, untracked, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core'; import { Times } from '@primeicons/angular/times'; import { setAttribute, addClass, removeClass, appendChild } from '@primeuix/utils'; import { SharedModule } from 'primeng/api'; import { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent'; import * as i1 from 'primeng/bind'; import { Bind } from 'primeng/bind'; import { ButtonDirective } from 'primeng/button'; import { blockBodyScroll, unblockBodyScroll } from 'primeng/dom'; import * as i2 from 'primeng/focustrap'; import { FocusTrapModule } from 'primeng/focustrap'; import * as i3 from 'primeng/motion'; import { MotionModule } from 'primeng/motion'; import { ZIndexUtils } from 'primeng/utils'; import { style as style$1 } from '@primeuix/styles/drawer'; import { BaseStyle } from 'primeng/base'; const style = /*css*/ ` ${style$1} /** For PrimeNG **/ .p-drawer { position: fixed; } .p-drawer-left { top: 0; left: 0; width: 20rem; height: 100%; border-inline-end-width: 1px; } .p-drawer-right { top: 0; right: 0; width: 20rem; height: 100%; border-inline-start-width: 1px; } .p-drawer-top { top: 0; left: 0; width: 100%; height: 10rem; border-block-end-width: 1px; } .p-drawer-bottom { bottom: 0; left: 0; width: 100%; height: 10rem; border-block-start-width: 1px; } .p-drawer-full { width: 100%; height: 100%; top: 0; left: 0; -webkit-transition: none; transition: none; } /* Animations */ .p-drawer-enter-left { animation: p-animate-drawer-enter-left 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-leave-left { animation: p-animate-drawer-leave-left 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-enter-right { animation: p-animate-drawer-enter-right 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-leave-right { animation: p-animate-drawer-leave-right 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-enter-top { animation: p-animate-drawer-enter-top 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-leave-top { animation: p-animate-drawer-leave-top 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-enter-bottom { animation: p-animate-drawer-enter-bottom 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-leave-bottom { animation: p-animate-drawer-leave-bottom 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-enter-full { animation: p-animate-drawer-enter-full 0.5s cubic-bezier(0.32, 0.72, 0, 1); } .p-drawer-leave-full { animation: p-animate-drawer-leave-full 0.5s cubic-bezier(0.32, 0.72, 0, 1); } `; const classes = { mask: ({ instance }) => ['p-drawer-mask', { [`p-overlay-mask p-overlay-mask-enter-active`]: instance.modal() }, { 'p-drawer-full': instance.fullScreen() }], root: ({ instance }) => [ 'p-drawer p-component', { 'p-drawer-full': instance.fullScreen(), 'p-drawer-open': instance.visible() }, `p-drawer-${instance.position()}` ], header: 'p-drawer-header', title: 'p-drawer-title', pcCloseButton: 'p-drawer-close-button', content: 'p-drawer-content', footer: 'p-drawer-footer' }; class DrawerStyle extends BaseStyle { name = 'drawer'; style = style; classes = classes; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DrawerStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DrawerStyle }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DrawerStyle, decorators: [{ type: Injectable }] }); /** * * Drawer is a panel component displayed as an overlay at the edges of the screen. * * [Live Demo](https://www.primeng.org/drawer) * * @module drawerstyle * */ var DrawerClasses; (function (DrawerClasses) { /** * Class name of the mask element */ DrawerClasses["mask"] = "p-drawer-mask"; /** * Class name of the root element */ DrawerClasses["root"] = "p-drawer"; /** * Class name of the header element */ DrawerClasses["header"] = "p-drawer-header"; /** * Class name of the title element */ DrawerClasses["title"] = "p-drawer-title"; /** * Class name of the close button element */ DrawerClasses["pcCloseButton"] = "p-drawer-close-button"; /** * Class name of the content element */ DrawerClasses["content"] = "p-drawer-content"; })(DrawerClasses || (DrawerClasses = {})); const DRAWER_INSTANCE = new InjectionToken('DRAWER_INSTANCE'); /** * Sidebar is a panel component displayed as an overlay at the edges of the screen. * @group Components */ class Drawer extends BaseComponent { componentName = 'Drawer'; $pcDrawer = inject(DRAWER_INSTANCE, { optional: true, skipSelf: true }) ?? undefined; bindDirectiveInstance = inject(Bind, { self: true }); onAfterViewChecked() { this.bindDirectiveInstance.setAttrs(this.ptm('host')); } /** * Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). * @defaultValue 'self' * @group Props */ appendTo = input(undefined, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "appendTo" }] : /* istanbul ignore next */ [])); /** * The motion options. * @group Props */ motionOptions = input(undefined, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "motionOptions" }] : /* istanbul ignore next */ [])); computedMotionOptions = computed(() => { return { ...this.ptm('motion'), ...this.motionOptions() }; }, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "computedMotionOptions" }] : /* istanbul ignore next */ [])); /** * Whether to block scrolling of the document when drawer is active. * @group Props */ blockScroll = input(false, { ...(ngDevMode ? { debugName: "blockScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * Inline style of the component. * @group Props */ style = input(/* @ts-ignore */ ...(ngDevMode ? [undefined, { debugName: "style" }] : /* istanbul ignore next */ [])); /** * Style class of the component. * @group Props */ styleClass = input(/* @ts-ignore */ ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ [])); /** * Aria label of the close icon. * @group Props */ ariaCloseLabel = input(/* @ts-ignore */ ...(ngDevMode ? [undefined, { debugName: "ariaCloseLabel" }] : /* istanbul ignore next */ [])); /** * Whether to automatically manage layering. * @group Props */ autoZIndex = input(true, { ...(ngDevMode ? { debugName: "autoZIndex" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * Base zIndex value to use in layering. * @group Props */ baseZIndex = input(0, { ...(ngDevMode ? { debugName: "baseZIndex" } : /* istanbul ignore next */ {}), transform: numberAttribute }); /** * Whether an overlay mask is displayed behind the drawer. * @group Props */ modal = input(true, { ...(ngDevMode ? { debugName: "modal" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * Configuration object forwarded to the close button. * @group Props */ closeButtonProps = input({ severity: 'secondary', variant: 'text', rounded: true }, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "closeButtonProps" }] : /* istanbul ignore next */ [])); /** * Whether to dismiss drawer on click of the mask. * @group Props */ dismissible = input(true, { ...(ngDevMode ? { debugName: "dismissible" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * Whether to display the close icon. * @group Props * @deprecated use 'closable' instead. */ showCloseIcon = input(true, { ...(ngDevMode ? { debugName: "showCloseIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * Specifies if pressing escape key should hide the drawer. * @group Props */ closeOnEscape = input(true, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * The visible property is an input that determines the visibility of the component. * @defaultValue false * @group Props */ visible = model(false, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ [])); /** * Specifies the position of the drawer, valid values are "left", "right", "bottom" and "top". * @defaultValue 'left' * @group Props */ position = input('left', /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ [])); /** * Adds a close icon to the header to hide the dialog. * @defaultValue false * @group Props */ fullScreen = input(false, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "fullScreen" }] : /* istanbul ignore next */ [])); $enterAnimation = computed(() => (this.fullScreen() ? 'p-drawer-enter-full' : `p-drawer-enter-${this.position()}`), /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "$enterAnimation" }] : /* istanbul ignore next */ [])); $leaveAnimation = computed(() => (this.fullScreen() ? 'p-drawer-leave-full' : `p-drawer-leave-${this.position()}`), /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "$leaveAnimation" }] : /* istanbul ignore next */ [])); /** * Title content of the dialog. * @group Props */ header = input(/* @ts-ignore */ ...(ngDevMode ? [undefined, { debugName: "header" }] : /* istanbul ignore next */ [])); /** * Style of the mask. * @group Props */ maskStyle = input(/* @ts-ignore */ ...(ngDevMode ? [undefined, { debugName: "maskStyle" }] : /* istanbul ignore next */ [])); /** * Whether to display close button. * @group Props * @defaultValue true */ closable = input(true, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute }); /** * Callback to invoke when dialog is shown. * @group Emits */ onShow = output(); /** * Callback to invoke when dialog is hidden. * @group Emits */ onHide = output(); containerViewChild = viewChild('container', /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "containerViewChild" }] : /* istanbul ignore next */ [])); closeButtonViewChild = viewChild('closeButton', /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "closeButtonViewChild" }] : /* istanbul ignore next */ [])); initialized; modalVisible = signal(false, /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "modalVisible" }] : /* istanbul ignore next */ [])); container; mask; maskClickListener; documentEscapeListener; animationEndListener; _componentStyle = inject(DrawerStyle); onAfterViewInit() { this.initialized = true; } /** * Custom header template. * @group Templates */ headerTemplate = contentChild('header', { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), descendants: false }); /** * Custom footer template. * @group Templates */ footerTemplate = contentChild('footer', { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), descendants: false }); /** * Custom content template. * @group Templates */ contentTemplate = contentChild('content', { ...(ngDevMode ? { debugName: "contentTemplate" } : /* istanbul ignore next */ {}), descendants: false }); /** * Custom close icon template. * @group Templates */ closeIconTemplate = contentChild('closeicon', { ...(ngDevMode ? { debugName: "closeIconTemplate" } : /* istanbul ignore next */ {}), descendants: false }); /** * Custom headless template to replace the entire drawer content. * @group Templates */ headlessTemplate = contentChild('headless', { ...(ngDevMode ? { debugName: "headlessTemplate" } : /* istanbul ignore next */ {}), descendants: false }); showCloseButton = computed(() => this.showCloseIcon() && this.closable(), /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "showCloseButton" }] : /* istanbul ignore next */ [])); $appendTo = computed(() => this.appendTo() || this.config.overlayAppendTo(), /* @ts-ignore */ ...(ngDevMode ? [{ debugName: "$appendTo" }] : /* istanbul ignore next */ [])); constructor() { super(); effect(() => { const isVisible = this.visible(); untracked(() => { if (isVisible && !this.modalVisible()) { this.modalVisible.set(true); } }); }); } onKeyDown(event) { if (event.code === 'Escape') { this.hide(false); } } show() { this.container?.setAttribute(this.$attrSelector, ''); if (this.autoZIndex()) { ZIndexUtils.set('modal', this.container, this.baseZIndex() || this.config.zIndex.modal); } if (this.modal()) { this.enableModality(); } this.onShow.emit({}); } hide(emit = true) { if (emit) { this.onHide.emit({}); } if (this.modal()) { this.disableModality(); } } close(event) { this.hide(); this.visible.set(false); event.preventDefault(); } enableModality() { const activeDrawers = this.document.querySelectorAll('[data-p-open="true"]'); const activeDrawersLength = activeDrawers.length; const zIndex = activeDrawersLength == 1 ? String(parseInt(this.container.style.zIndex) - 1) : String(parseInt(activeDrawers[activeDrawersLength - 1].style.zIndex) - 1); if (!this.mask) { this.mask = this.renderer.createElement('div'); if (this.mask) { const style = `z-index: ${zIndex};${this.getMaskStyle()}`; setAttribute(this.mask, 'style', style); setAttribute(this.mask, 'data-p', this.dataP); addClass(this.mask, this.cx('mask')); } if (this.dismissible()) { this.maskClickListener = this.renderer.listen(this.mask, 'click', (event) => { if (this.dismissible()) { this.close(event); } }); } const maskParent = this.container?.parentNode; if (maskParent) { this.renderer.insertBefore(maskParent, this.mask, this.container); } else { this.renderer.appendChild(this.document.body, this.mask); } if (this.blockScroll()) { blockBodyScroll(); } } } getMaskStyle() { const maskStyleValue = this.maskStyle(); return maskStyleValue ? Object.entries(maskStyleValue) .map(([key, value]) => `${key}: ${value}`) .join('; ') : ''; } disableModality() { if (this.mask) { !this.$unstyled() && removeClass(this.mask, 'p-overlay-mask-enter-active'); !this.$unstyled() && addClass(this.mask, 'p-overlay-mask-leave-active'); this.animationEndListener = this.renderer.listen(this.mask, 'animationend', this.destroyModal.bind(this)); } } destroyModal() { this.unbindMaskClickListener(); if (this.mask?.parentNode) { this.renderer.removeChild(this.mask.parentNode, this.mask); } if (this.blockScroll()) { unblockBodyScroll(); } this.unbindAnimationEndListener(); this.mask = null; } onBeforeEnter(event) { this.container = event.element; this.appendContainer(); this.show(); if (this.closeOnEscape()) { this.bindDocumentEscapeListener(); } } onAfterLeave() { this.hide(false); ZIndexUtils.clear(this.container); this.unbindGlobalListeners(); this.modalVisible.set(false); this.container = null; } appendContainer() { if (this.$appendTo() && this.$appendTo() !== 'self') { if (this.$appendTo() === 'body') { appendChild(this.document.body, this.container); } else { appendChild(this.$appendTo(), this.container); } } } bindDocumentEscapeListener() { const documentTarget = this.el ? this.el.nativeElement.ownerDocument : this.document; this.documentEscapeListener = this.renderer.listen(documentTarget, 'keydown', (event) => { if (event.which == 27) { if (parseInt(this.container?.style.zIndex) === ZIndexUtils.get(this.container)) { this.close(event); } } }); } unbindDocumentEscapeListener() { if (this.documentEscapeListener) { this.documentEscapeListener(); this.documentEscapeListener = null; } } unbindMaskClickListener() { if (this.maskClickListener) { this.maskClickListener(); this.maskClickListener = null; } } unbindGlobalListeners() { this.unbindMaskClickListener(); this.unbindDocumentEscapeListener(); } unbindAnimationEndListener() { if (this.animationEndListener && this.mask) { this.animationEndListener(); this.animationEndListener = null; } } onDestroy() { this.initialized = false; if (this.visible() && this.modal()) { this.destroyModal(); } if (this.$appendTo() && this.container) { this.renderer.appendChild(this.el.nativeElement, this.container); } if (this.container && this.autoZIndex()) { ZIndexUtils.clear(this.container); } this.container = null; this.unbindGlobalListeners(); this.unbindAnimationEndListener(); } get dataP() { return this.cn({ 'full-screen': this.position() === 'full', [this.position()]: this.position(), open: this.visible(), modal: this.modal() }); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: Drawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: Drawer, isStandalone: true, selector: "p-drawer", inputs: { appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, motionOptions: { classPropertyName: "motionOptions", publicName: "motionOptions", isSignal: true, isRequired: false, transformFunction: null }, blockScroll: { classPropertyName: "blockScroll", publicName: "blockScroll", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, ariaCloseLabel: { classPropertyName: "ariaCloseLabel", publicName: "ariaCloseLabel", isSignal: true, isRequired: false, transformFunction: null }, autoZIndex: { classPropertyName: "autoZIndex", publicName: "autoZIndex", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, closeButtonProps: { classPropertyName: "closeButtonProps", publicName: "closeButtonProps", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, showCloseIcon: { classPropertyName: "showCloseIcon", publicName: "showCloseIcon", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, maskStyle: { classPropertyName: "maskStyle", publicName: "maskStyle", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", onShow: "onShow", onHide: "onHide" }, providers: [DrawerStyle, { provide: DRAWER_INSTANCE, useExisting: Drawer }, { provide: PARENT_INSTANCE, useExisting: Drawer }], queries: [{ propertyName: "headerTemplate", first: true, predicate: ["header"], isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], isSignal: true }, { propertyName: "contentTemplate", first: true, predicate: ["content"], isSignal: true }, { propertyName: "closeIconTemplate", first: true, predicate: ["closeicon"], isSignal: true }, { propertyName: "headlessTemplate", first: true, predicate: ["headless"], isSignal: true }], viewQueries: [{ propertyName: "containerViewChild", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "closeButtonViewChild", first: true, predicate: ["closeButton"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: ` @if (modalVisible()) { <div #container [pBind]="ptm('root')" [pMotion]="visible()" [pMotionAppear]="true" [pMotionEnterActiveClass]="$enterAnimation()" [pMotionLeaveActiveClass]="$leaveAnimation()" [pMotionOptions]="computedMotionOptions()" (pMotionOnBeforeEnter)="onBeforeEnter($event)" (pMotionOnAfterLeave)="onAfterLeave($event)" [class]="cn(cx('root'), styleClass())" [style]="style()" role="complementary" (keydown)="onKeyDown($event)" pFocusTrap [attr.data-p]="dataP" [attr.data-p-open]="visible()" > @if (headlessTemplate()) { <ng-container *ngTemplateOutlet="headlessTemplate()"></ng-container> } @else { <div [pBind]="ptm('header')" [class]="cx('header')" [attr.data-pc-section]="'header'"> @if (headerTemplate()) { <ng-container *ngTemplateOutlet="headerTemplate()"></ng-container> } @if (header()) { <div [pBind]="ptm('title')" [class]="cx('title')">{{ header() }}</div> } @if (showCloseButton()) { <button type="button" iconOnly [pButton]="closeButtonProps()" [class]="cx('pcCloseButton')" [attr.aria-label]="ariaCloseLabel()" [attr.data-pc-group-section]="'iconcontainer'" [pButtonPT]="ptm('pcCloseButton')" [pButtonUnstyled]="unstyled()" (click)="close($event)" (keydown.enter)="close($event)" > @if (!closeIconTemplate()) { <svg data-p-icon="times" [attr.data-pc-section]="'closeicon'" /> } @else { <ng-container *ngTemplateOutlet="closeIconTemplate()"></ng-container> } </button> } </div> <div [pBind]="ptm('content')" [class]="cx('content')" [attr.data-pc-section]="'content'"> <ng-content></ng-content> @if (contentTemplate()) { <ng-container *ngTemplateOutlet="contentTemplate()"></ng-container> } </div> @if (footerTemplate()) { <div [pBind]="ptm('footer')" [class]="cx('footer')" [attr.data-pc-section]="'footer'"> <ng-container *ngTemplateOutlet="footerTemplate()"></ng-container> </div> } } </div> } `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["pButton", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "link", "rounded", "fluid", "variant", "iconOnly", "loading", "severity"] }, { kind: "component", type: Times, selector: "svg[data-p-icon=\"times\"]" }, { kind: "ngmodule", type: SharedModule }, { kind: "directive", type: Bind, selector: "[pBind]", inputs: ["pBind"] }, { kind: "ngmodule", type: FocusTrapModule }, { kind: "directive", type: i2.FocusTrap, selector: "[pFocusTrap]", inputs: ["pFocusTrapDisabled"] }, { kind: "ngmodule", type: MotionModule }, { kind: "directive", type: i3.MotionDirective, selector: "[pMotion]", inputs: ["pMotion", "pMotionName", "pMotionType", "pMotionSafe", "pMotionDisabled", "pMotionAppear", "pMotionEnter", "pMotionLeave", "pMotionDuration", "pMotionHideStrategy", "pMotionEnterFromClass", "pMotionEnterToClass", "pMotionEnterActiveClass", "pMotionLeaveFromClass", "pMotionLeaveToClass", "pMotionLeaveActiveClass", "pMotionOptions"], outputs: ["pMotionOnBeforeEnter", "pMotionOnEnter", "pMotionOnAfterEnter", "pMotionOnEnterCancelled", "pMotionOnBeforeLeave", "pMotionOnLeave", "pMotionOnAfterLeave", "pMotionOnLeaveCancelled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: Drawer, decorators: [{ type: Component, args: [{ selector: 'p-drawer', standalone: true, imports: [NgTemplateOutlet, ButtonDirective, Times, SharedModule, Bind, FocusTrapModule, MotionModule], providers: [DrawerStyle, { provide: DRAWER_INSTANCE, useExisting: Drawer }, { provide: PARENT_INSTANCE, useExisting: Drawer }], hostDirectives: [Bind], template: ` @if (modalVisible()) { <div #container [pBind]="ptm('root')" [pMotion]="visible()" [pMotionAppear]="true" [pMotionEnterActiveClass]="$enterAnimation()" [pMotionLeaveActiveClass]="$leaveAnimation()" [pMotionOptions]="computedMotionOptions()" (pMotionOnBeforeEnter)="onBeforeEnter($event)" (pMotionOnAfterLeave)="onAfterLeave($event)" [class]="cn(cx('root'), styleClass())" [style]="style()" role="complementary" (keydown)="onKeyDown($event)" pFocusTrap [attr.data-p]="dataP" [attr.data-p-open]="visible()" > @if (headlessTemplate()) { <ng-container *ngTemplateOutlet="headlessTemplate()"></ng-container> } @else { <div [pBind]="ptm('header')" [class]="cx('header')" [attr.data-pc-section]="'header'"> @if (headerTemplate()) { <ng-container *ngTemplateOutlet="headerTemplate()"></ng-container> } @if (header()) { <div [pBind]="ptm('title')" [class]="cx('title')">{{ header() }}</div> } @if (showCloseButton()) { <button type="button" iconOnly [pButton]="closeButtonProps()" [class]="cx('pcCloseButton')" [attr.aria-label]="ariaCloseLabel()" [attr.data-pc-group-section]="'iconcontainer'" [pButtonPT]="ptm('pcCloseButton')" [pButtonUnstyled]="unstyled()" (click)="close($event)" (keydown.enter)="close($event)" > @if (!closeIconTemplate()) { <svg data-p-icon="times" [attr.data-pc-section]="'closeicon'" /> } @else { <ng-container *ngTemplateOutlet="closeIconTemplate()"></ng-container> } </button> } </div> <div [pBind]="ptm('content')" [class]="cx('content')" [attr.data-pc-section]="'content'"> <ng-content></ng-content> @if (contentTemplate()) { <ng-container *ngTemplateOutlet="contentTemplate()"></ng-container> } </div> @if (footerTemplate()) { <div [pBind]="ptm('footer')" [class]="cx('footer')" [attr.data-pc-section]="'footer'"> <ng-container *ngTemplateOutlet="footerTemplate()"></ng-container> </div> } } </div> } `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }] }], ctorParameters: () => [], propDecorators: { appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], motionOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionOptions", required: false }] }], blockScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockScroll", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], ariaCloseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaCloseLabel", required: false }] }], autoZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoZIndex", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], closeButtonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeButtonProps", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], showCloseIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseIcon", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], fullScreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullScreen", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], maskStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "maskStyle", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], onShow: [{ type: i0.Output, args: ["onShow"] }], onHide: [{ type: i0.Output, args: ["onHide"] }], containerViewChild: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }], closeButtonViewChild: [{ type: i0.ViewChild, args: ['closeButton', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { ...{ descendants: false }, isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { ...{ descendants: false }, isSignal: true }] }], contentTemplate: [{ type: i0.ContentChild, args: ['content', { ...{ descendants: false }, isSignal: true }] }], closeIconTemplate: [{ type: i0.ContentChild, args: ['closeicon', { ...{ descendants: false }, isSignal: true }] }], headlessTemplate: [{ type: i0.ContentChild, args: ['headless', { ...{ descendants: false }, isSignal: true }] }] } }); class DrawerModule { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DrawerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: DrawerModule, imports: [Drawer, SharedModule], exports: [Drawer, SharedModule] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DrawerModule, imports: [Drawer, SharedModule, SharedModule] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DrawerModule, decorators: [{ type: NgModule, args: [{ imports: [Drawer, SharedModule], exports: [Drawer, SharedModule] }] }] }); /** * Generated bundle index. Do not edit. */ export { Drawer, DrawerClasses, DrawerModule, DrawerStyle }; //# sourceMappingURL=primeng-drawer.mjs.map