ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
94 lines (93 loc) • 2.7 kB
TypeScript
import { RanElement } from '@/utils/index';
import '@/components/popover/content';
import '@/components/dropdown';
import { EventManager } from '@/utils/builder';
export type PlacementDirection = Record<string, Record<string, string>>;
export declare enum PLACEMENT_TYPE {
TOP = "top",
BOTTOM = "bottom",
LEFT = "left",
RIGHT = "right"
}
export declare class Popover extends RanElement {
_events: EventManager;
_slot: HTMLSlotElement;
popoverBlock: HTMLDivElement;
popoverContent?: HTMLElement;
popoverInner?: HTMLDivElement;
popoverInnerBlock?: HTMLDivElement;
_shadowDom: ShadowRoot;
dropDownInTimeId?: NodeJS.Timeout;
dropDownOutTimeId?: NodeJS.Timeout;
removeTimeId?: NodeJS.Timeout;
static get observedAttributes(): string[];
readonly closePopover: () => void;
constructor();
get placement(): string;
set placement(value: string);
get trigger(): string;
set trigger(value: string);
get getPopupContainerId(): string;
set getPopupContainerId(value: string);
get sheet(): string;
set sheet(value: string);
handlerExternalCss: () => void;
initAria: () => void;
updateAriaExpanded: (isExpanded: boolean) => void;
stopPropagation: (e: Event) => void;
/**
* @description: 创建下拉框
* @param {HTMLCollection} content
* @return {*}
*/
createContent: (content: HTMLCollection) => void;
/**
* @description: 观察内容变化
* @param {Event} e
* @return {*}
*/
watchContent: (e: Event) => void;
/**
* @description: 焦点移除的情况,需要移除下拉框
* @return {*}
*/
blur: any;
/**
* @description: 移除下拉框
* @return {*}
*/
removeDropDownTimeId: any;
/**
* @description: 添加 dropdown
* @return {*}
*/
setDropdownDisplayBlock: any;
/**
* @description: 移除 select dropdown
* @return {*}
*/
setDropdownDisplayNone: any;
/**
* @description: 设置 popover 位置
* @param {*} void
* @return {*}
*/
placementPosition: () => void;
/**
* @description: 鼠标移入
* @param {Event} e
* @return {*}
*/
hoverPopover: (e: Event) => void;
clickContent: (e: Event) => void;
clickPopover: (e: Event) => void;
keydownPopover: (e: KeyboardEvent) => void;
clickRemovePopover: (e: Event) => void;
popoverTrigger: () => void;
hoverRemovePopover: (e: Event) => void;
changePlacement: any;
connectedCallback(): void;
disconnectedCallback(): void;
attributeChangedCallback(n: string, o: string, v: string): void;
}
export default Popover;