@fixefy/fixefy-ui-components 0.3.29 → 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 (122) hide show
  1. package/dist/{FxModalWithComponent/FxModalWithComponent.d.ts → FxButtonModalWithComponent/FxButtonModalWithComponent.d.ts} +1 -1
  2. package/dist/{FxModalWithComponent/FxModalWithComponent.js → FxButtonModalWithComponent/FxButtonModalWithComponent.js} +3 -3
  3. package/dist/FxButtonModalWithComponent/index.d.ts +1 -0
  4. package/dist/FxButtonModalWithComponent/index.js +11 -0
  5. package/dist/{FxModalWithMenu/FxModalWithMenu.d.ts → FxButtonModalWithMenu/FxButtonModalWithMenu.d.ts} +1 -1
  6. package/dist/{FxModalWithMenu/FxModalWithMenu.js → FxButtonModalWithMenu/FxButtonModalWithMenu.js} +3 -3
  7. package/dist/FxButtonModalWithMenu/index.d.ts +1 -0
  8. package/dist/FxButtonModalWithMenu/index.js +11 -0
  9. package/dist/FxCheckbox/FxCheckbox.d.ts +9 -0
  10. package/dist/FxCheckbox/FxCheckbox.js +76 -0
  11. package/dist/FxCheckbox/index.d.ts +1 -0
  12. package/dist/{src/FxIcon → FxCheckbox}/index.js +3 -3
  13. package/dist/index.d.ts +3 -2
  14. package/dist/index.js +12 -8
  15. package/package.json +1 -1
  16. package/dist/FxActionButton/FxActionButton.d.ts +0 -7
  17. package/dist/FxActionButton/FxActionButton.js +0 -82
  18. package/dist/FxActionButton/index.d.ts +0 -1
  19. package/dist/FxActionButton/index.js +0 -11
  20. package/dist/FxActionsTray/styles/actions_tray.styles.d.ts +0 -8
  21. package/dist/FxActionsTray/styles/actions_tray.styles.js +0 -159
  22. package/dist/FxFilterActionButton/FxFilterActionButton.d.ts +0 -7
  23. package/dist/FxFilterActionButton/FxFilterActionButton.js +0 -82
  24. package/dist/FxFilterActionButton/index.d.ts +0 -1
  25. package/dist/FxFilterActionButton/index.js +0 -11
  26. package/dist/FxFilterSortButton/FxFilterSortButton.d.ts +0 -7
  27. package/dist/FxFilterSortButton/FxFilterSortButton.js +0 -82
  28. package/dist/FxFilterSortButton/index.d.ts +0 -1
  29. package/dist/FxFilterSortButton/index.js +0 -11
  30. package/dist/FxModalWithButton/FxModalWithButton.d.ts +0 -10
  31. package/dist/FxModalWithButton/FxModalWithButton.js +0 -131
  32. package/dist/FxModalWithButton/index.d.ts +0 -1
  33. package/dist/FxModalWithButton/index.js +0 -11
  34. package/dist/FxModalWithComponent/index.d.ts +0 -1
  35. package/dist/FxModalWithComponent/index.js +0 -11
  36. package/dist/FxModalWithMenu/index.d.ts +0 -1
  37. package/dist/FxModalWithMenu/index.js +0 -11
  38. package/dist/FxPopper/styles/makeStyles.d.ts +0 -16
  39. package/dist/FxPopper/styles/makeStyles.js +0 -23
  40. package/dist/FxWizard/FxWizard/FxWizard.d.ts +0 -6
  41. package/dist/FxWizard/FxWizard/FxWizard.js +0 -42
  42. package/dist/FxWizard/FxWizard/index.d.ts +0 -2
  43. package/dist/FxWizard/FxWizard/index.js +0 -19
  44. package/dist/FxWizard/FxWizard/utils/envHelpers.d.ts +0 -1
  45. package/dist/FxWizard/FxWizard/utils/envHelpers.js +0 -35
  46. package/dist/FxWizard/FxWizard/utils/index.d.ts +0 -1
  47. package/dist/FxWizard/FxWizard/utils/index.js +0 -18
  48. package/dist/FxWizard/pages/wizard/[step].d.ts +0 -9
  49. package/dist/FxWizard/pages/wizard/[step].js +0 -112
  50. package/dist/FxWizard/pages/wizard/index.d.ts +0 -1
  51. package/dist/FxWizard/pages/wizard/index.js +0 -18
  52. package/dist/src/FxActionsTray/FxActionsTray.js +0 -351
  53. package/dist/src/FxActionsTray/index.js +0 -19
  54. package/dist/src/FxActionsTray/styles/actions_tray.styles.js +0 -159
  55. package/dist/src/FxAggregationsBar/FxAggregations.js +0 -41
  56. package/dist/src/FxAggregationsBar/helpers/structureReader.js +0 -78
  57. package/dist/src/FxAggregationsBar/index.js +0 -22
  58. package/dist/src/FxAggregationsBar/operations/query.js +0 -73
  59. package/dist/src/FxAsyncDropdown/FxAsyncDropdown.js +0 -628
  60. package/dist/src/FxAsyncDropdown/helpers/helpers.js +0 -161
  61. package/dist/src/FxAsyncDropdown/index.js +0 -25
  62. package/dist/src/FxAsyncDropdown/styles/dropdown.styles.js +0 -228
  63. package/dist/src/FxAvatar/FxAvatar.js +0 -145
  64. package/dist/src/FxAvatar/helpers/stringToColor.js +0 -23
  65. package/dist/src/FxAvatar/index.js +0 -22
  66. package/dist/src/FxAvatar/styles/avatar.styles.js +0 -192
  67. package/dist/src/FxButton/FxButton.js +0 -106
  68. package/dist/src/FxButton/index.js +0 -19
  69. package/dist/src/FxButton/styles/button.styles.js +0 -23
  70. package/dist/src/FxChip/FxChip.js +0 -45
  71. package/dist/src/FxChip/index.js +0 -19
  72. package/dist/src/FxChip/styles/chip.styles.js +0 -61
  73. package/dist/src/FxFilterSortButton/FxFilterSortButton.js +0 -82
  74. package/dist/src/FxFilterSortButton/index.js +0 -11
  75. package/dist/src/FxIcon/FxIcon.js +0 -107
  76. package/dist/src/FxIcon/content/dynamic_icon.js +0 -20
  77. package/dist/src/FxIcon/content/index.js +0 -20
  78. package/dist/src/FxIcon/content/lazy_icon.js +0 -137
  79. package/dist/src/FxModal/FxModal.js +0 -170
  80. package/dist/src/FxModal/index.js +0 -19
  81. package/dist/src/FxModal/styles/modal.style.js +0 -59
  82. package/dist/src/FxModalWithButton/FxModalWithButton.js +0 -94
  83. package/dist/src/FxModalWithButton/index.js +0 -11
  84. package/dist/src/FxNotes/FxNotes.js +0 -216
  85. package/dist/src/FxNotes/helpers/stringToColor.js +0 -26
  86. package/dist/src/FxNotes/index.js +0 -22
  87. package/dist/src/FxNotes/operations/queries.js +0 -35
  88. package/dist/src/FxNotes/styles/notes.styles.js +0 -168
  89. package/dist/src/FxNumberField/FxNumberField.js +0 -109
  90. package/dist/src/FxNumberField/index.js +0 -19
  91. package/dist/src/FxNumberField/styles/number_field.styles.js +0 -94
  92. package/dist/src/FxProgressCircle/FxProgressCircle.js +0 -65
  93. package/dist/src/FxProgressCircle/index.js +0 -19
  94. package/dist/src/FxProgressCircle/styles/progress_circle.styles.js +0 -106
  95. package/dist/src/FxProgressCounter/ProgressCounter.js +0 -168
  96. package/dist/src/FxProgressCounter/index.js +0 -19
  97. package/dist/src/FxProgressCounter/styles/progress_counter.styles.js +0 -61
  98. package/dist/src/FxScore/FxScore.js +0 -207
  99. package/dist/src/FxScore/index.js +0 -19
  100. package/dist/src/FxScore/styles/score.styles.js +0 -97
  101. package/dist/src/FxShowMore/FxShowMore.js +0 -80
  102. package/dist/src/FxShowMore/index.js +0 -19
  103. package/dist/src/FxShowMore/styles/show_more.styles.js +0 -134
  104. package/dist/src/FxSlider/FxSlider.js +0 -49
  105. package/dist/src/FxSlider/index.js +0 -19
  106. package/dist/src/FxStatisticsBar/FxStatisticsBar.js +0 -191
  107. package/dist/src/FxStatisticsBar/index.js +0 -19
  108. package/dist/src/FxStatisticsBar/styles/statistics.styles.js +0 -98
  109. package/dist/src/FxStatusBar/FxStatusBar.js +0 -143
  110. package/dist/src/FxStatusBar/helpers/constants.js +0 -22
  111. package/dist/src/FxStatusBar/index.js +0 -22
  112. package/dist/src/FxStatusBar/styles/statusBar.styles.js +0 -131
  113. package/dist/src/FxStyledComponents/index.js +0 -310
  114. package/dist/src/FxTag/FxTag.js +0 -41
  115. package/dist/src/FxTag/index.js +0 -19
  116. package/dist/src/FxTag/styles/tag.styles.js +0 -100
  117. package/dist/src/FxTextField/FxTextField.js +0 -208
  118. package/dist/src/FxTextField/index.js +0 -19
  119. package/dist/src/FxTodo/FxTodo.js +0 -95
  120. package/dist/src/FxTodo/index.js +0 -22
  121. package/dist/src/FxTodo/styles/todo.styles.js +0 -183
  122. package/dist/src/index.js +0 -215
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "FxProgressCircle", {
6
- enumerable: true,
7
- get: function() {
8
- return FxProgressCircle;
9
- }
10
- });
11
- const _jsxruntime = require("react/jsx-runtime");
12
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
- const _progress_circlestyles = require("./styles/progress_circle.styles");
14
- function _interop_require_default(obj) {
15
- return obj && obj.__esModule ? obj : {
16
- default: obj
17
- };
18
- }
19
- const FxProgressCircle = ({ radius = 70, border = 70, value, hasLabel = true, max = 100, color, type = 'progress' })=>{
20
- const _value = value ? value / max : 0;
21
- const p = 2 * Math.PI * (radius - border / 2);
22
- const strokeWidth = border;
23
- const strokeDashoffset = p * (1 - _value);
24
- const strokeDasharray = p;
25
- const label = type === 'progress' ? `${value}/${max}` : `${value.toFixed()}%`;
26
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_progress_circlestyles.Container, {
27
- children: [
28
- hasLabel && type === 'progress' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_progress_circlestyles.Label, {
29
- children: label
30
- }),
31
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_progress_circlestyles.Slider, {
32
- // ref={(potar) => (potar = potar)}
33
- viewBox: `0 0 ${radius * 2} ${radius * 2}`,
34
- children: [
35
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_progress_circlestyles.SliderCircle, {
36
- style: {
37
- strokeWidth
38
- },
39
- r: radius - border / 2,
40
- cx: radius,
41
- cy: radius,
42
- color: color
43
- }),
44
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_progress_circlestyles.SliderBar, {
45
- style: {
46
- strokeWidth,
47
- strokeDashoffset,
48
- strokeDasharray
49
- },
50
- r: radius - border / 2,
51
- cx: radius,
52
- cy: radius,
53
- color: color
54
- })
55
- ]
56
- }),
57
- hasLabel && type === 'percentage' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_progress_circlestyles.Label, {
58
- sx: {
59
- ml: 1
60
- },
61
- children: label
62
- })
63
- ]
64
- });
65
- };
@@ -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
- FxProgressCircle: function() {
13
- return _FxProgressCircle.FxProgressCircle;
14
- },
15
- ProgressCirclePropsType: function() {
16
- return _FxProgressCircle.ProgressCirclePropsType;
17
- }
18
- });
19
- const _FxProgressCircle = require("./FxProgressCircle");
@@ -1,106 +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
- Container: function() {
13
- return Container;
14
- },
15
- Label: function() {
16
- return Label;
17
- },
18
- Slider: function() {
19
- return Slider;
20
- },
21
- SliderBar: function() {
22
- return SliderBar;
23
- },
24
- SliderCircle: function() {
25
- return SliderCircle;
26
- }
27
- });
28
- const _styles = require("@mui/material/styles");
29
- function _define_property(obj, key, value) {
30
- if (key in obj) {
31
- Object.defineProperty(obj, key, {
32
- value: value,
33
- enumerable: true,
34
- configurable: true,
35
- writable: true
36
- });
37
- } else {
38
- obj[key] = value;
39
- }
40
- return obj;
41
- }
42
- function _object_spread(target) {
43
- for(var i = 1; i < arguments.length; i++){
44
- var source = arguments[i] != null ? arguments[i] : {};
45
- var ownKeys = Object.keys(source);
46
- if (typeof Object.getOwnPropertySymbols === "function") {
47
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
48
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
49
- }));
50
- }
51
- ownKeys.forEach(function(key) {
52
- _define_property(target, key, source[key]);
53
- });
54
- }
55
- return target;
56
- }
57
- function ownKeys(object, enumerableOnly) {
58
- var keys = Object.keys(object);
59
- if (Object.getOwnPropertySymbols) {
60
- var symbols = Object.getOwnPropertySymbols(object);
61
- if (enumerableOnly) {
62
- symbols = symbols.filter(function(sym) {
63
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
64
- });
65
- }
66
- keys.push.apply(keys, symbols);
67
- }
68
- return keys;
69
- }
70
- function _object_spread_props(target, source) {
71
- source = source != null ? source : {};
72
- if (Object.getOwnPropertyDescriptors) {
73
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
74
- } else {
75
- ownKeys(Object(source)).forEach(function(key) {
76
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
77
- });
78
- }
79
- return target;
80
- }
81
- const Container = (0, _styles.styled)("div")(({})=>({
82
- display: "flex",
83
- alignItems: "center",
84
- justifyContent: "center"
85
- }));
86
- const Label = (0, _styles.styled)("span")(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.body1), {
87
- color: theme.palette.typography.title,
88
- marginRight: 8
89
- }));
90
- const Slider = (0, _styles.styled)("svg")(({})=>({
91
- display: "block",
92
- width: 22,
93
- height: 22,
94
- transform: "rotate(-90deg)"
95
- }));
96
- const SliderCircle = (0, _styles.styled)("circle")(({ theme, color })=>({
97
- fill: "transparent",
98
- stroke: color !== null && color !== void 0 ? color : theme.palette.green2scale.main,
99
- opacity: 0.1
100
- }));
101
- const SliderBar = (0, _styles.styled)("circle")(({ theme, color })=>({
102
- fill: "transparent",
103
- stroke: color !== null && color !== void 0 ? color : theme.palette.green2scale.main,
104
- strokeDashoffset: 0,
105
- strokeDasharray: 0
106
- }));
@@ -1,168 +0,0 @@
1
- // @ts-nocheck
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "FxProgressCounter", {
7
- enumerable: true,
8
- get: function() {
9
- return FxProgressCounter;
10
- }
11
- });
12
- const _jsxruntime = require("react/jsx-runtime");
13
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
14
- const _material = require("@mui/material");
15
- const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
16
- const _progress_counterstyles = require("./styles/progress_counter.styles");
17
- const _image = /*#__PURE__*/ _interop_require_default(require("next/image"));
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 _interop_require_default(obj) {
32
- return obj && obj.__esModule ? obj : {
33
- default: obj
34
- };
35
- }
36
- function _object_spread(target) {
37
- for(var i = 1; i < arguments.length; i++){
38
- var source = arguments[i] != null ? arguments[i] : {};
39
- var ownKeys = Object.keys(source);
40
- if (typeof Object.getOwnPropertySymbols === "function") {
41
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
42
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
43
- }));
44
- }
45
- ownKeys.forEach(function(key) {
46
- _define_property(target, key, source[key]);
47
- });
48
- }
49
- return target;
50
- }
51
- function _object_without_properties(source, excluded) {
52
- if (source == null) return {};
53
- var target = _object_without_properties_loose(source, excluded);
54
- var key, i;
55
- if (Object.getOwnPropertySymbols) {
56
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
57
- for(i = 0; i < sourceSymbolKeys.length; i++){
58
- key = sourceSymbolKeys[i];
59
- if (excluded.indexOf(key) >= 0) continue;
60
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
61
- target[key] = source[key];
62
- }
63
- }
64
- return target;
65
- }
66
- function _object_without_properties_loose(source, excluded) {
67
- if (source == null) return {};
68
- var target = {};
69
- var sourceKeys = Object.keys(source);
70
- var key, i;
71
- for(i = 0; i < sourceKeys.length; i++){
72
- key = sourceKeys[i];
73
- if (excluded.indexOf(key) >= 0) continue;
74
- target[key] = source[key];
75
- }
76
- return target;
77
- }
78
- function FxProgressCounter(_param) {
79
- var { values, structure, filter } = _param, rest = _object_without_properties(_param, [
80
- "values",
81
- "structure",
82
- "filter"
83
- ]);
84
- var _values_count, _values_current;
85
- // const { extended, title } = structure ?? {};
86
- // const {
87
- // gql_operation,
88
- // object_path: objectPath,
89
- // title_path: titlePath,
90
- // filter: structureFilter,
91
- // } = extended ?? {};
92
- const initialValues = {
93
- count: (_values_count = values === null || values === void 0 ? void 0 : values.count) !== null && _values_count !== void 0 ? _values_count : 0,
94
- current: (_values_current = values === null || values === void 0 ? void 0 : values.current) !== null && _values_current !== void 0 ? _values_current : 0
95
- };
96
- // let _filter = structureFilter;
97
- // if (filter) {
98
- // _filter = {
99
- // ..._filter,
100
- // ...filter,
101
- // };
102
- // }
103
- // const { data, error, loading } = useQuery(gql(gql_operation), {
104
- // variables: {
105
- // where: { ..._filter },
106
- // },
107
- // });
108
- const normalizeNumber = (number)=>{
109
- return number / initialValues.count * 100;
110
- };
111
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_progress_counterstyles.Container, {
112
- children: [
113
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
114
- position: 'relative',
115
- textAlign: 'center',
116
- justifyContent: 'center',
117
- mt: 1.2,
118
- children: [
119
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_image.default, {
120
- alt: 'approve',
121
- width: 16,
122
- height: 16,
123
- loader: ()=>(0, _fixefyuiutils.imageLoader)({
124
- root: 'https://cdn-dev.fixefy.me/',
125
- src: 'invoices/approve-small-white.svg'
126
- }),
127
- src: 'invoices/approve-small-white.svg',
128
- onLoad: ()=>console.log('loaded'),
129
- onError: (e)=>console.log('error:', e)
130
- }),
131
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
132
- mt: 0.5,
133
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
134
- fontSize: 19,
135
- fontWeight: 600,
136
- children: [
137
- initialValues.current,
138
- "/",
139
- initialValues.count
140
- ]
141
- })
142
- }),
143
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
144
- fontSize: 11,
145
- sx: {
146
- opacity: 0.6
147
- },
148
- children: "Charges"
149
- })
150
- ]
151
- }),
152
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_progress_counterstyles.ProgressContainer, {
153
- children: [
154
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_progress_counterstyles.MainBar, _object_spread({
155
- variant: "determinate",
156
- value: normalizeNumber(initialValues.current),
157
- color: 'inherit'
158
- }, rest)),
159
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_progress_counterstyles.BackgroundBar, _object_spread({
160
- variant: "determinate",
161
- value: initialValues.count > 100 ? 100 : initialValues.count,
162
- color: 'inherit'
163
- }, rest))
164
- ]
165
- })
166
- ]
167
- });
168
- }
@@ -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
- FxProgressCounter: function() {
13
- return _ProgressCounter.FxProgressCounter;
14
- },
15
- ProgressCounterPropsType: function() {
16
- return _ProgressCounter.ProgressCounterPropsType;
17
- }
18
- });
19
- const _ProgressCounter = require("./ProgressCounter");
@@ -1,61 +0,0 @@
1
- // @ts-nocheck
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
- BackgroundBar: function() {
14
- return BackgroundBar;
15
- },
16
- BaseProgress: function() {
17
- return BaseProgress;
18
- },
19
- Container: function() {
20
- return Container;
21
- },
22
- MainBar: function() {
23
- return MainBar;
24
- },
25
- ProgressContainer: function() {
26
- return ProgressContainer;
27
- }
28
- });
29
- const _styles = require("@mui/material/styles");
30
- const _material = require("@mui/material");
31
- const BaseProgress = (0, _styles.styled)(_material.LinearProgress)(({ theme })=>({
32
- borderRadius: '8px',
33
- width: '70%',
34
- position: 'absolute',
35
- zIndex: 2,
36
- height: 3
37
- }));
38
- const MainBar = (0, _styles.styled)(BaseProgress)(({ theme })=>({
39
- opacity: 1
40
- }));
41
- const BackgroundBar = (0, _styles.styled)(BaseProgress)(({ theme })=>({
42
- opacity: 0.2
43
- }));
44
- const ProgressContainer = (0, _styles.styled)(_material.Box)(({ theme })=>({
45
- alignItems: 'center',
46
- display: 'flex',
47
- width: '100%',
48
- margin: '8px 0',
49
- position: 'relative',
50
- justifyContent: 'center'
51
- }));
52
- const Container = (0, _styles.styled)(_material.Box)(({ theme })=>({
53
- width: 104,
54
- height: 104,
55
- minWidth: 104,
56
- maxWidth: 104,
57
- borderRadius: 8,
58
- position: 'relative',
59
- color: theme.palette.common.white,
60
- backgroundColor: theme.palette.score.excellent
61
- }));
@@ -1,207 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "FxScore", {
6
- enumerable: true,
7
- get: function() {
8
- return FxScore;
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 _scorestyles = require("./styles/score.styles");
16
- const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
17
- const _material = require("@mui/material");
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 _object_without_properties(source, excluded) {
88
- if (source == null) return {};
89
- var target = _object_without_properties_loose(source, excluded);
90
- var key, i;
91
- if (Object.getOwnPropertySymbols) {
92
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
93
- for(i = 0; i < sourceSymbolKeys.length; i++){
94
- key = sourceSymbolKeys[i];
95
- if (excluded.indexOf(key) >= 0) continue;
96
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
97
- target[key] = source[key];
98
- }
99
- }
100
- return target;
101
- }
102
- function _object_without_properties_loose(source, excluded) {
103
- if (source == null) return {};
104
- var target = {};
105
- var sourceKeys = Object.keys(source);
106
- var key, i;
107
- for(i = 0; i < sourceKeys.length; i++){
108
- key = sourceKeys[i];
109
- if (excluded.indexOf(key) >= 0) continue;
110
- target[key] = source[key];
111
- }
112
- return target;
113
- }
114
- const FxScore = (_param)=>{
115
- var { value, structure, filter, variant = 'box', hasLabel = true, title: propsTitle = 'score', Sizes: propsSizes = {} } = _param, rest = _object_without_properties(_param, [
116
- "value",
117
- "structure",
118
- "filter",
119
- "variant",
120
- "hasLabel",
121
- "title",
122
- "Sizes"
123
- ]);
124
- const Sizes = _object_spread({
125
- box: {
126
- boxWidth: 104,
127
- progressWidth: 68
128
- },
129
- circle: {
130
- boxWidth: 40,
131
- progressWidth: 36
132
- }
133
- }, propsSizes);
134
- const { extended, title } = structure || {};
135
- const { gql_operation, object_path: objectPath, filter: structureFilter } = extended || {};
136
- 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 }" } ) }';
137
- let _filter = structureFilter;
138
- if (filter) {
139
- _filter = _object_spread({}, _filter, filter);
140
- }
141
- const [fetchData, { data, loading }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(gqlOperation));
142
- (0, _react.useEffect)(()=>{
143
- if (!value && structure) {
144
- fetchData({
145
- variables: {
146
- where: _object_spread({}, _filter)
147
- }
148
- });
149
- }
150
- }, []);
151
- const ScoreValue = data ? data[objectPath] * 100 : value;
152
- const _classes = (0, _scorestyles.useStyles)({
153
- scoreColor: (0, _fixefyuiutils.getScoreColor)(ScoreValue || 0),
154
- variant
155
- });
156
- var _Math_round;
157
- return loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
158
- className: _classes.container,
159
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
160
- animation: "wave",
161
- variant: "circular",
162
- width: 68,
163
- height: 68
164
- })
165
- }) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
166
- className: _classes.container,
167
- sx: {
168
- width: Sizes[variant].boxWidth,
169
- height: Sizes[variant].boxWidth,
170
- minWidth: Sizes[variant].boxWidth,
171
- maxWidth: Sizes[variant].boxWidth,
172
- borderRadius: variant === 'box' ? '8px' : '50%'
173
- },
174
- children: [
175
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, _object_spread({
176
- size: Sizes[variant].progressWidth,
177
- variant: "determinate",
178
- value: ScoreValue,
179
- color: "inherit",
180
- thickness: 2,
181
- className: _classes.mainCircle
182
- }, rest)),
183
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, _object_spread({
184
- size: Sizes[variant].progressWidth,
185
- variant: "determinate",
186
- value: 100,
187
- color: "inherit",
188
- thickness: 2,
189
- className: _classes.backgroundCircle
190
- }, rest)),
191
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
192
- className: _classes.content,
193
- children: [
194
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
195
- variant: variant === 'box' ? 'h5' : 'table',
196
- className: _classes.scoreNumber,
197
- children: `${(_Math_round = Math.round(Number(ScoreValue))) !== null && _Math_round !== void 0 ? _Math_round : 0}%`
198
- }),
199
- hasLabel && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
200
- className: _classes.scoreText,
201
- children: (0, _fixefyuiutils.titleCase)(title !== null && title !== void 0 ? title : propsTitle)
202
- })
203
- ]
204
- })
205
- ]
206
- });
207
- };
@@ -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
- FxScore: function() {
13
- return _FxScore.FxScore;
14
- },
15
- ScorePropsType: function() {
16
- return _FxScore.ScorePropsType;
17
- }
18
- });
19
- const _FxScore = require("./FxScore");