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": "./progressbar.cjs.js",
"module": "./progressbar.esm.js",
"unpkg": "./progressbar.min.js",
"types": "./progressbar.d.ts",
"sideEffects": false
}
+212
View File
@@ -0,0 +1,212 @@
'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 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;
File diff suppressed because one or more lines are too long
+123
View File
@@ -0,0 +1,123 @@
/**
*
* ProgressBar is a process status indicator.
*
* [Live Demo](https://www.primereact.org/progressbar)
*
* @module progressbar
*
*/
import * as React from 'react';
import { ComponentHooks } from '../componentbase/componentbase';
import { PassThroughOptions } from '../passthrough';
import { PassThroughType } from '../utils/utils';
export declare type ProgressBarPassThroughType<T> = PassThroughType<T, ProgressBarPassThroughMethodOptions>;
/**
* Custom passthrough(pt) option method.
*/
export interface ProgressBarPassThroughMethodOptions {
props: ProgressBarProps;
}
/**
* Custom passthrough(pt) options.
* @see {@link ProgressBarProps.pt}
*/
export interface ProgressBarPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: ProgressBarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the container's DOM element.
*/
container?: ProgressBarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the value's DOM element.
*/
value?: ProgressBarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the label's DOM element.
*/
label?: ProgressBarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Used to manage all lifecycle hooks
* @see {@link ComponentHooks}
*/
hooks?: ComponentHooks;
}
/**
* Defines valid properties in ProgressBar component. In addition to these, all properties of HTMLDivElement can be used in this component.
* @group Properties
*/
export interface ProgressBarProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
/**
* Current value of the progress.
*/
value?: string | number | null | undefined;
/**
* Show or hide progress bar value.
* @defaultValue true
*/
showValue?: boolean | undefined;
/**
* Unit sign appended to the value.
* @defaultValue %
*/
unit?: string | undefined;
/**
* Defines the mode of the progress, valid values are "determinate" and "indeterminate".
* @defaultValue determinate
*/
mode?: 'determinate' | 'indeterminate' | undefined;
/**
* Color for the background of the progress.
*/
color?: string | undefined;
/**
* Custom display value template
*/
displayValueTemplate?(value: string | number | undefined | null | undefined): React.ReactNode;
/**
* 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 {ProgressBarPassThroughOptions}
*/
pt?: ProgressBarPassThroughOptions;
/**
* 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 - ProgressBar**
*
* _ProgressBar is a process status indicator._
*
* [Live Demo](https://www.primereact.org/progressbar/)
* --- ---
* ![PrimeReact](https://primefaces.org/cdn/primereact/images/logo-100.png)
*
* @group Component
*/
export declare class ProgressBar extends React.Component<ProgressBarProps, any> {
/**
* Used to get container element.
* @return {HTMLDivElement | null} Container element
*/
public getElement(): HTMLDivElement | null;
}
+188
View File
@@ -0,0 +1,188 @@
'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 } 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 classes = {
root: function root(_ref) {
var props = _ref.props;
return props.mode === 'indeterminate' ? classNames('p-progressbar p-component p-progressbar-indeterminate') : 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.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.memo(/*#__PURE__*/React.forwardRef(function (inProps, ref) {
var mergeProps = useMergeProps();
var context = React.useContext(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;
useHandleStyle(ProgressBarBase.css.styles, isUnstyled, {
name: 'progressbar'
});
var elementRef = React.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: 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.createElement("div", _extends({
id: props.id,
ref: elementRef
}, rootProps), /*#__PURE__*/React.createElement("div", valueProps, label != null && /*#__PURE__*/React.createElement("div", labelProps, label)));
};
var createIndeterminate = function createIndeterminate() {
var rootProps = mergeProps({
className: 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.createElement("div", _extends({
id: props.id,
ref: elementRef
}, rootProps), /*#__PURE__*/React.createElement("div", containerProps, /*#__PURE__*/React.createElement("div", valueProps)));
};
React.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';
export { ProgressBar };
File diff suppressed because one or more lines are too long
+211
View File
@@ -0,0 +1,211 @@
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);
File diff suppressed because one or more lines are too long