@arcgis/map-components
Version:
ArcGIS Map Components
82 lines (81 loc) • 3.99 kB
TypeScript
/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { LabelItem } from "../arcgis-value-picker/types.js";
/** @internal */
export abstract class ArcgisValuePickerLabel extends LitElement {
/**
* If true, the component will not be destroyed automatically when it is
* disconnected from the document. This is useful when you want to move the
* component to a different place on the page, or temporarily hide it. If this
* is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#destroy) method when you are done to
* prevent memory leaks.
*
* @default false
*/
accessor autoDestroyDisabled: boolean;
/**
* Determines whether the user can interact with the next button.
* This property is automatically set to `false` when [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#currentValue) matches the last index of
* [items](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#items).
*
* @default false
* @example
* ```js
* const valuePicker = document.querySelector("arcgis-value-picker");
* const valuePickerLabel = document.querySelector("arcgis-value-picker-label");
*
* valuePickerLabel.items = [
* { value: "90606", label: "Whittier, CA (90606)" },
* { value: "76001", label: "Arlington, TX (76001)" },
* { value: "92335", label: "Fontana, CA (92335)" }
* ];
* valuePickerLabel.currentValue = valuePickerLabel.items[0];
* if (valuePickerLabel.canNext === true) {
* valuePicker.next();
* console.log(valuePickerLabel.currentValue.label); // "Arlington, TX (76001)"
* }
* ```
*/
accessor canNext: boolean;
/**
* Determines whether the user can interact with the play/pause button.
*
* @default false
*/
accessor canPlay: boolean;
/**
* Determines whether the user can interact with the previous button.
* This property is automatically set to `false` when [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#currentValue) matches the first index of
* [items](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#items).
*
* @default false
* @example
* ```js
* const valuePicker = document.querySelector("arcgis-value-picker");
* const valuePickerLabel = document.querySelector("arcgis-value-picker-label");
*
* valuePickerLabel.items = [
* { value: "90606", label: "Whittier, CA (90606)" },
* { value: "76001", label: "Arlington, TX (76001)" },
* { value: "92335", label: "Fontana, CA (92335)" }
* ];
* valuePickerLabel.currentValue = valuePickerLabel.items[1];
* if (valuePickerLabel.canPrevious === true) {
* valuePicker.previous();
* console.log(valuePickerLabel.currentValue.label); // "Whittier, CA (90606)"
* }
* ```
*/
accessor canPrevious: boolean;
/** The currently selected label item rendered by the component. */
accessor currentValue: LabelItem | undefined;
/** The array of label items that [arcgis-value-picker](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/) can iterate over. */
accessor items: LabelItem[] | undefined;
/** Permanently destroy the component. */
destroy(): Promise<void>;
/** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "canNext" | "canPlay" | "canPrevious" | "currentValue"; }>;
readonly "@eventTypes": {
arcgisPropertyChange: ArcgisValuePickerLabel["arcgisPropertyChange"]["detail"];
};
}