-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3168936
commit e325a0a
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const PortalProps = [ | ||
{ | ||
name: "appendTo", | ||
type: "string", | ||
default: "body", | ||
description: '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.' | ||
}, | ||
{ | ||
name: "disabled", | ||
type: "boolean", | ||
default: "false", | ||
description: "If disabled, the Portal feature is eliminated and the content is displayed directly." | ||
} | ||
]; | ||
|
||
const PortalEvents = []; | ||
|
||
const PortalSlots = []; | ||
|
||
module.exports = { | ||
portal: { | ||
name: "Portal", | ||
description: "Portal moves its container to a specific location based on target elements. Basically it uses <Teleport> in the background.", | ||
props: PortalProps, | ||
events: PortalEvents, | ||
slots: PortalSlots | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { VNode } from 'vue'; | ||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; | ||
|
||
type PortalAppendToType = 'body' | 'self' | string | undefined; | ||
|
||
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. | ||
*/ | ||
disabled?: boolean | undefined; | ||
} | ||
|
||
export interface PortalSlots { | ||
/** | ||
* Default content slot. | ||
*/ | ||
default: () => VNode[]; | ||
} | ||
|
||
export declare type PortalEmits = { } | ||
|
||
declare class Portal extends ClassComponent<PortalProps, PortalSlots, PortalEmits> { } | ||
|
||
declare module '@vue/runtime-core' { | ||
interface GlobalComponents { | ||
Portal: GlobalComponentConstructor<Portal> | ||
} | ||
} | ||
|
||
export default Portal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters