@adiba-banking-cloud/backoffice 0.0.97 → 0.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11225,7 +11225,8 @@ const initChart$2 = props => {
11225
11225
  type: "column",
11226
11226
  borderRadius: 8,
11227
11227
  backgroundColor: props?.bgColor || "rgba(255, 255, 255, 0)",
11228
- plotBackgroundColor: props?.plotBgColor || "rgba(255, 255, 255, 0)"
11228
+ plotBackgroundColor: props?.plotBgColor || "rgba(255, 255, 255, 0)",
11229
+ inverted: props?.inverted || false
11229
11230
  },
11230
11231
  tooltip: {
11231
11232
  backgroundColor: "#0F193D",
@@ -11376,7 +11377,8 @@ const EqualizerColumn = props => {
11376
11377
  bgColor: props.bgColor,
11377
11378
  plotBgColor: props.plotBgColor,
11378
11379
  colors: [props.color || "blue"],
11379
- title: props.title
11380
+ title: props.title,
11381
+ inverted: props.inverted
11380
11382
  };
11381
11383
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11382
11384
  };
@@ -11390,7 +11392,8 @@ const SimpleColumn = props => {
11390
11392
  bgColor: props.bgColor,
11391
11393
  plotBgColor: props.plotBgColor,
11392
11394
  colors: [props.color || "gray"],
11393
- title: props.title
11395
+ title: props.title,
11396
+ inverted: props.inverted
11394
11397
  };
11395
11398
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11396
11399
  };
@@ -11518,7 +11521,16 @@ const initSeries$2 = props => {
11518
11521
  };
11519
11522
  };
11520
11523
 
