@fixefy/fixefy-ui-components 0.0.45 → 0.0.47

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 (93) hide show
  1. package/package.json +3 -4
  2. package/build/FxActionsTray/FxActionsTray.js +0 -351
  3. package/build/FxActionsTray/actions_tray_types.d.js +0 -4
  4. package/build/FxActionsTray/index.js +0 -11
  5. package/build/FxActionsTray/styles/actions_tray.styles.js +0 -160
  6. package/build/FxAggregationsBar/FxAggregations.js +0 -41
  7. package/build/FxAggregationsBar/aggregations_types.d.js +0 -4
  8. package/build/FxAggregationsBar/helpers/structureReader.js +0 -78
  9. package/build/FxAggregationsBar/index.js +0 -11
  10. package/build/FxAggregationsBar/operations/query.js +0 -73
  11. package/build/FxAsyncDropdown/FxAsyncDropdown.js +0 -456
  12. package/build/FxAsyncDropdown/async_dropdown_types.d.js +0 -4
  13. package/build/FxAsyncDropdown/helpers/helpers.js +0 -151
  14. package/build/FxAsyncDropdown/index.js +0 -11
  15. package/build/FxAsyncDropdown/styles/dropdown.styles.js +0 -230
  16. package/build/FxAvatar/FxAvatar.js +0 -145
  17. package/build/FxAvatar/avatar_types.d.js +0 -4
  18. package/build/FxAvatar/helpers/stringToColor.js +0 -23
  19. package/build/FxAvatar/index.js +0 -11
  20. package/build/FxAvatar/styles/avatar.styles.js +0 -193
  21. package/build/FxButton/FxButton.js +0 -106
  22. package/build/FxButton/index.js +0 -11
  23. package/build/FxButton/styles/button.styles.js +0 -23
  24. package/build/FxChip/FxChip.js +0 -37
  25. package/build/FxChip/chip_types.d.js +0 -4
  26. package/build/FxChip/index.js +0 -11
  27. package/build/FxChip/styles/chip.styles.js +0 -62
  28. package/build/FxIcon/FxIcon.js +0 -147
  29. package/build/FxIcon/content/dynamic_icon.js +0 -20
  30. package/build/FxIcon/content/index.js +0 -20
  31. package/build/FxIcon/content/lazy_icon.js +0 -137
  32. package/build/FxIcon/icon_types.d.js +0 -4
  33. package/build/FxIcon/index.js +0 -20
  34. package/build/FxModal/FxModal.js +0 -171
  35. package/build/FxModal/index.js +0 -11
  36. package/build/FxModal/modal_types.d.js +0 -4
  37. package/build/FxModal/styles/modal.style.js +0 -59
  38. package/build/FxNotes/FxNotes.js +0 -216
  39. package/build/FxNotes/helpers/stringToColor.js +0 -26
  40. package/build/FxNotes/index.js +0 -11
  41. package/build/FxNotes/note_types.d.js +0 -4
  42. package/build/FxNotes/operations/queries.js +0 -35
  43. package/build/FxNotes/styles/notes.styles.js +0 -169
  44. package/build/FxNumberField/FxNumberField.js +0 -109
  45. package/build/FxNumberField/index.js +0 -11
  46. package/build/FxNumberField/number_field_types.d.js +0 -4
  47. package/build/FxNumberField/styles/number_field.styles.js +0 -94
  48. package/build/FxProgressCircle/FxProgressCircle.js +0 -65
  49. package/build/FxProgressCircle/index.js +0 -11
  50. package/build/FxProgressCircle/progress_circle_types.d.js +0 -4
  51. package/build/FxProgressCircle/styles/progress_circle.styles.js +0 -106
  52. package/build/FxProgressCounter/ProgressCounter.js +0 -168
  53. package/build/FxProgressCounter/index.js +0 -11
  54. package/build/FxProgressCounter/progress_counter_types.d.js +0 -4
  55. package/build/FxProgressCounter/styles/progress_counter.styles.js +0 -61
  56. package/build/FxScore/FxScore.js +0 -207
  57. package/build/FxScore/index.js +0 -11
  58. package/build/FxScore/score_types.d.js +0 -4
  59. package/build/FxScore/styles/score.styles.js +0 -96
  60. package/build/FxShowMore/FxShowMore.js +0 -80
  61. package/build/FxShowMore/index.js +0 -11
  62. package/build/FxShowMore/show_more_types.d.js +0 -4
  63. package/build/FxShowMore/styles/show_more.styles.js +0 -134
  64. package/build/FxSlider/FxSlider.js +0 -49
  65. package/build/FxSlider/index.js +0 -11
  66. package/build/FxSlider/slider_types.d.js +0 -4
  67. package/build/FxStatisticsBar/FxStatisticsBar.js +0 -191
  68. package/build/FxStatisticsBar/index.js +0 -11
  69. package/build/FxStatisticsBar/statistics_bar_types.d.js +0 -4
  70. package/build/FxStatisticsBar/styles/statistics.styles.js +0 -98
  71. package/build/FxStatusBar/FxStatusBar.js +0 -143
  72. package/build/FxStatusBar/helpers/constants.js +0 -22
  73. package/build/FxStatusBar/index.js +0 -20
  74. package/build/FxStatusBar/status_bar_types.d.js +0 -4
  75. package/build/FxStatusBar/styles/statusBar.styles.js +0 -131
  76. package/build/FxStyledComponents/index.js +0 -311
  77. package/build/FxTag/FxTag.js +0 -41
  78. package/build/FxTag/fxtag_types.d.js +0 -4
  79. package/build/FxTag/index.js +0 -20
  80. package/build/FxTag/styles/tag.styles.js +0 -94
  81. package/build/FxTextField/FxTextField.js +0 -208
  82. package/build/FxTextField/index.js +0 -11
  83. package/build/FxTextField/text_field_types.d.js +0 -4
  84. package/build/FxTodo/FxTodo.js +0 -95
  85. package/build/FxTodo/index.js +0 -23
  86. package/build/FxTodo/styles/todo.styles.js +0 -183
  87. package/build/FxTodo/todo_types.d.js +0 -4
  88. package/build/FxWizard/FxWizard.js +0 -179
  89. package/build/FxWizard/WizardContext.js +0 -207
  90. package/build/FxWizard/index.js +0 -23
  91. package/build/FxWizard/styles/wizard.styles.js +0 -89
  92. package/build/FxWizard/wizard_types.d.js +0 -4
  93. package/build/index.js +0 -182
