@adiba-banking-cloud/backoffice 0.0.105 → 0.2.0

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-FFda0udd.js');
3
+ var index = require('./index-QwR6crYB.js');
4
4
 
5
5
  function _mergeNamespaces(n, m) {
6
6
  m.forEach(function (e) {
@@ -19,6 +19,9 @@ require('@fontsource/poppins/500.css');
19
19
  require('@fontsource/poppins/600.css');
20
20
  require('@fontsource/poppins/700.css');
21
21
  require('@fontsource/poppins/800.css');
22
+ var axios = require('axios');
23
+ var dates = require('@mantine/dates');
24
+ require('@mantine/dates/styles.css');
22
25
 
23
26
  function _interopNamespaceDefault(e) {
24
27
  var n = Object.create(null);
@@ -52,6 +55,7 @@ function _mergeNamespaces(n, m) {
52
55
  return Object.freeze(n);
53
56
  }
54
57
 
58
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
55
59
  var IconSax__namespace = /*#__PURE__*/_interopNamespaceDefault(IconSax);
56
60
 
57
61
  function getDefaultExportFromCjs (x) {
@@ -11416,34 +11420,40 @@ const StackedColumn = props => {
11416
11420
  }));
11417
11421
  };
11418
11422
  const initSeries$3 = props => {
11419
- const renderXAxis = (categories, showXLabel) => ({
11420
- categories,
11421
- labels: {
11422
- enabled: showXLabel,
11423
- style: {
11424
- textTransform: "uppercase",
11425
- color: "#575E77"
11423
+ const renderXAxis = function (categories) {
11424
+ let showXLabel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
11425
+ return {
11426
+ categories,
11427
+ labels: {
11428
+ enabled: showXLabel,
11429
+ style: {
11430
+ textTransform: "uppercase",
11431
+ color: "#575E77"
11432
+ }
11426
11433
  }
11427
- }
11428
- });
11429
- const renderYAxis = (equalizer, series, showYLabel) => ({
11430
- allowDecimals: false,
11431
- title: {
11432
- text: null
11433
- },
11434
- gridLineDashStyle: "Dot",
11435
- gridLineWidth: 2,
11436
- labels: {
11437
- enabled: showYLabel,
11438
- formatter: ctx => {
11439
- if (!equalizer || series.length > 1) {
11440
- return ctx.value;
11434
+ };
11435
+ };
11436
+ const renderYAxis = function (equalizer, series) {
11437
+ let showYLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
11438
+ return {
11439
+ allowDecimals: false,
11440
+ title: {
11441
+ text: null
11442
+ },
11443
+ gridLineDashStyle: "Dot",
11444
+ gridLineWidth: 2,
11445
+ labels: {
11446
+ enabled: showYLabel,
11447
+ formatter: ctx => {
11448
+ if (!equalizer || series.length > 1) {
11449
+ return ctx.value;
11450
+ }
11451
+ const axisLabel = ctx.value * computeBoundary(series[0]) / 100;
11452
+ return axisLabel.toFixed();
11441
11453
  }
11442
- const axisLabel = ctx.value * computeBoundary(series[0]) / 100;
11443
- return axisLabel.toFixed();
11444
11454
  }
11445
- }
11446
- });
11455
+ };
11456
+ };
11447
11457
  const renderSeries = (seriesData, seriesColors, equalizer, showDataLabels, showAxisLabel) => {
11448
11458
  if (seriesData.length > 1 || !equalizer) {
11449
11459
  let br = undefined;
@@ -11592,8 +11602,8 @@ const initSeries$3 = props => {
11592
11602
  return plot;
11593
11603
  };
11594
11604
  return {
11595
- xAxis: renderXAxis(props.xAxisLabel, props.showXLabel),
11596
- yAxis: renderYAxis(props.equalizer, props.series, props.showYLabel),
11605
+ xAxis: renderXAxis(props.xAxisLabel, props.showXLabel ?? true),
11606
+ yAxis: renderYAxis(props.equalizer, props.series, props.showYLabel ?? true),
11597
11607
  plotOptions: renderPlot(props.equalizer),
11598
11608
  series: renderSeries(props.series, props?.colors, props.equalizer, props.showDataLabels, props.showAxisLabel)
11599
11609
  };
@@ -11893,20 +11903,27 @@ const initMultiAxisSeries = props => {
11893
11903
  const yAxesCount = props.series.length;
11894
11904
  const yAxes = [];
11895
11905
  const showYAxisArray = Array.isArray(props.showYAxis) ? props.showYAxis : props.showYAxis === false ? new Array(yAxesCount).fill(false) : new Array(yAxesCount).fill(true);
11906
+
11907
+ // Handle showYAxisTitle - default to true if not specified
11908
+ const showYAxisTitleArray = Array.isArray(props.showYAxisTitle) ? props.showYAxisTitle : props.showYAxisTitle === false ? new Array(yAxesCount).fill(false) : new Array(yAxesCount).fill(true);
11896
11909
  for (let i = 0; i < yAxesCount; i++) {
11897
11910
  const config = props.yAxisConfig?.[i] || {};
11898
11911
  // showYAxisArray[i] will be true or false (never undefined due to fill logic above)
11899
11912
  // We want to show the axis unless it's explicitly false
11900
11913
  const shouldShowYAxis = showYAxisArray[i] !== false;
11914
+ const shouldShowTitle = showYAxisTitleArray[i] !== false;
11915
+
11916
+ // Determine title text - hide if showYAxisTitle is false, otherwise use config.title or null
11917
+ const titleText = shouldShowTitle && config.title !== undefined ? config.title : null;
11901
11918
 
11902
11919
  // Hide yAxis labels and grid if showYAxis is explicitly false for this axis
11903
11920
  if (!shouldShowYAxis) {
11904
11921
  yAxes.push({
11905
11922
  ...defaultYAxis,
11906
11923
  ...config,
11907
- title: config.title !== undefined ? {
11908
- text: config.title
11909
- } : defaultYAxis.title,
11924
+ title: {
11925
+ text: titleText
11926
+ },
11910
11927
  labels: {
11911
11928
  enabled: false
11912
11929
  },
@@ -11919,9 +11936,9 @@ const initMultiAxisSeries = props => {
11919
11936
  yAxes.push({
11920
11937
  ...defaultYAxis,
11921
11938
  ...config,
11922
- title: config.title !== undefined ? {
11923
- text: config.title
11924
- } : defaultYAxis.title,
11939
+ title: {
11940
+ text: titleText
11941
+ },
11925
11942
  labels: {
11926
11943
  enabled: true,
11927
11944
  color: "#575E77",
@@ -12153,7 +12170,7 @@ const initChart$1 = props => {
12153
12170
  }
12154
12171
 
12155
12172
  // Fallback: use dynamic import (async, but will work in Vite/Storybook)
12156
- Promise.resolve().then(function () { return require('./heatmap-iI7S3gXi.js'); }).then(function (n) { return n.heatmap; }).then(heatmapModule => {
12173
+ Promise.resolve().then(function () { return require('./heatmap-c3tdleHx.js'); }).then(function (n) { return n.heatmap; }).then(heatmapModule => {
12157
12174
  const moduleFn = typeof heatmapModule === "function" ? heatmapModule : heatmapModule?.default || heatmapModule;
12158
12175
  if (typeof moduleFn === "function") {
12159
12176
  moduleFn(Highcharts);
@@ -14413,12 +14430,132 @@ const useManagedModals = () => {
14413
14430
  };
14414
14431
  };
14415
14432
 
14433
+ /**
14434
+ * Default pagination page size
14435
+ */
14436
+ const DEFAULT_PAGE_SIZE = 10;
14437
+
14438
+ /**
14439
+ * Maximum allowed page size for pagination
14440
+ */
14441
+ const MAX_PAGE_SIZE = 100;
14442
+
14443
+ /**
14444
+ * Default API request timeout in milliseconds
14445
+ */
14446
+ const DEFAULT_API_TIMEOUT = 30000;
14447
+
14448
+ class ApiClient {
14449
+ constructor(config) {
14450
+ const {
14451
+ baseURL = "/",
14452
+ timeout = DEFAULT_API_TIMEOUT,
14453
+ headers = {
14454
+ "Content-Type": "application/json"
14455
+ }
14456
+ } = config;
14457
+ this.client = axios.create({
14458
+ baseURL,
14459
+ timeout,
14460
+ headers
14461
+ });
14462
+ this.setupInterceptors();
14463
+ }
14464
+ setupInterceptors() {
14465
+ // Request interceptor
14466
+ this.client.interceptors.request.use(config => {
14467
+ // Add auth token, logging, etc. if needed
14468
+ return config;
14469
+ }, error => Promise.reject(error));
14470
+
14471
+ // Response interceptor
14472
+ this.client.interceptors.response.use(response => {
14473
+ return response;
14474
+ }, error => {
14475
+ // Handle errors globally
14476
+ return Promise.reject(this.handleError(error));
14477
+ });
14478
+ }
14479
+ handleError(error) {
14480
+ if (error && typeof error === "object" && "response" in error) {
14481
+ const axiosError = error;
14482
+ if (axiosError.response) {
14483
+ return {
14484
+ status: "error",
14485
+ code: axiosError.response.status,
14486
+ message: axiosError.response.data?.message || "An error occurred",
14487
+ error: axiosError.response.data?.error || axiosError.message || "An unexpected error occurred"
14488
+ };
14489
+ }
14490
+ }
14491
+ const errorMessage = error instanceof Error ? error.message : "An unexpected error occurred";
14492
+ return {
14493
+ status: "error",
14494
+ code: 500,
14495
+ message: "Network error",
14496
+ error: errorMessage
14497
+ };
14498
+ }
14499
+ async get(url, config) {
14500
+ const response = await this.client.get(url, config);
14501
+ return response.data;
14502
+ }
14503
+ async post(url, data, config) {
14504
+ const response = await this.client.post(url, data, config);
14505
+ return response.data;
14506
+ }
14507
+ async put(url, data, config) {
14508
+ const response = await this.client.put(url, data, config);
14509
+ return response.data;
14510
+ }
14511
+ async delete(url, config) {
14512
+ const response = await this.client.delete(url, config);
14513
+ return response.data;
14514
+ }
14515
+ }
14516
+
14517
+ /**
14518
+ * Factory function to create a configured API client instance
14519
+ * @param config - Configuration options for the API client
14520
+ * @returns Configured ApiClient instance
14521
+ */
14522
+ function createApiClient() {
14523
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14524
+ return new ApiClient(config);
14525
+ }
14526
+
14527
+ /**
14528
+ * Default API client instance with default configuration
14529
+ * For custom configuration, use createApiClient() instead
14530
+ */
14531
+ const apiClient = createApiClient();
14532
+
14533
+ /**
14534
+ * Wrapper component for modal content to ensure MantineProvider context is available
14535
+ * This is needed because modals rendered by the appshell may not have access to the pilet's provider
14536
+ */
14537
+ const ModalContentWrapper = _ref => {
14538
+ let {
14539
+ children
14540
+ } = _ref;
14541
+ return /*#__PURE__*/React__namespace.createElement(core.MantineProvider, {
14542
+ theme: theme
14543
+ }, /*#__PURE__*/React__namespace.createElement(dates.DatesProvider, {
14544
+ settings: {
14545
+ locale: "en",
14546
+ timezone: "UTC"
14547
+ }
14548
+ }, children));
14549
+ };
14550
+
14416
14551
  exports.ApplicationMenu = ApplicationMenu;
14417
14552
  exports.ApplicationPanel = ApplicationPanel;
14418
14553
  exports.AvatarLabelPanel = AvatarLabelPanel;
14419
14554
  exports.BasicHeatmap = BasicHeatmap;
14420
14555
  exports.CalendarHeatmap = CalendarHeatmap;
14421
14556
  exports.ConnectionPanel = ConnectionPanel;
14557
+ exports.DEFAULT_API_TIMEOUT = DEFAULT_API_TIMEOUT;
14558
+ exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
14422
14559
  exports.DonutChart = DonutChart;
14423
14560
  exports.Drawer = Drawer;
14424
14561
  exports.DynamicLogo = DynamicLogo;
@@ -14430,7 +14567,9 @@ exports.Icons = Icons;
14430
14567
  exports.InfoModal = InfoModal;
14431
14568
  exports.InterpolatedHeatmap = InterpolatedHeatmap;
14432
14569
  exports.LabelPanel = LabelPanel;
14570
+ exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE;
14433
14571
  exports.MaskedTilePanel = MaskedTilePanel;
14572
+ exports.ModalContentWrapper = ModalContentWrapper;
14434
14573
  exports.MultiAxisArea = MultiAxisArea;
14435
14574
  exports.PageTitle = PageTitle;
14436
14575
  exports.PaymentMethod = PaymentMethod;
@@ -14453,6 +14592,8 @@ exports.TitleWithIndex = TitleWithIndex;
14453
14592
  exports.TitledPanel = TitledPanel;
14454
14593
  exports.TwoFactorModal = TwoFactorModal;
14455
14594
  exports.UserMenu = UserMenu;
14595
+ exports.apiClient = apiClient;
14596
+ exports.createApiClient = createApiClient;
14456
14597
  exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
14457
14598
  exports.theme = theme;
14458
14599
  exports.useManagedModals = useManagedModals;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-FFda0udd.js');
3
+ var index = require('./index-QwR6crYB.js');
4
4
  require('@mantine/modals');
5
5
  require('react');
6
6
  require('@mantine/core');
@@ -20,6 +20,9 @@ require('@fontsource/poppins/500.css');
20
20
  require('@fontsource/poppins/600.css');
21
21
  require('@fontsource/poppins/700.css');
22
22
  require('@fontsource/poppins/800.css');
23
+ require('axios');
24
+ require('@mantine/dates');
25
+ require('@mantine/dates/styles.css');
23
26
 
24
27
 
25
28
 
@@ -29,6 +32,8 @@ exports.AvatarLabelPanel = index.AvatarLabelPanel;
29
32
  exports.BasicHeatmap = index.BasicHeatmap;
30
33
  exports.CalendarHeatmap = index.CalendarHeatmap;
31
34
  exports.ConnectionPanel = index.ConnectionPanel;
35
+ exports.DEFAULT_API_TIMEOUT = index.DEFAULT_API_TIMEOUT;
36
+ exports.DEFAULT_PAGE_SIZE = index.DEFAULT_PAGE_SIZE;
32
37
  exports.DonutChart = index.DonutChart;
33
38
  exports.Drawer = index.Drawer;
34
39
  exports.DynamicLogo = index.DynamicLogo;
@@ -40,7 +45,9 @@ exports.Icons = index.Icons;
40
45
  exports.InfoModal = index.InfoModal;
41
46
  exports.InterpolatedHeatmap = index.InterpolatedHeatmap;
42
47
  exports.LabelPanel = index.LabelPanel;
48
+ exports.MAX_PAGE_SIZE = index.MAX_PAGE_SIZE;
43
49
  exports.MaskedTilePanel = index.MaskedTilePanel;
50
+ exports.ModalContentWrapper = index.ModalContentWrapper;
44
51
  exports.MultiAxisArea = index.MultiAxisArea;
45
52
  exports.PageTitle = index.PageTitle;
46
53
  exports.PaymentMethod = index.PaymentMethod;
@@ -63,6 +70,8 @@ exports.TitleWithIndex = index.TitleWithIndex;
63
70
  exports.TitledPanel = index.TitledPanel;
64
71
  exports.TwoFactorModal = index.TwoFactorModal;
65
72
  exports.UserMenu = index.UserMenu;
73
+ exports.apiClient = index.apiClient;
74
+ exports.createApiClient = index.createApiClient;
66
75
  exports.theme = index.theme;
67
76
  exports.useManagedModals = index.useManagedModals;
68
77
  exports.useModal = index.useModal;
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from './index-D_S62F0o.js';
1
+ import { g as getDefaultExportFromCjs } from './index-9HtrJaD9.js';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {