This commit is contained in:
2022-11-14 11:59:26 +08:00
parent 0a63adba99
commit 492d0963fe
336 changed files with 70636 additions and 7 deletions

4
types/component/dropdown/index.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
import { WithInstallType } from "../../utils";
import Component from "./index.vue";
declare const component: WithInstallType<typeof Component>;
export default component;

23
types/component/dropdown/interface.d.ts vendored Normal file
View File

@@ -0,0 +1,23 @@
export declare type DropdownTrigger = "click" | "hover" | "focus" | "contextMenu";
export declare type DropdownPlacementLegacy = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "right-top" | "right-bottom" | "left-top" | "left-bottom";
export declare type DropdownPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end" | DropdownPlacementLegacy;
export interface ElementScrollRect {
top: number;
bottom: number;
left: number;
right: number;
scrollTop: number;
scrollBottom: number;
scrollLeft: number;
scrollRight: number;
width: number;
height: number;
}
export interface DropdownContext {
onMouseenter: Function;
onMouseleave: Function;
addChildRef: Function;
removeChildRef: Function;
hide: Function;
}
export declare const dropdownInjectionKey: unique symbol;

33
types/component/dropdown/util.d.ts vendored Normal file
View File

@@ -0,0 +1,33 @@
import { DropdownPlacement } from "./interface";
import { Component, VNode, VNodeTypes } from "vue";
export interface SlotChildren {
value?: VNode[];
}
export declare enum ShapeFlags {
ELEMENT = 1,
FUNCTIONAL_COMPONENT = 2,
STATEFUL_COMPONENT = 4,
COMPONENT = 6,
TEXT_CHILDREN = 8,
ARRAY_CHILDREN = 16,
SLOTS_CHILDREN = 32,
TELEPORT = 64,
SUSPENSE = 128,
COMPONENT_SHOULD_KEEP_ALIVE = 256,
COMPONENT_KEPT_ALIVE = 512
}
export declare const isScrollElement: (element: HTMLElement) => boolean;
export declare const getScrollElements: (container: HTMLElement | undefined) => HTMLElement[];
export declare const isElement: (vn: VNode) => boolean;
export declare const isComponent: (vn: VNode, type?: VNodeTypes) => type is Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
export declare const isArrayChildren: (vn: VNode, children: VNode["children"]) => children is VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[];
export declare const getChildrenArray: (vn: VNode) => VNode[] | undefined;
export declare const getFirstElementFromVNode: (vn: VNode) => HTMLElement | undefined;
export declare const getFirstElementFromChildren: (children: VNode[] | undefined) => HTMLElement | undefined;
export declare const useFirstElement: () => {
children: SlotChildren;
firstElement: import("vue").Ref<HTMLElement | undefined>;
};
export declare const transformPlacement: (placement: DropdownPlacement) => DropdownPlacement;