@adiba-banking-cloud/backoffice 0.0.98 → 0.0.100

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.
@@ -11378,7 +11378,11 @@ const EqualizerColumn = props => {
11378
11378
  plotBgColor: props.plotBgColor,
11379
11379
  colors: [props.color || "blue"],
11380
11380
  title: props.title,
11381
- inverted: props.inverted
11381
+ inverted: props.inverted,
11382
+ showDataLabels: props.showDataLabels,
11383
+ showXLabel: props.showXLabel,
11384
+ showYLabel: props.showYLabel,
11385
+ showAxisLabel: props.showAxisLabel
11382
11386
  };
11383
11387
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11384
11388
  };
@@ -11393,7 +11397,11 @@ const SimpleColumn = props => {
11393
11397
  plotBgColor: props.plotBgColor,
11394
11398
  colors: [props.color || "gray"],
11395
11399
  title: props.title,
11396
- inverted: props.inverted
11400
+ inverted: props.inverted,
11401
+ showDataLabels: props.showDataLabels,
11402
+ showXLabel: props.showXLabel,
11403
+ showYLabel: props.showYLabel,
11404
+ showAxisLabel: props.showAxisLabel
11397
11405
  };
11398
11406
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11399
11407
  };
@@ -11403,16 +11411,18 @@ const StackedColumn = props => {
11403
11411
  }));
11404
11412
  };
