UNPKG

@enact/sandstone

Version:

Large-screen/TV support library for Enact, containing a variety of UI components.

88 lines (79 loc) 2.97 kB
// Type definitions for sandstone/FormCheckboxItem import { ToggleableProps as ui_Toggleable_ToggleableProps } from "@enact/ui/Toggleable"; import { ItemProps as sandstone_Item_ItemProps } from "@enact/sandstone/Item"; import * as React from "react"; type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N; export interface FormCheckboxItemBaseProps extends sandstone_Item_ItemProps { /** * Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component. * * The following classes are supported: * * `formCheckboxItem` - The root class name */ css?: object; /** * The icon content. * * May be specified as either: * * A string that represents an icon from the , * * An HTML entity string, Unicode reference or hex value (in the form '0x...'), * * A URL specifying path to an icon image, or * * An object representing a resolution independent resource (See ) */ icon?: string | object; /** * Enables the "indeterminate" state. * * An indeterminate, mixed, or half-selected state is typically used in a hierarchy or group to represent that some, not all, children are selected. * * NOTE: This does not prevent updating the `selected` state. Applications must control this property directly. */ indeterminate?: boolean; /** * The icon to be used in the `indeterminate` state. * * May be specified as either: * * A string that represents an icon from the , * * An HTML entity string, Unicode reference or hex value (in the form '0x...'), * * A URL specifying path to an icon image, or * * An object representing a resolution independent resource (See ) */ indeterminateIcon?: string; /** * Controls the presence of the checkmark icon. */ selected?: boolean; /** * Nodes to be inserted after the checkbox and before `children` . */ slotBefore?: React.ReactNode; } /** * A Sandstone-styled form item with a checkbox component. * * Useful to show a selected state on an item inside a form. */ export class FormCheckboxItemBase extends React.Component< Merge<React.HTMLProps<HTMLElement>, FormCheckboxItemBaseProps> > {} export interface FormCheckboxItemDecoratorProps extends ui_Toggleable_ToggleableProps {} export function FormCheckboxItemDecorator<P>( Component: React.ComponentType<P> | string, ): React.ComponentType<P & FormCheckboxItemDecoratorProps>; export interface FormCheckboxItemProps extends Merge<FormCheckboxItemBaseProps, FormCheckboxItemDecoratorProps> {} /** * A Sandstone-styled form item with a checkbox component. * * `FormCheckboxItem` will manage its `selected` state via unless set directly. */ export class FormCheckboxItem extends React.Component< Merge<React.HTMLProps<HTMLElement>, FormCheckboxItemProps> > {} export default FormCheckboxItem;