UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

70 lines (69 loc) 2.81 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { Scale } from "../interfaces.js"; /** * @cssproperty [--calcite-radio-button-background-color] - Specifies the component's background color. * @cssproperty [--calcite-radio-button-border-color] - Specifies the component's border color. * @cssproperty [--calcite-radio-button-corner-radius] - Specifies the component's corner radius. * @cssproperty [--calcite-radio-button-size] - Specifies the component's size. */ export abstract class RadioButton extends LitElement { /** * When `true`, the component is checked. * * @default false */ accessor checked: boolean; /** * When `true`, interaction is prevented and the component is displayed with lower opacity. * * @default false */ accessor disabled: boolean; /** * Specifies the `id` of the component's associated form. * * When not set, the component is associated with its ancestor form element, if one exists. */ accessor form: string; /** Specifies the component's label text. */ accessor labelText: string; /** Specifies the name of the component. Required to pass the component's `value` on form submission. */ accessor name: string; /** * When `true` and the component resides in a form, * the component must have a value selected from the `calcite-radio-button-group` in order for the form to submit. * * @default false */ accessor required: boolean; /** * Specifies the size of the component inherited from the `calcite-radio-button-group`. * * @default "m" */ accessor scale: Scale; /** * The component's value. * * @required */ accessor value: any; /** * 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 only when the radio button is checked. This behavior is identical to the native HTML input element. * Since this event does not fire when the radio button is unchecked, it's not recommended to attach a listener for this event * directly on the element, but instead either attach it to a node that contains all of the radio buttons in the group * or use the `calciteRadioButtonGroupChange` event if using this with `calcite-radio-button-group`. */ readonly calciteRadioButtonChange: import("@arcgis/lumina").TargetedEvent<this, void>; readonly "@eventTypes": { calciteRadioButtonChange: RadioButton["calciteRadioButtonChange"]["detail"]; }; }