▾
import "@arcgis/common-components/components/arcgis-value-picker-label";- Inheritance
- ArcgisValuePickerLabel→
HTMLElement
Demo
Properties
autoDestroyDisabled
- Type
- boolean
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() method when you are done to prevent memory leaks.
- Attribute
- auto-destroy-disabled
- Default value
- false
canNext
- Type
- boolean
Determines whether the user can interact with the next button.
This property is automatically set to false when currentValue matches the last index of
items.
- Attribute
- can-next
- Default value
- false
- Example
- 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)"}
canPlay
- Type
- boolean
Determines whether the user can interact with the play/pause button.
- Attribute
- can-play
- Default value
- false
canPrevious
- Type
- boolean
Determines whether the user can interact with the previous button.
This property is automatically set to false when currentValue matches the first index of
items.
- Attribute
- can-previous
- Default value
- false
- Example
- 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)"}
disabled
- Type
- boolean
When true, the component is visually withdrawn and cannot receive user interaction.
- Attribute
- disabled
- Default value
- false
items
The array of label items that arcgis-value-picker can iterate over.
Methods
| Method | Signature |
|---|---|
| inherited | componentOnReady(): Promise<this> |
| destroy(): Promise<void> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
- Example
- const arcgisValuePickerLabel = document.createElement("arcgis-value-picker-label");document.body.append(arcgisValuePickerLabel);await arcgisValuePickerLabel.componentOnReady();console.log("arcgis-value-picker-label is ready to go!");
Events
| Name | Type |
|---|---|
| CustomEvent<{ name: "canNext" | "canPlay" | "canPrevious" | "currentValue"; }> |
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "canNext" | "canPlay" | "canPrevious" | "currentValue"; }>