UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

54 lines (51 loc) 2.77 kB
import type Accessor from "../../core/Accessor.js"; import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js"; export interface ExpandViewModelProperties extends Partial<Pick<ExpandViewModel, "autoCollapse" | "expanded" | "group" | "view">> {} export type ExpandViewModelState = "ready" | "disabled"; /** * Provides the logic for the [Expand](https://developers.arcgis.com/javascript/latest/references/core/widgets/Expand/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-expand/). * * @deprecated since version 5.0. Use the [Expand component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-expand/) directly instead. * @since 4.3 * @see [Expand](https://developers.arcgis.com/javascript/latest/references/core/widgets/Expand/) widget - _Deprecated since 4.34. Use the [Expand component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-expand/) instead._ * @see [Expand component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-expand/) * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern) */ export default class ExpandViewModel extends Accessor { constructor(properties?: ExpandViewModelProperties); /** * Automatically collapses the Expand instance when the view's * `viewpoint` updates. * * @default false */ accessor autoCollapse: boolean; /** * Whether the element is currently expanded or not. * * @default false */ accessor expanded: boolean; /** * This value associates two or more Expand instances with each other, allowing one * instance to auto collapse when another instance in the same group is expanded. For auto collapsing * to take effect, all instances of the group must be included in the view's `ui` property. * * For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a * group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the * `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be * fully visible. * * @since 4.6 * @see [Expand.group](https://developers.arcgis.com/javascript/latest/references/core/widgets/Expand/#group) */ accessor group: string | null | undefined; /** * The view model's state. * * @default "disabled" */ get state(): ExpandViewModelState; /** The view in which the Expand is used. */ accessor view: MapViewOrSceneView | null | undefined; }