@fixefy/fixefy-ui-components 0.2.56 → 0.2.58

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,5 +1,6 @@
1
1
  import React from 'react';
2
2
  export type StatisticsPropsType = {
3
+ currency?: any;
3
4
  value?: number;
4
5
  type?: 'currency' | 'percentage';
5
6
  collapsed?: boolean;
@@ -7,4 +8,4 @@ export type StatisticsPropsType = {
7
8
  structure?: any;
8
9
  filter?: object;
9
10
  };
10
- export declare function FxStatisticsBar({ value, type, label, structure, collapsed, filter, }: StatisticsPropsType): React.JSX.Element;
11
+ export declare function FxStatisticsBar({ currency, value, type, label, structure, collapsed, filter, }: StatisticsPropsType): React.JSX.Element;
@@ -84,7 +84,7 @@ function _object_spread(target) {
84
84
  }
85
85
  return target;
86
86
  }
87
- function FxStatisticsBar({ value, type = 'currency', label, structure, collapsed, filter }) {
87
+ function FxStatisticsBar({ currency, value, type = 'currency', label, structure, collapsed, filter }) {
88
88
  const _classes = (0, _statisticsstyles.useStyles)();
89
89
  const { extended, input_type, title } = structure || {};
90
90
  const { gql_operation, object_path, filter: structurefilter, variables } = extended || {};
@@ -109,7 +109,7 @@ function FxStatisticsBar({ value, type = 'currency', label, structure, collapsed
109
109
  }
110
110
  return new Intl.NumberFormat('en-US', {
111
111
  style: 'currency',
112
- currency: ((_getCurrency = (0, _fixefyuiutils.getCurrency)(null)) === null || _getCurrency === void 0 ? void 0 : _getCurrency.code.toUpperCase()) || 'USD'
112
+ currency: currency ? currency.code.toUpperCase() : ((_getCurrency = (0, _fixefyuiutils.getCurrency)(null)) === null || _getCurrency === void 0 ? void 0 : _getCurrency.code.toUpperCase()) || 'USD'
113
113
  }).format(Number(newValue)) + sign;
114
114
  };
115
115
  const checkIsCollapsed = ()=>{
@@ -140,7 +140,7 @@ function FxStatisticsBar({ value, type = 'currency', label, structure, collapsed
140
140
  var _getCurrency;
141
141
  return new Intl.NumberFormat('en-US', {
142
142
  style: 'currency',
143
- currency: ((_getCurrency = (0, _fixefyuiutils.getCurrency)(null)) === null || _getCurrency === void 0 ? void 0 : _getCurrency.code.toUpperCase()) || 'USD'
143
+ currency: currency ? currency.code.toUpperCase() : ((_getCurrency = (0, _fixefyuiutils.getCurrency)(null)) === null || _getCurrency === void 0 ? void 0 : _getCurrency.code.toUpperCase()) || 'USD'
144
144
  }).format(Number(value));
145
145
  }
146
146
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@apollo/client": "^3.10.4",
8
- "@fixefy/fixefy-ui-utils": "0.2.22",
8
+ "@fixefy/fixefy-ui-utils": "0.2.23",
9
9
  "@mui/icons-material": "^5.16.7",
10
10
  "@mui/material": "^5.16.7",
11
11
  "@mui/styled-engine": "^5.15.14",
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.2.56"
68
+ "version": "0.2.58"
69
69
  }