UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

95 lines (94 loc) 3.64 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { MutableValidityState } from "../../utils/form.js"; import type { Appearance, Layout, Scale, Status, Width } from "../interfaces.js"; import type { IconName } from "../calcite-icon/interfaces.js"; import type { SegmentedControlItem } from "../calcite-segmented-control-item/customElement.js"; /** * @cssproperty [--calcite-segmented-control-border-color] - Specifies the component's border color. * @slot - A slot for adding `calcite-segmented-control-item`s. * @slot [label-content] - A slot for rendering content next to the component's `labelText`. */ export abstract class SegmentedControl extends LitElement { /** * Specifies the appearance style of the component. * * @default "solid" */ accessor appearance: Extract<"outline" | "outline-fill" | "solid", Appearance>; /** * 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; /** * Defines the layout of the component. * * @default "horizontal" */ accessor layout: Extract<"horizontal" | "vertical", Layout>; /** Overrides individual strings used by the component. */ accessor messageOverrides: { required?: 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 in order for the form to submit. * * @default false */ accessor required: boolean; /** * Specifies the size of the component. * * @default "m" */ accessor scale: Scale; /** The component's selected item `HTMLElement`. */ get selectedItem(): SegmentedControlItem; /** * Specifies the status of the validation message. * * @default "idle" */ accessor status: Status; /** Specifies the validation icon to display under the component. */ accessor validationIcon: IconName | boolean; /** Specifies the validation message to display under the component. */ accessor validationMessage: string; /** * The component's current validation state. * * @mdn [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) */ get validity(): MutableValidityState; /** The component's `selectedItem` value. */ accessor value: string; /** * Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead. * * @default "auto" */ accessor width: Extract<"auto" | "full", Width>; /** * 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 the `calcite-segmented-control-item` selection changes. */ readonly calciteSegmentedControlChange: import("@arcgis/lumina").TargetedEvent<this, void>; readonly "@eventTypes": { calciteSegmentedControlChange: SegmentedControl["calciteSegmentedControlChange"]["detail"]; }; }