11524
+ const isMultiAxis = props => {
11525
+ return "yAxisConfig" in props;
11526
+ };
11527
+ const isStacked = props => {
11528
+ // StackedAreaChartProps doesn't have yAxisConfig, but has multiple series
11529
+ return !("yAxisConfig" in props) && props.series.length > 1;
11530
+ };
11521
11531
  const initChart$1 = props => {
11532
+ const isMulti = isMultiAxis(props);
11533
+ const isStackedChart = isStacked(props);
11522
11534
  return {
11523
11535
  chart: {
11524
11536
  type: "areaspline",
@@ -11533,7 +11545,45 @@ const initChart$1 = props => {
11533
11545
  style: {
11534
11546
  color: "white"
11535
11547
  },
11536
- format: props.series.length > 1 ? "<b>{key}</b><br/>{series.name}: <b>{y}</b><br/>" + "Total: <b>{point.stackTotal}</b>" : "<b>{key}</b><br/>{series.name}: {y}<br/>"
11548
+ formatter: function () {
11549
+ const point = this.point;
11550
+ const series = this.series;
11551
+ const key = this.key || this.x;
11552
+ if (isStackedChart) {
11553
+ const stackedProps = props;
11554
+ const aggregator = stackedProps.aggregator || "sum";
11555
+ const stackTotal = point.stackTotal || point.y;
11556
+ if (aggregator === "average") {
11557
+ const seriesCount = props.series.length;
11558
+ const average = (stackTotal / seriesCount).toFixed(2);
11559
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Average: <b>${average}</b>`;
11560
+ } else {
11561
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Total: <b>${stackTotal}</b>`;
11562
+ }
11563
+ }
11564
+ if (isMulti) {
11565
+ const multiProps = props;
11566
+ const aggregator = multiProps.aggregator || "sum";
11567
+ const chart = this.series.chart;
11568
+ const allSeries = chart.series;
11569
+ const pointIndex = series.data.indexOf(point);
11570
+ let sum = 0;
11571
+ let count = 0;
11572
+ allSeries.forEach(s => {
11573
+ if (s.data && s.data[pointIndex] && s.data[pointIndex].y !== null && s.data[pointIndex].y !== undefined) {
11574
+ sum += s.data[pointIndex].y;
11575
+ count++;
11576
+ }
11577
+ });
11578
+ if (aggregator === "average") {
11579
+ const average = count > 0 ? (sum / count).toFixed(2) : "0.00";
11580
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Average: <b>${average}</b>`;
11581
+ } else {
11582
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Total: <b>${sum}</b>`;
11583
+ }
11584
+ }
11585
+ return `<b>${key}</b><br/>${series.name}: ${point.y}<br/>`;
11586
+ }
11537
11587
  },
11538
11588
  credits: {
11539
11589
  enabled: false
@@ -11551,8 +11601,8 @@ const initChart$1 = props => {
11551
11601
  },
11552
11602
  legend: {
11553
11603
  enabled: props.withLegend,
11554
- align: "right",
11555
- verticalAlign: "top"
11604
+ align: props.legendPosition?.align || "right",
11605
+ verticalAlign: props.legendPosition?.verticalAlign || "top"
11556
11606
  }
11557
11607
  };
11558
11608
  };
@@ -11589,10 +11639,56 @@ const SimpleArea = props => {
11589
11639
  bgColor: props.bgColor,
11590
11640
  plotBgColor: props.plotBgColor,
11591
11641
  colors: [props.color || "gray"],
11592
- title: props.title
11642
+ title: props.title,
11643
+ legendPosition: props.legendPosition,
11644
+ showYAxis: props.showYAxis
11593
11645
  };
11594
11646
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11595
11647
  };
11648
+ const MultiAxisArea = props => {
11649
+ const chartRef = React.useRef(null);
11650
+ const chartOptions = React.useMemo(() => {
11651
+ const area = {
11652
+ ...props
11653
+ };
11654
+ return {
11655
+ ...initChart$1(area),
11656
+ ...initMultiAxisSeries(area)
11657
+ };
11658
+ }, [props]);
11659
+ React.useEffect(() => {
11660
+ if (chartRef.current && chartRef.current.chart) {
11661
+ chartRef.current.chart.update(chartOptions, true);
11662
+ }
11663
+ }, [chartOptions]);
11664
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11665
+ highcharts: Highcharts,
11666
+ ref: chartRef,
11667
+ options: chartOptions
11668
+ });
11669
+ };
11670
+ const StackedArea = props => {
11671
+ const chartRef = React.useRef(null);
11672
+ const chartOptions = React.useMemo(() => {
11673
+ const area = {
11674
+ ...props
11675
+ };
11676
+ return {
11677
+ ...initChart$1(area),
11678
+ ...initStackedSeries(area)
11679
+ };
11680
+ }, [props]);
11681
+ React.useEffect(() => {
11682
+ if (chartRef.current && chartRef.current.chart) {
11683
+ chartRef.current.chart.update(chartOptions, true);
11684
+ }
11685
+ }, [chartOptions]);
11686
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11687
+ highcharts: Highcharts,
11688
+ ref: chartRef,
11689
+ options: chartOptions
11690
+ });
11691
+ };
11596
11692
  const initSeries$1 = props => {
11597
11693
  const renderXAxis = () => {
11598
11694
  const crosshair = props.withCrossHair ? {
@@ -11626,15 +11722,215 @@ const initSeries$1 = props => {
11626
11722
  const labels = {
11627
11723
  color: "#575E77"
11628
11724
  };
11725
+ const yAxis = {
11726
+ ...defaults,
11727
+ ...{
11728
+ labels
11729
+ }
11730
+ };
11731
+
11732
+ // Hide yAxis if showYAxis is false
11733
+ if (props.showYAxis === false) {
11734
+ return {
11735
+ ...yAxis,
11736
+ visible: false,
11737
+ labels: {
11738
+ enabled: false
11739
+ },
11740
+ title: {
11741
+ text: null
11742
+ }
11743
+ };
11744
+ }
11745
+ return yAxis;
11746
+ };
11747
+ const renderPlot = () => {
11748
+ const areaspline = {
11749
+ lineWidth: 1,
11750
+ color: "#C8700B",
11751
+ pointPlacement: "on",
11752
+ marker: {
11753
+ enabled: false
11754
+ }
11755
+ };
11756
+ return {
11757
+ areaspline
11758
+ };
11759
+ };
11760
+ const renderSeries = () => {
11761
+ const series = props.series.map((value, key) => ({
11762
+ name: props.yAxisLabel[key],
11763
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11764
+ data: value,
11765
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11766
+ }));
11767
+ return series;
11768
+ };
11769
+ return {
11770
+ xAxis: renderXAxis(),
11771
+ yAxis: renderYAxis(),
11772
+ plotOptions: renderPlot(),
11773
+ series: renderSeries()
11774
+ };
11775
+ };
11776
+ const initMultiAxisSeries = props => {
11777
+ const renderXAxis = () => {
11778
+ const crosshair = props.withCrossHair ? {
11779
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11780
+ width: 2,
11781
+ dashStyle: "Dot",
11782
+ snap: true
11783
+ } : undefined;
11784
+ const categories = props.xAxisLabel;
11785
+ const labels = {
11786
+ style: {
11787
+ textTransform: "uppercase",
11788
+ color: "#575E77"
11789
+ }
11790
+ };
11791
+ return {
11792
+ categories,
11793
+ crosshair,
11794
+ labels
11795
+ };
11796
+ };
11797
+ const renderYAxes = () => {
11798
+ const defaultYAxis = {
11799
+ allowDecimals: false,
11800
+ title: {
11801
+ text: null
11802
+ },
11803
+ gridLineDashStyle: "Dot",
11804
+ gridLineWidth: 2,
11805
+ labels: {
11806
+ color: "#575E77"
11807
+ }
11808
+ };
11809
+
11810
+ // Create yAxes array - one for each series or use provided config
11811
+ const yAxesCount = props.series.length;
11812
+ const yAxes = [];
11813
+ const showYAxisArray = Array.isArray(props.showYAxis) ? props.showYAxis : props.showYAxis === false ? new Array(yAxesCount).fill(false) : new Array(yAxesCount).fill(true);
11814
+ for (let i = 0; i < yAxesCount; i++) {
11815
+ const config = props.yAxisConfig?.[i] || {};
11816
+ const shouldShowYAxis = showYAxisArray[i] !== false;
11817
+ const yAxis = {
11818
+ ...defaultYAxis,
11819
+ ...config,
11820
+ title: config.title !== undefined ? {
11821
+ text: config.title
11822
+ } : defaultYAxis.title,
11823
+ labels: config.labels || defaultYAxis.labels
11824
+ };
11825
+
11826
+ // Hide yAxis if showYAxis is false for this axis
11827
+ if (!shouldShowYAxis) {
11828
+ yAxes.push({
11829
+ ...yAxis,
11830
+ visible: false,
11831
+ labels: {
11832
+ enabled: false
11833
+ },
11834
+ title: {
11835
+ text: null
11836
+ }
11837
+ });
11838
+ } else {
11839
+ yAxes.push(yAxis);
11840
+ }
11841
+ }
11842
+ return yAxes;
11843
+ };
11844
+ const renderPlot = () => {
11845
+ const areaspline = {
11846
+ lineWidth: 1,
11847
+ color: "#C8700B",
11848
+ pointPlacement: "on",
11849
+ marker: {
11850
+ enabled: false
11851
+ }
11852
+ };
11629
11853
  return {
11854
+ areaspline
11855
+ };
11856
+ };
11857
+ const renderSeries = () => {
11858
+ const series = props.series.map((value, key) => ({
11859
+ name: props.yAxisLabel[key],
11860
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11861
+ data: value,
11862
+ yAxis: key,
11863
+ // Assign each series to its corresponding yAxis
11864
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11865
+ }));
11866
+ return series;
11867
+ };
11868
+ return {
11869
+ xAxis: renderXAxis(),
11870
+ yAxis: renderYAxes(),
11871
+ plotOptions: renderPlot(),
11872
+ series: renderSeries()
11873
+ };
11874
+ };
11875
+ const initStackedSeries = props => {
11876
+ const renderXAxis = () => {
11877
+ const crosshair = props.withCrossHair ? {
11878
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11879
+ width: 2,
11880
+ dashStyle: "Dot",
11881
+ snap: true
11882
+ } : undefined;
11883
+ const categories = props.xAxisLabel;
11884
+ const labels = {
11885
+ style: {
11886
+ textTransform: "uppercase",
11887
+ color: "#575E77"
11888
+ }
11889
+ };
11890
+ return {
11891
+ categories,
11892
+ crosshair,
11893
+ labels
11894
+ };
11895
+ };
11896
+ const renderYAxis = () => {
11897
+ const defaults = {
11898
+ allowDecimals: false,
11899
+ title: {
11900
+ text: null
11901
+ },
11902
+ gridLineDashStyle: "Dot",
11903
+ gridLineWidth: 2
11904
+ };
11905
+ const labels = {
11906
+ color: "#575E77"
11907
+ };
11908
+ const yAxis = {
11630
11909
  ...defaults,
11631
11910
  ...{
11632
11911
  labels
11633
11912
  }
11634
11913
  };
11914
+
11915
+ // Hide yAxis if showYAxis is false
11916
+ if (props.showYAxis === false) {
11917
+ return {
11918
+ ...yAxis,
11919
+ visible: false,
11920
+ labels: {
11921
+ enabled: false
11922
+ },
11923
+ title: {
11924
+ text: null
11925
+ }
11926
+ };
11927
+ }
11928
+ return yAxis;
11635
11929
  };
11636
11930
  const renderPlot = () => {
11637
11931
  const areaspline = {
11932
+ stacking: "normal",
11933
+ // Enable stacking
11638
11934
  lineWidth: 1,
11639
11935
  color: "#C8700B",
11640
11936
  pointPlacement: "on",
@@ -13682,6 +13978,7 @@ exports.Icons = Icons;
13682
13978
  exports.InfoModal = InfoModal;
13683
13979
  exports.LabelPanel = LabelPanel;
13684
13980
  exports.MaskedTilePanel = MaskedTilePanel;
13981
+ exports.MultiAxisArea = MultiAxisArea;
13685
13982
  exports.PageTitle = PageTitle;
13686
13983
  exports.PaymentMethod = PaymentMethod;
13687
13984
  exports.PaymentMethodAdd = PaymentMethodAdd;
@@ -13694,6 +13991,7 @@ exports.SimpleModal = SimpleModal;
13694
13991
  exports.SimplePanel = SimplePanel;
13695
13992
  exports.SimpleTable = SimpleTable;
13696
13993
  exports.SimpleText = SimpleText;
13994
+ exports.StackedArea = StackedArea;
13697
13995
  exports.StackedColumn = StackedColumn;
13698
13996
  exports.SubscriptionPlans = SubscriptionPlans;
13699
13997
  exports.SuccessModal = SuccessModal;
@@ -11204,7 +11204,8 @@ const initChart$2 = props => {
11204
11204
  type: "column",
11205
11205
  borderRadius: 8,
11206
11206
  backgroundColor: props?.bgColor || "rgba(255, 255, 255, 0)",
11207
- plotBackgroundColor: props?.plotBgColor || "rgba(255, 255, 255, 0)"
11207
+ plotBackgroundColor: props?.plotBgColor || "rgba(255, 255, 255, 0)",
11208
+ inverted: props?.inverted || false
11208
11209
  },
11209
11210
  tooltip: {
11210
11211
  backgroundColor: "#0F193D",
@@ -11355,7 +11356,8 @@ const EqualizerColumn = props => {
11355
11356
  bgColor: props.bgColor,
11356
11357
  plotBgColor: props.plotBgColor,
11357
11358
  colors: [props.color || "blue"],
11358
- title: props.title
11359
+ title: props.title,
11360
+ inverted: props.inverted
11359
11361
  };
11360
11362
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11361
11363
  };
@@ -11369,7 +11371,8 @@ const SimpleColumn = props => {
11369
11371
  bgColor: props.bgColor,
11370
11372
  plotBgColor: props.plotBgColor,
11371
11373
  colors: [props.color || "gray"],
11372
- title: props.title
11374
+ title: props.title,
11375
+ inverted: props.inverted
11373
11376
  };
11374
11377
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11375
11378
  };
@@ -11497,7 +11500,16 @@ const initSeries$2 = props => {
11497
11500
  };
11498
11501
  };
11499
11502
 
11503
+ const isMultiAxis = props => {
11504
+ return "yAxisConfig" in props;
11505
+ };
11506
+ const isStacked = props => {
11507
+ // StackedAreaChartProps doesn't have yAxisConfig, but has multiple series
11508
+ return !("yAxisConfig" in props) && props.series.length > 1;
11509
+ };
11500
11510
  const initChart$1 = props => {
11511
+ const isMulti = isMultiAxis(props);
11512
+ const isStackedChart = isStacked(props);
11501
11513
  return {
11502
11514
  chart: {
11503
11515
  type: "areaspline",
@@ -11512,7 +11524,45 @@ const initChart$1 = props => {
11512
11524
  style: {
11513
11525
  color: "white"
11514
11526
  },
11515
- format: props.series.length > 1 ? "<b>{key}</b><br/>{series.name}: <b>{y}</b><br/>" + "Total: <b>{point.stackTotal}</b>" : "<b>{key}</b><br/>{series.name}: {y}<br/>"
11527
+ formatter: function () {
11528
+ const point = this.point;
11529
+ const series = this.series;
11530
+ const key = this.key || this.x;
11531
+ if (isStackedChart) {
11532
+ const stackedProps = props;
11533
+ const aggregator = stackedProps.aggregator || "sum";
11534
+ const stackTotal = point.stackTotal || point.y;
11535
+ if (aggregator === "average") {
11536
+ const seriesCount = props.series.length;
11537
+ const average = (stackTotal / seriesCount).toFixed(2);
11538
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Average: <b>${average}</b>`;
11539
+ } else {
11540
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Total: <b>${stackTotal}</b>`;
11541
+ }
11542
+ }
11543
+ if (isMulti) {
11544
+ const multiProps = props;
11545
+ const aggregator = multiProps.aggregator || "sum";
11546
+ const chart = this.series.chart;
11547
+ const allSeries = chart.series;
11548
+ const pointIndex = series.data.indexOf(point);
11549
+ let sum = 0;
11550
+ let count = 0;
11551
+ allSeries.forEach(s => {
11552
+ if (s.data && s.data[pointIndex] && s.data[pointIndex].y !== null && s.data[pointIndex].y !== undefined) {
11553
+ sum += s.data[pointIndex].y;
11554
+ count++;
11555
+ }
11556
+ });
11557
+ if (aggregator === "average") {
11558
+ const average = count > 0 ? (sum / count).toFixed(2) : "0.00";
11559
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Average: <b>${average}</b>`;
11560
+ } else {
11561
+ return `<b>${key}</b><br/>${series.name}: <b>${point.y}</b><br/>` + `Total: <b>${sum}</b>`;
11562
+ }
11563
+ }
11564
+ return `<b>${key}</b><br/>${series.name}: ${point.y}<br/>`;
11565
+ }
11516
11566
  },
11517
11567
  credits: {
11518
11568
  enabled: false
@@ -11530,8 +11580,8 @@ const initChart$1 = props => {
11530
11580
  },
11531
11581
  legend: {
11532
11582
  enabled: props.withLegend,
11533
- align: "right",
11534
- verticalAlign: "top"
11583
+ align: props.legendPosition?.align || "right",
11584
+ verticalAlign: props.legendPosition?.verticalAlign || "top"
11535
11585
  }
11536
11586
  };
11537
11587
  };
@@ -11568,10 +11618,56 @@ const SimpleArea = props => {
11568
11618
  bgColor: props.bgColor,
11569
11619
  plotBgColor: props.plotBgColor,
11570
11620
  colors: [props.color || "gray"],
11571
- title: props.title
11621
+ title: props.title,
11622
+ legendPosition: props.legendPosition,
11623
+ showYAxis: props.showYAxis
11572
11624
  };
11573
11625
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11574
11626
  };
11627
+ const MultiAxisArea = props => {
11628
+ const chartRef = useRef(null);
11629
+ const chartOptions = useMemo(() => {
11630
+ const area = {
11631
+ ...props
11632
+ };
11633
+ return {
11634
+ ...initChart$1(area),
11635
+ ...initMultiAxisSeries(area)
11636
+ };
11637
+ }, [props]);
11638
+ useEffect(() => {
11639
+ if (chartRef.current && chartRef.current.chart) {
11640
+ chartRef.current.chart.update(chartOptions, true);
11641
+ }
11642
+ }, [chartOptions]);
11643
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11644
+ highcharts: Highcharts,
11645
+ ref: chartRef,
11646
+ options: chartOptions
11647
+ });
11648
+ };
11649
+ const StackedArea = props => {
11650
+ const chartRef = useRef(null);
11651
+ const chartOptions = useMemo(() => {
11652
+ const area = {
11653
+ ...props
11654
+ };
11655
+ return {
11656
+ ...initChart$1(area),
11657
+ ...initStackedSeries(area)
11658
+ };
11659
+ }, [props]);
11660
+ useEffect(() => {
11661
+ if (chartRef.current && chartRef.current.chart) {
11662
+ chartRef.current.chart.update(chartOptions, true);
11663
+ }
11664
+ }, [chartOptions]);
11665
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11666
+ highcharts: Highcharts,
11667
+ ref: chartRef,
11668
+ options: chartOptions
11669
+ });
11670
+ };
11575
11671
  const initSeries$1 = props => {
11576
11672
  const renderXAxis = () => {
11577
11673
  const crosshair = props.withCrossHair ? {
@@ -11605,15 +11701,215 @@ const initSeries$1 = props => {
11605
11701
  const labels = {
11606
11702
  color: "#575E77"
11607
11703
  };
11704
+ const yAxis = {
11705
+ ...defaults,
11706
+ ...{
11707
+ labels
11708
+ }
11709
+ };
11710
+
11711
+ // Hide yAxis if showYAxis is false
11712
+ if (props.showYAxis === false) {
11713
+ return {
11714
+ ...yAxis,
11715
+ visible: false,
11716
+ labels: {
11717
+ enabled: false
11718
+ },
11719
+ title: {
11720
+ text: null
11721
+ }
11722
+ };
11723
+ }
11724
+ return yAxis;
11725
+ };
11726
+ const renderPlot = () => {
11727
+ const areaspline = {
11728
+ lineWidth: 1,
11729
+ color: "#C8700B",
11730
+ pointPlacement: "on",
11731
+ marker: {
11732
+ enabled: false
11733
+ }
11734
+ };
11735
+ return {
11736
+ areaspline
11737
+ };
11738
+ };
11739
+ const renderSeries = () => {
11740
+ const series = props.series.map((value, key) => ({
11741
+ name: props.yAxisLabel[key],
11742
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11743
+ data: value,
11744
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11745
+ }));
11746
+ return series;
11747
+ };
11748
+ return {
11749
+ xAxis: renderXAxis(),
11750
+ yAxis: renderYAxis(),
11751
+ plotOptions: renderPlot(),
11752
+ series: renderSeries()
11753
+ };
11754
+ };
11755
+ const initMultiAxisSeries = props => {
11756
+ const renderXAxis = () => {
11757
+ const crosshair = props.withCrossHair ? {
11758
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11759
+ width: 2,
11760
+ dashStyle: "Dot",
11761
+ snap: true
11762
+ } : undefined;
11763
+ const categories = props.xAxisLabel;
11764
+ const labels = {
11765
+ style: {
11766
+ textTransform: "uppercase",
11767
+ color: "#575E77"
11768
+ }
11769
+ };
11770
+ return {
11771
+ categories,
11772
+ crosshair,
11773
+ labels
11774
+ };
11775
+ };
11776
+ const renderYAxes = () => {
11777
+ const defaultYAxis = {
11778
+ allowDecimals: false,
11779
+ title: {
11780
+ text: null
11781
+ },
11782
+ gridLineDashStyle: "Dot",
11783
+ gridLineWidth: 2,
11784
+ labels: {
11785
+ color: "#575E77"
11786
+ }
11787
+ };
11788
+
11789
+ // Create yAxes array - one for each series or use provided config
11790
+ const yAxesCount = props.series.length;
11791
+ const yAxes = [];
11792
+ const showYAxisArray = Array.isArray(props.showYAxis) ? props.showYAxis : props.showYAxis === false ? new Array(yAxesCount).fill(false) : new Array(yAxesCount).fill(true);
11793
+ for (let i = 0; i < yAxesCount; i++) {
11794
+ const config = props.yAxisConfig?.[i] || {};
11795
+ const shouldShowYAxis = showYAxisArray[i] !== false;
11796
+ const yAxis = {
11797
+ ...defaultYAxis,
11798
+ ...config,
11799
+ title: config.title !== undefined ? {
11800
+ text: config.title
11801
+ } : defaultYAxis.title,
11802
+ labels: config.labels || defaultYAxis.labels
11803
+ };
11804
+
11805
+ // Hide yAxis if showYAxis is false for this axis
11806
+ if (!shouldShowYAxis) {
11807
+ yAxes.push({
11808
+ ...yAxis,
11809
+ visible: false,
11810
+ labels: {
11811
+ enabled: false
11812
+ },
11813
+ title: {
11814
+ text: null
11815
+ }
11816
+ });
11817
+ } else {
11818
+ yAxes.push(yAxis);
11819
+ }
11820
+ }
11821
+ return yAxes;
11822
+ };
11823
+ const renderPlot = () => {
11824
+ const areaspline = {
11825
+ lineWidth: 1,
11826
+ color: "#C8700B",
11827
+ pointPlacement: "on",
11828
+ marker: {
11829
+ enabled: false
11830
+ }
11831
+ };
11608
11832
  return {
11833
+ areaspline
11834
+ };
11835
+ };
11836
+ const renderSeries = () => {
11837
+ const series = props.series.map((value, key) => ({
11838
+ name: props.yAxisLabel[key],
11839
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11840
+ data: value,
11841
+ yAxis: key,
11842
+ // Assign each series to its corresponding yAxis
11843
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11844
+ }));
11845
+ return series;
11846
+ };
11847
+ return {
11848
+ xAxis: renderXAxis(),
11849
+ yAxis: renderYAxes(),
11850
+ plotOptions: renderPlot(),
11851
+ series: renderSeries()
11852
+ };
11853
+ };
11854
+ const initStackedSeries = props => {
11855
+ const renderXAxis = () => {
11856
+ const crosshair = props.withCrossHair ? {
11857
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11858
+ width: 2,
11859
+ dashStyle: "Dot",
11860
+ snap: true
11861
+ } : undefined;
11862
+ const categories = props.xAxisLabel;
11863
+ const labels = {
11864
+ style: {
11865
+ textTransform: "uppercase",
11866
+ color: "#575E77"
11867
+ }
11868
+ };
11869
+ return {
11870
+ categories,
11871
+ crosshair,
11872
+ labels
11873
+ };
11874
+ };
11875
+ const renderYAxis = () => {
11876
+ const defaults = {
11877
+ allowDecimals: false,
11878
+ title: {
11879
+ text: null
11880
+ },
11881
+ gridLineDashStyle: "Dot",
11882
+ gridLineWidth: 2
11883
+ };
11884
+ const labels = {
11885
+ color: "#575E77"
11886
+ };
11887
+ const yAxis = {
11609
11888
  ...defaults,
11610
11889
  ...{
11611
11890
  labels
11612
11891
  }
11613
11892
  };
11893
+
11894
+ // Hide yAxis if showYAxis is false
11895
+ if (props.showYAxis === false) {
11896
+ return {
11897
+ ...yAxis,
11898
+ visible: false,
11899
+ labels: {
11900
+ enabled: false
11901
+ },
11902
+ title: {
11903
+ text: null
11904
+ }
11905
+ };
11906
+ }
11907
+ return yAxis;
11614
11908
  };
11615
11909
  const renderPlot = () => {
11616
11910
  const areaspline = {
11911
+ stacking: "normal",
11912
+ // Enable stacking
11617
11913
  lineWidth: 1,
11618
11914
  color: "#C8700B",
11619
11915
  pointPlacement: "on",
@@ -13646,4 +13942,4 @@ const useManagedModals = () => {
13646
13942
  };
13647
13943
  };
13648
13944
 
13649
- export { ApplicationMenu, ApplicationPanel, AvatarLabelPanel, ConnectionPanel, DonutChart, Drawer, DynamicLogo, DynamicShigaLogo, EqualizerColumn, ErrorModal, File, Icons, InfoModal, LabelPanel, MaskedTilePanel, PageTitle, PaymentMethod, PaymentMethodAdd, SearchPanel, SideMenu, SimpleArea, SimpleColumn, SimpleForm, SimpleModal, SimplePanel, SimpleTable, SimpleText, StackedColumn, SubscriptionPlans, SuccessModal, TilePanel, TitleWithIndex, TitledPanel, TwoFactorModal, UserMenu, theme, useManagedModals, useModal };
13945
+ export { ApplicationMenu, ApplicationPanel, AvatarLabelPanel, ConnectionPanel, DonutChart, Drawer, DynamicLogo, DynamicShigaLogo, EqualizerColumn, ErrorModal, File, Icons, InfoModal, LabelPanel, MaskedTilePanel, MultiAxisArea, PageTitle, PaymentMethod, PaymentMethodAdd, SearchPanel, SideMenu, SimpleArea, SimpleColumn, SimpleForm, SimpleModal, SimplePanel, SimpleTable, SimpleText, StackedArea, StackedColumn, SubscriptionPlans, SuccessModal, TilePanel, TitleWithIndex, TitledPanel, TwoFactorModal, UserMenu, theme, useManagedModals, useModal };
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
- import { SimpleAreaChartProps } from "./Area.types";
2
+ import { SimpleAreaChartProps, MultiAxisAreaChartProps, StackedAreaChartProps } from "./Area.types";
3
3
  export declare const SimpleArea: React.FC<SimpleAreaChartProps>;
4
+ export declare const MultiAxisArea: React.FC<MultiAxisAreaChartProps>;
5
+ export declare const StackedArea: React.FC<StackedAreaChartProps>;
@@ -1,2 +1,2 @@
1
- import { AreaChartConfig, AreaChartProps } from "./Area.types";
2
- export declare const initChart: (props: AreaChartProps) => AreaChartConfig;
1
+ import { AreaChartConfig, AreaChartProps, MultiAxisAreaChartProps, StackedAreaChartProps } from "./Area.types";
2
+ export declare const initChart: (props: AreaChartProps | MultiAxisAreaChartProps | StackedAreaChartProps) => AreaChartConfig;
@@ -4,3 +4,5 @@ import { SimpleArea } from "./Area";
4
4
  declare const _default: Meta<typeof SimpleArea>;
5
5
  export default _default;
6
6
  export declare const SimpleAreaChart: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Area.types").SimpleAreaChartProps>;
7
+ export declare const MultiAxisAreaChart: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Area.types").MultiAxisAreaChartProps>;
8
+ export declare const StackedAreaChart: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Area.types").StackedAreaChartProps>;
@@ -17,6 +17,11 @@ export interface AreaChartProps {
17
17
  series: number[][];
18
18
  withLegend: boolean;
19
19
  withCrossHair: boolean;
20
+ legendPosition?: {
21
+ align?: "left" | "center" | "right";
22
+ verticalAlign?: "top" | "middle" | "bottom";
23
+ };
24
+ showYAxis?: boolean;
20
25
  }
21
26
  export interface SimpleAreaChartProps {
22
27
  bgColor?: string;
@@ -28,6 +33,11 @@ export interface SimpleAreaChartProps {
28
33
  series: number[];
29
34
  withLegend: boolean;
30
35
  withCrossHair: boolean;
36
+ legendPosition?: {
37
+ align?: "left" | "center" | "right";
38
+ verticalAlign?: "top" | "middle" | "bottom";
39
+ };
40
+ showYAxis?: boolean;
31
41
  }
32
42
  export interface ChartSeriesArea {
33
43
  xAxis: {
@@ -46,7 +56,13 @@ export interface ChartSeriesArea {
46
56
  gridLineDashStyle?: string;
47
57
  gridLineWidth?: number;
48
58
  labels: object;
49
- };
59
+ } | Array<{
60
+ allowDecimals: boolean;
61
+ title: object;
62
+ gridLineDashStyle?: string;
63
+ gridLineWidth?: number;
64
+ labels: object;
65
+ }>;
50
66
  series: AreaChartSeries[];
51
67
  plotOptions: object;
52
68
  }
@@ -56,4 +72,49 @@ export interface AreaChartSeries {
56
72
  color: string;
57
73
  enableMouseTracking?: boolean;
58
74
  showInLegend?: boolean;
75
+ yAxis?: number;
76
+ }
77
+ export interface MultiAxisAreaChartProps {
78
+ bgColor?: string;
79
+ plotBgColor?: string;
80
+ colors?: string[];
81
+ title?: string;
82
+ xAxisLabel: string[];
83
+ yAxisLabel: string[];
84
+ series: number[][];
85
+ withLegend: boolean;
86
+ withCrossHair: boolean;
87
+ legendPosition?: {
88
+ align?: "left" | "center" | "right";
89
+ verticalAlign?: "top" | "middle" | "bottom";
90
+ };
91
+ showYAxis?: boolean | boolean[];
92
+ aggregator?: "sum" | "average";
93
+ yAxisConfig?: Array<{
94
+ title?: string;
95
+ allowDecimals?: boolean;
96
+ gridLineDashStyle?: string;
97
+ gridLineWidth?: number;
98
+ labels?: {
99
+ color?: string;
100
+ formatter?: (ctx: any) => string;
101
+ };
102
+ }>;
103
+ }
104
+ export interface StackedAreaChartProps {
105
+ bgColor?: string;
106
+ plotBgColor?: string;
107
+ colors?: string[];
108
+ title?: string;
109
+ xAxisLabel: string[];
110
+ yAxisLabel: string[];
111
+ series: number[][];
112
+ withLegend: boolean;
113
+ withCrossHair: boolean;
114
+ legendPosition?: {
115
+ align?: "left" | "center" | "right";
116
+ verticalAlign?: "top" | "middle" | "bottom";
117
+ };
118
+ showYAxis?: boolean;
119
+ aggregator?: "sum" | "average";
59
120
  }
@@ -8,6 +8,7 @@ export interface ChartProps {
8
8
  series: number[][];
9
9
  withLegend: boolean;
10
10
  equalizer: boolean;
11
+ inverted?: boolean;
11
12
  }
12
13
  export interface SimpleChartProps {
13
14
  bgColor?: string;
@@ -18,6 +19,7 @@ export interface SimpleChartProps {
18
19
  yAxisLabel: string;
19
20
  series: number[];
20
21
  withLegend: boolean;
22
+ inverted?: boolean;
21
23
  }
22
24
  export interface ChartConfig {
23
25
  chart: object;
@@ -1,5 +1,5 @@
1
1
  export { SimpleColumn, EqualizerColumn, StackedColumn, } from "./charts/column/Column";
2
- export { SimpleArea } from "./charts/area/Area";
2
+ export { SimpleArea, StackedArea, MultiAxisArea } from "./charts/area/Area";
3
3
  export { DonutChart } from "./charts/donut/Donut";
4
4
  export { Icons } from "./general/icons/Icons";
5
5
  export { DynamicLogo, DynamicShigaLogo } from "./general/logos/Logos";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adiba-banking-cloud/backoffice",
3
3
  "author": "TUROG Technologies",
4
- "version": "0.0.97",
4
+ "version": "0.0.99",
5
5
  "description": "An ADIBA component library for backoffice and dashboard applications",
6
6
  "license": "ISC",
7
7
  "main": "build/index.cjs.js",