Компоненты PrimeNG
Dialog

Диалоговое окно

PrimeNG/Dialog (opens in a new tab)

Диалоговое окно - это контейнер для отображения контента во всплывающем окне.

С чего начать

Подключите модуль

import { DialogModule } from 'primeng/dialog';

Basic

Modal

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Responsive

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Maximizable

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Position

The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.

Severities

Это базовый диалог. Он такой по умолчанию в теме SoftUIЭтот диалог всячески подсказывает Вам, что вышло все успешноЭтот диалог подсказывает, что что-то может пойти не такЭтот диалог подсказывает, что надо что то удалить или произошла ошибка

Свойства

NameTypeDefaultDescription
headerstringnullTitle text of the dialog.
draggablebooleantrueEnables dragging to change the position using header.
keepInViewportbooleantrueKeeps dialog in the viewport.
resizablebooleantrueEnables resizing of the content.
contentStyleobjectnullStyle of the content section.
visiblebooleanfalseSpecifies the visibility of the dialog.
modalbooleanfalseDefines if background should be blocked when dialog is displayed.
positionstringcenterPosition of the dialog, options are "center", "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left" or "bottom-right".
blockScrollbooleanfalseWhether background scroll should be blocked when dialog is visible.
closeOnEscapebooleantrueSpecifices if pressing escape key should hide the dialog.
dismissableMaskbooleanfalseSpecifices if clicking the modal background should hide the dialog.
rtlbooleanfalseWhen enabled dialog is displayed in RTL direction.
closablebooleantrueAdds a close icon to the header to hide the dialog.
appendToanynullTarget element to attach the dialog, 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).
styleobjectnullInline style of the component.
styleClassstringnullStyle class of the component.
maskStyleClassstringnullStyle class of the mask.
contentStyleobjectnullInline style of the content.
contentStyleClassstringnullStyle class of the content.
showHeaderbooleantrueWhether to show the header or not.
baseZIndexnumber0Base zIndex value to use in layering.
autoZIndexbooleantrueWhether to automatically manage layering.
minXnumber0Minimum value for the left coordinate of dialog in dragging.
minYnumber0Minimum value for the top coordinate of dialog in dragging.
focusOnShowbooleantrueWhen enabled, first button receives focus on show.
focusTrapbooleantrueWhen enabled, can only focus on elements inside the dialog.
maximizablebooleanfalseWhether the dialog can be displayed full screen.
breakpointsobjectnullObject literal to define widths per screen size.
transitionOptionsstring150ms cubic-bezier(0, 0, 0.2, 1)Transition options of the animation.
closeIconstringpi pi-timesName of the close icon.
closeAriaLabelstringnullDefines a string that labels the close button for accessibility.
closeTabindexstringnullIndex of the close button in tabbing order.
minimizeIconstringpi pi-window-minimizeName of the minimize icon.
maximizeIconstringpi pi-window-maximizeName of the maximize icon.

События

NameParametersDescription
onShowevent: Event objectCallback to invoke when dialog is shown.
onHideevent: Event objectCallback to invoke when dialog is hidden.
onResizeInitevent: Event objectCallback to invoke when dialog resizing is initiated.
onResizeEndevent: Event objectCallback to invoke when dialog resizing is completed.
onDragEndevent: Event objectCallback to invoke when dialog dragging is completed.
onMaximizeevent: Event objectCallback to invoke when dialog maximized or unmaximized.

Шаблоны

NameParameters
header-
content-
footer-

Стилизация

NameElement
p-dialogContainer element
p-dialog-titlebarContainer of header.
p-dialog-titleHeader element.
p-dialog-titlebar-iconIcon container inside header.
p-dialog-titlebar-closeClose icon element.
p-dialog-contentContent element.
p-dialog-footerFooter element.