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
+176
View File
@@ -0,0 +1,176 @@
'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);
var ChartBase = componentbase.ComponentBase.extend({
defaultProps: {
__TYPE: 'Chart',
id: null,
type: null,
data: null,
options: null,
plugins: null,
width: null,
height: null,
style: null,
className: null,
children: undefined
},
css: {
classes: {
root: 'p-chart'
},
inlineStyles: {
root: function root(_ref) {
var props = _ref.props;
return Object.assign({
width: props.width,
height: props.height
}, props.style);
}
},
styles: "\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "
}
});
// GitHub #3059 wrapper if loaded by script tag
var ChartJS = function () {
try {
return Chart;
} catch (_unused) {
return null;
}
}();
var PrimeReactChart = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
var mergeProps = hooks.useMergeProps();
var context = React__namespace.useContext(api.PrimeReactContext);
var props = ChartBase.getProps(inProps, context);
var _ChartBase$setMetaDat = ChartBase.setMetaData({
props: props
}),
ptm = _ChartBase$setMetaDat.ptm,
cx = _ChartBase$setMetaDat.cx,
sx = _ChartBase$setMetaDat.sx,
isUnstyled = _ChartBase$setMetaDat.isUnstyled;
componentbase.useHandleStyle(ChartBase.css.styles, isUnstyled, {
name: 'chart'
});
var elementRef = React__namespace.useRef(null);
var chartRef = React__namespace.useRef(null);
var canvasRef = React__namespace.useRef(null);
var initChart = function initChart() {
destroyChart();
var configuration = {
type: props.type,
data: props.data,
options: props.options,
plugins: props.plugins
};
if (ChartJS) {
// GitHub #3059 loaded by script only
chartRef.current = new ChartJS(canvasRef.current, configuration);
} else {
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('chart.js/auto')); }).then(function (module) {
destroyChart();
// In case that the Chart component has been unmounted during asynchronous loading of ChartJS,
// the canvasRef will not be available anymore, and no Chart should be created.
if (!canvasRef.current) {
return;
}
if (module) {
if (module["default"]) {
// WebPack
chartRef.current = new module["default"](canvasRef.current, configuration);
} else {
// ParcelJS
chartRef.current = new module(canvasRef.current, configuration);
}
}
});
}
};
var destroyChart = function destroyChart() {
if (chartRef.current) {
chartRef.current.destroy();
chartRef.current = null;
}
};
React__namespace.useImperativeHandle(ref, function () {
return {
props: props,
getCanvas: function getCanvas() {
return canvasRef.current;
},
getChart: function getChart() {
return chartRef.current;
},
getBase64Image: function getBase64Image() {
return chartRef.current.toBase64Image();
},
getElement: function getElement() {
return elementRef.current;
},
generateLegend: function generateLegend() {
return chartRef.current && chartRef.current.generateLegend();
},
refresh: function refresh() {
return chartRef.current && chartRef.current.update();
}
};
});
React__namespace.useEffect(function () {
initChart();
});
hooks.useUnmountEffect(function () {
destroyChart();
});
var title = props.options && props.options.plugins && props.options.plugins.title && props.options.plugins.title.text;
var ariaLabel = props.ariaLabel || title;
var rootProps = mergeProps({
id: props.id,
ref: elementRef,
style: sx('root'),
className: utils.classNames(props.className, cx('root'))
}, ChartBase.getOtherProps(props), ptm('root'));
var canvasProps = mergeProps({
ref: canvasRef,
width: props.width,
height: props.height,
role: 'img',
'aria-label': ariaLabel
}, ptm('canvas'));
return /*#__PURE__*/React__namespace.createElement("div", rootProps, /*#__PURE__*/React__namespace.createElement("canvas", canvasProps));
}), function (prevProps, nextProps) {
return prevProps.data === nextProps.data && prevProps.options === nextProps.options && prevProps.type === nextProps.type;
});
PrimeReactChart.displayName = 'Chart';
exports.Chart = PrimeReactChart;
+1
View File
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/componentbase"),n=require("primereact/hooks"),u=require("primereact/utils");function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=a(e),s=r.ComponentBase.extend({defaultProps:{__TYPE:"Chart",id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null,children:void 0},css:{classes:{root:"p-chart"},inlineStyles:{root:function(e){var t=e.props;return Object.assign({width:t.width,height:t.height},t.style)}},styles:"\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "}}),o=function(){try{return Chart}catch(e){return null}}(),c=i.memo(i.forwardRef((function(e,c){var l=n.useMergeProps(),p=i.useContext(t.PrimeReactContext),f=s.getProps(e,p),d=s.setMetaData({props:f}),h=d.ptm,g=d.cx,m=d.sx;r.useHandleStyle(s.css.styles,d.isUnstyled,{name:"chart"});var y=i.useRef(null),v=i.useRef(null),b=i.useRef(null),w=function(){P();var e={type:f.type,data:f.data,options:f.options,plugins:f.plugins};o?v.current=new o(b.current,e):Promise.resolve().then((function(){return a(require("chart.js/auto"))})).then((function(t){P(),b.current&&t&&(v.current=t.default?new t.default(b.current,e):new t(b.current,e))}))},P=function(){v.current&&(v.current.destroy(),v.current=null)};i.useImperativeHandle(c,(function(){return{props:f,getCanvas:function(){return b.current},getChart:function(){return v.current},getBase64Image:function(){return v.current.toBase64Image()},getElement:function(){return y.current},generateLegend:function(){return v.current&&v.current.generateLegend()},refresh:function(){return v.current&&v.current.update()}}})),i.useEffect((function(){w()})),n.useUnmountEffect((function(){P()}));var C=f.ariaLabel||f.options&&f.options.plugins&&f.options.plugins.title&&f.options.plugins.title.text,O=l({id:f.id,ref:y,style:m("root"),className:u.classNames(f.className,g("root"))},s.getOtherProps(f),h("root")),j=l({ref:b,width:f.width,height:f.height,role:"img","aria-label":C},h("canvas"));return i.createElement("div",O,i.createElement("canvas",j))})),(function(e,t){return e.data===t.data&&e.options===t.options&&e.type===t.type}));c.displayName="Chart",exports.Chart=c;
+141
View File
@@ -0,0 +1,141 @@
/**
*
* Chart components are based on Chart.js, an open source HTML5 based charting library.
*
* [Live Demo](https://www.primereact.org/chart)
*
* @module chart
*
*/
import * as React from 'react';
import { ComponentHooks } from '../componentbase/componentbase';
import { PassThroughOptions } from '../passthrough';
import { PassThroughType } from '../utils/utils';
export declare type ChartPassThroughType<T> = PassThroughType<T, ChartPassThroughMethodOptions>;
/**
* Custom passthrough(pt) option method.
*/
export interface ChartPassThroughMethodOptions {
props: ChartProps;
}
/**
* Custom passthrough(pt) options.
* @see {@link ChartProps.pt}
*/
export interface ChartPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: ChartPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the canvas's DOM element.
*/
canvas?: ChartPassThroughType<React.HTMLAttributes<HTMLCanvasElement>>;
/**
* Used to manage all lifecycle hooks
* @see {@link ComponentHooks}
*/
hooks?: ComponentHooks;
}
/**
* Defines valid properties in Chart component.
* @group Properties
*/
export interface ChartProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref' | 'content' | 'pt'> {
/**
* Type of the chart.
*/
type?: string | undefined;
/**
* Data to display.
*/
data?: object | undefined;
/**
* Options to customize the chart.
*/
options?: object | undefined;
/**
* Used to custom plugins of the chart.
*/
plugins?: any[] | undefined;
/**
* Width of the chart in non-responsive mode.
*/
width?: string | undefined;
/**
* Height of the chart in non-responsive mode.
*/
height?: string | undefined;
/**
* ARIA label for the chart canvas. Defaults to options.plugins.title.text if available.
* @default options.plugins.title.text
*/
ariaLabel?: string | undefined;
/**
* 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 {ChartPassThroughOptions}
*/
pt?: ChartPassThroughOptions;
/**
* 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 - Chart**
*
* _Chart components are based on Chart.js, an open source HTML5 based charting library._
*
* [Live Demo](https://www.primereact.org/chart/)
* --- ---
* ![PrimeReact](https://primefaces.org/cdn/primereact/images/logo-100.png)
*
* @group Component
*/
export declare class Chart extends React.Component<ChartProps, any> {
/**
* Used to get canvas element.
* @return {HTMLCanvasElement} Canvas element
*/
public getCanvas(): HTMLCanvasElement;
/**
* Used to get chart instance.
* @return {*} Chart instance
*/
public getChart(): any;
/**
* Used to get base64 image.
* @return {*} base64 image
*/
public getBase64Image(): any;
/**
* Used to generate legend.
* @return {string} Generated legend
*/
public generateLegend(): string;
/**
* Redraws the graph.
*/
public refresh(): void;
/**
* Used to get container element.
* @return {HTMLDivElement | null} Container element
*/
public getElement(): HTMLDivElement | null;
}
+152
View File
@@ -0,0 +1,152 @@
'use client';
import * as React from 'react';
import { PrimeReactContext } from 'primereact/api';
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
import { useMergeProps, useUnmountEffect } from 'primereact/hooks';
import { classNames } from 'primereact/utils';
var ChartBase = ComponentBase.extend({
defaultProps: {
__TYPE: 'Chart',
id: null,
type: null,
data: null,
options: null,
plugins: null,
width: null,
height: null,
style: null,
className: null,
children: undefined
},
css: {
classes: {
root: 'p-chart'
},
inlineStyles: {
root: function root(_ref) {
var props = _ref.props;
return Object.assign({
width: props.width,
height: props.height
}, props.style);
}
},
styles: "\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "
}
});
// GitHub #3059 wrapper if loaded by script tag
var ChartJS = function () {
try {
return Chart;
} catch (_unused) {
return null;
}
}();
var PrimeReactChart = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inProps, ref) {
var mergeProps = useMergeProps();
var context = React.useContext(PrimeReactContext);
var props = ChartBase.getProps(inProps, context);
var _ChartBase$setMetaDat = ChartBase.setMetaData({
props: props
}),
ptm = _ChartBase$setMetaDat.ptm,
cx = _ChartBase$setMetaDat.cx,
sx = _ChartBase$setMetaDat.sx,
isUnstyled = _ChartBase$setMetaDat.isUnstyled;
useHandleStyle(ChartBase.css.styles, isUnstyled, {
name: 'chart'
});
var elementRef = React.useRef(null);
var chartRef = React.useRef(null);
var canvasRef = React.useRef(null);
var initChart = function initChart() {
destroyChart();
var configuration = {
type: props.type,
data: props.data,
options: props.options,
plugins: props.plugins
};
if (ChartJS) {
// GitHub #3059 loaded by script only
chartRef.current = new ChartJS(canvasRef.current, configuration);
} else {
import('chart.js/auto').then(function (module) {
destroyChart();
// In case that the Chart component has been unmounted during asynchronous loading of ChartJS,
// the canvasRef will not be available anymore, and no Chart should be created.
if (!canvasRef.current) {
return;
}
if (module) {
if (module["default"]) {
// WebPack
chartRef.current = new module["default"](canvasRef.current, configuration);
} else {
// ParcelJS
chartRef.current = new module(canvasRef.current, configuration);
}
}
});
}
};
var destroyChart = function destroyChart() {
if (chartRef.current) {
chartRef.current.destroy();
chartRef.current = null;
}
};
React.useImperativeHandle(ref, function () {
return {
props: props,
getCanvas: function getCanvas() {
return canvasRef.current;
},
getChart: function getChart() {
return chartRef.current;
},
getBase64Image: function getBase64Image() {
return chartRef.current.toBase64Image();
},
getElement: function getElement() {
return elementRef.current;
},
generateLegend: function generateLegend() {
return chartRef.current && chartRef.current.generateLegend();
},
refresh: function refresh() {
return chartRef.current && chartRef.current.update();
}
};
});
React.useEffect(function () {
initChart();
});
useUnmountEffect(function () {
destroyChart();
});
var title = props.options && props.options.plugins && props.options.plugins.title && props.options.plugins.title.text;
var ariaLabel = props.ariaLabel || title;
var rootProps = mergeProps({
id: props.id,
ref: elementRef,
style: sx('root'),
className: classNames(props.className, cx('root'))
}, ChartBase.getOtherProps(props), ptm('root'));
var canvasProps = mergeProps({
ref: canvasRef,
width: props.width,
height: props.height,
role: 'img',
'aria-label': ariaLabel
}, ptm('canvas'));
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("canvas", canvasProps));
}), function (prevProps, nextProps) {
return prevProps.data === nextProps.data && prevProps.options === nextProps.options && prevProps.type === nextProps.type;
});
PrimeReactChart.displayName = 'Chart';
export { PrimeReactChart as Chart };
+1
View File
@@ -0,0 +1 @@
import*as t from"react";import{PrimeReactContext as e}from"primereact/api";import{ComponentBase as r,useHandleStyle as n}from"primereact/componentbase";import{useMergeProps as a,useUnmountEffect as u}from"primereact/hooks";import{classNames as o}from"primereact/utils";var i=r.extend({defaultProps:{__TYPE:"Chart",id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null,children:void 0},css:{classes:{root:"p-chart"},inlineStyles:{root:function(t){var e=t.props;return Object.assign({width:e.width,height:e.height},e.style)}},styles:"\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "}}),s=function(){try{return Chart}catch(t){return null}}(),l=t.memo(t.forwardRef((function(r,l){var c=a(),p=t.useContext(e),f=i.getProps(r,p),m=i.setMetaData({props:f}),h=m.ptm,d=m.cx,g=m.sx;n(i.css.styles,m.isUnstyled,{name:"chart"});var y=t.useRef(null),v=t.useRef(null),w=t.useRef(null),C=function(){x();var t={type:f.type,data:f.data,options:f.options,plugins:f.plugins};s?v.current=new s(w.current,t):import("chart.js/auto").then((function(e){x(),w.current&&e&&(v.current=e.default?new e.default(w.current,t):new e(w.current,t))}))},x=function(){v.current&&(v.current.destroy(),v.current=null)};t.useImperativeHandle(l,(function(){return{props:f,getCanvas:function(){return w.current},getChart:function(){return v.current},getBase64Image:function(){return v.current.toBase64Image()},getElement:function(){return y.current},generateLegend:function(){return v.current&&v.current.generateLegend()},refresh:function(){return v.current&&v.current.update()}}})),t.useEffect((function(){C()})),u((function(){x()}));var E=f.ariaLabel||f.options&&f.options.plugins&&f.options.plugins.title&&f.options.plugins.title.text,b=c({id:f.id,ref:y,style:g("root"),className:o(f.className,d("root"))},i.getOtherProps(f),h("root")),N=c({ref:w,width:f.width,height:f.height,role:"img","aria-label":E},h("canvas"));return t.createElement("div",b,t.createElement("canvas",N))})),(function(t,e){return t.data===e.data&&t.options===e.options&&t.type===e.type}));l.displayName="Chart";export{l as Chart};
+175
View File
@@ -0,0 +1,175 @@
this.primereact = this.primereact || {};
this.primereact.chart = (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);
var ChartBase = componentbase.ComponentBase.extend({
defaultProps: {
__TYPE: 'Chart',
id: null,
type: null,
data: null,
options: null,
plugins: null,
width: null,
height: null,
style: null,
className: null,
children: undefined
},
css: {
classes: {
root: 'p-chart'
},
inlineStyles: {
root: function root(_ref) {
var props = _ref.props;
return Object.assign({
width: props.width,
height: props.height
}, props.style);
}
},
styles: "\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "
}
});
// GitHub #3059 wrapper if loaded by script tag
var ChartJS = function () {
try {
return Chart;
} catch (_unused) {
return null;
}
}();
var PrimeReactChart = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
var mergeProps = hooks.useMergeProps();
var context = React__namespace.useContext(api.PrimeReactContext);
var props = ChartBase.getProps(inProps, context);
var _ChartBase$setMetaDat = ChartBase.setMetaData({
props: props
}),
ptm = _ChartBase$setMetaDat.ptm,
cx = _ChartBase$setMetaDat.cx,
sx = _ChartBase$setMetaDat.sx,
isUnstyled = _ChartBase$setMetaDat.isUnstyled;
componentbase.useHandleStyle(ChartBase.css.styles, isUnstyled, {
name: 'chart'
});
var elementRef = React__namespace.useRef(null);
var chartRef = React__namespace.useRef(null);
var canvasRef = React__namespace.useRef(null);
var initChart = function initChart() {
destroyChart();
var configuration = {
type: props.type,
data: props.data,
options: props.options,
plugins: props.plugins
};
if (ChartJS) {
// GitHub #3059 loaded by script only
chartRef.current = new ChartJS(canvasRef.current, configuration);
} else {
import('chart.js/auto').then(function (module) {
destroyChart();
// In case that the Chart component has been unmounted during asynchronous loading of ChartJS,
// the canvasRef will not be available anymore, and no Chart should be created.
if (!canvasRef.current) {
return;
}
if (module) {
if (module["default"]) {
// WebPack
chartRef.current = new module["default"](canvasRef.current, configuration);
} else {
// ParcelJS
chartRef.current = new module(canvasRef.current, configuration);
}
}
});
}
};
var destroyChart = function destroyChart() {
if (chartRef.current) {
chartRef.current.destroy();
chartRef.current = null;
}
};
React__namespace.useImperativeHandle(ref, function () {
return {
props: props,
getCanvas: function getCanvas() {
return canvasRef.current;
},
getChart: function getChart() {
return chartRef.current;
},
getBase64Image: function getBase64Image() {
return chartRef.current.toBase64Image();
},
getElement: function getElement() {
return elementRef.current;
},
generateLegend: function generateLegend() {
return chartRef.current && chartRef.current.generateLegend();
},
refresh: function refresh() {
return chartRef.current && chartRef.current.update();
}
};
});
React__namespace.useEffect(function () {
initChart();
});
hooks.useUnmountEffect(function () {
destroyChart();
});
var title = props.options && props.options.plugins && props.options.plugins.title && props.options.plugins.title.text;
var ariaLabel = props.ariaLabel || title;
var rootProps = mergeProps({
id: props.id,
ref: elementRef,
style: sx('root'),
className: utils.classNames(props.className, cx('root'))
}, ChartBase.getOtherProps(props), ptm('root'));
var canvasProps = mergeProps({
ref: canvasRef,
width: props.width,
height: props.height,
role: 'img',
'aria-label': ariaLabel
}, ptm('canvas'));
return /*#__PURE__*/React__namespace.createElement("div", rootProps, /*#__PURE__*/React__namespace.createElement("canvas", canvasProps));
}), function (prevProps, nextProps) {
return prevProps.data === nextProps.data && prevProps.options === nextProps.options && prevProps.type === nextProps.type;
});
PrimeReactChart.displayName = 'Chart';
exports.Chart = PrimeReactChart;
Object.defineProperty(exports, '__esModule', { value: true });
return exports;
})({}, React, primereact.api, primereact.componentbase, primereact.hooks, primereact.utils);
+1
View File
@@ -0,0 +1 @@
this.primereact=this.primereact||{},this.primereact.chart=function(e,t,r,n,u,a){"use strict";function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=i(t),c=n.ComponentBase.extend({defaultProps:{__TYPE:"Chart",id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null,children:void 0},css:{classes:{root:"p-chart"},inlineStyles:{root:function(e){var t=e.props;return Object.assign({width:t.width,height:t.height},t.style)}},styles:"\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "}}),o=function(){try{return Chart}catch(e){return null}}(),l=s.memo(s.forwardRef((function(e,t){var i=u.useMergeProps(),l=s.useContext(r.PrimeReactContext),p=c.getProps(e,l),f=c.setMetaData({props:p}),d=f.ptm,h=f.cx,m=f.sx;n.useHandleStyle(c.css.styles,f.isUnstyled,{name:"chart"});var g=s.useRef(null),y=s.useRef(null),v=s.useRef(null),b=function(){w();var e={type:p.type,data:p.data,options:p.options,plugins:p.plugins};o?y.current=new o(v.current,e):import("chart.js/auto").then((function(t){w(),v.current&&t&&(y.current=t.default?new t.default(v.current,e):new t(v.current,e))}))},w=function(){y.current&&(y.current.destroy(),y.current=null)};s.useImperativeHandle(t,(function(){return{props:p,getCanvas:function(){return v.current},getChart:function(){return y.current},getBase64Image:function(){return y.current.toBase64Image()},getElement:function(){return g.current},generateLegend:function(){return y.current&&y.current.generateLegend()},refresh:function(){return y.current&&y.current.update()}}})),s.useEffect((function(){b()})),u.useUnmountEffect((function(){w()}));var C=p.ariaLabel||p.options&&p.options.plugins&&p.options.plugins.title&&p.options.plugins.title.text,O=i({id:p.id,ref:g,style:m("root"),className:a.classNames(p.className,h("root"))},c.getOtherProps(p),d("root")),P=i({ref:v,width:p.width,height:p.height,role:"img","aria-label":C},d("canvas"));return s.createElement("div",O,s.createElement("canvas",P))})),(function(e,t){return e.data===t.data&&e.options===t.options&&e.type===t.type}));return l.displayName="Chart",e.Chart=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.utils);
+7
View File
@@ -0,0 +1,7 @@
{
"main": "./chart.cjs.js",
"module": "./chart.esm.js",
"unpkg": "./chart.min.js",
"types": "./chart.d.ts",
"sideEffects": false
}