2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
2024-05-16 10:50:43 +00:00
|
|
|
import { DefineComponent, EmitFn, GlobalComponentConstructor, HintedString } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-02-23 08:38:50 +00:00
|
|
|
type PortalAppendToType = HintedString<'body' | 'self'> | undefined | HTMLElement;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
export interface PortalProps {
|
|
|
|
/**
|
|
|
|
* A valid query selector or an HTMLElement to specify where the dialog gets attached. Special keywords are 'body' for document body and 'self' for the element itself.
|
|
|
|
* @see PortalAppendToType
|
|
|
|
* Default value is 'body'.
|
|
|
|
*/
|
|
|
|
appendTo?: PortalAppendToType;
|
|
|
|
/**
|
|
|
|
* If disabled, the Portal feature is eliminated and the content is displayed directly.
|
2023-03-10 14:00:58 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
disabled?: boolean | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PortalSlots {
|
|
|
|
/**
|
|
|
|
* Default content slot.
|
|
|
|
*/
|
|
|
|
default: () => VNode[];
|
|
|
|
}
|
|
|
|
|
2024-05-16 10:50:43 +00:00
|
|
|
declare type PortalEmitsOptions = {};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-05-16 10:50:43 +00:00
|
|
|
export declare type PortalEmits = EmitFn<PortalEmitsOptions>;
|
|
|
|
|
|
|
|
declare const Portal: DefineComponent<PortalProps, PortalSlots, PortalEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-03-14 22:58:11 +00:00
|
|
|
declare module 'vue' {
|
|
|
|
export interface GlobalComponents {
|
2024-05-16 10:50:43 +00:00
|
|
|
Portal: GlobalComponentConstructor<PortalProps, PortalSlots, PortalEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Portal;
|