Skip to content

Commit

Permalink
Refactor #2602
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jun 1, 2022
1 parent 3168936 commit e325a0a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
28 changes: 28 additions & 0 deletions api-generator/components/portal.js
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
}
};
36 changes: 36 additions & 0 deletions src/components/portal/Portal.d.ts
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;
1 change: 1 addition & 0 deletions src/components/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"main": "./portal.cjs.js",
"module": "./portal.esm.js",
"unpkg": "./portal.min.js",
"types": "./Portal.d.ts",
"browser": {
"./sfc": "./Portal.vue"
}
Expand Down

0 comments on commit e325a0a

Please sign in to comment.