@adiba-banking-cloud/backoffice 0.0.31 → 0.0.33

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.
@@ -5,8 +5,8 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
5
  var React = require('react');
6
6
  var HighchartsReact = require('highcharts-react-official');
7
7
  var HighchartsRounded = require('highcharts-rounded-corners');
8
- var IconSax = require('iconsax-react');
9
8
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
9
+ var IconSax = require('iconsax-react');
10
10
  var core = require('@mantine/core');
11
11
  var reactRouterDom = require('react-router-dom');
12
12
  var hooks = require('@mantine/hooks');
@@ -36,6 +36,21 @@ function _interopNamespaceDefault(e) {
36
36
  return Object.freeze(n);
37
37
  }
38
38
 
39
+ function _mergeNamespaces(n, m) {
40
+ m.forEach(function (e) {
41
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
42
+ if (k !== 'default' && !(k in n)) {
43
+ var d = Object.getOwnPropertyDescriptor(e, k);
44
+ Object.defineProperty(n, k, d.get ? d : {
45
+ enumerable: true,
46
+ get: function () { return e[k]; }
47
+ });
48
+ }
49
+ });
50
+ });
51
+ return Object.freeze(n);
52
+ }
53
+
39
54
  var IconSax__namespace = /*#__PURE__*/_interopNamespaceDefault(IconSax);
40
55
 
