Add comprehensive e2e test suites for Tasks 16-25

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.
This commit is contained in:
gnezim
2026-04-05 19:25:03 +03:00
parent 21c6ed4f82
commit 60e2149072
31032 changed files with 5222883 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"main": "./timeline.cjs.js",
"module": "./timeline.esm.js",
"unpkg": "./timeline.min.js",
"types": "./timeline.d.ts",
"sideEffects": false
}
+177
View File
@@ -0,0 +1,177 @@
'use client';
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var api = require('primereact/api');
var componentbase = require('primereact/componentbase');
var hooks = require('primereact/hooks');
var utils = require('primereact/utils');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
var TimelineBase = componentbase.ComponentBase.extend({
defaultProps: {
__TYPE: 'Timeline',
align: 'left',
className: null,
content: null,
dataKey: null,
layout: 'vertical',
marker: null,
opposite: null,
value: null,
children: undefined
},
css: {
classes: {
marker: 'p-timeline-event-marker',
connector: 'p-timeline-event-connector',
event: 'p-timeline-event',
opposite: 'p-timeline-event-opposite',
separator: 'p-timeline-event-separator',
content: 'p-timeline-event-content',
root: function root(_ref) {
var props = _ref.props;
return utils.classNames('p-timeline p-component', _defineProperty(_defineProperty({}, "p-timeline-".concat(props.align), true), "p-timeline-".concat(props.layout), true), props.className);
}
},
styles: "\n @layer primereact {\n .p-timeline {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n }\n \n .p-timeline-left .p-timeline-event-opposite {\n text-align: right;\n }\n \n .p-timeline-left .p-timeline-event-content {\n text-align: left;\n }\n \n .p-timeline-right .p-timeline-event {\n flex-direction: row-reverse;\n }\n \n .p-timeline-right .p-timeline-event-opposite {\n text-align: left;\n }\n \n .p-timeline-right .p-timeline-event-content {\n text-align: right;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: row-reverse;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-opposite {\n text-align: right;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-content {\n text-align: left;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-opposite {\n text-align: left;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-content {\n text-align: right;\n }\n \n .p-timeline-event {\n display: flex;\n position: relative;\n min-height: 70px;\n }\n \n .p-timeline-event:last-child {\n min-height: 0;\n }\n \n .p-timeline-event-opposite {\n flex: 1;\n padding: 0 1rem;\n }\n \n .p-timeline-event-content {\n flex: 1;\n padding: 0 1rem;\n }\n \n .p-timeline-event-separator {\n flex: 0;\n display: flex;\n align-items: center;\n flex-direction: column;\n }\n \n .p-timeline-event-marker {\n display: flex;\n align-self: baseline;\n }\n \n .p-timeline-event-connector {\n flex-grow: 1;\n }\n \n .p-timeline-horizontal {\n flex-direction: row;\n }\n \n .p-timeline-horizontal .p-timeline-event {\n flex-direction: column;\n flex: 1;\n }\n \n .p-timeline-horizontal .p-timeline-event:last-child {\n flex: 0;\n }\n \n .p-timeline-horizontal .p-timeline-event-separator {\n flex-direction: row;\n }\n \n .p-timeline-horizontal .p-timeline-event-connector {\n width: 100%;\n }\n \n .p-timeline-bottom .p-timeline-event {\n flex-direction: column-reverse;\n }\n \n .p-timeline-horizontal.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: column-reverse;\n }\n }\n "
}
});
var Timeline = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
var mergeProps = hooks.useMergeProps();
var context = React__namespace.useContext(api.PrimeReactContext);
var props = TimelineBase.getProps(inProps, context);
var _TimelineBase$setMeta = TimelineBase.setMetaData({
props: props
}),
ptm = _TimelineBase$setMeta.ptm,
cx = _TimelineBase$setMeta.cx,
isUnstyled = _TimelineBase$setMeta.isUnstyled;
componentbase.useHandleStyle(TimelineBase.css.styles, isUnstyled, {
name: 'timeline'
});
var getPTOptions = function getPTOptions(key, index) {
return ptm(key, {
context: {
index: index
}
});
};
var elementRef = React__namespace.useRef(null);
var getKey = function getKey(item, index) {
return props.dataKey ? utils.ObjectUtils.resolveFieldData(item, props.dataKey) : "pr_id__".concat(index);
};
var createEvents = function createEvents() {
return props.value && props.value.map(function (item, index) {
var opposite = utils.ObjectUtils.getJSXElement(props.opposite, item, index);
var markerProps = mergeProps({
className: cx('marker')
}, getPTOptions('marker', index));
var marker = utils.ObjectUtils.getJSXElement(props.marker, item, index) || /*#__PURE__*/React__namespace.createElement("div", markerProps);
var connectorProps = mergeProps({
className: cx('connector')
}, getPTOptions('connector', index));
var connector = index !== props.value.length - 1 && /*#__PURE__*/React__namespace.createElement("div", connectorProps);
var content = utils.ObjectUtils.getJSXElement(props.content, item, index);
var eventProps = mergeProps({
className: cx('event')
}, getPTOptions('event', index));
var oppositeProps = mergeProps({
className: cx('opposite')
}, getPTOptions('opposite', index));
var separatorProps = mergeProps({
className: cx('separator')
}, getPTOptions('separator', index));
var contentProps = mergeProps({
className: cx('content')
}, getPTOptions('content', index));
return /*#__PURE__*/React__namespace.createElement("div", _extends({
key: getKey(item, index)
}, eventProps), /*#__PURE__*/React__namespace.createElement("div", oppositeProps, opposite), /*#__PURE__*/React__namespace.createElement("div", separatorProps, marker, connector), /*#__PURE__*/React__namespace.createElement("div", contentProps, content));
});
};
React__namespace.useImperativeHandle(ref, function () {
return {
props: props,
getElement: function getElement() {
return elementRef.current;
}
};
});
var events = createEvents();
var rootProps = mergeProps({
ref: elementRef,
className: utils.classNames(props.className, cx('root'))
}, TimelineBase.getOtherProps(props), ptm('root'));
return /*#__PURE__*/React__namespace.createElement("div", rootProps, events);
}));
Timeline.displayName = 'Timeline';
exports.Timeline = Timeline;
File diff suppressed because one or more lines are too long
+138
View File
@@ -0,0 +1,138 @@
/**
*
* Timeline visualizes a series of chained events.
*
* [Live Demo](https://www.primereact.org/timeline/)
*
* @module timeline
*
*/
import * as React from 'react';
import { ComponentHooks } from '../componentbase/componentbase';
import { PassThroughOptions } from '../passthrough';
import { PassThroughType } from '../utils/utils';
export declare type TimelinePassThroughType<T> = PassThroughType<T, TimelinePassThroughMethodOptions>;
/**
* Custom passthrough(pt) option method.
*/
export interface TimelinePassThroughMethodOptions {
props: Timeline;
}
/**
* Custom passthrough(pt) options.
* @see {@link TimelineProps.pt}
*/
export interface TimelinePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the event's DOM element.
*/
event?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the opposite's DOM element.
*/
opposite?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the separator's DOM element.
*/
separator?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the marker's DOM element.
*/
marker?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the connector's DOM element.
*/
connector?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the content's DOM element.
*/
content?: TimelinePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Used to manage all lifecycle hooks
* @see {@link ComponentHooks}
*/
hooks?: ComponentHooks;
}
/**
* Defines valid properties in Timeline component. In addition to these, all properties of HTMLDivElement can be used in this component.
* @group Properties
*/
export interface TimelineProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref' | 'content' | 'pt'> {
/**
* Position of the timeline bar relative to the content. Valid values are "left", "right for vertical layout and "top", "bottom" for horizontal layout.
* @defaultValue left
*/
align?: 'left' | 'right' | 'top' | 'bottom' | 'alternate' | undefined;
/**
* Used to get the child elements of the component.
* @readonly
*/
children?: React.ReactNode;
/**
* Template of the content.
*/
content?: React.ReactNode | ((item: any, index: number) => React.ReactNode);
/**
* Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering.
*/
dataKey?: string | undefined;
/**
* Orientation of the timeline, valid values are "vertical" and "horizontal".
* @defaultValue vertical
*/
layout?: 'vertical' | 'horizontal' | undefined;
/**
* Template content allows placing a custom event marker instead of the default one.
*/
marker?: React.ReactNode | ((item: any, index: number) => React.ReactNode);
/**
* Template content to be placed at the other side of the bar.
*/
opposite?: React.ReactNode | ((item: any, index: number) => React.ReactNode);
/**
* An array of events to display.
*/
value?: any[] | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {TimelinePassThroughOptions}
*/
pt?: TimelinePassThroughOptions;
/**
* 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 - Timeline**
*
* _Timeline visualizes a series of chained events._
*
* [Live Demo](https://www.primereact.org/timeline/)
* --- ---
* ![PrimeReact](https://primefaces.org/cdn/primereact/images/logo-100.png)
*
* @group Component
*/
export declare class Timeline extends React.Component<TimelineProps, any> {
/**
* Used to get container element.
* @return {HTMLDivElement | null} Container element
*/
public getElement(): HTMLDivElement | null;
}
+153
View File
@@ -0,0 +1,153 @@
'use client';
import * as React from 'react';
import { PrimeReactContext } from 'primereact/api';
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
import { useMergeProps } from 'primereact/hooks';
import { classNames, ObjectUtils } from 'primereact/utils';
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
var TimelineBase = ComponentBase.extend({
defaultProps: {
__TYPE: 'Timeline',
align: 'left',
className: null,
content: null,
dataKey: null,
layout: 'vertical',
marker: null,
opposite: null,
value: null,
children: undefined
},
css: {
classes: {
marker: 'p-timeline-event-marker',
connector: 'p-timeline-event-connector',
event: 'p-timeline-event',
opposite: 'p-timeline-event-opposite',
separator: 'p-timeline-event-separator',
content: 'p-timeline-event-content',
root: function root(_ref) {
var props = _ref.props;
return classNames('p-timeline p-component', _defineProperty(_defineProperty({}, "p-timeline-".concat(props.align), true), "p-timeline-".concat(props.layout), true), props.className);
}
},
styles: "\n @layer primereact {\n .p-timeline {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n }\n \n .p-timeline-left .p-timeline-event-opposite {\n text-align: right;\n }\n \n .p-timeline-left .p-timeline-event-content {\n text-align: left;\n }\n \n .p-timeline-right .p-timeline-event {\n flex-direction: row-reverse;\n }\n \n .p-timeline-right .p-timeline-event-opposite {\n text-align: left;\n }\n \n .p-timeline-right .p-timeline-event-content {\n text-align: right;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: row-reverse;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-opposite {\n text-align: right;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-content {\n text-align: left;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-opposite {\n text-align: left;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-content {\n text-align: right;\n }\n \n .p-timeline-event {\n display: flex;\n position: relative;\n min-height: 70px;\n }\n \n .p-timeline-event:last-child {\n min-height: 0;\n }\n \n .p-timeline-event-opposite {\n flex: 1;\n padding: 0 1rem;\n }\n \n .p-timeline-event-content {\n flex: 1;\n padding: 0 1rem;\n }\n \n .p-timeline-event-separator {\n flex: 0;\n display: flex;\n align-items: center;\n flex-direction: column;\n }\n \n .p-timeline-event-marker {\n display: flex;\n align-self: baseline;\n }\n \n .p-timeline-event-connector {\n flex-grow: 1;\n }\n \n .p-timeline-horizontal {\n flex-direction: row;\n }\n \n .p-timeline-horizontal .p-timeline-event {\n flex-direction: column;\n flex: 1;\n }\n \n .p-timeline-horizontal .p-timeline-event:last-child {\n flex: 0;\n }\n \n .p-timeline-horizontal .p-timeline-event-separator {\n flex-direction: row;\n }\n \n .p-timeline-horizontal .p-timeline-event-connector {\n width: 100%;\n }\n \n .p-timeline-bottom .p-timeline-event {\n flex-direction: column-reverse;\n }\n \n .p-timeline-horizontal.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: column-reverse;\n }\n }\n "
}
});
var Timeline = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inProps, ref) {
var mergeProps = useMergeProps();
var context = React.useContext(PrimeReactContext);
var props = TimelineBase.getProps(inProps, context);
var _TimelineBase$setMeta = TimelineBase.setMetaData({
props: props
}),
ptm = _TimelineBase$setMeta.ptm,
cx = _TimelineBase$setMeta.cx,
isUnstyled = _TimelineBase$setMeta.isUnstyled;
useHandleStyle(TimelineBase.css.styles, isUnstyled, {
name: 'timeline'
});
var getPTOptions = function getPTOptions(key, index) {
return ptm(key, {
context: {
index: index
}
});
};
var elementRef = React.useRef(null);
var getKey = function getKey(item, index) {
return props.dataKey ? ObjectUtils.resolveFieldData(item, props.dataKey) : "pr_id__".concat(index);
};
var createEvents = function createEvents() {
return props.value && props.value.map(function (item, index) {
var opposite = ObjectUtils.getJSXElement(props.opposite, item, index);
var markerProps = mergeProps({
className: cx('marker')
}, getPTOptions('marker', index));
var marker = ObjectUtils.getJSXElement(props.marker, item, index) || /*#__PURE__*/React.createElement("div", markerProps);
var connectorProps = mergeProps({
className: cx('connector')
}, getPTOptions('connector', index));
var connector = index !== props.value.length - 1 && /*#__PURE__*/React.createElement("div", connectorProps);
var content = ObjectUtils.getJSXElement(props.content, item, index);
var eventProps = mergeProps({
className: cx('event')
}, getPTOptions('event', index));
var oppositeProps = mergeProps({
className: cx('opposite')
}, getPTOptions('opposite', index));
var separatorProps = mergeProps({
className: cx('separator')
}, getPTOptions('separator', index));
var contentProps = mergeProps({
className: cx('content')
}, getPTOptions('content', index));
return /*#__PURE__*/React.createElement("div", _extends({
key: getKey(item, index)
}, eventProps), /*#__PURE__*/React.createElement("div", oppositeProps, opposite), /*#__PURE__*/React.createElement("div", separatorProps, marker, connector), /*#__PURE__*/React.createElement("div", contentProps, content));
});
};
React.useImperativeHandle(ref, function () {
return {
props: props,
getElement: function getElement() {
return elementRef.current;
}
};
});
var events = createEvents();
var rootProps = mergeProps({
ref: elementRef,
className: classNames(props.className, cx('root'))
}, TimelineBase.getOtherProps(props), ptm('root'));
return /*#__PURE__*/React.createElement("div", rootProps, events);
}));
Timeline.displayName = 'Timeline';
export { Timeline };
File diff suppressed because one or more lines are too long
+176
View File
@@ -0,0 +1,176 @@
this.primereact = this.primereact || {};
this.primereact.timeline = (function (exports, React, api, componentbase, hooks, utils) {
'use strict';
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
var TimelineBase = componentbase.ComponentBase.extend({
defaultProps: {
__TYPE: 'Timeline',
align: 'left',
className: null,
content: null,
dataKey: null,
layout: 'vertical',
marker: null,
opposite: null,
value: null,
children: undefined
},
css: {
classes: {
marker: 'p-timeline-event-marker',
connector: 'p-timeline-event-connector',
event: 'p-timeline-event',
opposite: 'p-timeline-event-opposite',
separator: 'p-timeline-event-separator',
content: 'p-timeline-event-content',
root: function root(_ref) {
var props = _ref.props;
return utils.classNames('p-timeline p-component', _defineProperty(_defineProperty({}, "p-timeline-".concat(props.align), true), "p-timeline-".concat(props.layout), true), props.className);
}
},
styles: "\n @layer primereact {\n .p-timeline {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n }\n \n .p-timeline-left .p-timeline-event-opposite {\n text-align: right;\n }\n \n .p-timeline-left .p-timeline-event-content {\n text-align: left;\n }\n \n .p-timeline-right .p-timeline-event {\n flex-direction: row-reverse;\n }\n \n .p-timeline-right .p-timeline-event-opposite {\n text-align: left;\n }\n \n .p-timeline-right .p-timeline-event-content {\n text-align: right;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: row-reverse;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-opposite {\n text-align: right;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-content {\n text-align: left;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-opposite {\n text-align: left;\n }\n \n .p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-content {\n text-align: right;\n }\n \n .p-timeline-event {\n display: flex;\n position: relative;\n min-height: 70px;\n }\n \n .p-timeline-event:last-child {\n min-height: 0;\n }\n \n .p-timeline-event-opposite {\n flex: 1;\n padding: 0 1rem;\n }\n \n .p-timeline-event-content {\n flex: 1;\n padding: 0 1rem;\n }\n \n .p-timeline-event-separator {\n flex: 0;\n display: flex;\n align-items: center;\n flex-direction: column;\n }\n \n .p-timeline-event-marker {\n display: flex;\n align-self: baseline;\n }\n \n .p-timeline-event-connector {\n flex-grow: 1;\n }\n \n .p-timeline-horizontal {\n flex-direction: row;\n }\n \n .p-timeline-horizontal .p-timeline-event {\n flex-direction: column;\n flex: 1;\n }\n \n .p-timeline-horizontal .p-timeline-event:last-child {\n flex: 0;\n }\n \n .p-timeline-horizontal .p-timeline-event-separator {\n flex-direction: row;\n }\n \n .p-timeline-horizontal .p-timeline-event-connector {\n width: 100%;\n }\n \n .p-timeline-bottom .p-timeline-event {\n flex-direction: column-reverse;\n }\n \n .p-timeline-horizontal.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: column-reverse;\n }\n }\n "
}
});
var Timeline = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
var mergeProps = hooks.useMergeProps();
var context = React__namespace.useContext(api.PrimeReactContext);
var props = TimelineBase.getProps(inProps, context);
var _TimelineBase$setMeta = TimelineBase.setMetaData({
props: props
}),
ptm = _TimelineBase$setMeta.ptm,
cx = _TimelineBase$setMeta.cx,
isUnstyled = _TimelineBase$setMeta.isUnstyled;
componentbase.useHandleStyle(TimelineBase.css.styles, isUnstyled, {
name: 'timeline'
});
var getPTOptions = function getPTOptions(key, index) {
return ptm(key, {
context: {
index: index
}
});
};
var elementRef = React__namespace.useRef(null);
var getKey = function getKey(item, index) {
return props.dataKey ? utils.ObjectUtils.resolveFieldData(item, props.dataKey) : "pr_id__".concat(index);
};
var createEvents = function createEvents() {
return props.value && props.value.map(function (item, index) {
var opposite = utils.ObjectUtils.getJSXElement(props.opposite, item, index);
var markerProps = mergeProps({
className: cx('marker')
}, getPTOptions('marker', index));
var marker = utils.ObjectUtils.getJSXElement(props.marker, item, index) || /*#__PURE__*/React__namespace.createElement("div", markerProps);
var connectorProps = mergeProps({
className: cx('connector')
}, getPTOptions('connector', index));
var connector = index !== props.value.length - 1 && /*#__PURE__*/React__namespace.createElement("div", connectorProps);
var content = utils.ObjectUtils.getJSXElement(props.content, item, index);
var eventProps = mergeProps({
className: cx('event')
}, getPTOptions('event', index));
var oppositeProps = mergeProps({
className: cx('opposite')
}, getPTOptions('opposite', index));
var separatorProps = mergeProps({
className: cx('separator')
}, getPTOptions('separator', index));
var contentProps = mergeProps({
className: cx('content')
}, getPTOptions('content', index));
return /*#__PURE__*/React__namespace.createElement("div", _extends({
key: getKey(item, index)
}, eventProps), /*#__PURE__*/React__namespace.createElement("div", oppositeProps, opposite), /*#__PURE__*/React__namespace.createElement("div", separatorProps, marker, connector), /*#__PURE__*/React__namespace.createElement("div", contentProps, content));
});
};
React__namespace.useImperativeHandle(ref, function () {
return {
props: props,
getElement: function getElement() {
return elementRef.current;
}
};
});
var events = createEvents();
var rootProps = mergeProps({
ref: elementRef,
className: utils.classNames(props.className, cx('root'))
}, TimelineBase.getOtherProps(props), ptm('root'));
return /*#__PURE__*/React__namespace.createElement("div", rootProps, events);
}));
Timeline.displayName = 'Timeline';
exports.Timeline = Timeline;
Object.defineProperty(exports, '__esModule', { value: true });
return exports;
})({}, React, primereact.api, primereact.componentbase, primereact.hooks, primereact.utils);
File diff suppressed because one or more lines are too long