@adiba-banking-cloud/backoffice 0.0.98 → 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.
@@ -11645,6 +11645,50 @@ const SimpleArea = props => {
11645
11645
  };
11646
11646
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11647
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
+ };
11648
11692
  const initSeries$1 = props => {
11649
11693
  const renderXAxis = () => {
11650
11694
  const crosshair = props.withCrossHair ? {
@@ -11729,6 +11773,191 @@ const initSeries$1 = props => {
11729
11773
  series: renderSeries()
11730
11774
  };
11731
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
+ };
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 = {
11909
+ ...defaults,
11910
+ ...{
11911
+ labels
11912
+ }
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;
11929
+ };
11930
+ const renderPlot = () => {
11931
+ const areaspline = {
11932
+ stacking: "normal",
11933
+ // Enable stacking
11934
+ lineWidth: 1,
11935
+ color: "#C8700B",
11936
+ pointPlacement: "on",
11937
+ marker: {
11938
+ enabled: false
11939
+ }
11940
+ };
11941
+ return {
11942
+ areaspline
11943
+ };
11944
+ };
11945
+ const renderSeries = () => {
11946
+ const series = props.series.map((value, key) => ({
11947
+ name: props.yAxisLabel[key],
11948
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11949
+ data: value,
11950
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11951
+ }));
11952
+ return series;
11953
+ };
11954
+ return {
11955
+ xAxis: renderXAxis(),
11956
+ yAxis: renderYAxis(),
11957
+ plotOptions: renderPlot(),
11958
+ series: renderSeries()
11959
+ };
11960
+ };
11732
11961
 
11733
11962
  const initChart = _ref => {
11734
11963
  let {
@@ -13749,6 +13978,7 @@ exports.Icons = Icons;
13749
13978
  exports.InfoModal = InfoModal;
13750
13979
  exports.LabelPanel = LabelPanel;
13751
13980
  exports.MaskedTilePanel = MaskedTilePanel;
13981
+ exports.MultiAxisArea = MultiAxisArea;
13752
13982
  exports.PageTitle = PageTitle;
13753
13983
  exports.PaymentMethod = PaymentMethod;
13754
13984
  exports.PaymentMethodAdd = PaymentMethodAdd;
@@ -13761,6 +13991,7 @@ exports.SimpleModal = SimpleModal;
13761
13991
  exports.SimplePanel = SimplePanel;
13762
13992
  exports.SimpleTable = SimpleTable;
13763
13993
  exports.SimpleText = SimpleText;
13994
+ exports.StackedArea = StackedArea;
13764
13995
  exports.StackedColumn = StackedColumn;
13765
13996
  exports.SubscriptionPlans = SubscriptionPlans;
13766
13997
  exports.SuccessModal = SuccessModal;
@@ -11624,6 +11624,50 @@ const SimpleArea = props => {
11624
11624
  };
11625
11625
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11626
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
+ };
11627
11671
  const initSeries$1 = props => {
11628
11672
  const renderXAxis = () => {
11629
11673
  const crosshair = props.withCrossHair ? {
@@ -11708,6 +11752,191 @@ const initSeries$1 = props => {
11708
11752
  series: renderSeries()
11709
11753
  };
11710
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
+ };
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 = {
11888
+ ...defaults,
11889
+ ...{
11890
+ labels
11891
+ }
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;
11908
+ };
11909
+ const renderPlot = () => {
11910
+ const areaspline = {
11911
+ stacking: "normal",
11912
+ // Enable stacking
11913
+ lineWidth: 1,
11914
+ color: "#C8700B",
11915
+ pointPlacement: "on",
11916
+ marker: {
11917
+ enabled: false
11918
+ }
11919
+ };
11920
+ return {
11921
+ areaspline
11922
+ };
11923
+ };
11924
+ const renderSeries = () => {
11925
+ const series = props.series.map((value, key) => ({
11926
+ name: props.yAxisLabel[key],
11927
+ color: props.colors?.length ? props.colors[key] : "#C8700B",
11928
+ data: value,
11929
+ fillColor: createAreaFillGradient(props.colors?.length ? props.colors[key] : "#C8700B")
11930
+ }));
11931
+ return series;
11932
+ };
11933
+ return {
11934
+ xAxis: renderXAxis(),
11935
+ yAxis: renderYAxis(),
11936
+ plotOptions: renderPlot(),
11937
+ series: renderSeries()
11938
+ };
11939
+ };
11711
11940
 
11712
11941
  const initChart = _ref => {
11713
11942
  let {
@@ -13713,4 +13942,4 @@ const useManagedModals = () => {
13713
13942
  };
13714
13943
  };
13715
13944
 
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 };
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,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.99",
5
5
  "description": "An ADIBA component library for backoffice and dashboard applications",
6
6
  "license": "ISC",
7
7
  "main": "build/index.cjs.js",