Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/devextreme/js/__internal/ui/chat/confirmationpopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import Guid from '@js/core/guid';
import type { dxElementWrapper } from '@js/core/renderer';
import $ from '@js/core/renderer';
import messageLocalization from '@js/localization/message';
import Popup, { type Properties as PopupProperties, type ToolbarItem } from '@js/ui/popup';
import type { ToolbarItem } from '@js/ui/popup';
import eventsEngine from '@ts/events/core/events_engine';
import { BUTTON_CLASS } from '@ts/ui/button/button';
import type InternalPopup from '@ts/ui/popup/popup';
import type { PopupProperties } from '@ts/ui/popup/popup';
import Popup from '@ts/ui/popup/popup.full';

export const CHAT_CONFIRMATION_POPUP_WRAPPER_CLASS = 'dx-chat-confirmation-popup-wrapper';

Expand All @@ -16,7 +17,7 @@ interface ConfirmationPopupActions {
onCancelButtonClick?: () => void;
}

type ConfirmationPopupProperties = PopupProperties & ConfirmationPopupActions;
type ConfirmationPopupProperties = PopupProperties<Popup> & ConfirmationPopupActions;

class ConfirmationPopup {
_$container: dxElementWrapper;
Expand Down Expand Up @@ -52,7 +53,7 @@ class ConfirmationPopup {
this._popup = new Popup($popupContainer.get(0), this._getPopupConfig());
}

_getPopupConfig(): PopupProperties {
_getPopupConfig(): PopupProperties<Popup> {
const messageId = new Guid().toString();
const $message = $('<div>')
.text(messageLocalization.format('dxChat-editingDeleteConfirmText'))
Expand All @@ -68,15 +69,15 @@ class ConfirmationPopup {
hideOnOutsideClick: true,
toolbarItems: this._getToolbarItems(),
onContentReady(args): void {
const component = args.component as InternalPopup;
const { component } = args;

component.$content()
?.append($message);

component.$overlayContent().attr('aria-labelledby', messageId);
},
onShown: (e): void => {
const component = e.component as InternalPopup;
const { component } = e;
const $firstButton = component
.bottomToolbar()
?.find(`.${BUTTON_CLASS}`)
Expand Down
Loading