@fixefy/fixefy-ui-components 0.3.30 → 0.3.31

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.
Files changed (118) hide show
  1. package/dist/FxCheckbox/FxCheckbox.d.ts +9 -0
  2. package/dist/FxCheckbox/FxCheckbox.js +76 -0
  3. package/dist/FxCheckbox/index.d.ts +1 -0
  4. package/dist/{src/FxIcon → FxCheckbox}/index.js +3 -3
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +4 -0
  7. package/package.json +1 -1
  8. package/dist/FxActionButton/FxActionButton.d.ts +0 -7
  9. package/dist/FxActionButton/FxActionButton.js +0 -82
  10. package/dist/FxActionButton/index.d.ts +0 -1
  11. package/dist/FxActionButton/index.js +0 -11
  12. package/dist/FxActionsTray/styles/actions_tray.styles.d.ts +0 -8
  13. package/dist/FxActionsTray/styles/actions_tray.styles.js +0 -159
  14. package/dist/FxFilterActionButton/FxFilterActionButton.d.ts +0 -7
  15. package/dist/FxFilterActionButton/FxFilterActionButton.js +0 -82
  16. package/dist/FxFilterActionButton/index.d.ts +0 -1
  17. package/dist/FxFilterActionButton/index.js +0 -11
  18. package/dist/FxFilterSortButton/FxFilterSortButton.d.ts +0 -7
  19. package/dist/FxFilterSortButton/FxFilterSortButton.js +0 -82
  20. package/dist/FxFilterSortButton/index.d.ts +0 -1
  21. package/dist/FxFilterSortButton/index.js +0 -11
  22. package/dist/FxModalWithButton/FxModalWithButton.d.ts +0 -10
  23. package/dist/FxModalWithButton/FxModalWithButton.js +0 -131
  24. package/dist/FxModalWithButton/index.d.ts +0 -1
  25. package/dist/FxModalWithButton/index.js +0 -11
  26. package/dist/FxModalWithComponent/FxModalWithComponent.d.ts +0 -11
  27. package/dist/FxModalWithComponent/FxModalWithComponent.js +0 -102
  28. package/dist/FxModalWithComponent/index.d.ts +0 -1
  29. package/dist/FxModalWithComponent/index.js +0 -11
  30. package/dist/FxModalWithMenu/FxModalWithMenu.d.ts +0 -14
  31. package/dist/FxModalWithMenu/FxModalWithMenu.js +0 -114
  32. package/dist/FxModalWithMenu/index.d.ts +0 -1
  33. package/dist/FxModalWithMenu/index.js +0 -11
  34. package/dist/FxPopper/styles/makeStyles.d.ts +0 -16
  35. package/dist/FxPopper/styles/makeStyles.js +0 -23
  36. package/dist/FxWizard/FxWizard/FxWizard.d.ts +0 -6
  37. package/dist/FxWizard/FxWizard/FxWizard.js +0 -42
  38. package/dist/FxWizard/FxWizard/index.d.ts +0 -2
  39. package/dist/FxWizard/FxWizard/index.js +0 -19
  40. package/dist/FxWizard/FxWizard/utils/envHelpers.d.ts +0 -1
  41. package/dist/FxWizard/FxWizard/utils/envHelpers.js +0 -35
  42. package/dist/FxWizard/FxWizard/utils/index.d.ts +0 -1
  43. package/dist/FxWizard/FxWizard/utils/index.js +0 -18
  44. package/dist/FxWizard/pages/wizard/[step].d.ts +0 -9
  45. package/dist/FxWizard/pages/wizard/[step].js +0 -112
  46. package/dist/FxWizard/pages/wizard/index.d.ts +0 -1
  47. package/dist/FxWizard/pages/wizard/index.js +0 -18
  48. package/dist/src/FxActionsTray/FxActionsTray.js +0 -351
  49. package/dist/src/FxActionsTray/index.js +0 -19
  50. package/dist/src/FxActionsTray/styles/actions_tray.styles.js +0 -159
  51. package/dist/src/FxAggregationsBar/FxAggregations.js +0 -41
  52. package/dist/src/FxAggregationsBar/helpers/structureReader.js +0 -78
  53. package/dist/src/FxAggregationsBar/index.js +0 -22
  54. package/dist/src/FxAggregationsBar/operations/query.js +0 -73
  55. package/dist/src/FxAsyncDropdown/FxAsyncDropdown.js +0 -628
  56. package/dist/src/FxAsyncDropdown/helpers/helpers.js +0 -161
  57. package/dist/src/FxAsyncDropdown/index.js +0 -25
  58. package/dist/src/FxAsyncDropdown/styles/dropdown.styles.js +0 -228
  59. package/dist/src/FxAvatar/FxAvatar.js +0 -145
  60. package/dist/src/FxAvatar/helpers/stringToColor.js +0 -23
  61. package/dist/src/FxAvatar/index.js +0 -22
  62. package/dist/src/FxAvatar/styles/avatar.styles.js +0 -192
  63. package/dist/src/FxButton/FxButton.js +0 -106
  64. package/dist/src/FxButton/index.js +0 -19
  65. package/dist/src/FxButton/styles/button.styles.js +0 -23
  66. package/dist/src/FxChip/FxChip.js +0 -45
  67. package/dist/src/FxChip/index.js +0 -19
  68. package/dist/src/FxChip/styles/chip.styles.js +0 -61
  69. package/dist/src/FxFilterSortButton/FxFilterSortButton.js +0 -82
  70. package/dist/src/FxFilterSortButton/index.js +0 -11
  71. package/dist/src/FxIcon/FxIcon.js +0 -107
  72. package/dist/src/FxIcon/content/dynamic_icon.js +0 -20
  73. package/dist/src/FxIcon/content/index.js +0 -20
  74. package/dist/src/FxIcon/content/lazy_icon.js +0 -137
  75. package/dist/src/FxModal/FxModal.js +0 -170
  76. package/dist/src/FxModal/index.js +0 -19
  77. package/dist/src/FxModal/styles/modal.style.js +0 -59
  78. package/dist/src/FxModalWithButton/FxModalWithButton.js +0 -94
  79. package/dist/src/FxModalWithButton/index.js +0 -11
  80. package/dist/src/FxNotes/FxNotes.js +0 -216
  81. package/dist/src/FxNotes/helpers/stringToColor.js +0 -26
  82. package/dist/src/FxNotes/index.js +0 -22
  83. package/dist/src/FxNotes/operations/queries.js +0 -35
  84. package/dist/src/FxNotes/styles/notes.styles.js +0 -168
  85. package/dist/src/FxNumberField/FxNumberField.js +0 -109
  86. package/dist/src/FxNumberField/index.js +0 -19
  87. package/dist/src/FxNumberField/styles/number_field.styles.js +0 -94
  88. package/dist/src/FxProgressCircle/FxProgressCircle.js +0 -65
  89. package/dist/src/FxProgressCircle/index.js +0 -19
  90. package/dist/src/FxProgressCircle/styles/progress_circle.styles.js +0 -106
  91. package/dist/src/FxProgressCounter/ProgressCounter.js +0 -168
  92. package/dist/src/FxProgressCounter/index.js +0 -19
  93. package/dist/src/FxProgressCounter/styles/progress_counter.styles.js +0 -61
  94. package/dist/src/FxScore/FxScore.js +0 -207
  95. package/dist/src/FxScore/index.js +0 -19
  96. package/dist/src/FxScore/styles/score.styles.js +0 -97
  97. package/dist/src/FxShowMore/FxShowMore.js +0 -80
  98. package/dist/src/FxShowMore/index.js +0 -19
  99. package/dist/src/FxShowMore/styles/show_more.styles.js +0 -134
  100. package/dist/src/FxSlider/FxSlider.js +0 -49
  101. package/dist/src/FxSlider/index.js +0 -19
  102. package/dist/src/FxStatisticsBar/FxStatisticsBar.js +0 -191
  103. package/dist/src/FxStatisticsBar/index.js +0 -19
  104. package/dist/src/FxStatisticsBar/styles/statistics.styles.js +0 -98
  105. package/dist/src/FxStatusBar/FxStatusBar.js +0 -143
  106. package/dist/src/FxStatusBar/helpers/constants.js +0 -22
  107. package/dist/src/FxStatusBar/index.js +0 -22
  108. package/dist/src/FxStatusBar/styles/statusBar.styles.js +0 -131
  109. package/dist/src/FxStyledComponents/index.js +0 -310
  110. package/dist/src/FxTag/FxTag.js +0 -41
  111. package/dist/src/FxTag/index.js +0 -19
  112. package/dist/src/FxTag/styles/tag.styles.js +0 -100
  113. package/dist/src/FxTextField/FxTextField.js +0 -208
  114. package/dist/src/FxTextField/index.js +0 -19
  115. package/dist/src/FxTodo/FxTodo.js +0 -95
  116. package/dist/src/FxTodo/index.js +0 -22
  117. package/dist/src/FxTodo/styles/todo.styles.js +0 -183
  118. package/dist/src/index.js +0 -215
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useStyles", {
6
- enumerable: true,
7
- get: function() {
8
- return useStyles;
9
- }
10
- });
11
- const _styles = require("@mui/styles");
12
- function _define_property(obj, key, value) {
13
- if (key in obj) {
14
- Object.defineProperty(obj, key, {
15
- value: value,
16
- enumerable: true,
17
- configurable: true,
18
- writable: true
19
- });
20
- } else {
21
- obj[key] = value;
22
- }
23
- return obj;
24
- }
25
- function _object_spread(target) {
26
- for(var i = 1; i < arguments.length; i++){
27
- var source = arguments[i] != null ? arguments[i] : {};
28
- var ownKeys = Object.keys(source);
29
- if (typeof Object.getOwnPropertySymbols === "function") {
30
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
31
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
32
- }));
33
- }
34
- ownKeys.forEach(function(key) {
35
- _define_property(target, key, source[key]);
36
- });
37
- }
38
- return target;
39
- }
40
- function ownKeys(object, enumerableOnly) {
41
- var keys = Object.keys(object);
42
- if (Object.getOwnPropertySymbols) {
43
- var symbols = Object.getOwnPropertySymbols(object);
44
- if (enumerableOnly) {
45
- symbols = symbols.filter(function(sym) {
46
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
47
- });
48
- }
49
- keys.push.apply(keys, symbols);
50
- }
51
- return keys;
52
- }
53
- function _object_spread_props(target, source) {
54
- source = source != null ? source : {};
55
- if (Object.getOwnPropertyDescriptors) {
56
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
57
- } else {
58
- ownKeys(Object(source)).forEach(function(key) {
59
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
60
- });
61
- }
62
- return target;
63
- }
64
- const useStyles = (0, _styles.makeStyles)((theme)=>({
65
- container: {
66
- display: 'flex',
67
- justifyContent: 'center',
68
- alignItems: 'center',
69
- position: 'relative',
70
- color: theme.palette.common.white,
71
- backgroundColor: (props)=>theme.palette.score[props.scoreColor]
72
- },
73
- content: {
74
- position: 'absolute',
75
- display: 'flex',
76
- justifyContent: 'center',
77
- alignItems: 'center',
78
- flexDirection: 'column'
79
- },
80
- scoreNumber: {
81
- color: theme.palette.common.white,
82
- fontWeight: 700
83
- },
84
- scoreText: _object_spread_props(_object_spread({}, theme.typography.table), {
85
- fontWeight: 400,
86
- color: theme.palette.common.white,
87
- opacity: 0.6
88
- }),
89
- mainCircle: {
90
- position: 'absolute',
91
- zIndex: 2
92
- },
93
- backgroundCircle: {
94
- position: 'absolute',
95
- opacity: 0.2
96
- }
97
- }));
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "FxShowMore", {
6
- enumerable: true,
7
- get: function() {
8
- return FxShowMore;
9
- }
10
- });
11
- const _jsxruntime = require("react/jsx-runtime");
12
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
- const _material = require("@mui/material");
14
- const _show_morestyles = require("./styles/show_more.styles");
15
- const _KeyboardArrowDown = /*#__PURE__*/ _interop_require_default(require("@mui/icons-material/KeyboardArrowDown"));
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- function FxShowMore({ items, label, children, title }) {
22
- const [anchorEl, setAnchorEl] = _react.default.useState(null);
23
- const handleClick = (event)=>{
24
- setAnchorEl(event.currentTarget);
25
- };
26
- const handleClose = ()=>{
27
- setAnchorEl(null);
28
- };
29
- const open = Boolean(anchorEl);
30
- const id = open ? 'simple-popover' : undefined;
31
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_show_morestyles.ShowMoreWrapper, {
32
- children: [
33
- children,
34
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_show_morestyles.ShowMoreBtn, {
35
- onClick: handleClick,
36
- children: [
37
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_show_morestyles.ShowMoreIcon, {
38
- isOpen: open,
39
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_KeyboardArrowDown.default, {})
40
- }),
41
- title ? title : 'SHOW MORE'
42
- ]
43
- }),
44
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_show_morestyles.StyledPopover, {
45
- id: id,
46
- open: open,
47
- anchorEl: anchorEl,
48
- onClose: handleClose,
49
- anchorOrigin: {
50
- vertical: 'bottom',
51
- horizontal: 'center'
52
- },
53
- transformOrigin: {
54
- vertical: 'top',
55
- horizontal: 'center'
56
- },
57
- children: [
58
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_show_morestyles.StyledLabel, {
59
- children: [
60
- label,
61
- " (",
62
- items.length,
63
- ")"
64
- ]
65
- }),
66
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_show_morestyles.StyledDivider, {}),
67
- items === null || items === void 0 ? void 0 : items.map((item, index)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
68
- children: [
69
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
70
- variant: "body1",
71
- children: item
72
- }),
73
- index + 1 !== items.length && /*#__PURE__*/ (0, _jsxruntime.jsx)(_show_morestyles.StyledDivider, {})
74
- ]
75
- }, index))
76
- ]
77
- })
78
- ]
79
- });
80
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- FxShowMore: function() {
13
- return _FxShowMore.FxShowMore;
14
- },
15
- ShowMorePropsType: function() {
16
- return _FxShowMore.ShowMorePropsType;
17
- }
18
- });
19
- const _FxShowMore = require("./FxShowMore");
@@ -1,134 +0,0 @@
1
- // import React from 'react'
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- function _export(target, all) {
7
- for(var name in all)Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- ShowMoreBtn: function() {
14
- return ShowMoreBtn;
15
- },
16
- ShowMoreIcon: function() {
17
- return ShowMoreIcon;
18
- },
19
- ShowMoreWrapper: function() {
20
- return ShowMoreWrapper;
21
- },
22
- StyledDivider: function() {
23
- return StyledDivider;
24
- },
25
- StyledLabel: function() {
26
- return StyledLabel;
27
- },
28
- StyledPopover: function() {
29
- return StyledPopover;
30
- }
31
- });
32
- const _styles = require("@mui/material/styles");
33
- const _material = require("@mui/material");
34
- function _define_property(obj, key, value) {
35
- if (key in obj) {
36
- Object.defineProperty(obj, key, {
37
- value: value,
38
- enumerable: true,
39
- configurable: true,
40
- writable: true
41
- });
42
- } else {
43
- obj[key] = value;
44
- }
45
- return obj;
46
- }
47
- function _object_spread(target) {
48
- for(var i = 1; i < arguments.length; i++){
49
- var source = arguments[i] != null ? arguments[i] : {};
50
- var ownKeys = Object.keys(source);
51
- if (typeof Object.getOwnPropertySymbols === "function") {
52
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
53
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
54
- }));
55
- }
56
- ownKeys.forEach(function(key) {
57
- _define_property(target, key, source[key]);
58
- });
59
- }
60
- return target;
61
- }
62
- function ownKeys(object, enumerableOnly) {
63
- var keys = Object.keys(object);
64
- if (Object.getOwnPropertySymbols) {
65
- var symbols = Object.getOwnPropertySymbols(object);
66
- if (enumerableOnly) {
67
- symbols = symbols.filter(function(sym) {
68
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
69
- });
70
- }
71
- keys.push.apply(keys, symbols);
72
- }
73
- return keys;
74
- }
75
- function _object_spread_props(target, source) {
76
- source = source != null ? source : {};
77
- if (Object.getOwnPropertyDescriptors) {
78
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
79
- } else {
80
- ownKeys(Object(source)).forEach(function(key) {
81
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
82
- });
83
- }
84
- return target;
85
- }
86
- const ShowMoreWrapper = (0, _styles.styled)(_material.Box)(({})=>({
87
- borderRadius: '8px'
88
- }));
89
- const ShowMoreBtn = (0, _styles.styled)(_material.Button)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.button), {
90
- fontWeight: 600,
91
- fontSize: 12,
92
- textTransform: 'uppercase',
93
- color: theme.palette.primary[800],
94
- padding: 0,
95
- display: 'flex',
96
- justifyContent: 'flex-start',
97
- alignItems: 'center'
98
- }));
99
- const ShowMoreIcon = (0, _styles.styled)(_material.Box)(({ theme, isOpen })=>({
100
- width: 16,
101
- height: 16,
102
- color: theme.palette.primary[800],
103
- borderRadius: '50%',
104
- border: '1px solid',
105
- display: 'flex',
106
- justifyContent: 'center',
107
- alignItems: 'center',
108
- marginRight: 8,
109
- ['& svg']: {
110
- width: 14,
111
- height: 14,
112
- color: theme.palette.primary[800],
113
- transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)',
114
- transition: 'all 0.5s'
115
- }
116
- }));
117
- const StyledPopover = (0, _styles.styled)(_material.Popover)(({ theme })=>({
118
- ['.MuiPaper-root']: {
119
- background: theme.palette.common.white,
120
- boxShadow: '0px 0px 10px rgba(86, 135, 147, 0.3)',
121
- borderRadius: 8,
122
- padding: 24,
123
- marginTop: 8,
124
- minWidth: 226,
125
- maxWidth: 328
126
- }
127
- }));
128
- const StyledDivider = (0, _styles.styled)(_material.Divider)(({})=>({
129
- marginTop: 8,
130
- marginBottom: 8
131
- }));
132
- const StyledLabel = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.overLineCaption), {
133
- color: '#8B9092'
134
- }));
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "FxSlider", {
6
- enumerable: true,
7
- get: function() {
8
- return FxSlider;
9
- }
10
- });
11
- const _jsxruntime = require("react/jsx-runtime");
12
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
- const _material = require("@mui/material");
14
- function _define_property(obj, key, value) {
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
26
- }
27
- function _interop_require_default(obj) {
28
- return obj && obj.__esModule ? obj : {
29
- default: obj
30
- };
31
- }
32
- function _object_spread(target) {
33
- for(var i = 1; i < arguments.length; i++){
34
- var source = arguments[i] != null ? arguments[i] : {};
35
- var ownKeys = Object.keys(source);
36
- if (typeof Object.getOwnPropertySymbols === "function") {
37
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
38
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
39
- }));
40
- }
41
- ownKeys.forEach(function(key) {
42
- _define_property(target, key, source[key]);
43
- });
44
- }
45
- return target;
46
- }
47
- function FxSlider(props) {
48
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Slider, _object_spread({}, props));
49
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- FxSlider: function() {
13
- return _FxSlider.FxSlider;
14
- },
15
- SliderPropsType: function() {
16
- return _FxSlider.SliderPropsType;
17
- }
18
- });
19
- const _FxSlider = require("./FxSlider");
@@ -1,191 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "FxStatisticsBar", {
6
- enumerable: true,
7
- get: function() {
8
- return FxStatisticsBar;
9
- }
10
- });
11
- const _jsxruntime = require("react/jsx-runtime");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
- const _graphqltag = require("graphql-tag");
14
- const _client = require("@apollo/client");
15
- const _material = require("@mui/material");
16
- const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
17
- const _statisticsstyles = require("./styles/statistics.styles");
18
- function _define_property(obj, key, value) {
19
- if (key in obj) {
20
- Object.defineProperty(obj, key, {
21
- value: value,
22
- enumerable: true,
23
- configurable: true,
24
- writable: true
25
- });
26
- } else {
27
- obj[key] = value;
28
- }
29
- return obj;
30
- }
31
- function _getRequireWildcardCache(nodeInterop) {
32
- if (typeof WeakMap !== "function") return null;
33
- var cacheBabelInterop = new WeakMap();
34
- var cacheNodeInterop = new WeakMap();
35
- return (_getRequireWildcardCache = function(nodeInterop) {
36
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
37
- })(nodeInterop);
38
- }
39
- function _interop_require_wildcard(obj, nodeInterop) {
40
- if (!nodeInterop && obj && obj.__esModule) {
41
- return obj;
42
- }
43
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
44
- return {
45
- default: obj
46
- };
47
- }
48
- var cache = _getRequireWildcardCache(nodeInterop);
49
- if (cache && cache.has(obj)) {
50
- return cache.get(obj);
51
- }
52
- var newObj = {
53
- __proto__: null
54
- };
55
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
56
- for(var key in obj){
57
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
58
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
59
- if (desc && (desc.get || desc.set)) {
60
- Object.defineProperty(newObj, key, desc);
61
- } else {
62
- newObj[key] = obj[key];
63
- }
64
- }
65
- }
66
- newObj.default = obj;
67
- if (cache) {
68
- cache.set(obj, newObj);
69
- }
70
- return newObj;
71
- }
72
- function _object_spread(target) {
73
- for(var i = 1; i < arguments.length; i++){
74
- var source = arguments[i] != null ? arguments[i] : {};
75
- var ownKeys = Object.keys(source);
76
- if (typeof Object.getOwnPropertySymbols === "function") {
77
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
78
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
79
- }));
80
- }
81
- ownKeys.forEach(function(key) {
82
- _define_property(target, key, source[key]);
83
- });
84
- }
85
- return target;
86
- }
87
- function FxStatisticsBar({ value, type = 'currency', label, structure, collapsed, filter }) {
88
- const _classes = (0, _statisticsstyles.useStyles)();
89
- const { extended, input_type, title } = structure || {};
90
- const { gql_operation, object_path, filter: structurefilter, variables } = extended || {};
91
- const gqlOperation = gql_operation !== null && gql_operation !== void 0 ? gql_operation : 'query GET_SCORE($where: Json) { score: chargesAvg( where: $where data: { fields: ["score"], fragment: "{ score }" } ) }';
92
- let _filter = structurefilter;
93
- if (filter) {
94
- _filter = _object_spread({}, _filter, filter);
95
- }
96
- const [fetchData, { data, loading }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(gqlOperation));
97
- const convertValue = (value)=>{
98
- var _getCurrency;
99
- let newValue = '';
100
- let sign = '';
101
- if (value < 1000) {
102
- newValue = value;
103
- } else if (value >= 1000 && value < 1000000) {
104
- newValue = (value / 1000).toFixed(2);
105
- sign = 'K';
106
- } else {
107
- newValue = (value / 1000000).toFixed(2);
108
- sign = 'M';
109
- }
110
- return new Intl.NumberFormat('en-US', {
111
- style: 'currency',
112
- currency: ((_getCurrency = (0, _fixefyuiutils.getCurrency)(null)) === null || _getCurrency === void 0 ? void 0 : _getCurrency.code.toUpperCase()) || 'USD'
113
- }).format(Number(newValue)) + sign;
114
- };
115
- const checkIsCollapsed = ()=>{
116
- let collapsedFromStructureIsDefined = false;
117
- if (variables && variables.collapsed !== undefined && variables.collapsed !== null) {
118
- collapsedFromStructureIsDefined = true;
119
- }
120
- if (collapsedFromStructureIsDefined) {
121
- return variables.collapsed;
122
- } else {
123
- return collapsed;
124
- }
125
- };
126
- const getValue = (value)=>{
127
- const statisticsType = (input_type === null || input_type === void 0 ? void 0 : input_type.value) || type;
128
- switch(statisticsType){
129
- case 'percentage':
130
- {
131
- return new Intl.NumberFormat('en-US', {
132
- style: 'percent'
133
- }).format(Number(value));
134
- }
135
- case 'currency':
136
- {
137
- if (checkIsCollapsed()) {
138
- return convertValue(value);
139
- } else {
140
- var _getCurrency;
141
- return new Intl.NumberFormat('en-US', {
142
- style: 'currency',
143
- currency: ((_getCurrency = (0, _fixefyuiutils.getCurrency)(null)) === null || _getCurrency === void 0 ? void 0 : _getCurrency.code.toUpperCase()) || 'USD'
144
- }).format(Number(value));
145
- }
146
- }
147
- default:
148
- return value;
149
- }
150
- };
151
- (0, _react.useEffect)(()=>{
152
- if (!value && structure) {
153
- fetchData({
154
- variables: {
155
- where: _object_spread({}, _filter)
156
- }
157
- });
158
- }
159
- }, []);
160
- const statisticsTitle = label ? label : title;
161
- const statisticsValue = data && data[object_path] != null ? getValue(data[object_path]) : getValue(value);
162
- return loading ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
163
- sx: {
164
- width: 100
165
- },
166
- children: [
167
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
168
- animation: "wave",
169
- width: 100,
170
- height: 30
171
- }),
172
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
173
- animation: "wave",
174
- width: 100,
175
- height: 20
176
- })
177
- ]
178
- }) : /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
179
- className: _classes.container,
180
- children: [
181
- /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
182
- className: (variables === null || variables === void 0 ? void 0 : variables.contrast) ? _classes.contrastValue : _classes.value,
183
- children: statisticsValue
184
- }),
185
- /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
186
- className: (variables === null || variables === void 0 ? void 0 : variables.contrast) ? _classes.contrastLabel : _classes.label,
187
- children: (0, _fixefyuiutils.titleCase)(statisticsTitle)
188
- })
189
- ]
190
- });
191
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- FxStatisticsBar: function() {
13
- return _FxStatisticsBar.FxStatisticsBar;
14
- },
15
- StatisticsPropsType: function() {
16
- return _FxStatisticsBar.StatisticsPropsType;
17
- }
18
- });
19
- const _FxStatisticsBar = require("./FxStatisticsBar");