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.
212 lines
10 KiB
JavaScript
212 lines
10 KiB
JavaScript
this.primereact = this.primereact || {};
|
|
this.primereact.progressbar = (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 classes = {
|
|
root: function root(_ref) {
|
|
var props = _ref.props;
|
|
return props.mode === 'indeterminate' ? utils.classNames('p-progressbar p-component p-progressbar-indeterminate') : utils.classNames('p-progressbar p-component p-progressbar-determinate');
|
|
},
|
|
value: 'p-progressbar-value p-progressbar-value-animate',
|
|
label: 'p-progressbar-label',
|
|
container: 'p-progressbar-indeterminate-container'
|
|
};
|
|
var styles = "\n@layer primereact {\n .p-progressbar {\n position: relative;\n overflow: hidden;\n }\n \n .p-progressbar-determinate .p-progressbar-value {\n height: 100%;\n width: 0%;\n position: absolute;\n display: none;\n border: 0 none;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n }\n \n .p-progressbar-determinate .p-progressbar-label {\n display: inline-flex;\n }\n \n .p-progressbar-determinate .p-progressbar-value-animate {\n transition: width 1s ease-in-out;\n }\n \n .p-progressbar-indeterminate .p-progressbar-value::before {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n \n .p-progressbar-indeterminate .p-progressbar-value::after {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n -webkit-animation-delay: 1.15s;\n animation-delay: 1.15s;\n }\n}\n\n@-webkit-keyframes p-progressbar-indeterminate-anim {\n 0% {\n left: -35%;\n right: 100%; }\n 60% {\n left: 100%;\n right: -90%; }\n 100% {\n left: 100%;\n right: -90%; }\n}\n@keyframes p-progressbar-indeterminate-anim {\n 0% {\n left: -35%;\n right: 100%; }\n 60% {\n left: 100%;\n right: -90%; }\n 100% {\n left: 100%;\n right: -90%; }\n}\n\n@-webkit-keyframes p-progressbar-indeterminate-anim-short {\n 0% {\n left: -200%;\n right: 100%; }\n 60% {\n left: 107%;\n right: -8%; }\n 100% {\n left: 107%;\n right: -8%; }\n}\n@keyframes p-progressbar-indeterminate-anim-short {\n 0% {\n left: -200%;\n right: 100%; }\n 60% {\n left: 107%;\n right: -8%; }\n 100% {\n left: 107%;\n right: -8%; }\n}\n";
|
|
var inlineStyles = {
|
|
value: function value(_ref2) {
|
|
var props = _ref2.props;
|
|
var valueWidth = Math.max(props.value, 2); // min 2 to display full label of 0% and 1%
|
|
var valueColor = props.value ? props.color : 'transparent';
|
|
return props.mode === 'indeterminate' ? {
|
|
backgroundColor: props.color
|
|
} : {
|
|
width: valueWidth + '%',
|
|
display: 'flex',
|
|
backgroundColor: valueColor
|
|
};
|
|
}
|
|
};
|
|
var ProgressBarBase = componentbase.ComponentBase.extend({
|
|
defaultProps: {
|
|
__TYPE: 'ProgressBar',
|
|
__parentMetadata: null,
|
|
id: null,
|
|
value: null,
|
|
showValue: true,
|
|
unit: '%',
|
|
style: null,
|
|
className: null,
|
|
mode: 'determinate',
|
|
displayValueTemplate: null,
|
|
color: null,
|
|
children: undefined
|
|
},
|
|
css: {
|
|
classes: classes,
|
|
styles: styles,
|
|
inlineStyles: inlineStyles
|
|
}
|
|
});
|
|
|
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
var ProgressBar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
var mergeProps = hooks.useMergeProps();
|
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
var props = ProgressBarBase.getProps(inProps, context);
|
|
var _ProgressBarBase$setM = ProgressBarBase.setMetaData(_objectSpread({
|
|
props: props
|
|
}, props.__parentMetadata)),
|
|
ptm = _ProgressBarBase$setM.ptm,
|
|
cx = _ProgressBarBase$setM.cx,
|
|
isUnstyled = _ProgressBarBase$setM.isUnstyled;
|
|
componentbase.useHandleStyle(ProgressBarBase.css.styles, isUnstyled, {
|
|
name: 'progressbar'
|
|
});
|
|
var elementRef = React__namespace.useRef(null);
|
|
var createLabel = function createLabel() {
|
|
if (props.showValue && props.value != null) {
|
|
var label = props.displayValueTemplate ? props.displayValueTemplate(props.value) : props.value + props.unit;
|
|
return label;
|
|
}
|
|
return null;
|
|
};
|
|
var createDeterminate = function createDeterminate() {
|
|
var label = createLabel();
|
|
var rootProps = mergeProps({
|
|
className: utils.classNames(props.className, cx('root')),
|
|
style: props.style,
|
|
role: 'progressbar',
|
|
'aria-valuemin': '0',
|
|
'aria-valuenow': props.value,
|
|
'aria-valuemax': '100'
|
|
}, ProgressBarBase.getOtherProps(props), ptm('root'));
|
|
var valueProps = mergeProps({
|
|
className: cx('value'),
|
|
style: {
|
|
width: props.value + '%',
|
|
display: 'flex',
|
|
backgroundColor: props.color
|
|
}
|
|
}, ptm('value'));
|
|
var labelProps = mergeProps({
|
|
className: cx('label')
|
|
}, ptm('label'));
|
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
id: props.id,
|
|
ref: elementRef
|
|
}, rootProps), /*#__PURE__*/React__namespace.createElement("div", valueProps, label != null && /*#__PURE__*/React__namespace.createElement("div", labelProps, label)));
|
|
};
|
|
var createIndeterminate = function createIndeterminate() {
|
|
var rootProps = mergeProps({
|
|
className: utils.classNames(props.className, cx('root')),
|
|
style: props.style,
|
|
role: 'progressbar',
|
|
'aria-valuemin': '0',
|
|
'aria-valuenow': props.value,
|
|
'aria-valuemax': '100'
|
|
}, ProgressBarBase.getOtherProps(props), ptm('root'));
|
|
var containerProps = mergeProps({
|
|
className: cx('container')
|
|
}, ptm('container'));
|
|
var valueProps = mergeProps({
|
|
className: cx('value'),
|
|
style: {
|
|
backgroundColor: props.color
|
|
}
|
|
}, ptm('value'));
|
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
id: props.id,
|
|
ref: elementRef
|
|
}, rootProps), /*#__PURE__*/React__namespace.createElement("div", containerProps, /*#__PURE__*/React__namespace.createElement("div", valueProps)));
|
|
};
|
|
React__namespace.useImperativeHandle(ref, function () {
|
|
return {
|
|
props: props,
|
|
getElement: function getElement() {
|
|
return elementRef.current;
|
|
}
|
|
};
|
|
});
|
|
if (props.mode === 'determinate') {
|
|
return createDeterminate();
|
|
} else if (props.mode === 'indeterminate') {
|
|
return createIndeterminate();
|
|
}
|
|
throw new Error(props.mode + " is not a valid mode for the ProgressBar. Valid values are 'determinate' and 'indeterminate'");
|
|
}));
|
|
ProgressBar.displayName = 'ProgressBar';
|
|
|
|
exports.ProgressBar = ProgressBar;
|
|
|
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
return exports;
|
|
|
|
})({}, React, primereact.api, primereact.componentbase, primereact.hooks, primereact.utils);
|