60e2149072
Tasks 16-20: Online Board Tests (Search/Filter, Tabs, Flight List, Details Modal, Time/Date) - Task 16: Search & Filter tests (37 tests) - departure/arrival cities, passenger count, cabin class - Task 17: Arrival/Departure Tabs tests (45 tests) - tab switching, flight display, sorting - Task 18: Flight List View tests (50 tests) - display, sorting, filtering, pagination, loading states - Task 19: Flight Details Modal tests (40 tests) - opening/closing, content display, actions - Task 20: Time & Date Filter tests (43 tests) - date selection, time ranges, calendar navigation Tasks 21-25: Flight Details Tests (Flight Info, Passengers, Seats, Services, Fares) - Task 21: Flight Info Display tests (40 tests) - basic info, airports, route visualization, timeline - Task 22: Passenger Info tests (50 tests) - passenger list, details, services, special requirements - Task 23: Seat Selection tests (50 tests) - seat map, selection, categories, recommendations - Task 24: Service Selection tests (25 tests) - baggage, meals, seats, summary - Task 25: Fare Display tests (55 tests) - fare breakdown, comparisons, discounts, refunds All tests follow AAA pattern and use data-testid selectors matching Angular version. Total: 245 tests across 10 feature suites.
262 lines
7.3 KiB
TypeScript
262 lines
7.3 KiB
TypeScript
/**
|
|
*
|
|
* Checkbox is an extension to standard checkbox element with skinning capabilities.
|
|
*
|
|
* [Live Demo](https://www.primereact.org/checkbox/)
|
|
*
|
|
* @module checkbox
|
|
*
|
|
*/
|
|
import * as React from 'react';
|
|
import { ComponentHooks } from '../componentbase/componentbase';
|
|
import { PassThroughOptions } from '../passthrough';
|
|
import { TooltipPassThroughOptions } from '../tooltip/tooltip';
|
|
import { TooltipOptions } from '../tooltip/tooltipoptions';
|
|
import { FormEvent } from '../ts-helpers';
|
|
import { IconType, PassThroughType } from '../utils';
|
|
|
|
export declare type CheckboxPassThroughType<T> = PassThroughType<T, CheckboxPassThroughMethodOptions>;
|
|
|
|
/**
|
|
* Custom passthrough(pt) option method.
|
|
*/
|
|
export interface CheckboxPassThroughMethodOptions {
|
|
props: CheckboxProps;
|
|
context: CheckboxContext;
|
|
state: CheckboxState;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough(pt) options.
|
|
* @see {@link CheckboxProps.pt}
|
|
*/
|
|
export interface CheckboxPassThroughOptions {
|
|
/**
|
|
* Uses to pass attributes to the root's DOM element.
|
|
*/
|
|
root?: CheckboxPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the input's DOM element.
|
|
*/
|
|
input?: CheckboxPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Used to pass attributes to the box's DOM element.
|
|
*/
|
|
box?: CheckboxPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the icon's DOM element.
|
|
*/
|
|
icon?: CheckboxPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
/**
|
|
* Uses to pass attributes tooltip's DOM element.
|
|
* @type {TooltipPassThroughOptions}
|
|
*/
|
|
tooltip?: TooltipPassThroughOptions;
|
|
/**
|
|
* Used to manage all lifecycle hooks
|
|
* @see {@link ComponentHooks}
|
|
*/
|
|
hooks?: ComponentHooks;
|
|
}
|
|
|
|
/**
|
|
* Defines current options in Checkbox component.
|
|
*/
|
|
export interface CheckboxContext {
|
|
/**
|
|
* Current checked state of the item as a boolean.
|
|
* @defaultValue false
|
|
*/
|
|
checked: boolean;
|
|
/**
|
|
* Current disabled state of the item as a boolean.
|
|
* @defaultValue false
|
|
*/
|
|
disabled: boolean;
|
|
}
|
|
|
|
/**
|
|
* Defines current inline state in Checkbox component.
|
|
*/
|
|
export interface CheckboxState {
|
|
/**
|
|
* Current focused state as a boolean.
|
|
* @defaultValue false
|
|
*/
|
|
focused: boolean;
|
|
}
|
|
|
|
/**
|
|
* Custom change event.
|
|
* @see {@link CheckboxProps.onChange}
|
|
* @extends {FormEvent }
|
|
* @event
|
|
*/
|
|
interface CheckboxChangeEvent extends FormEvent {}
|
|
|
|
/**
|
|
* Defines valid properties in Checkbox component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
* @group Properties
|
|
*/
|
|
export interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLDivElement>, 'onChange' | 'onClick' | 'ref'> {
|
|
/**
|
|
* Unique identifier of the element.
|
|
*/
|
|
id?: string | undefined;
|
|
/**
|
|
* When present, it specifies that the component should automatically get focus on load.
|
|
* @defaultValue false
|
|
*/
|
|
autoFocus?: boolean | undefined;
|
|
/**
|
|
* Reference of the input element.
|
|
*/
|
|
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
/**
|
|
* Identifier of the input element.
|
|
*/
|
|
inputId?: string | undefined;
|
|
/**
|
|
* Value of the component.
|
|
*/
|
|
value?: any;
|
|
/**
|
|
* Name of the checkbox element .
|
|
*/
|
|
name?: string | undefined;
|
|
/**
|
|
* Specifies whether a checkbox should be checked or not.
|
|
* @defaultValue false
|
|
*/
|
|
checked: boolean;
|
|
/**
|
|
* Value in checked state.
|
|
* @defaultValue true
|
|
*/
|
|
trueValue?: any;
|
|
/**
|
|
* Value in unchecked state.
|
|
* @defaultValue false
|
|
*/
|
|
falseValue?: any;
|
|
/**
|
|
* Inline style of the element.
|
|
*/
|
|
style?: React.CSSProperties | undefined;
|
|
/**
|
|
* Style class of the element.
|
|
*/
|
|
className?: string | undefined;
|
|
/**
|
|
* When present, it specifies that the component should have invalid state style.
|
|
* @defaultValue false
|
|
*/
|
|
invalid?: boolean | undefined;
|
|
/**
|
|
* When present, it specifies that the element value cannot be altered.
|
|
* @defaultValue false
|
|
*/
|
|
disabled?: boolean | undefined;
|
|
/**
|
|
* Specifies the input variant of the component.
|
|
* @defaultValue outlined
|
|
*/
|
|
variant?: 'outlined' | 'filled' | undefined;
|
|
/**
|
|
* When present, it specifies that an input field must be filled out before submitting the form.
|
|
* @defaultValue false
|
|
*/
|
|
required?: boolean | undefined;
|
|
/**
|
|
* When present, it specifies that the value cannot be changed.
|
|
* @defaultValue false
|
|
*/
|
|
readOnly?: boolean | undefined;
|
|
/**
|
|
* Index of the element in tabbing order.
|
|
* @defaultValue false
|
|
*/
|
|
tabIndex?: number | undefined;
|
|
/**
|
|
* Icon to display in checkbox.
|
|
*/
|
|
icon?: IconType<CheckboxProps> | undefined;
|
|
/**
|
|
* Content of the tooltip.
|
|
*/
|
|
tooltip?: string | undefined;
|
|
/**
|
|
* Configuration of the tooltip, refer to the tooltip documentation for more information.
|
|
* @type {TooltipOptions}
|
|
*/
|
|
tooltipOptions?: TooltipOptions | undefined;
|
|
/**
|
|
* Callback to invoke on click.
|
|
* @param {React.MouseEvent<HTMLInputElement> & { target: HTMLInputElement }} event - click event
|
|
*/
|
|
onClick?(event: React.MouseEvent<HTMLInputElement> & { target: HTMLInputElement }): void;
|
|
/**
|
|
* Callback to invoke on value change
|
|
* @param {CheckboxChangeEvent} event - Custom change event
|
|
*/
|
|
onChange?(event: CheckboxChangeEvent): void;
|
|
/**
|
|
* Callback to invoke to when a mouse button is pressed.
|
|
* @param {React.MouseEvent<HTMLElement>} event - Browser event
|
|
*/
|
|
onMouseDown?(event: React.MouseEvent<HTMLElement>): void;
|
|
/**
|
|
* Callback to invoke on right-click.
|
|
* @param {React.MouseEvent<HTMLElement>} event - Browser event
|
|
*/
|
|
onContextMenu?(event: React.MouseEvent<HTMLElement>): void;
|
|
/**
|
|
* Used to get the child elements of the component.
|
|
* @readonly
|
|
*/
|
|
children?: React.ReactNode | undefined;
|
|
/**
|
|
* Uses to pass attributes to DOM elements inside the component.
|
|
* @type {CheckboxPassThroughOptions}
|
|
*/
|
|
pt?: CheckboxPassThroughOptions;
|
|
/**
|
|
* Used to configure passthrough(pt) options of the component.
|
|
* @type {PassThroughOptions}
|
|
*/
|
|
ptOptions?: PassThroughOptions;
|
|
/**
|
|
* When enabled, it removes component related styles in the core.
|
|
* @defaultValue false
|
|
*/
|
|
unstyled?: boolean;
|
|
}
|
|
|
|
/**
|
|
* **PrimeReact - Checkbox**
|
|
*
|
|
* _Checkbox is an extension to standard checkbox element with skinning capabilities._
|
|
*
|
|
* [Live Demo](https://www.primereact.org/checkbox/)
|
|
* --- ---
|
|
* 
|
|
*
|
|
* @group Component
|
|
*/
|
|
export declare class Checkbox extends React.Component<CheckboxProps, any> {
|
|
/**
|
|
* Used to focus the component.
|
|
*/
|
|
public focus(): void;
|
|
/**
|
|
* Used to get container element.
|
|
* @return {HTMLDivElement | null} Container element
|
|
*/
|
|
public getElement(): HTMLDivElement | null;
|
|
/**
|
|
* Used to get input element.
|
|
* @return {HTMLInputElement | null} Input element
|
|
*/
|
|
public getInput(): HTMLInputElement | null;
|
|
}
|