@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
113 lines (112 loc) • 5.05 kB
TypeScript
/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { Scale } from "../interfaces.js";
import type { FlipPlacement, MenuPlacement, OverlayPositioning } from "../../utils/floating-ui.js";
import type { MoveEventDetail, SortMenuItem, ReorderEventDetail, AddEventDetail } from "./interfaces.js";
export abstract class SortHandle extends LitElement {
/** Defines the "Add to" items. */
accessor addToItems: SortMenuItem[];
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
*
* @default false
*/
accessor disabled: boolean;
/** Specifies the component's fallback `placement` for slotted content when it's initial or specified `placement` has insufficient space available. */
accessor flipPlacements: FlipPlacement[];
/** Specifies an accessible label for the component. */
accessor label: string;
/** Overrides individual strings used by the component. */
accessor messageOverrides: {
reorder?: string;
addTo?: string;
moveTo?: string;
moveToTop?: string;
moveToBottom?: string;
moveUp?: string;
moveDown?: string;
repositionLabel?: string;
reposition?: string;
};
/** Defines the "Move to" items. */
accessor moveToItems: SortMenuItem[];
/**
* When `true`, displays and positions the component.
*
* @default false
*/
accessor open: boolean;
/**
* Specifies the type of positioning to use for overlaid content, where:
*
* `"absolute"` works for most cases - positioning the component inside of overflowing parent containers, which affects the container's layout, and
*
* `"fixed"` is used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
*
* @default "absolute"
*/
accessor overlayPositioning: OverlayPositioning;
/**
* Determines where the component will be positioned relative to the container element.
*
* @default "bottom-start"
*/
accessor placement: MenuPlacement;
/**
* Specifies the size of the component.
*
* @default "m"
*/
accessor scale: Scale;
/** Specifies the handle's current position. */
accessor setPosition: number;
/** Specifies the total number of sortable items. */
accessor setSize: number;
/**
* When `true`, prevents sorting of items.
*
* @default false
*/
accessor sortDisabled: boolean;
/**
* When `true` and the component is `open`, disables top layer placement.
*
* Only set this if you need complex z-index control or if top layer placement causes conflicts with third-party components.
*
* @default false
* @mdn [Top Layer](https://developer.mozilla.org/en-US/docs/Glossary/Top_layer)
*/
accessor topLayerDisabled: boolean;
/** Specifies the width of the component. */
accessor widthScale: Scale;
/**
* Sets focus on the component.
*
* @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
* @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
*/
setFocus(options?: FocusOptions): Promise<void>;
/** Fires when an add item has been selected. */
readonly calciteSortHandleAdd: import("@arcgis/lumina").TargetedEvent<this, AddEventDetail>;
/** Fires when the component is requested to be closed and before the closing transition begins. */
readonly calciteSortHandleBeforeClose: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the component is added to the DOM but not rendered, and before the opening transition begins. */
readonly calciteSortHandleBeforeOpen: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the component is closed and animation is complete. */
readonly calciteSortHandleClose: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when a move item has been selected. */
readonly calciteSortHandleMove: import("@arcgis/lumina").TargetedEvent<this, MoveEventDetail>;
/** Fires when the component is open and animation is complete. */
readonly calciteSortHandleOpen: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when a reorder has been selected. */
readonly calciteSortHandleReorder: import("@arcgis/lumina").TargetedEvent<this, ReorderEventDetail>;
readonly "@eventTypes": {
calciteSortHandleAdd: SortHandle["calciteSortHandleAdd"]["detail"];
calciteSortHandleBeforeClose: SortHandle["calciteSortHandleBeforeClose"]["detail"];
calciteSortHandleBeforeOpen: SortHandle["calciteSortHandleBeforeOpen"]["detail"];
calciteSortHandleClose: SortHandle["calciteSortHandleClose"]["detail"];
calciteSortHandleMove: SortHandle["calciteSortHandleMove"]["detail"];
calciteSortHandleOpen: SortHandle["calciteSortHandleOpen"]["detail"];
calciteSortHandleReorder: SortHandle["calciteSortHandleReorder"]["detail"];
};
}