vira
Version:
A simple and highly versatile design system using element-vir.
50 lines (49 loc) • 2.19 kB
TypeScript
import { type PartialWithUndefined } from '@augment-vir/common';
import { type ViraIconSvg } from '../icons/icon-svg.js';
import { type ShowPopUpResult } from '../util/pop-up-manager.js';
import { type ViraSelectOption } from '../util/vira-select-option.js';
import { type PopUpTriggerPosition } from './pop-up/vira-pop-up-trigger.element.js';
/**
* A dropdown element that uses pop-up menus.
*
* @category Dropdown
* @category Elements
* @see https://electrovir.github.io/vira/book/elements/dropdown/vira-dropdown
*/
export declare const ViraDropdown: import("element-vir").DeclarativeElementDefinition<"vira-dropdown", {
options: ReadonlyArray<Readonly<ViraSelectOption>>;
/** The selected id from the given options. */
selected: ReadonlyArray<PropertyKey>;
} & PartialWithUndefined<{
/** Text to show if nothing is selected. */
placeholder: string;
/**
* If false, this will behave like a single select dropdown, otherwise you can select
* multiple.
*/
isMultiSelect: boolean;
icon: ViraIconSvg;
selectionPrefix: string;
isDisabled: boolean;
label: string;
/** For debugging purposes only. Very bad for actual production code use. */
z_debug_forceOpenState: boolean;
} & PopUpTriggerPosition>, {
/** `undefined` means the pop up is not currently showing. */
showPopUpResult: ShowPopUpResult | undefined;
/**
* Used to couple the label and trigger together. This is not applied if no label is
* provided.
*/
randomId: string;
}, {
/**
* @deprecated Use `selectedValuesChange` instead. `selectedChange` is broken for
* multi-select (it doesn't emit all the currently selected values) but is temporarily
* left for backwards compatibility purposes. It will be removed entirely soon.
*/
selectedChange: import("element-vir").DefineEvent<string[]>;
/** Emits all currently selected values. */
selectedValuesChange: import("element-vir").DefineEvent<string[]>;
openChange: import("element-vir").DefineEvent<ShowPopUpResult | undefined>;
}, "vira-dropdown-", "vira-dropdown-", readonly [], readonly ["leadingIcon", "prefixText", "trigger"]>;