41
56
  function getDefaultExportFromCjs (x) {
@@ -11170,7 +11185,12 @@ function requireHighcharts() {
11170
11185
  var highchartsExports = requireHighcharts();
11171
11186
  var Highcharts = /*@__PURE__*/getDefaultExportFromCjs(highchartsExports);
11172
11187
 
11173
- const initChart$1 = props => {
11188
+ var Highcharts$1 = /*#__PURE__*/_mergeNamespaces({
11189
+ __proto__: null,
11190
+ default: Highcharts
11191
+ }, [highchartsExports]);
11192
+
11193
+ const initChart$2 = props => {
11174
11194
  return {
11175
11195
  chart: {
11176
11196
  type: "column",
@@ -11292,8 +11312,8 @@ const createAreaFillGradient = function (baseColor) {
11292
11312
  };
11293
11313
  };
11294
11314
 
11295
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11296
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11315
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11316
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11297
11317
 
11298
11318
  // Initialize Highcharts with rounded corners
11299
11319
  if (typeof window !== "undefined") {
@@ -11302,8 +11322,8 @@ if (typeof window !== "undefined") {
11302
11322
  const Column = props => {
11303
11323
  const chartRef = React.useRef(null);
11304
11324
  const chartOptions = React.useMemo(() => {
11305
- const column = _objectSpread$1({}, props);
11306
- return _objectSpread$1(_objectSpread$1({}, initChart$1(column)), initSeries$1(column));
11325
+ const column = _objectSpread$3({}, props);
11326
+ return _objectSpread$3(_objectSpread$3({}, initChart$2(column)), initSeries$2(column));
11307
11327
  }, [props]);
11308
11328
  React.useEffect(() => {
11309
11329
  if (chartRef.current && chartRef.current.chart) {
@@ -11349,7 +11369,7 @@ const StackedColumn = props => {
11349
11369
  equalizer: false
11350
11370
  }));
11351
11371
  };
11352
- const initSeries$1 = props => {
11372
+ const initSeries$2 = props => {
11353
11373
  const renderXAxis = categories => ({
11354
11374
  categories,
11355
11375
  labels: {
@@ -11406,7 +11426,7 @@ const initSeries$1 = props => {
11406
11426
  enableMouseTracking: false,
11407
11427
  showInLegend: false
11408
11428
  });
11409
- const mainSeries = _objectSpread$1(_objectSpread$1({}, fillSeries(boundary)), {
11429
+ const mainSeries = _objectSpread$3(_objectSpread$3({}, fillSeries(boundary)), {
11410
11430
  name: props.yAxisLabel[0],
11411
11431
  color: seriesColors ? seriesColors[0] : "gray",
11412
11432
  data: seriesData[0],
@@ -11446,7 +11466,7 @@ const initSeries$1 = props => {
11446
11466
  pointWidth: undefined
11447
11467
  }
11448
11468
  };
11449
- const plot = _objectSpread$1(_objectSpread$1({}, {
11469
+ const plot = _objectSpread$3(_objectSpread$3({}, {
11450
11470
  column: {
11451
11471
  borderWidth: 0,
11452
11472
  borderRadius: 10
@@ -11462,7 +11482,7 @@ const initSeries$1 = props => {
11462
11482
  };
11463
11483
  };
11464
11484
 
11465
- const initChart = props => {
11485
+ const initChart$1 = props => {
11466
11486
  return {
11467
11487
  chart: {
11468
11488
  type: "areaspline",
@@ -11501,13 +11521,13 @@ const initChart = props => {
11501
11521
  };
11502
11522
  };
11503
11523
 
11504
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11505
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11524
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11525
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11506
11526
  const Area = props => {
11507
11527
  const chartRef = React.useRef(null);
11508
11528
  const chartOptions = React.useMemo(() => {
11509
- const area = _objectSpread({}, props);
11510
- return _objectSpread(_objectSpread({}, initChart(area)), initSeries(area));
11529
+ const area = _objectSpread$2({}, props);
11530
+ return _objectSpread$2(_objectSpread$2({}, initChart$1(area)), initSeries$1(area));
11511
11531
  }, [props]);
11512
11532
  React.useEffect(() => {
11513
11533
  if (chartRef.current && chartRef.current.chart) {
@@ -11534,7 +11554,7 @@ const SimpleArea = props => {
11534
11554
  };
11535
11555
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11536
11556
  };
11537
- const initSeries = props => {
11557
+ const initSeries$1 = props => {
11538
11558
  const renderXAxis = () => {
11539
11559
  var _props$colors;
11540
11560
  const crosshair = props.withCrossHair ? {
@@ -11568,7 +11588,7 @@ const initSeries = props => {
11568
11588
  const labels = {
11569
11589
  color: "#575E77"
11570
11590
  };
11571
- return _objectSpread(_objectSpread({}, defaults), {
11591
+ return _objectSpread$2(_objectSpread$2({}, defaults), {
11572
11592
  labels
11573
11593
  });
11574
11594
  };
@@ -11605,6 +11625,132 @@ const initSeries = props => {
11605
11625
  };
11606
11626
  };
11607
11627
 
11628
+ const _excluded$9 = ["withLegend", "centerLabel", "centerValue"];
11629
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11630
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11631
+ const initChart = _ref => {
11632
+ let {
11633
+ withLegend,
11634
+ centerLabel = "",
11635
+ centerValue = ""
11636
+ } = _ref;
11637
+ _objectWithoutProperties(_ref, _excluded$9);
11638
+ return {
11639
+ chart: {
11640
+ type: "pie",
11641
+ events: {
11642
+ render: function () {
11643
+ const chart = this,
11644
+ series = chart.series[0];
11645
+ let customLabel = chart.customLabel;
11646
+ if (!customLabel) {
11647
+ customLabel = chart.customLabel = chart.renderer.label("<strong>".concat(centerValue, "</strong><br/>").concat(centerLabel), 0, 0, undefined, undefined, undefined, true, undefined, "center").css({
11648
+ textAlign: "center"
11649
+ }).add();
11650
+ }
11651
+ const x = series.center[0] + chart.plotLeft;
11652
+ const y = series.center[1] + chart.plotTop - customLabel.getBBox().height / 2;
11653
+ customLabel.attr({
11654
+ x,
11655
+ y
11656
+ });
11657
+
11658
+ // Set font size and colour via configuration options
11659
+ customLabel.attr({
11660
+ text: "<span style=\"color: #0F193D; font-size: 24px; font-weight: 800\">".concat(centerValue, "</span><br/><span style=\"font-size: 12px; color: #878C9E\">").concat(centerLabel, "</span>"),
11661
+ align: "center",
11662
+ verticalAlign: "middle",
11663
+ x: x,
11664
+ y: y
11665
+ });
11666
+ }
11667
+ }
11668
+ },
11669
+ title: {
11670
+ text: ""
11671
+ },
11672
+ exporting: {
11673
+ enabled: false
11674
+ },
11675
+ tooltip: {
11676
+ pointFormat: "{series.name}: <b>{point.percentage:.0f}%</b>"
11677
+ },
11678
+ legend: !withLegend ? {
11679
+ enabled: false
11680
+ } : _objectSpread$1(_objectSpread$1({}, {
11681
+ enabled: true,
11682
+ layout: "vertical",
11683
+ verticalAlign: "middle",
11684
+ align: "right",
11685
+ labelFormat: '{name} <span style="opacity: 0.4">{y}</span>'
11686
+ }), withLegend && typeof withLegend !== "boolean" ? withLegend : {}),
11687
+ plotOptions: {
11688
+ pie: {
11689
+ allowPointSelect: true,
11690
+ cursor: "pointer",
11691
+ paddingLeft: 0,
11692
+ borderRadius: 8,
11693
+ dataLabels: {
11694
+ enabled: true,
11695
+ format: "{point.percentage:.0f}%",
11696
+ distance: -30,
11697
+ style: {
11698
+ fontWeight: "bold",
11699
+ fontSize: "15px",
11700
+ textOutline: "1px contrast"
11701
+ }
11702
+ },
11703
+ showInLegend: true
11704
+ }
11705
+ },
11706
+ credits: {
11707
+ enabled: false
11708
+ },
11709
+ series: []
11710
+ };
11711
+ };
11712
+
11713
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11714
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11715
+ const DonutChart = props => {
11716
+ const chartRef = React.useRef(null);
11717
+ const chartOptions = React.useMemo(() => {
11718
+ const area = _objectSpread({}, props);
11719
+ return _objectSpread(_objectSpread({}, initChart(area)), initSeries(area));
11720
+ }, [props]);
11721
+ React.useEffect(() => {
11722
+ if (chartRef.current && chartRef.current.chart) {
11723
+ chartRef.current.chart.update(chartOptions, true);
11724
+ }
11725
+ }, [chartOptions]);
11726
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11727
+ highcharts: Highcharts$1,
11728
+ ref: chartRef,
11729
+ options: chartOptions
11730
+ });
11731
+ };
11732
+ const initSeries = donut => {
11733
+ const {
11734
+ series,
11735
+ categories,
11736
+ colors,
11737
+ title
11738
+ } = donut;
11739
+ const data = series.map((item, index) => ({
11740
+ name: categories[index],
11741
+ y: item,
11742
+ color: colors && colors[index] ? colors[index] : "#0F193D"
11743
+ }));
11744
+ return {
11745
+ series: [{
11746
+ type: "pie",
11747
+ innerSize: "60%",
11748
+ name: title,
11749
+ data
11750
+ }]
11751
+ };
11752
+ };
11753
+
11608
11754
  const Icons = _ref => {
11609
11755
  let {
11610
11756
  name = "Home",
@@ -11750,6 +11896,7 @@ const DropdownItem = _ref2 => {
11750
11896
  activeBg = "gray.1",
11751
11897
  activeColor = "altiba",
11752
11898
  inactiveColor = "adiba",
11899
+ id,
11753
11900
  onClick
11754
11901
  } = _ref2;
11755
11902
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(core.Button, {
@@ -11758,7 +11905,8 @@ const DropdownItem = _ref2 => {
11758
11905
  mih: 70,
11759
11906
  bg: active ? activeBg : {},
11760
11907
  c: active ? activeColor : inactiveColor,
11761
- onClick: onClick
11908
+ onClick: onClick,
11909
+ "data-index": id
11762
11910
  }, /*#__PURE__*/React.createElement(core.Group, {
11763
11911
  w: 320
11764
11912
  }, /*#__PURE__*/React.createElement(Icons, icon), /*#__PURE__*/React.createElement(core.Stack, {
@@ -12778,7 +12926,6 @@ const SimpleBody = _ref => {
12778
12926
  h: 50
12779
12927
  }, columns.map((column, index) => {
12780
12928
  const columnIndex = column.id;
12781
- console.log("column: ".concat(column.id, ", type: ").concat(typeof row[column.id]));
12782
12929
  return /*#__PURE__*/React.createElement(core.Table.Td, {
12783
12930
  key: index
12784
12931
  }, typeof row[columnIndex] === 'function' ? row[columnIndex](columnIndex) : row[columnIndex] || "");
@@ -12886,6 +13033,7 @@ exports.ApplicationMenu = ApplicationMenu;
12886
13033
  exports.ApplicationPanel = ApplicationPanel;
12887
13034
  exports.AvatarLabelPanel = AvatarLabelPanel;
12888
13035
  exports.ConnectionPanel = ConnectionPanel;
13036
+ exports.DonutChart = DonutChart;
12889
13037
  exports.DynamicLogo = DynamicLogo;
12890
13038
  exports.DynamicShigaLogo = DynamicShigaLogo;
12891
13039
  exports.EqualizerColumn = EqualizerColumn;
@@ -3,8 +3,8 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import React, { useRef, useMemo, useEffect } from 'react';
4
4
  import HighchartsReact from 'highcharts-react-official';
5
5
  import HighchartsRounded from 'highcharts-rounded-corners';
6
- import * as IconSax from 'iconsax-react';
7
6
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
7
+ import * as IconSax from 'iconsax-react';
8
8
  import { Center, Image, Space, Popover, Button, Stack, Divider, Group, Text, Menu, Avatar, Badge, NavLink, Card, TextInput, ActionIcon, Box, Title, createTheme, SegmentedControl, Breadcrumbs, Anchor, ColorSwatch, AspectRatio, Overlay, rem, SimpleGrid, Indicator, Table } from '@mantine/core';
9
9
  import { Link } from 'react-router-dom';
10
10
  import { useDisclosure } from '@mantine/hooks';
@@ -17,6 +17,21 @@ import '@fontsource/poppins/600.css';
17
17
  import '@fontsource/poppins/700.css';
18
18
  import '@fontsource/poppins/800.css';
19
19
 
20
+ function _mergeNamespaces(n, m) {
21
+ m.forEach(function (e) {
22
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
23
+ if (k !== 'default' && !(k in n)) {
24
+ var d = Object.getOwnPropertyDescriptor(e, k);
25
+ Object.defineProperty(n, k, d.get ? d : {
26
+ enumerable: true,
27
+ get: function () { return e[k]; }
28
+ });
29
+ }
30
+ });
31
+ });
32
+ return Object.freeze(n);
33
+ }
34
+
20
35
  function getDefaultExportFromCjs (x) {
21
36
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
22
37
  }
@@ -11149,7 +11164,12 @@ function requireHighcharts() {
11149
11164
  var highchartsExports = requireHighcharts();
11150
11165
  var Highcharts = /*@__PURE__*/getDefaultExportFromCjs(highchartsExports);
11151
11166
 
11152
- const initChart$1 = props => {
11167
+ var Highcharts$1 = /*#__PURE__*/_mergeNamespaces({
11168
+ __proto__: null,
11169
+ default: Highcharts
11170
+ }, [highchartsExports]);
11171
+
11172
+ const initChart$2 = props => {
11153
11173
  return {
11154
11174
  chart: {
11155
11175
  type: "column",
@@ -11271,8 +11291,8 @@ const createAreaFillGradient = function (baseColor) {
11271
11291
  };
11272
11292
  };
11273
11293
 
11274
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11275
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11294
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11295
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11276
11296
 
11277
11297
  // Initialize Highcharts with rounded corners
11278
11298
  if (typeof window !== "undefined") {
@@ -11281,8 +11301,8 @@ if (typeof window !== "undefined") {
11281
11301
  const Column = props => {
11282
11302
  const chartRef = useRef(null);
11283
11303
  const chartOptions = useMemo(() => {
11284
- const column = _objectSpread$1({}, props);
11285
- return _objectSpread$1(_objectSpread$1({}, initChart$1(column)), initSeries$1(column));
11304
+ const column = _objectSpread$3({}, props);
11305
+ return _objectSpread$3(_objectSpread$3({}, initChart$2(column)), initSeries$2(column));
11286
11306
  }, [props]);
11287
11307
  useEffect(() => {
11288
11308
  if (chartRef.current && chartRef.current.chart) {
@@ -11328,7 +11348,7 @@ const StackedColumn = props => {
11328
11348
  equalizer: false
11329
11349
  }));
11330
11350
  };
11331
- const initSeries$1 = props => {
11351
+ const initSeries$2 = props => {
11332
11352
  const renderXAxis = categories => ({
11333
11353
  categories,
11334
11354
  labels: {
@@ -11385,7 +11405,7 @@ const initSeries$1 = props => {
11385
11405
  enableMouseTracking: false,
11386
11406
  showInLegend: false
11387
11407
  });
11388
- const mainSeries = _objectSpread$1(_objectSpread$1({}, fillSeries(boundary)), {
11408
+ const mainSeries = _objectSpread$3(_objectSpread$3({}, fillSeries(boundary)), {
11389
11409
  name: props.yAxisLabel[0],
11390
11410
  color: seriesColors ? seriesColors[0] : "gray",
11391
11411
  data: seriesData[0],
@@ -11425,7 +11445,7 @@ const initSeries$1 = props => {
11425
11445
  pointWidth: undefined
11426
11446
  }
11427
11447
  };
11428
- const plot = _objectSpread$1(_objectSpread$1({}, {
11448
+ const plot = _objectSpread$3(_objectSpread$3({}, {
11429
11449
  column: {
11430
11450
  borderWidth: 0,
11431
11451
  borderRadius: 10
@@ -11441,7 +11461,7 @@ const initSeries$1 = props => {
11441
11461
  };
11442
11462
  };
11443
11463
 
11444
- const initChart = props => {
11464
+ const initChart$1 = props => {
11445
11465
  return {
11446
11466
  chart: {
11447
11467
  type: "areaspline",
@@ -11480,13 +11500,13 @@ const initChart = props => {
11480
11500
  };
11481
11501
  };
11482
11502
 
11483
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11484
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11503
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11504
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11485
11505
  const Area = props => {
11486
11506
  const chartRef = useRef(null);
11487
11507
  const chartOptions = useMemo(() => {
11488
- const area = _objectSpread({}, props);
11489
- return _objectSpread(_objectSpread({}, initChart(area)), initSeries(area));
11508
+ const area = _objectSpread$2({}, props);
11509
+ return _objectSpread$2(_objectSpread$2({}, initChart$1(area)), initSeries$1(area));
11490
11510
  }, [props]);
11491
11511
  useEffect(() => {
11492
11512
  if (chartRef.current && chartRef.current.chart) {
@@ -11513,7 +11533,7 @@ const SimpleArea = props => {
11513
11533
  };
11514
11534
  return /*#__PURE__*/React.createElement(Area, chartOptions);
11515
11535
  };
11516
- const initSeries = props => {
11536
+ const initSeries$1 = props => {
11517
11537
  const renderXAxis = () => {
11518
11538
  var _props$colors;
11519
11539
  const crosshair = props.withCrossHair ? {
@@ -11547,7 +11567,7 @@ const initSeries = props => {
11547
11567
  const labels = {
11548
11568
  color: "#575E77"
11549
11569
  };
11550
- return _objectSpread(_objectSpread({}, defaults), {
11570
+ return _objectSpread$2(_objectSpread$2({}, defaults), {
11551
11571
  labels
11552
11572
  });
11553
11573
  };
@@ -11584,6 +11604,132 @@ const initSeries = props => {
11584
11604
  };
11585
11605
  };
11586
11606
 
11607
+ const _excluded$9 = ["withLegend", "centerLabel", "centerValue"];
11608
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11609
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11610
+ const initChart = _ref => {
11611
+ let {
11612
+ withLegend,
11613
+ centerLabel = "",
11614
+ centerValue = ""
11615
+ } = _ref;
11616
+ _objectWithoutProperties(_ref, _excluded$9);
11617
+ return {
11618
+ chart: {
11619
+ type: "pie",
11620
+ events: {
11621
+ render: function () {
11622
+ const chart = this,
11623
+ series = chart.series[0];
11624
+ let customLabel = chart.customLabel;
11625
+ if (!customLabel) {
11626
+ customLabel = chart.customLabel = chart.renderer.label("<strong>".concat(centerValue, "</strong><br/>").concat(centerLabel), 0, 0, undefined, undefined, undefined, true, undefined, "center").css({
11627
+ textAlign: "center"
11628
+ }).add();
11629
+ }
11630
+ const x = series.center[0] + chart.plotLeft;
11631
+ const y = series.center[1] + chart.plotTop - customLabel.getBBox().height / 2;
11632
+ customLabel.attr({
11633
+ x,
11634
+ y
11635
+ });
11636
+
11637
+ // Set font size and colour via configuration options
11638
+ customLabel.attr({
11639
+ text: "<span style=\"color: #0F193D; font-size: 24px; font-weight: 800\">".concat(centerValue, "</span><br/><span style=\"font-size: 12px; color: #878C9E\">").concat(centerLabel, "</span>"),
11640
+ align: "center",
11641
+ verticalAlign: "middle",
11642
+ x: x,
11643
+ y: y
11644
+ });
11645
+ }
11646
+ }
11647
+ },
11648
+ title: {
11649
+ text: ""
11650
+ },
11651
+ exporting: {
11652
+ enabled: false
11653
+ },
11654
+ tooltip: {
11655
+ pointFormat: "{series.name}: <b>{point.percentage:.0f}%</b>"
11656
+ },
11657
+ legend: !withLegend ? {
11658
+ enabled: false
11659
+ } : _objectSpread$1(_objectSpread$1({}, {
11660
+ enabled: true,
11661
+ layout: "vertical",
11662
+ verticalAlign: "middle",
11663
+ align: "right",
11664
+ labelFormat: '{name} <span style="opacity: 0.4">{y}</span>'
11665
+ }), withLegend && typeof withLegend !== "boolean" ? withLegend : {}),
11666
+ plotOptions: {
11667
+ pie: {
11668
+ allowPointSelect: true,
11669
+ cursor: "pointer",
11670
+ paddingLeft: 0,
11671
+ borderRadius: 8,
11672
+ dataLabels: {
11673
+ enabled: true,
11674
+ format: "{point.percentage:.0f}%",
11675
+ distance: -30,
11676
+ style: {
11677
+ fontWeight: "bold",
11678
+ fontSize: "15px",
11679
+ textOutline: "1px contrast"
11680
+ }
11681
+ },
11682
+ showInLegend: true
11683
+ }
11684
+ },
11685
+ credits: {
11686
+ enabled: false
11687
+ },
11688
+ series: []
11689
+ };
11690
+ };
11691
+
11692
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11693
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11694
+ const DonutChart = props => {
11695
+ const chartRef = useRef(null);
11696
+ const chartOptions = useMemo(() => {
11697
+ const area = _objectSpread({}, props);
11698
+ return _objectSpread(_objectSpread({}, initChart(area)), initSeries(area));
11699
+ }, [props]);
11700
+ useEffect(() => {
11701
+ if (chartRef.current && chartRef.current.chart) {
11702
+ chartRef.current.chart.update(chartOptions, true);
11703
+ }
11704
+ }, [chartOptions]);
11705
+ return /*#__PURE__*/React.createElement(HighchartsReact, {
11706
+ highcharts: Highcharts$1,
11707
+ ref: chartRef,
11708
+ options: chartOptions
11709
+ });
11710
+ };
11711
+ const initSeries = donut => {
11712
+ const {
11713
+ series,
11714
+ categories,
11715
+ colors,
11716
+ title
11717
+ } = donut;
11718
+ const data = series.map((item, index) => ({
11719
+ name: categories[index],
11720
+ y: item,
11721
+ color: colors && colors[index] ? colors[index] : "#0F193D"
11722
+ }));
11723
+ return {
11724
+ series: [{
11725
+ type: "pie",
11726
+ innerSize: "60%",
11727
+ name: title,
11728
+ data
11729
+ }]
11730
+ };
11731
+ };
11732
+
11587
11733
  const Icons = _ref => {
11588
11734
  let {
11589
11735
  name = "Home",
@@ -11729,6 +11875,7 @@ const DropdownItem = _ref2 => {
11729
11875
  activeBg = "gray.1",
11730
11876
  activeColor = "altiba",
11731
11877
  inactiveColor = "adiba",
11878
+ id,
11732
11879
  onClick
11733
11880
  } = _ref2;
11734
11881
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
@@ -11737,7 +11884,8 @@ const DropdownItem = _ref2 => {
11737
11884
  mih: 70,
11738
11885
  bg: active ? activeBg : {},
11739
11886
  c: active ? activeColor : inactiveColor,
11740
- onClick: onClick
11887
+ onClick: onClick,
11888
+ "data-index": id
11741
11889
  }, /*#__PURE__*/React.createElement(Group, {
11742
11890
  w: 320
11743
11891
  }, /*#__PURE__*/React.createElement(Icons, icon), /*#__PURE__*/React.createElement(Stack, {
@@ -12757,7 +12905,6 @@ const SimpleBody = _ref => {
12757
12905
  h: 50
12758
12906
  }, columns.map((column, index) => {
12759
12907
  const columnIndex = column.id;
12760
- console.log("column: ".concat(column.id, ", type: ").concat(typeof row[column.id]));
12761
12908
  return /*#__PURE__*/React.createElement(Table.Td, {
12762
12909
  key: index
12763
12910
  }, typeof row[columnIndex] === 'function' ? row[columnIndex](columnIndex) : row[columnIndex] || "");
@@ -12861,4 +13008,4 @@ const File = _ref => {
12861
13008
  }, /*#__PURE__*/React.createElement(Icons, rightsection === null || rightsection === void 0 ? void 0 : rightsection.icon)) : undefined)));
12862
13009
  };
12863
13010
 
12864
- export { ApplicationMenu, ApplicationPanel, AvatarLabelPanel, ConnectionPanel, DynamicLogo, DynamicShigaLogo, EqualizerColumn, File, Icons, LabelPanel, PageTitle, PaymentMethod, PaymentMethodAdd, SearchPanel, SideMenu, SimpleArea, SimpleColumn, SimplePanel, SimpleTable, SimpleText, StackedColumn, SubscriptionPlans, TitleWithIndex, TitledPanel, UserMenu, theme };
13011
+ export { ApplicationMenu, ApplicationPanel, AvatarLabelPanel, ConnectionPanel, DonutChart, DynamicLogo, DynamicShigaLogo, EqualizerColumn, File, Icons, LabelPanel, PageTitle, PaymentMethod, PaymentMethodAdd, SearchPanel, SideMenu, SimpleArea, SimpleColumn, SimplePanel, SimpleTable, SimpleText, StackedColumn, SubscriptionPlans, TitleWithIndex, TitledPanel, UserMenu, theme };
@@ -1,5 +1,6 @@
1
1
  export { SimpleColumn, EqualizerColumn, StackedColumn, } from "./charts/column/Column";
2
2
  export { SimpleArea } from "./charts/area/Area";
3
+ export { DonutChart } from "./charts/donut/Donut";
3
4
  export { Icons } from "./general/icons/Icons";
4
5
  export { DynamicLogo, DynamicShigaLogo } from "./general/logos/Logos";
5
6
  export { ApplicationMenu } from "./menus/application/Application";
@@ -127,7 +127,7 @@ export declare const theme: {
127
127
  xl?: string | undefined;
128
128
  } | undefined;
129
129
  respectReducedMotion?: boolean | undefined;
130
- cursorType?: "default" | "pointer" | undefined;
130
+ cursorType?: "pointer" | "default" | undefined;
131
131
  defaultGradient?: {
132
132
  from?: string | undefined;
133
133
  to?: string | undefined;
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.31",
4
+ "version": "0.0.33",
5
5
  "description": "An ADIBA component library for backoffice and dashboard applications",
6
6
  "license": "ISC",
7
7
  "main": "build/index.cjs.js",