@@ -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,11 +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.FxSlider;
9
- }
10
- });
11
- const _FxSlider = require("./FxSlider");
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -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,11 +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.FxStatisticsBar;
9
- }
10
- });
11
- const _FxStatisticsBar = require("./FxStatisticsBar");
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,98 +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
- require("@fixefy/fixefy-ui-utils");
13
- function _define_property(obj, key, value) {
14
- if (key in obj) {
15
- Object.defineProperty(obj, key, {
16
- value: value,
17
- enumerable: true,
18
- configurable: true,
19
- writable: true
20
- });
21
- } else {
22
- obj[key] = value;
23
- }
24
- return obj;
25
- }
26
- function _object_spread(target) {
27
- for(var i = 1; i < arguments.length; i++){
28
- var source = arguments[i] != null ? arguments[i] : {};
29
- var ownKeys = Object.keys(source);
30
- if (typeof Object.getOwnPropertySymbols === "function") {
31
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
32
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
33
- }));
34
- }
35
- ownKeys.forEach(function(key) {
36
- _define_property(target, key, source[key]);
37
- });
38
- }
39
- return target;
40
- }
41
- function ownKeys(object, enumerableOnly) {
42
- var keys = Object.keys(object);
43
- if (Object.getOwnPropertySymbols) {
44
- var symbols = Object.getOwnPropertySymbols(object);
45
- if (enumerableOnly) {
46
- symbols = symbols.filter(function(sym) {
47
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
48
- });
49
- }
50
- keys.push.apply(keys, symbols);
51
- }
52
- return keys;
53
- }
54
- function _object_spread_props(target, source) {
55
- source = source != null ? source : {};
56
- if (Object.getOwnPropertyDescriptors) {
57
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
58
- } else {
59
- ownKeys(Object(source)).forEach(function(key) {
60
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
61
- });
62
- }
63
- return target;
64
- }
65
- const useStyles = (0, _styles.makeStyles)((theme)=>({
66
- container: {
67
- display: 'flex',
68
- alignItems: 'center',
69
- justifyContent: 'center',
70
- flexDirection: 'column',
71
- minHeight: 56
72
- },
73
- contrastLabel: {
74
- fontWeight: 'normal',
75
- fontSize: 11,
76
- lineHeight: '16px',
77
- letterSpacing: '0.1px',
78
- opacity: 0.7,
79
- color: theme.palette.common.white,
80
- textOverflow: 'ellipsis',
81
- whiteSpace: 'nowrap'
82
- },
83
- contrastValue: {
84
- fontWeight: 600,
85
- fontSize: 19,
86
- lineHeight: '28px',
87
- letterSpacing: '0.15px',
88
- color: theme.palette.common.white
89
- },
90
- label: _object_spread_props(_object_spread({}, theme.typography.table), {
91
- color: theme.palette.statistics.label,
92
- textOverflow: 'ellipsis',
93
- whiteSpace: 'nowrap'
94
- }),
95
- value: _object_spread_props(_object_spread({}, theme.typography.h5), {
96
- color: theme.palette.statistics.value
97
- })
98
- }));
@@ -1,143 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "FxStatusBar", {
6
- enumerable: true,
7
- get: function() {
8
- return FxStatusBar;
9
- }
10
- });
11
- const _jsxruntime = require("react/jsx-runtime");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
- const _material = require("@mui/material");
14
- const _FxChip = require("../FxChip");
15
- const _constants = require("./helpers/constants");
16
- const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
17
- const _statusBarstyles = require("./styles/statusBar.styles");
18
- function _getRequireWildcardCache(nodeInterop) {
19
- if (typeof WeakMap !== "function") return null;
20
- var cacheBabelInterop = new WeakMap();
21
- var cacheNodeInterop = new WeakMap();
22
- return (_getRequireWildcardCache = function(nodeInterop) {
23
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
24
- })(nodeInterop);
25
- }
26
- function _interop_require_wildcard(obj, nodeInterop) {
27
- if (!nodeInterop && obj && obj.__esModule) {
28
- return obj;
29
- }
30
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
31
- return {
32
- default: obj
33
- };
34
- }
35
- var cache = _getRequireWildcardCache(nodeInterop);
36
- if (cache && cache.has(obj)) {
37
- return cache.get(obj);
38
- }
39
- var newObj = {
40
- __proto__: null
41
- };
42
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
- for(var key in obj){
44
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
45
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
46
- if (desc && (desc.get || desc.set)) {
47
- Object.defineProperty(newObj, key, desc);
48
- } else {
49
- newObj[key] = obj[key];
50
- }
51
- }
52
- }
53
- newObj.default = obj;
54
- if (cache) {
55
- cache.set(obj, newObj);
56
- }
57
- return newObj;
58
- }
59
- const FxStatusBar = ({ onChangeStatus, onSearch, defaultStatus, title, options, chipsVariant = 'filled' })=>{
60
- const [selectedStatus, setSelectedStatus] = (0, _react.useState)([]);
61
- const [searchValue] = (0, _react.useState)('');
62
- (0, _react.useEffect)(()=>{
63
- if (defaultStatus) {
64
- typeof defaultStatus === 'string' ? setSelectedStatus([
65
- defaultStatus
66
- ]) : setSelectedStatus(defaultStatus);
67
- } else {
68
- setSelectedStatus([
69
- 'all'
70
- ]);
71
- }
72
- }, [
73
- defaultStatus
74
- ]);
75
- const onStatusClick = (status)=>{
76
- if (status === 'all') {
77
- setSelectedStatus(()=>{
78
- if (selectedStatus.includes(status)) {
79
- return [];
80
- } else {
81
- return [
82
- 'all'
83
- ];
84
- }
85
- });
86
- } else {
87
- setSelectedStatus((prevState)=>{
88
- if (selectedStatus.includes(status)) {
89
- const rv = prevState.filter((_status)=>_status !== status && _status !== 'all');
90
- return rv.length == 0 ? [
91
- 'all'
92
- ] : rv;
93
- } else {
94
- const rv = prevState.filter((_status)=>_status !== status && _status !== 'all');
95
- return [
96
- ...rv,
97
- status
98
- ];
99
- }
100
- });
101
- }
102
- };
103
- (0, _react.useEffect)(()=>{
104
- onChangeStatus(selectedStatus);
105
- }, [
106
- selectedStatus
107
- ]);
108
- (0, _react.useEffect)(()=>{
109
- onSearch && onSearch(searchValue);
110
- }, [
111
- searchValue
112
- ]);
113
- const __options = options !== null && options !== void 0 ? options : _constants.statuses;
114
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_statusBarstyles.StatusBarCard, {
115
- children: [
116
- title && /*#__PURE__*/ (0, _jsxruntime.jsx)(_statusBarstyles.StatusBarTitle, {
117
- style: {
118
- marginRight: '8px'
119
- },
120
- children: (0, _fixefyuiutils.titleCase)(title)
121
- }),
122
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
123
- direction: "row",
124
- spacing: 1,
125
- children: [
126
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_statusBarstyles.StatusChipStyled, {
127
- onClick: ()=>onStatusClick('all'),
128
- label: "All",
129
- variant: selectedStatus.includes('all') ? 'filled' : 'outlined'
130
- }),
131
- Object.keys(__options).map((key, index)=>{
132
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxChip.FxChip, {
133
- onClick: ()=>onStatusClick(__options[key]),
134
- label: (0, _fixefyuiutils.titleCase)(key),
135
- variant: chipsVariant,
136
- status: selectedStatus.includes(__options[key]) ? __options[key] : ''
137
- }, index);
138
- })
139
- ]
140
- })
141
- ]
142
- });
143
- };
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "statuses", {
6
- enumerable: true,
7
- get: function() {
8
- return statuses;
9
- }
10
- });
11
- const statuses = {
12
- Declined: 'declined',
13
- Pending: 'pending',
14
- Approved: 'approved',
15
- Active: 'active',
16
- Challenge: 'challenged',
17
- in_review: 'in_review',
18
- Discrepancy: 'discrepancy',
19
- no_pricing: 'no_pricing',
20
- in_progress: 'in_progress',
21
- Duplicated: 'duplicated'
22
- };