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.
171 lines
4.5 KiB
TypeScript
171 lines
4.5 KiB
TypeScript
/**
|
|
*
|
|
* TabMenu is a navigation/command component that displays items as tab headers.
|
|
*
|
|
* [Live Demo](https://www.primereact.org/tabmenu/)
|
|
*
|
|
* @module tabmenu
|
|
*
|
|
*/
|
|
import * as React from 'react';
|
|
import { ComponentHooks } from '../componentbase/componentbase';
|
|
import { MenuItem } from '../menuitem';
|
|
import { PassThroughOptions } from '../passthrough';
|
|
import { PassThroughType } from '../utils/utils';
|
|
|
|
export declare type TabMenuPassThroughType<T> = PassThroughType<T, TabMenuThroughMethodOptions>;
|
|
|
|
/**
|
|
* Custom passthrough(pt) option method.
|
|
*/
|
|
export interface TabMenuThroughMethodOptions {
|
|
props: TabMenuProps;
|
|
state: TabMenuState;
|
|
context: TabMenuContext;
|
|
}
|
|
|
|
/**
|
|
* Defines current options in TabMenu component.
|
|
*/
|
|
export interface TabMenuContext {
|
|
/**
|
|
* Current menuitem
|
|
*/
|
|
item: any;
|
|
/**
|
|
* Index of the menuitem
|
|
*/
|
|
index: number;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough(pt) options.
|
|
* @see {@link TabMenuProps.pt}
|
|
*/
|
|
export interface TabMenuPassThroughOptions {
|
|
/**
|
|
* Uses to pass attributes to the root's DOM element.
|
|
*/
|
|
root?: TabMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
/**
|
|
* Uses to pass attributes to the list's DOM element.
|
|
*/
|
|
menu?: TabMenuPassThroughType<React.HTMLAttributes<HTMLUListElement>>;
|
|
/**
|
|
* Uses to pass attributes to the list item's DOM element.
|
|
*/
|
|
menuitem?: TabMenuPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
/**
|
|
* Uses to pass attributes to the action's DOM element.
|
|
*/
|
|
action?: TabMenuPassThroughType<React.HTMLAttributes<HTMLAnchorElement>>;
|
|
/**
|
|
* Uses to pass attributes to the icon's DOM element.
|
|
*/
|
|
icon?: TabMenuPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
/**
|
|
* Uses to pass attributes to the label's DOM element.
|
|
*/
|
|
label?: TabMenuPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
|
|
/**
|
|
* Uses to pass attributes to the inkbar's DOM element.
|
|
*/
|
|
inkbar?: TabMenuPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
/**
|
|
* Used to manage all lifecycle hooks
|
|
* @see {@link ComponentHooks}
|
|
*/
|
|
hooks?: ComponentHooks;
|
|
}
|
|
|
|
/**
|
|
* Defines current inline state in TabMenu component.
|
|
*/
|
|
export interface TabMenuState {
|
|
/**
|
|
* Current active index state as a number.
|
|
* @defaulValue 0
|
|
*/
|
|
activeIndex: number;
|
|
}
|
|
|
|
/**
|
|
* Custom tab change event.
|
|
* @see {@link TabMenuProps.onTabChange}
|
|
* @event
|
|
*/
|
|
interface TabMenuTabChangeEvent {
|
|
/**
|
|
* Browser event
|
|
*/
|
|
originalEvent: React.SyntheticEvent;
|
|
/**
|
|
* Selected menuitem
|
|
*/
|
|
value: MenuItem;
|
|
/**
|
|
* Index of the selected tab
|
|
*/
|
|
index: number;
|
|
}
|
|
|
|
/**
|
|
* Defines valid properties in TabMenu component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
* @group Properties
|
|
*/
|
|
export interface TabMenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
/**
|
|
* An array of menuitems.
|
|
*/
|
|
model?: MenuItem[] | undefined;
|
|
/**
|
|
* Active index of menuitem.
|
|
* @defaultValue 0
|
|
*/
|
|
activeIndex?: number | undefined;
|
|
/**
|
|
* Callback to invoke when active tab changes.
|
|
* @param {TabMenuTabChangeEvent} event - Custom tab change event.
|
|
*/
|
|
onTabChange?(event: TabMenuTabChangeEvent): 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 {TabMenuPassThroughOptions}
|
|
*/
|
|
pt?: TabMenuPassThroughOptions;
|
|
/**
|
|
* 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 - TabMenu**
|
|
*
|
|
* _TabMenu is a navigation/command component that displays items as tab headers._
|
|
*
|
|
* [Live Demo](https://www.primereact.org/tabmenu/)
|
|
* --- ---
|
|
* 
|
|
*
|
|
* @group Component
|
|
*/
|
|
export declare class TabMenu extends React.Component<TabMenuProps, any> {
|
|
/**
|
|
* Used to get container element.
|
|
* @return {HTMLDivElement | null} Container element
|
|
*/
|
|
public getElement(): HTMLDivElement | null;
|
|
}
|