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.
284 lines
8.9 KiB
TypeScript
284 lines
8.9 KiB
TypeScript
/**
|
|
*
|
|
* SplitButton groups a set of commands in an overlay with a default command.
|
|
*
|
|
* [Live Demo](https://www.primereact.org/splitbutton/)
|
|
*
|
|
* @module splitbutton
|
|
*
|
|
*/
|
|
import * as React from 'react';
|
|
import { CSSTransitionProps as ReactCSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
import { ButtonPassThroughOptions } from '../button/button';
|
|
import { ComponentHooks } from '../componentbase/componentbase';
|
|
import { CSSTransitionProps } from '../csstransition';
|
|
import { MenuItem } from '../menuitem';
|
|
import { PassThroughOptions } from '../passthrough';
|
|
import { TooltipPassThroughOptions } from '../tooltip/tooltip';
|
|
import { TooltipOptions } from '../tooltip/tooltipoptions';
|
|
import { IconType, PassThroughType, TemplateType } from '../utils';
|
|
|
|
export declare type SplitButtonPassThroughType<T> = PassThroughType<T, SplitButtonPassThroughMethodOptions>;
|
|
export declare type SplitButtonPassThroughTransitionType = ReactCSSTransitionProps | ((options: SplitButtonPassThroughMethodOptions) => ReactCSSTransitionProps) | undefined;
|
|
|
|
/**
|
|
* Custom passthrough(pt) option method.
|
|
*/
|
|
export interface SplitButtonPassThroughMethodOptions {
|
|
props: SplitButtonProps;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough(pt) options.
|
|
* @see {@link SplitButtonProps.pt}
|
|
*/
|
|
export interface SplitButtonPassThroughOptions {
|
|
/**
|
|
* Uses to pass attributes to the root's DOM element.
|
|
*/
|
|
root?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the icon's DOM element.
|
|
*/
|
|
icon?: SplitButtonPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement | SVGSVGElement>>;
|
|
/**
|
|
* Uses to pass attributes to the Button component.
|
|
*/
|
|
button?: ButtonPassThroughOptions;
|
|
/**
|
|
* Uses to pass attributes to the Button component.
|
|
*/
|
|
menuButton?: ButtonPassThroughOptions;
|
|
/**
|
|
* Uses to pass attributes to the menu's DOM element.
|
|
*/
|
|
menu?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the menu list's DOM element.
|
|
*/
|
|
menuList?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLUListElement>>;
|
|
/**
|
|
* Uses to pass attributes to the separator's DOM element.
|
|
*/
|
|
separator?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
/**
|
|
* Uses to pass attributes to the menu icon's DOM element.
|
|
*/
|
|
menuIcon?: SplitButtonPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
/**
|
|
* Uses to pass attributes to the menu label's DOM element.
|
|
*/
|
|
menuLabel?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
|
|
/**
|
|
* Uses to pass attributes to the anchor's DOM element.
|
|
*/
|
|
anchor?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLAnchorElement>>;
|
|
/**
|
|
* Uses to pass attributes to the menu item's DOM element.
|
|
*/
|
|
menuItem?: SplitButtonPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
/**
|
|
* Uses to pass attributes tooltip's DOM element.
|
|
* @type {TooltipPassThroughOptions}
|
|
*/
|
|
tooltip?: TooltipPassThroughOptions;
|
|
/**
|
|
* Used to manage all lifecycle hooks
|
|
* @see {@link ComponentHooks}
|
|
*/
|
|
hooks?: ComponentHooks;
|
|
/**
|
|
* Used to control React Transition API.
|
|
*/
|
|
transition?: SplitButtonPassThroughTransitionType;
|
|
}
|
|
|
|
/**
|
|
* Defines valid properties in SplitButton component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
* @group Properties
|
|
*/
|
|
export interface SplitButtonProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
/**
|
|
* Text of the button.
|
|
*/
|
|
label?: string | undefined;
|
|
/**
|
|
* Name of the icon.
|
|
*/
|
|
icon?: IconType<SplitButtonProps> | undefined;
|
|
/**
|
|
* Add a textual class to the button without a background initially.
|
|
* @defaultValue false
|
|
*/
|
|
text?: boolean | undefined;
|
|
/**
|
|
* Add a circular border radius to the button.
|
|
* @defaultValue false
|
|
*/
|
|
rounded?: boolean | undefined;
|
|
/**
|
|
* Add a shadow to indicate elevation.
|
|
* @defaultValue false
|
|
*/
|
|
raised?: boolean | undefined;
|
|
/**
|
|
* Add a border class without a background initially.
|
|
* @defaultValue false
|
|
*/
|
|
outlined?: boolean | undefined;
|
|
/**
|
|
* Defines the style of the button, valid values are "secondary", "success", "info", "warning", "danger", "contrast", "help".
|
|
*/
|
|
severity?: 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'contrast' | 'help' | undefined;
|
|
/**
|
|
* Defines the size of the button, valid values are "small" and "large".
|
|
*/
|
|
size?: 'small' | 'large' | undefined;
|
|
/**
|
|
* Display loading icon of the button
|
|
* @defaultValue false
|
|
*/
|
|
loading?: boolean | undefined;
|
|
/**
|
|
* Name of the loading icon or JSX.Element for loading icon.
|
|
*/
|
|
loadingIcon?: IconType<SplitButtonProps> | undefined;
|
|
/**
|
|
* MenuModel instance to define the overlay items.
|
|
*/
|
|
model?: MenuItem[] | undefined;
|
|
/**
|
|
* When present, it specifies that the component should be disabled.
|
|
* @defaultValue false
|
|
*/
|
|
disabled?: boolean | undefined;
|
|
/**
|
|
* When present, it specifies that the element should be visible.
|
|
* @defaultValue true
|
|
*/
|
|
visible?: boolean | undefined;
|
|
/**
|
|
* ClassName of the button.
|
|
*/
|
|
buttonClassName?: string | undefined;
|
|
/**
|
|
* Inline style of the overlay menu.
|
|
*/
|
|
menuStyle?: React.CSSProperties | undefined;
|
|
/**
|
|
* ClassName class of the overlay menu.
|
|
*/
|
|
menuClassName?: string | undefined;
|
|
/**
|
|
* ClassName of the menu dropdown button.
|
|
*/
|
|
menuButtonClassName?: string | undefined;
|
|
/**
|
|
* Props for the main button, any prop is passed implicity to the button element.
|
|
*/
|
|
buttonProps?: any | undefined;
|
|
/**
|
|
* Props for the dropdown button, any prop is passed implicity to the dropdown button element.
|
|
*/
|
|
menuButtonProps?: any | undefined;
|
|
/**
|
|
* DOM element instance where the overlay panel should be mounted. Valid values are any DOM Element and 'self'. The self value is used to render a component where it is located.
|
|
* @defaultValue document.body
|
|
*/
|
|
appendTo?: 'self' | HTMLElement | undefined | null | (() => HTMLElement);
|
|
/**
|
|
* Content of the tooltip.
|
|
*/
|
|
tooltip?: string | undefined;
|
|
/**
|
|
* Configuration of the tooltip, refer to the tooltip documentation for more information.
|
|
*/
|
|
tooltipOptions?: TooltipOptions | undefined;
|
|
/**
|
|
* Template of the default button.
|
|
*/
|
|
buttonTemplate?: TemplateType<SplitButtonProps> | undefined;
|
|
/**
|
|
* The properties of CSSTransition can be customized, except for "nodeRef" and "in" properties.
|
|
*/
|
|
transitionOptions?: CSSTransitionProps | undefined;
|
|
/**
|
|
* Name of the dropdown icon or JSX.Element for dropdown icon.
|
|
*/
|
|
dropdownIcon?: IconType<SplitButtonProps> | undefined;
|
|
/**
|
|
* Callback to invoke when main button is clicked.
|
|
* @param {React.MouseEvent<HTMLElement>} event - Browser event
|
|
*/
|
|
onClick?(event: React.MouseEvent<HTMLElement>): void;
|
|
/**
|
|
* Callback to invoke when overlay panel becomes visible.
|
|
*/
|
|
onShow?(): void;
|
|
/**
|
|
* Callback to invoke when overlay panel becomes hidden.
|
|
*/
|
|
onHide?(): 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 {SplitButtonPassThroughOptions}
|
|
*/
|
|
pt?: SplitButtonPassThroughOptions;
|
|
/**
|
|
* 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;
|
|
}
|
|
|
|
/**
|
|
* Defines current inline state in SplitButton component.
|
|
*/
|
|
export interface SplitButtonState {
|
|
/**
|
|
* Current id state as a boolean.
|
|
*/
|
|
id: string;
|
|
/**
|
|
* Current overlay visible state as a boolean.
|
|
*/
|
|
overlayVisible: boolean;
|
|
}
|
|
|
|
/**
|
|
* **PrimeReact - SplitButton**
|
|
*
|
|
* _SplitButton groups a set of commands in an overlay with a default command._
|
|
*
|
|
* [Live Demo](https://www.primereact.org/splitbutton/)
|
|
* --- ---
|
|
* 
|
|
*
|
|
* @group Component
|
|
*/
|
|
export declare class SplitButton extends React.Component<SplitButtonProps, any> {
|
|
/**
|
|
* Used to show the popup.
|
|
*/
|
|
public show(): void;
|
|
/**
|
|
* Used to hide the popup.
|
|
*/
|
|
public hide(): void;
|
|
/**
|
|
* Used to get container element.
|
|
* @return {HTMLDivElement | null} Container element
|
|
*/
|
|
public getElement(): HTMLDivElement | null;
|
|
}
|