import { JSXInterface } from '../jsx'; import { CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core'; import '@refinitiv-ui/phrasebook/locale/en/dialog.js'; import { Translate } from '@refinitiv-ui/translate'; import '../button/index.js'; import '../header/index.js'; import '../icon/index.js'; import { Overlay } from '../overlay/index.js'; import '../panel/index.js'; /** * Popup window, designed to contain and show any HTML content. * It provides modal and dragging functionality, * and also allows custom footers and control buttons to be used. * * @prop {boolean} noCancelOnOutsideClick - Prevents dialog to close when user clicks outside the dialog. * * @attr {boolean} [opened=false] - Set dialog to open * @prop {boolean} [opened=false] - Set dialog to open * * @attr {boolean} [no-cancel-on-esc-key=false] - Prevents dialog to close when user presses ESC key * @prop {boolean} [noCancelOnEscKey=false] - Prevents dialog to close when user presses ESC key * * @attr {string | undefined} x - Set a specific x coordinate of dialog * @prop {string | undefined} x - Set a specific x coordinate of dialog * * @attr {string | undefined} y - Set a specific y coordinate of dialog * @prop {string | undefined} y - Set a specific y coordinate of dialog * * @attr {boolean} full-screen - Set dialog to full screen * @prop {boolean} [fullScreen=false] - Set dialog to full screen * * @attr {string | undefined} position-target - Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`. * @prop {string | undefined} positionTarget - Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`. * * @fires opened-changed - Fired when the user changes open state of the dialog e.g. when the user presses escape key or uses close button to close the dialog. The event is not triggered if `opened` property is changed programmatically. * @fires confirm - Fired when dialog is closed by user clicked a default OK button. Prevent default to stop default action * @fires cancel - Fired when dialog is closed by user clicked a default Cancel button, clicked outside to close dialog or press ESC to close the dialog. Prevent default to stop default action * * @slot footer - Hide default OK and Cancel button and replace dialog's footer with your custom content. */ export declare class Dialog extends Overlay { /** * Element version number * @returns version number */ static get version(): string; /** * Default role of the element */ protected readonly defaultRole: string | null; /** * A `CSSResultGroup` that will be used * to style the host, slotted children * and the internal template of the element. * @returns CSS template */ static get styles(): CSSResultGroup; /** * Set Header/Title of the dialog */ header: string | null; /** * Should the dialog be draggable */ draggable: boolean; /** * Used for translations */ protected t: Translate; /** * Element for capture dragging */ private handle; /** * Flag to say whether the dialog has been confirmed and closed. */ protected confirmed: boolean; /** * Close dialog when user clicked outside the dialog */ noCancelOnOutsideClick: boolean; /** * @ignore * Hiding from document to avoid property overridden */ withBackdrop: boolean; /** * @ignore * Hiding from document to avoid property overridden */ withShadow: boolean; /** * Clear all cached values and fit the popup. * @returns {void} */ refit(): void; disconnectedCallback(): void; /** * Check if component should be updated * @param changedProperties properties changed on shouldUpdate lifecycle callback * @returns boolean should component update */ protected shouldUpdate(changedProperties: PropertyValues): boolean; /** * Compute property values that depend on other properties * and are used in the rest of the update process. * @param changedProperties Properties that has changed * @returns {void} */ protected willUpdate(changedProperties: PropertyValues): void; /** * Called after the component is first rendered * @param changedProperties Properties which have changed * @return {void} */ protected firstUpdated(changedProperties: PropertyValues): void; /** * Called after the element’s properties has been updated * @param changedProperties Properties that has changed * @returns {void} */ protected updated(changedProperties: PropertyValues): void; /** * Run when the popup has closed, managers are de-registered * and closing transition has finished * @returns {void} */ protected onClosed(): void; /** * Default handler for confirm click * @returns {void} */ protected defaultConfirm(): void; /** * Default handler for cancel click * @returns {void} */ protected defaultCancel(): void; /** * Make sure that confirm/cancel events are fired appropriately * All internal opened set events can be stoppable externally * Use this instead of setting opened directly * @param opened True if opened * @returns {void} */ protected setOpened(opened: boolean): void; /** * Update draggable behavior looking to properties draggable and opened * @returns {void} */ private updateDraggableBehavior; /** * @param changedProperties - updated properties map * @returns true if needs to update draggable behavior */ private isDraggableBehaviourNeedToBeChanged; /** * fire `cancel` or `confirm` event looking to `confirm` property * @param isConfirm true to fire `confirm` event. false to fire `cancel` event * @returns true if event is successful, false if event is prevented */ private fireCancelOrConfirmEvent; /** * Get the default content template * @return {TemplateResult} Render template */ protected get contentTemplate(): TemplateResult; /** * Get the default footer template * @return {TemplateResult} Render template */ protected get footerTemplate(): TemplateResult; /** * Get the default header template * @return {TemplateResult} Render template */ protected get headerTemplate(): TemplateResult; /** * A `TemplateResult` that will be used * to render the updated internal template. * @return {TemplateResult} Render template */ protected render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { 'ef-dialog': Dialog; } } declare global { interface HTMLElementTagNameMap { 'ef-dialog': Dialog; } namespace JSX { interface IntrinsicElements { 'ef-dialog': Partial | JSXInterface.HTMLAttributes; } } } export {};