vira
Version:
A simple and highly versatile design system using element-vir.
82 lines (81 loc) • 3.07 kB
TypeScript
import { type PartialWithUndefined } from '@augment-vir/common';
import { NavController, type Coords } from 'device-navigation';
import { PopUpManager, type ShowPopUpResult } from '../../util/pop-up-manager.js';
/**
* Offsets applied to any menu opened by {@link ViraPopUpTrigger}.
*
* @category Internal
*/
export type PopUpOffset = PartialWithUndefined<{
vertical: number;
right: number;
left: number;
}>;
/**
* Anchor options for pop-ups.
*
* @category Internal
*/
export declare enum HorizontalAnchor {
/**
* The left side of the pop-up will be anchored to the left side of the trigger, allowing the
* pop-up to grow on the right side of the trigger.
*/
Left = "left",
/**
* The Right side of the pop-up will be anchored to the right side of the trigger, allowing the
* pop-up to grow on the left side of the trigger.
*/
Right = "right",
/**
* Restrict the pop-up on both sides.
*
* This is the default anchor for {@link ViraPopUpTrigger}.
*/
Both = "both"
}
/**
* An element with slots for a pop-up trigger and pop-up contents.
*
* @category PopUp
* @category Elements
* @see https://electrovir.github.io/element-vir/vira/book/elements/vira-pop-up-trigger
*/
export declare const ViraPopUpTrigger: import("element-vir").DeclarativeElementDefinition<"vira-pop-up-trigger", PartialWithUndefined<{
isDisabled: boolean;
/** For debugging purposes only. Very bad for actual production code use. */
z_debug_forceOpenState: boolean;
/** Set to `true` to keep the pop-up open if it is interacted with. */
keepOpenAfterInteraction: boolean;
/** All values in px. */
popUpOffset?: PopUpOffset;
/**
* - `HorizontalAnchor.Left`: pop-up is anchored to the left side of the trigger and the
* pop-up can grow to the right.
* - `HorizontalAnchor.Right`: pop-up is anchored to the right side of the trigger and the
* pop-up can grow to the left.
* - `HorizontalAnchor.Both`: pop-up is anchored on both sides of the trigger and cannot grow
* beyond it. (This is the default experience.)
*
* Note that when `HorizontalAnchor.Both` is _not_ used, this anchor will cancel out any
* `popUpOffset` for the direction _opposite_ of the chosen anchor.
*
* @default HorizontalAnchor.Both
*/
horizontalAnchor?: HorizontalAnchor;
}>, {
/** `undefined` means the pop up is not currently showing. */
showPopUpResult: ShowPopUpResult | undefined;
popUpManager: PopUpManager;
}, {
navSelect: import("element-vir").DefineEvent<Coords>;
/**
* - `undefined` indicates that the pop-up just closed.
* - {@link ShowPopUpResult} indicates that the pop-up just opened.
*/
openChange: import("element-vir").DefineEvent<ShowPopUpResult | undefined>;
init: import("element-vir").DefineEvent<{
navController: NavController;
popUpManager: PopUpManager;
}>;
}, "vira-pop-up-trigger-disabled", "vira-pop-up-trigger-", readonly ["trigger", "popUp"]>;