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.
211 lines
6.3 KiB
TypeScript
211 lines
6.3 KiB
TypeScript
/**
|
|
*
|
|
* SelectButton is used to choose single or multiple items from a list using buttons.
|
|
*
|
|
* [Live Demo](https://www.primereact.org/selectbutton/)
|
|
*
|
|
* @module selectbutton
|
|
*
|
|
*/
|
|
import * as React from 'react';
|
|
import { ComponentHooks } from '../componentbase/componentbase';
|
|
import { PassThroughOptions } from '../passthrough';
|
|
import { SelectItemOptionsType } from '../selectitem/selectitem';
|
|
import { TooltipPassThroughOptions } from '../tooltip/tooltip';
|
|
import { TooltipOptions } from '../tooltip/tooltipoptions';
|
|
import { FormEvent } from '../ts-helpers';
|
|
import { PassThroughType } from '../utils/utils';
|
|
|
|
export declare type SelectButtonPassThroughType<T> = PassThroughType<T, SelectButtonPassThroughMethodOptions>;
|
|
|
|
/**
|
|
* Custom passthrough(pt) option method.
|
|
*/
|
|
export interface SelectButtonPassThroughMethodOptions {
|
|
props: SelectButtonProps;
|
|
context: SelectButtonContext;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough(pt) options.
|
|
* @see {@link SelectButtonProps.pt}
|
|
*/
|
|
export interface SelectButtonPassThroughOptions {
|
|
/**
|
|
* Uses to pass attributes to the root's DOM element.
|
|
*/
|
|
root?: SelectButtonPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the button's DOM element.
|
|
*/
|
|
button?: SelectButtonPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the label's DOM element.
|
|
*/
|
|
label?: SelectButtonPassThroughType<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 SelectButton component.
|
|
*/
|
|
export interface SelectButtonContext {
|
|
/**
|
|
* Current selected value of the item as a boolean.
|
|
* @defaultValue false
|
|
*/
|
|
selected: boolean;
|
|
/**
|
|
* Current disabled value of option or disabled property as a boolean.
|
|
* @defaultValue false
|
|
*/
|
|
disabled: boolean;
|
|
/**
|
|
* Available option.
|
|
*/
|
|
option: any;
|
|
}
|
|
|
|
/**
|
|
* Custom change event.
|
|
* @see {@link SelectButtonProps.onChange}
|
|
* @extends {FormEvent}
|
|
* @event
|
|
*/
|
|
interface SelectButtonChangeEvent extends FormEvent {}
|
|
|
|
/**
|
|
* Defines valid properties in SelectButton component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
* @group Properties
|
|
*/
|
|
export interface SelectButtonProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'unselectable' | 'onChange' | 'ref' | 'pt'> {
|
|
/**
|
|
* Value of the component.
|
|
*/
|
|
value?: any | undefined;
|
|
/**
|
|
* An array of objects to display as the available options.
|
|
*/
|
|
options?: SelectItemOptionsType | undefined;
|
|
/**
|
|
* Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options.
|
|
*/
|
|
optionLabel?: string | undefined;
|
|
/**
|
|
* Name of the value field of an option when arbitrary objects are used as options instead of SelectItems.
|
|
*/
|
|
optionValue?: string | undefined;
|
|
/**
|
|
* Property name or getter function to use as the disabled flag of an option, defaults to false when not defined.
|
|
*/
|
|
optionDisabled?: string | ((option: any) => boolean);
|
|
/**
|
|
* Index of the element in tabbing order.
|
|
*/
|
|
tabIndex?: number | undefined;
|
|
/**
|
|
* When specified, allows selecting multiple values.
|
|
* @defaultValue false
|
|
*/
|
|
multiple?: boolean | undefined;
|
|
/**
|
|
* When present, it specifies that the component should have invalid state style.
|
|
* @defaultValue false
|
|
*/
|
|
invalid?: boolean | undefined;
|
|
/**
|
|
* Whether selection can be cleared.
|
|
* @deprecated Use 'allowEmpty' property instead.
|
|
* @defaultValue true
|
|
*/
|
|
unselectable?: boolean | undefined;
|
|
/**
|
|
* Whether selection can not be cleared.
|
|
* @defaultValue true
|
|
*/
|
|
allowEmpty?: boolean | undefined;
|
|
/**
|
|
* When present, it specifies that the element should be disabled.
|
|
* @defaultValue false
|
|
*/
|
|
disabled?: boolean | undefined;
|
|
/**
|
|
* A property to uniquely match the value in options for better performance.
|
|
*/
|
|
dataKey?: string | undefined;
|
|
/**
|
|
* Content of the tooltip.
|
|
*/
|
|
tooltip?: string | undefined;
|
|
/**
|
|
* Configuration of the tooltip, refer to the tooltip documentation for more information.
|
|
*/
|
|
tooltipOptions?: TooltipOptions | undefined;
|
|
/**
|
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
*/
|
|
ariaLabelledBy?: string | undefined;
|
|
/**
|
|
* Function that gets the option and returns the content.
|
|
* @param {*} item - Current item
|
|
*/
|
|
itemTemplate?(item: any): React.ReactNode;
|
|
/**
|
|
* Callback to invoke on value change.
|
|
* @param {SelectButtonChangeEvent} event - Custom change event.
|
|
*/
|
|
onChange?(event: SelectButtonChangeEvent): 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 {SelectButtonPassThroughOptions}
|
|
*/
|
|
pt?: SelectButtonPassThroughOptions;
|
|
/**
|
|
* 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 - SelectButton**
|
|
*
|
|
* _SelectButton is used to choose single or multiple items from a list using buttons._
|
|
*
|
|
* [Live Demo](https://www.primereact.org/selectbutton/)
|
|
* --- ---
|
|
* 
|
|
*
|
|
* @group Component
|
|
*/
|
|
export declare class SelectButton extends React.Component<SelectButtonProps, any> {
|
|
/**
|
|
* Used to get container element.
|
|
* @return {HTMLDivElement | null} Container element
|
|
*/
|
|
public getElement(): HTMLDivElement | null;
|
|
/**
|
|
* Used to focus the component.
|
|
*/
|
|
public focus(): void;
|
|
}
|