11405
11413
  const initSeries$2 = props => {
11406
- const renderXAxis = categories => ({
11414
+ const renderXAxis = (categories, showXLabel) => ({
11407
11415
  categories,
11408
11416
  labels: {
11417
+ enabled: showXLabel !== false,
11418
+ // Default to true if not specified
11409
11419
  style: {
11410
11420
  textTransform: "uppercase",
11411
11421
  color: "#575E77"
11412
11422
  }
11413
11423
  }
11414
11424
  });
11415
- const renderYAxis = (equalizer, series) => ({
11425
+ const renderYAxis = (equalizer, series, showYLabel) => ({
11416
11426
  allowDecimals: false,
11417
11427
  title: {
11418
11428
  text: null
@@ -11420,6 +11430,8 @@ const initSeries$2 = props => {
11420
11430
  gridLineDashStyle: "Dot",
11421
11431
  gridLineWidth: 2,
11422
11432
  labels: {
11433
+ enabled: showYLabel !== false,
11434
+ // Default to true if not specified
11423
11435
  formatter: ctx => {
11424
11436
  if (!equalizer || series.length > 1) {
11425
11437
  return ctx.value;
@@ -11429,21 +11441,51 @@ const initSeries$2 = props => {
11429
11441
  }
11430
11442
  }
11431
11443
  });
11432
- const renderSeries = (seriesData, seriesColors, equalizer) => {
11444
+ const renderSeries = (seriesData, seriesColors, equalizer, showDataLabels, showAxisLabel) => {
11433
11445
  if (seriesData.length > 1 || !equalizer) {
11434
11446
  let br = undefined;
11435
11447
  if (seriesData.length > 1 && equalizer) {
11436
11448
  br = 20;
11437
11449
  }
11438
- return seriesData.map((data, key) => ({
11439
- name: props.yAxisLabel[key],
11440
- color: seriesColors ? seriesColors[key] : "gray",
11441
- data,
11442
- borderRadiusTopLeft: br,
11443
- borderRadiusTopRight: br,
11444
- borderRadiusBottomLeft: br,
11445
- borderRadiusBottomRight: br
11446
- }));
11450
+ return seriesData.map((data, key) => {
11451
+ const dataLabelConfig = {
11452
+ enabled: false
11453
+ };
11454
+ if (showDataLabels || showAxisLabel) {
11455
+ dataLabelConfig.enabled = true;
11456
+ dataLabelConfig.style = {
11457
+ color: "#575E77",
11458
+ fontSize: "12px",
11459
+ fontWeight: "500"
11460
+ };
11461
+ dataLabelConfig.align = "center";
11462
+ dataLabelConfig.verticalAlign = props.inverted ? "middle" : "bottom";
11463
+
11464
+ // Combine value and axis label if both are enabled
11465
+ dataLabelConfig.formatter = function () {
11466
+ const value = showDataLabels ? this.y?.toString() || "" : "";
11467
+ const axisLabel = showAxisLabel ? this.point?.category || this.category || this.x || "" : "";
11468
+ if (showDataLabels && showAxisLabel) {
11469
+ return `${axisLabel}<br/>${value}`;
11470
+ } else if (showDataLabels) {
11471
+ return value;
11472
+ } else if (showAxisLabel) {
11473
+ return axisLabel;
11474
+ }
11475
+ return "";
11476
+ };
11477
+ }
11478
+ return {
11479
+ name: props.yAxisLabel[key],
11480
+ color: seriesColors ? seriesColors[key] : "gray",
11481
+ data,
11482
+ borderRadiusTopLeft: br,
11483
+ borderRadiusTopRight: br,
11484
+ borderRadiusBottomLeft: br,
11485
+ borderRadiusBottomRight: br,
11486
+ dataLabels: dataLabelConfig
11487
+ };
11488
+ });
11447
11489
  }
11448
11490
  if (seriesData.length == 1 && equalizer) {
11449
11491
  const boundary = computeBoundary(seriesData[0]);
@@ -11457,15 +11499,46 @@ const initSeries$2 = props => {
11457
11499
  innerWidth: 8,
11458
11500
  color: "#EEEEEE",
11459
11501
  enableMouseTracking: false,
11460
- showInLegend: false
11502
+ showInLegend: false,
11503
+ dataLabels: {
11504
+ enabled: false
11505
+ }
11461
11506
  });
11507
+ const dataLabelConfig = {
11508
+ enabled: false
11509
+ };
11510
+ if (showDataLabels || showAxisLabel) {
11511
+ dataLabelConfig.enabled = true;
11512
+ dataLabelConfig.style = {
11513
+ color: "#575E77",
11514
+ fontSize: "12px",
11515
+ fontWeight: "500"
11516
+ };
11517
+ dataLabelConfig.align = "center";
11518
+ dataLabelConfig.verticalAlign = props.inverted ? "middle" : "bottom";
11519
+
11520
+ // Combine value and axis label if both are enabled
11521
+ dataLabelConfig.formatter = function () {
11522
+ const value = showDataLabels ? this.y?.toString() || "" : "";
11523
+ const axisLabel = showAxisLabel ? this.category || "" : "";
11524
+ if (showDataLabels && showAxisLabel) {
11525
+ return `${axisLabel}<br/>${value}`;
11526
+ } else if (showDataLabels) {
11527
+ return value;
11528
+ } else if (showAxisLabel) {
11529
+ return axisLabel;
11530
+ }
11531
+ return "";
11532
+ };
11533
+ }
11462
11534
  const mainSeries = {
11463
11535
  ...fillSeries(boundary),
11464
11536
  ...{
11465
11537
  name: props.yAxisLabel[0],
11466
11538
  color: seriesColors ? seriesColors[0] : "gray",
11467
11539
  data: seriesData[0],
11468
- enableMouseTracking: true
11540
+ enableMouseTracking: true,
11541
+ dataLabels: dataLabelConfig
11469
11542
  }
11470
11543
  };
11471
11544
  return [fillSeries(boundary), mainSeries];
@@ -11514,10 +11587,10 @@ const initSeries$2 = props => {
11514
11587
  return plot;
11515
11588
  };
11516
11589
  return {
11517
- xAxis: renderXAxis(props.xAxisLabel),
11518
- yAxis: renderYAxis(props.equalizer, props.series),
11590
+ xAxis: renderXAxis(props.xAxisLabel, props.showXLabel),
11591
+ yAxis: renderYAxis(props.equalizer, props.series, props.showYLabel),
11519
11592
  plotOptions: renderPlot(props.equalizer),
11520
- series: renderSeries(props.series, props?.colors, props.equalizer)
11593
+ series: renderSeries(props.series, props?.colors, props.equalizer, props.showDataLabels, props.showAxisLabel)
11521
11594
  };
11522
11595
  };
11523
11596
 
@@ -11645,6 +11718,50 @@ const SimpleArea = props => {
11645
11718
  };
11646
11719
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11647
11720
  };
11721
+ const MultiAxisArea = props => {
11722
+ const chartRef = React.useRef(null);
11723
+ const chartOptions = React.useMemo(() => {
11724
+ const area = {
11725
+ ...props
11726
+ };
11727
+ return {
11728
+ ...initChart$1(area),
11729
+ ...initMultiAxisSeries(area)
11730
+ };
11731
+ }, [props]);
11732
+ React.useEffect(() => {
11733
+ if (chartRef.current && chartRef.current.chart) {
11734
+ chartRef.current.chart.update(chartOptions, true);
11735
+ }
11736
+ }, [chartOptions]);
11737
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11738
+ highcharts: Highcharts,
11739
+ ref: chartRef,
11740
+ options: chartOptions
11741
+ });
11742
+ };
11743
+ const StackedArea = props => {
11744
+ const chartRef = React.useRef(null);
11745
+ const chartOptions = React.useMemo(() => {
11746
+ const area = {
11747
+ ...props
11748
+ };
11749
+ return {
11750
+ ...initChart$1(area),
11751
+ ...initStackedSeries(area)
11752
+ };
11753
+ }, [props]);
11754
+ React.useEffect(() => {
11755
+ if (chartRef.current && chartRef.current.chart) {
11756
+ chartRef.current.chart.update(chartOptions, true);
11757
+ }
11758
+ }, [chartOptions]);
11759
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11760
+ highcharts: Highcharts,
11761
+ ref: chartRef,
11762
+ options: chartOptions
11763
+ });
11764
+ };
11648
11765
  const initSeries$1 = props => {
11649
11766
  const renderXAxis = () => {
11650
11767
  const crosshair = props.withCrossHair ? {
@@ -11729,6 +11846,191 @@ const initSeries$1 = props => {
11729
11846
  series: renderSeries()
11730
11847
  };
11731
11848
  };
11849
+ const initMultiAxisSeries = props => {
11850
+ const renderXAxis = () => {
11851
+ const crosshair = props.withCrossHair ? {
11852
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11853
+ width: 2,
11854
+ dashStyle: "Dot",
11855
+ snap: true
11856
+ } : undefined;
11857
+ const categories = props.xAxisLabel;
11858
+ const labels = {
11859
+ style: {
11860
+ textTransform: "uppercase",
11861
+ color: "#575E77"
11862
+ }
11863
+ };
11864
+ return {
11865
+ categories,
11866
+ crosshair,
11867
+ labels
11868
+ };
11869
+ };
11870
+ const renderYAxes = () => {
11871
+ const defaultYAxis = {
11872
+ allowDecimals: false,
11873
+ title: {
11874
+ text: null
11875
+ },
11876
+ gridLineDashStyle: "Dot",
11877
+ gridLineWidth: 2,
11878
+ labels: {
11879
+ color: "#575E77"
11880
+ }
11881
+ };
11882
+
11883
+ // Create yAxes array - one for each series or use provided config
11884
+ const yAxesCount = props.series.length;
11885
+ const yAxes = [];
11886
+ const showYAxisArray = Array.isArray(props.showYAxis) ? props.showYAxis : props.showYAxis === false ? new Array(yAxesCount).fill(false) : new Array(yAxesCount).fill(true);
11887
+ for (let i = 0; i < yAxesCount; i++) {
11888
+ const config = props.yAxisConfig?.[i] || {};
11889
+ const shouldShowYAxis = showYAxisArray[i] !== false;
11890
+ const yAxis = {
11891
+ ...defaultYAxis,
11892
+ ...config,
11893
+ title: config.title !== undefined ? {
11894
+ text: config.title
11895
+ } : defaultYAxis.title,
11896
+ labels: config.labels || defaultYAxis.labels
11897
+ };
11898
+
11899
+ // Hide yAxis if showYAxis is false for this axis
11900
+ if (!shouldShowYAxis) {
11901
+ yAxes.push({
11902
+ ...yAxis,
11903
+ visible: false,
11904
+ labels: {
11905
+ enabled: false
11906
+ },
11907
+ title: {
11908
+ text: null
11909
+ }
11910
+ });
11911
+ } else {
11912
+ yAxes.push(yAxis);
11913
+ }
11914
+ }
11915
+ return yAxes;
11916
+ };
11917
+ const renderPlot = () => {
11918
+ const areaspline = {
11919
+ lineWidth: 1,
11920
+ color: "#C8700B",
11921
+ pointPlacement: "on",
11922
+ marker: {
11923
+ enabled: false
11924
+ }
11925
+ };
11926
+ return {
11927
+ areaspline
11928
+ };
11929
+ };
11930
+ const renderSeries = () => {
11931
+ const series = props.series.map((value, key) => ({
11932
+ name: props.yAxisLabel[key],
11933
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11934
+ data: value,
11935
+ yAxis: key,
11936
+ // Assign each series to its corresponding yAxis
11937
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11938
+ }));
11939
+ return series;
11940
+ };
11941
+ return {
11942
+ xAxis: renderXAxis(),
11943
+ yAxis: renderYAxes(),
11944
+ plotOptions: renderPlot(),
11945
+ series: renderSeries()
11946
+ };
11947
+ };
11948
+ const initStackedSeries = props => {
11949
+ const renderXAxis = () => {
11950
+ const crosshair = props.withCrossHair ? {
11951
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11952
+ width: 2,
11953
+ dashStyle: "Dot",
11954
+ snap: true
11955
+ } : undefined;
11956
+ const categories = props.xAxisLabel;
11957
+ const labels = {
11958
+ style: {
11959
+ textTransform: "uppercase",
11960
+ color: "#575E77"
11961
+ }
11962
+ };
11963
+ return {
11964
+ categories,
11965
+ crosshair,
11966
+ labels
11967
+ };
11968
+ };
11969
+ const renderYAxis = () => {
11970
+ const defaults = {
11971
+ allowDecimals: false,
11972
+ title: {
11973
+ text: null
11974
+ },
11975
+ gridLineDashStyle: "Dot",
11976
+ gridLineWidth: 2
11977
+ };
11978
+ const labels = {
11979
+ color: "#575E77"
11980
+ };
11981
+ const yAxis = {
11982
+ ...defaults,
11983
+ ...{
11984
+ labels
11985
+ }
11986
+ };
11987
+
11988
+ // Hide yAxis if showYAxis is false
11989
+ if (props.showYAxis === false) {
11990
+ return {
11991
+ ...yAxis,
11992
+ visible: false,
11993
+ labels: {
11994
+ enabled: false
11995
+ },
11996
+ title: {
11997
+ text: null
11998
+ }
11999
+ };
12000
+ }
12001
+ return yAxis;
12002
+ };
12003
+ const renderPlot = () => {
12004
+ const areaspline = {
12005
+ stacking: "normal",
12006
+ // Enable stacking
12007
+ lineWidth: 1,
12008
+ color: "#C8700B",
12009
+ pointPlacement: "on",
12010
+ marker: {
12011
+ enabled: false
12012
+ }
12013
+ };
12014
+ return {
12015
+ areaspline
12016
+ };
12017
+ };
12018
+ const renderSeries = () => {
12019
+ const series = props.series.map((value, key) => ({
12020
+ name: props.yAxisLabel[key],
12021
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
12022
+ data: value,
12023
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
12024
+ }));
12025
+ return series;
12026
+ };
12027
+ return {
12028
+ xAxis: renderXAxis(),
12029
+ yAxis: renderYAxis(),
12030
+ plotOptions: renderPlot(),
12031
+ series: renderSeries()
12032
+ };
12033
+ };
11732
12034
 
11733
12035
  const initChart = _ref => {
11734
12036
  let {
@@ -13749,6 +14051,7 @@ exports.Icons = Icons;
13749
14051
  exports.InfoModal = InfoModal;
13750
14052
  exports.LabelPanel = LabelPanel;
13751
14053
  exports.MaskedTilePanel = MaskedTilePanel;
14054
+ exports.MultiAxisArea = MultiAxisArea;
13752
14055
  exports.PageTitle = PageTitle;
13753
14056
  exports.PaymentMethod = PaymentMethod;
13754
14057
  exports.PaymentMethodAdd = PaymentMethodAdd;
@@ -13761,6 +14064,7 @@ exports.SimpleModal = SimpleModal;
13761
14064
  exports.SimplePanel = SimplePanel;
13762
14065
  exports.SimpleTable = SimpleTable;
13763
14066
  exports.SimpleText = SimpleText;
14067
+ exports.StackedArea = StackedArea;
13764
14068
  exports.StackedColumn = StackedColumn;
13765
14069
  exports.SubscriptionPlans = SubscriptionPlans;
13766
14070
  exports.SuccessModal = SuccessModal;
@@ -11357,7 +11357,11 @@ const EqualizerColumn = props => {
11357
11357
  plotBgColor: props.plotBgColor,
11358
11358
  colors: [props.color || "blue"],
11359
11359
  title: props.title,
11360
- inverted: props.inverted
11360
+ inverted: props.inverted,
11361
+ showDataLabels: props.showDataLabels,
11362
+ showXLabel: props.showXLabel,
11363
+ showYLabel: props.showYLabel,
11364
+ showAxisLabel: props.showAxisLabel
11361
11365
  };
11362
11366
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11363
11367
  };
@@ -11372,7 +11376,11 @@ const SimpleColumn = props => {
11372
11376
  plotBgColor: props.plotBgColor,
11373
11377
  colors: [props.color || "gray"],
11374
11378
  title: props.title,
11375
- inverted: props.inverted
11379
+ inverted: props.inverted,
11380
+ showDataLabels: props.showDataLabels,
11381
+ showXLabel: props.showXLabel,
11382
+ showYLabel: props.showYLabel,
11383
+ showAxisLabel: props.showAxisLabel
11376
11384
  };
11377
11385
  return /*#__PURE__*/React.createElement(Column, chartOptions);
11378
11386
  };
@@ -11382,16 +11390,18 @@ const StackedColumn = props => {
11382
11390
  }));
11383
11391
  };
11384
11392
  const initSeries$2 = props => {
11385
- const renderXAxis = categories => ({
11393
+ const renderXAxis = (categories, showXLabel) => ({
11386
11394
  categories,
11387
11395
  labels: {
11396
+ enabled: showXLabel !== false,
11397
+ // Default to true if not specified
11388
11398
  style: {
11389
11399
  textTransform: "uppercase",
11390
11400
  color: "#575E77"
11391
11401
  }
11392
11402
  }
11393
11403
  });
11394
- const renderYAxis = (equalizer, series) => ({
11404
+ const renderYAxis = (equalizer, series, showYLabel) => ({
11395
11405
  allowDecimals: false,
11396
11406
  title: {
11397
11407
  text: null
@@ -11399,6 +11409,8 @@ const initSeries$2 = props => {
11399
11409
  gridLineDashStyle: "Dot",
11400
11410
  gridLineWidth: 2,
11401
11411
  labels: {
11412
+ enabled: showYLabel !== false,
11413
+ // Default to true if not specified
11402
11414
  formatter: ctx => {
11403
11415
  if (!equalizer || series.length > 1) {
11404
11416
  return ctx.value;
@@ -11408,21 +11420,51 @@ const initSeries$2 = props => {
11408
11420
  }
11409
11421
  }
11410
11422
  });
11411
- const renderSeries = (seriesData, seriesColors, equalizer) => {
11423
+ const renderSeries = (seriesData, seriesColors, equalizer, showDataLabels, showAxisLabel) => {
11412
11424
  if (seriesData.length > 1 || !equalizer) {
11413
11425
  let br = undefined;
11414
11426
  if (seriesData.length > 1 && equalizer) {
11415
11427
  br = 20;
11416
11428
  }
11417
- return seriesData.map((data, key) => ({
11418
- name: props.yAxisLabel[key],
11419
- color: seriesColors ? seriesColors[key] : "gray",
11420
- data,
11421
- borderRadiusTopLeft: br,
11422
- borderRadiusTopRight: br,
11423
- borderRadiusBottomLeft: br,
11424
- borderRadiusBottomRight: br
11425
- }));
11429
+ return seriesData.map((data, key) => {
11430
+ const dataLabelConfig = {
11431
+ enabled: false
11432
+ };
11433
+ if (showDataLabels || showAxisLabel) {
11434
+ dataLabelConfig.enabled = true;
11435
+ dataLabelConfig.style = {
11436
+ color: "#575E77",
11437
+ fontSize: "12px",
11438
+ fontWeight: "500"
11439
+ };
11440
+ dataLabelConfig.align = "center";
11441
+ dataLabelConfig.verticalAlign = props.inverted ? "middle" : "bottom";
11442
+
11443
+ // Combine value and axis label if both are enabled
11444
+ dataLabelConfig.formatter = function () {
11445
+ const value = showDataLabels ? this.y?.toString() || "" : "";
11446
+ const axisLabel = showAxisLabel ? this.point?.category || this.category || this.x || "" : "";
11447
+ if (showDataLabels && showAxisLabel) {
11448
+ return `${axisLabel}<br/>${value}`;
11449
+ } else if (showDataLabels) {
11450
+ return value;
11451
+ } else if (showAxisLabel) {
11452
+ return axisLabel;
11453
+ }
11454
+ return "";
11455
+ };
11456
+ }
11457
+ return {
11458
+ name: props.yAxisLabel[key],
11459
+ color: seriesColors ? seriesColors[key] : "gray",
11460
+ data,
11461
+ borderRadiusTopLeft: br,
11462
+ borderRadiusTopRight: br,
11463
+ borderRadiusBottomLeft: br,
11464
+ borderRadiusBottomRight: br,
11465
+ dataLabels: dataLabelConfig
11466
+ };
11467
+ });
11426
11468
  }
11427
11469
  if (seriesData.length == 1 && equalizer) {
11428
11470
  const boundary = computeBoundary(seriesData[0]);
@@ -11436,15 +11478,46 @@ const initSeries$2 = props => {
11436
11478
  innerWidth: 8,
11437
11479
  color: "#EEEEEE",
11438
11480
  enableMouseTracking: false,
11439
- showInLegend: false
11481
+ showInLegend: false,
11482
+ dataLabels: {
11483
+ enabled: false
11484
+ }
11440
11485
  });
11486
+ const dataLabelConfig = {
11487
+ enabled: false
11488
+ };
11489
+ if (showDataLabels || showAxisLabel) {
11490
+ dataLabelConfig.enabled = true;
11491
+ dataLabelConfig.style = {
11492
+ color: "#575E77",
11493
+ fontSize: "12px",
11494
+ fontWeight: "500"
11495
+ };
11496
+ dataLabelConfig.align = "center";
11497
+ dataLabelConfig.verticalAlign = props.inverted ? "middle" : "bottom";
11498
+
11499
+ // Combine value and axis label if both are enabled
11500
+ dataLabelConfig.formatter = function () {
11501
+ const value = showDataLabels ? this.y?.toString() || "" : "";
11502
+ const axisLabel = showAxisLabel ? this.category || "" : "";
11503
+ if (showDataLabels && showAxisLabel) {
11504
+ return `${axisLabel}<br/>${value}`;
11505
+ } else if (showDataLabels) {
11506
+ return value;
11507
+ } else if (showAxisLabel) {
11508
+ return axisLabel;
11509
+ }
11510
+ return "";
11511
+ };
11512
+ }
11441
11513
  const mainSeries = {
11442
11514
  ...fillSeries(boundary),
11443
11515
  ...{
11444
11516
  name: props.yAxisLabel[0],
11445
11517
  color: seriesColors ? seriesColors[0] : "gray",
11446
11518
  data: seriesData[0],
11447
- enableMouseTracking: true
11519
+ enableMouseTracking: true,
11520
+ dataLabels: dataLabelConfig
11448
11521
  }
11449
11522
  };
11450
11523
  return [fillSeries(boundary), mainSeries];
@@ -11493,10 +11566,10 @@ const initSeries$2 = props => {
11493
11566
  return plot;
11494
11567
  };
11495
11568
  return {
11496
- xAxis: renderXAxis(props.xAxisLabel),
11497
- yAxis: renderYAxis(props.equalizer, props.series),
11569
+ xAxis: renderXAxis(props.xAxisLabel, props.showXLabel),
11570
+ yAxis: renderYAxis(props.equalizer, props.series, props.showYLabel),
11498
11571
  plotOptions: renderPlot(props.equalizer),
11499
- series: renderSeries(props.series, props?.colors, props.equalizer)
11572
+ series: renderSeries(props.series, props?.colors, props.equalizer, props.showDataLabels, props.showAxisLabel)
11500
11573
  };
11501
11574
  };
11502
11575
 
@@ -11624,6 +11697,50 @@ const SimpleArea = props => {
11624
11697
  };
11625
11698
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11626
11699
  };
11700
+ const MultiAxisArea = props => {
11701
+ const chartRef = useRef(null);
11702
+ const chartOptions = useMemo(() => {
11703
+ const area = {
11704
+ ...props
11705
+ };
11706
+ return {
11707
+ ...initChart$1(area),
11708
+ ...initMultiAxisSeries(area)
11709
+ };
11710
+ }, [props]);
11711
+ useEffect(() => {
11712
+ if (chartRef.current && chartRef.current.chart) {
11713
+ chartRef.current.chart.update(chartOptions, true);
11714
+ }
11715
+ }, [chartOptions]);
11716
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11717
+ highcharts: Highcharts,
11718
+ ref: chartRef,
11719
+ options: chartOptions
11720
+ });
11721
+ };
11722
+ const StackedArea = props => {
11723
+ const chartRef = useRef(null);
11724
+ const chartOptions = useMemo(() => {
11725
+ const area = {
11726
+ ...props
11727
+ };
11728
+ return {
11729
+ ...initChart$1(area),
11730
+ ...initStackedSeries(area)
11731
+ };
11732
+ }, [props]);
11733
+ useEffect(() => {
11734
+ if (chartRef.current && chartRef.current.chart) {
11735
+ chartRef.current.chart.update(chartOptions, true);
11736
+ }
11737
+ }, [chartOptions]);
11738
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11739
+ highcharts: Highcharts,
11740
+ ref: chartRef,
11741
+ options: chartOptions
11742
+ });
11743
+ };
11627
11744
  const initSeries$1 = props => {
11628
11745
  const renderXAxis = () => {
11629
11746
  const crosshair = props.withCrossHair ? {
@@ -11708,6 +11825,191 @@ const initSeries$1 = props => {
11708
11825
  series: renderSeries()
11709
11826
  };
11710
11827
  };
11828
+ const initMultiAxisSeries = props => {
11829
+ const renderXAxis = () => {
11830
+ const crosshair = props.withCrossHair ? {
11831
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11832
+ width: 2,
11833
+ dashStyle: "Dot",
11834
+ snap: true
11835
+ } : undefined;
11836
+ const categories = props.xAxisLabel;
11837
+ const labels = {
11838
+ style: {
11839
+ textTransform: "uppercase",
11840
+ color: "#575E77"
11841
+ }
11842
+ };
11843
+ return {
11844
+ categories,
11845
+ crosshair,
11846
+ labels
11847
+ };
11848
+ };
11849
+ const renderYAxes = () => {
11850
+ const defaultYAxis = {
11851
+ allowDecimals: false,
11852
+ title: {
11853
+ text: null
11854
+ },
11855
+ gridLineDashStyle: "Dot",
11856
+ gridLineWidth: 2,
11857
+ labels: {
11858
+ color: "#575E77"
11859
+ }
11860
+ };
11861
+
11862
+ // Create yAxes array - one for each series or use provided config
11863
+ const yAxesCount = props.series.length;
11864
+ const yAxes = [];
11865
+ const showYAxisArray = Array.isArray(props.showYAxis) ? props.showYAxis : props.showYAxis === false ? new Array(yAxesCount).fill(false) : new Array(yAxesCount).fill(true);
11866
+ for (let i = 0; i < yAxesCount; i++) {
11867
+ const config = props.yAxisConfig?.[i] || {};
11868
+ const shouldShowYAxis = showYAxisArray[i] !== false;
11869
+ const yAxis = {
11870
+ ...defaultYAxis,
11871
+ ...config,
11872
+ title: config.title !== undefined ? {
11873
+ text: config.title
11874
+ } : defaultYAxis.title,
11875
+ labels: config.labels || defaultYAxis.labels
11876
+ };
11877
+
11878
+ // Hide yAxis if showYAxis is false for this axis
11879
+ if (!shouldShowYAxis) {
11880
+ yAxes.push({
11881
+ ...yAxis,
11882
+ visible: false,
11883
+ labels: {
11884
+ enabled: false
11885
+ },
11886
+ title: {
11887
+ text: null
11888
+ }
11889
+ });
11890
+ } else {
11891
+ yAxes.push(yAxis);
11892
+ }
11893
+ }
11894
+ return yAxes;
11895
+ };
11896
+ const renderPlot = () => {
11897
+ const areaspline = {
11898
+ lineWidth: 1,
11899
+ color: "#C8700B",
11900
+ pointPlacement: "on",
11901
+ marker: {
11902
+ enabled: false
11903
+ }
11904
+ };
11905
+ return {
11906
+ areaspline
11907
+ };
11908
+ };
11909
+ const renderSeries = () => {
11910
+ const series = props.series.map((value, key) => ({
11911
+ name: props.yAxisLabel[key],
11912
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11913
+ data: value,
11914
+ yAxis: key,
11915
+ // Assign each series to its corresponding yAxis
11916
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11917
+ }));
11918
+ return series;
11919
+ };
11920
+ return {
11921
+ xAxis: renderXAxis(),
11922
+ yAxis: renderYAxes(),
11923
+ plotOptions: renderPlot(),
11924
+ series: renderSeries()
11925
+ };
11926
+ };
11927
+ const initStackedSeries = props => {
11928
+ const renderXAxis = () => {
11929
+ const crosshair = props.withCrossHair ? {
11930
+ color: props?.colors?.length ? props?.colors[0] : "#ccc",
11931
+ width: 2,
11932
+ dashStyle: "Dot",
11933
+ snap: true
11934
+ } : undefined;
11935
+ const categories = props.xAxisLabel;
11936
+ const labels = {
11937
+ style: {
11938
+ textTransform: "uppercase",
11939
+ color: "#575E77"
11940
+ }
11941
+ };
11942
+ return {
11943
+ categories,
11944
+ crosshair,
11945
+ labels
11946
+ };
11947
+ };
11948
+ const renderYAxis = () => {
11949
+ const defaults = {
11950
+ allowDecimals: false,
11951
+ title: {
11952
+ text: null
11953
+ },
11954
+ gridLineDashStyle: "Dot",
11955
+ gridLineWidth: 2
11956
+ };
11957
+ const labels = {
11958
+ color: "#575E77"
11959
+ };
11960
+ const yAxis = {
11961
+ ...defaults,
11962
+ ...{
11963
+ labels
11964
+ }
11965
+ };
11966
+
11967
+ // Hide yAxis if showYAxis is false
11968
+ if (props.showYAxis === false) {
11969
+ return {
11970
+ ...yAxis,
11971
+ visible: false,
11972
+ labels: {
11973
+ enabled: false
11974
+ },
11975
+ title: {
11976
+ text: null
11977
+ }
11978
+ };
11979
+ }
11980
+ return yAxis;
11981
+ };
11982
+ const renderPlot = () => {
11983
+ const areaspline = {
11984
+ stacking: "normal",
11985
+ // Enable stacking
11986
+ lineWidth: 1,
11987
+ color: "#C8700B",
11988
+ pointPlacement: "on",
11989
+ marker: {
11990
+ enabled: false
11991
+ }
11992
+ };
11993
+ return {
11994
+ areaspline
11995
+ };
11996
+ };
11997
+ const renderSeries = () => {
11998
+ const series = props.series.map((value, key) => ({
11999
+ name: props.yAxisLabel[key],
12000
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
12001
+ data: value,
12002
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
12003
+ }));
12004
+ return series;
12005
+ };
12006
+ return {
12007
+ xAxis: renderXAxis(),
12008
+ yAxis: renderYAxis(),
12009
+ plotOptions: renderPlot(),
12010
+ series: renderSeries()
12011
+ };
12012
+ };
11711
12013
 
11712
12014
  const initChart = _ref => {
11713
12015
  let {
@@ -13713,4 +14015,4 @@ const useManagedModals = () => {
13713
14015
  };
13714
14016
  };
13715
14017
 
13716
- 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 };
14018
+ 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 };
@@ -9,6 +9,10 @@ export interface ChartProps {
9
9
  withLegend: boolean;
10
10
  equalizer: boolean;
11
11
  inverted?: boolean;
12
+ showDataLabels?: boolean;
13
+ showXLabel?: boolean;
14
+ showYLabel?: boolean;
15
+ showAxisLabel?: boolean;
12
16
  }
13
17
  export interface SimpleChartProps {
14
18
  bgColor?: string;
@@ -20,6 +24,10 @@ export interface SimpleChartProps {
20
24
  series: number[];
21
25
  withLegend: boolean;
22
26
  inverted?: boolean;
27
+ showDataLabels?: boolean;
28
+ showXLabel?: boolean;
29
+ showYLabel?: boolean;
30
+ showAxisLabel?: boolean;
23
31
  }
24
32
  export interface ChartConfig {
25
33
  chart: object;
@@ -56,4 +64,15 @@ export interface ChartSeries {
56
64
  color: string;
57
65
  enableMouseTracking?: boolean;
58
66
  showInLegend?: boolean;
67
+ dataLabels?: {
68
+ enabled: boolean;
69
+ style?: {
70
+ color?: string;
71
+ fontSize?: string;
72
+ fontWeight?: string;
73
+ };
74
+ align?: string;
75
+ verticalAlign?: string;
76
+ formatter?: (this: any) => string;
77
+ };
59
78
  }
@@ -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.98",
4
+ "version": "0.0.100",
5
5
  "description": "An ADIBA component library for backoffice and dashboard applications",
6
6
  "license": "ISC",
7
7
  "main": "build/index.cjs.js",