@fixefy/fixefy-ui-components 0.0.42 → 0.0.43

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 (100) hide show
  1. package/build/FxButton/styles/button.styles.js +0 -6
  2. package/package.json +7 -7
  3. package/.prettierrc.json +0 -10
  4. package/.swcrc +0 -20
  5. package/src/FxActionsTray/FxActionsTray.tsx +0 -293
  6. package/src/FxActionsTray/actions_tray_types.d.ts +0 -15
  7. package/src/FxActionsTray/index.ts +0 -3
  8. package/src/FxActionsTray/styles/actions_tray.styles.tsx +0 -90
  9. package/src/FxAggregationsBar/FxAggregations.tsx +0 -32
  10. package/src/FxAggregationsBar/aggregations_types.d.ts +0 -21
  11. package/src/FxAggregationsBar/helpers/structureReader.tsx +0 -66
  12. package/src/FxAggregationsBar/index.ts +0 -2
  13. package/src/FxAggregationsBar/operations/query.ts +0 -64
  14. package/src/FxAsyncDropdown/FxAsyncDropdown.tsx +0 -362
  15. package/src/FxAsyncDropdown/async_dropdown_types.d.ts +0 -40
  16. package/src/FxAsyncDropdown/helpers/helpers.ts +0 -105
  17. package/src/FxAsyncDropdown/index.ts +0 -2
  18. package/src/FxAsyncDropdown/styles/dropdown.styles.tsx +0 -162
  19. package/src/FxAvatar/FxAvatar.tsx +0 -50
  20. package/src/FxAvatar/avatar_types.d.ts +0 -11
  21. package/src/FxAvatar/helpers/stringToColor.ts +0 -16
  22. package/src/FxAvatar/index.ts +0 -2
  23. package/src/FxAvatar/styles/avatar.styles.tsx +0 -82
  24. package/src/FxButton/FxButton.tsx +0 -11
  25. package/src/FxButton/index.ts +0 -2
  26. package/src/FxButton/styles/button.styles.jsx +0 -16
  27. package/src/FxButton/styles/button.styles.tsx +0 -14
  28. package/src/FxChip/FxChip.tsx +0 -14
  29. package/src/FxChip/chip_types.d.ts +0 -34
  30. package/src/FxChip/index.ts +0 -2
  31. package/src/FxChip/styles/chip.styles.tsx +0 -51
  32. package/src/FxIcon/FxIcon.tsx +0 -34
  33. package/src/FxIcon/content/dynamic_icon.tsx +0 -3
  34. package/src/FxIcon/content/index.ts +0 -2
  35. package/src/FxIcon/content/lazy_icon.tsx +0 -48
  36. package/src/FxIcon/icon_types.d.ts +0 -10
  37. package/src/FxIcon/index.ts +0 -2
  38. package/src/FxModal/FxModal.tsx +0 -44
  39. package/src/FxModal/index.ts +0 -2
  40. package/src/FxModal/modal_types.d.ts +0 -10
  41. package/src/FxModal/styles/modal.style.tsx +0 -40
  42. package/src/FxNotes/FxNotes.tsx +0 -165
  43. package/src/FxNotes/helpers/stringToColor.ts +0 -19
  44. package/src/FxNotes/index.ts +0 -2
  45. package/src/FxNotes/note_types.d.ts +0 -12
  46. package/src/FxNotes/operations/queries.ts +0 -21
  47. package/src/FxNotes/styles/notes.styles.tsx +0 -135
  48. package/src/FxNumberField/FxNumberField.tsx +0 -37
  49. package/src/FxNumberField/index.ts +0 -2
  50. package/src/FxNumberField/number_field_types.d.ts +0 -7
  51. package/src/FxNumberField/styles/number_field.styles.ts +0 -85
  52. package/src/FxProgressCircle/FxProgressCircle.tsx +0 -40
  53. package/src/FxProgressCircle/index.ts +0 -2
  54. package/src/FxProgressCircle/progress_circle_types.d.ts +0 -9
  55. package/src/FxProgressCircle/styles/progress_circle.styles.tsx +0 -33
  56. package/src/FxProgressCounter/ProgressCounter.tsx +0 -81
  57. package/src/FxProgressCounter/index.ts +0 -2
  58. package/src/FxProgressCounter/progress_counter_types.d.ts +0 -10
  59. package/src/FxProgressCounter/styles/progress_counter.styles.ts +0 -40
  60. package/src/FxScore/FxScore.tsx +0 -75
  61. package/src/FxScore/index.ts +0 -2
  62. package/src/FxScore/score_types.d.ts +0 -16
  63. package/src/FxScore/styles/score.styles.ts +0 -42
  64. package/src/FxShowMore/FxShowMore.tsx +0 -60
  65. package/src/FxShowMore/index.ts +0 -2
  66. package/src/FxShowMore/show_more_types.d.ts +0 -8
  67. package/src/FxShowMore/styles/show_more.styles.ts +0 -67
  68. package/src/FxSlider/FxSlider.tsx +0 -8
  69. package/src/FxSlider/index.ts +0 -2
  70. package/src/FxSlider/slider_types.d.ts +0 -3
  71. package/src/FxStatisticsBar/FxStatisticsBar.tsx +0 -112
  72. package/src/FxStatisticsBar/index.ts +0 -2
  73. package/src/FxStatisticsBar/statistics_bar_types.d.ts +0 -8
  74. package/src/FxStatisticsBar/styles/statistics.styles.ts +0 -41
  75. package/src/FxStatusBar/FxStatusBar.tsx +0 -66
  76. package/src/FxStatusBar/helpers/constants.ts +0 -12
  77. package/src/FxStatusBar/index.ts +0 -2
  78. package/src/FxStatusBar/status_bar_types.d.ts +0 -14
  79. package/src/FxStatusBar/styles/statusBar.styles.tsx +0 -67
  80. package/src/FxStyledComponents/index.tsx +0 -196
  81. package/src/FxTag/FxTag.tsx +0 -14
  82. package/src/FxTag/fxtag_types.d.ts +0 -4
  83. package/src/FxTag/index.ts +0 -2
  84. package/src/FxTag/styles/tag.styles.tsx +0 -24
  85. package/src/FxTextField/FxTextField.tsx +0 -117
  86. package/src/FxTextField/index.ts +0 -2
  87. package/src/FxTextField/text_field_types.d.ts +0 -20
  88. package/src/FxTodo/FxTodo.tsx +0 -58
  89. package/src/FxTodo/index.ts +0 -2
  90. package/src/FxTodo/styles/todo.styles.tsx +0 -113
  91. package/src/FxTodo/todo_types.d.ts +0 -19
  92. package/src/FxWizard/FxWizard.tsx +0 -56
  93. package/src/FxWizard/WizardContext.tsx +0 -108
  94. package/src/FxWizard/index.ts +0 -3
  95. package/src/FxWizard/styles/wizard.styles.tsx +0 -22
  96. package/src/FxWizard/wizard_types.d.ts +0 -37
  97. package/src/index.ts +0 -23
  98. package/tsconfig.json +0 -22
  99. package/webpack.config.js +0 -35
  100. package/yarn-error.log +0 -95
@@ -16,9 +16,3 @@ exports.ButtonStyled = (0, styles_1.styled)(material_1.Button)(({ theme, variant
16
16
  letterSpacing: '0.5px'
17
17
  };
18
18
  });
19
-
20
- minWidth: '87px',
21
- fontSize: '12px',
22
- letterSpacing: '0.5px'
23
- };
24
- });
package/package.json CHANGED
@@ -57,17 +57,17 @@
57
57
  "node": "18.17.1"
58
58
  },
59
59
  "files": [
60
- "*"
60
+ "build/**/*"
61
61
  ],
62
62
  "private": false,
63
- "main": "./index.js",
64
- "module": "./index.js",
63
+ "main": "./build/index.js",
64
+ "module": "./build/index.js",
65
65
  "exports": {
66
66
  ".": {
67
- "import": "./index.js",
68
- "require": "./index.js"
67
+ "import": "./builds/index.js",
68
+ "require": "./build/index.js"
69
69
  }
70
70
  },
71
- "types": "./index.d.ts",
72
- "version": "0.0.42"
71
+ "types": "./build/index.ts",
72
+ "version": "0.0.43"
73
73
  }
package/.prettierrc.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "bracketSpacing": true,
3
- "singleQuote": true,
4
- "trailingComma": "all",
5
- "tabWidth": 2,
6
- "semi": false,
7
- "printWidth": 120,
8
- "jsxSingleQuote": true,
9
- "endOfLine": "auto"
10
- }
package/.swcrc DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "jsc": {
3
- "externalHelpers": false,
4
- "target": "es2016",
5
- "parser": {
6
- "syntax": "typescript",
7
- "tsx": true,
8
- "decorators": false,
9
- "dynamicImport": true
10
- },
11
- "transform": {
12
- "react": {
13
- "runtime": "automatic"
14
- }
15
- }
16
- },
17
- "module": {
18
- "type": "commonjs"
19
- }
20
- }
@@ -1,293 +0,0 @@
1
- import React from 'react'
2
- import Image from 'next/image'
3
-
4
- import { Slide } from '@mui/material'
5
- import { imageLoader } from '@fixefy/fixefy-ui-utils'
6
- import { ActionsTrayPropsType } from './actions_tray_types'
7
-
8
- import { ActionBtn, ActionTitle, ChargesCount, ChargesTitle, Close, Container, Divider, TitleWrapper } from './styles/actions_tray.styles'
9
-
10
- export function FxActionsTray({ type, onApprove, onChallenge, show, onClose, chargesCount, container, direction = 'up' }: ActionsTrayPropsType) {
11
- const renderActions = () => {
12
- switch (type) {
13
- case 'approved':
14
- return <ApprovedActions onChallenge={onChallenge} />
15
- case 'challenge':
16
- return <ChallengeActions onChallenge={onChallenge} onApprove={onApprove} />
17
- case 'pending':
18
- return <PendingActions onApprove={onApprove} onChallenge={onChallenge} />
19
- case 'no_pricing':
20
- return <NoPricingActions onApprove={onApprove} onChallenge={onChallenge} />
21
- default:
22
- return <ApprovedActions onChallenge={onChallenge} />
23
- }
24
- }
25
- return (
26
- <div>
27
- <Slide direction={direction} in={show} mountOnEnter unmountOnExit timeout={400} container={container}>
28
- <Container>
29
- <TitleWrapper>
30
- <ChargesCount>{chargesCount}</ChargesCount>
31
- <ChargesTitle>charges selected</ChargesTitle>
32
- </TitleWrapper>
33
- <Divider />
34
- <div>
35
- {renderActions()}
36
- {/* {actions.map(({ title, name, onClick, ...action }, index) => (
37
- <ActionBtn key={index} onClick={(event) => onClick(event, name)}>
38
- <Image
39
- loader={() =>
40
- imageLoader({
41
- root: "https://cdn-dev.fixefy.me/",
42
- src: `actions/${action.extended.icon}}.svg`,
43
- })
44
- }
45
- src={`actions/${action.extended.icon}}.svg`}
46
- width={20}
47
- height={20}
48
- onLoad={() => console.log("loaded")}
49
- onError={(e) => console.log("error:", e)}
50
- />
51
- <ActionTitle>{titleCase(title)}</ActionTitle>
52
- </ActionBtn>
53
- ))} */}
54
- </div>
55
- <Divider />
56
- <div onClick={onClose}>
57
- <Close>close</Close>
58
- </div>
59
- </Container>
60
- </Slide>
61
- </div>
62
- )
63
- }
64
-
65
- const ChallengeActions = ({ onChallenge, onApprove }: { onChallenge?: () => void; onApprove?: () => void }) => {
66
- return (
67
- <>
68
- <ActionBtn onClick={onChallenge} type="low">
69
- <Image
70
- alt="challenge"
71
- loader={() =>
72
- imageLoader({
73
- root: 'https://cdn-dev.fixefy.me/',
74
- src: 'actions/challenge.svg',
75
- })
76
- }
77
- src={'actions/challenge.svg'}
78
- width={20}
79
- height={20}
80
- onLoad={() => console.log('loaded')}
81
- onError={(e: any) => console.log('error:', e)}
82
- />
83
- <ActionTitle>challenge</ActionTitle>
84
- </ActionBtn>
85
- <ActionBtn onClick={onApprove}>
86
- <Image
87
- alt="approve"
88
- loader={() =>
89
- imageLoader({
90
- root: 'https://cdn-dev.fixefy.me/',
91
- src: 'actions/approve.svg',
92
- })
93
- }
94
- src={'actions/approve.svg'}
95
- width={20}
96
- height={20}
97
- onLoad={() => console.log('loaded')}
98
- onError={(e: any) => console.log('error:', e)}
99
- />
100
- <ActionTitle>approve</ActionTitle>
101
- </ActionBtn>
102
- <ActionBtn onClick={onApprove}>
103
- <Image
104
- alt="ignore and approve"
105
- loader={() =>
106
- imageLoader({
107
- root: 'https://cdn-dev.fixefy.me/',
108
- src: 'actions/ignore_and_approve.svg',
109
- })
110
- }
111
- src={'actions/ignore_and_approve.svg'}
112
- width={20}
113
- height={20}
114
- onLoad={() => console.log('loaded')}
115
- onError={(e: any) => console.log('error:', e)}
116
- />
117
- <ActionTitle>ignore & approve</ActionTitle>
118
- </ActionBtn>
119
- <ActionBtn onClick={onApprove}>
120
- <Image
121
- alt="change exception"
122
- loader={() =>
123
- imageLoader({
124
- root: 'https://cdn-dev.fixefy.me/',
125
- src: 'actions/change_exception.svg',
126
- })
127
- }
128
- src={'actions/change_exception.svg'}
129
- width={20}
130
- height={20}
131
- onLoad={() => console.log('loaded')}
132
- onError={(e: any) => console.log('error:', e)}
133
- />
134
- <ActionTitle>Change exeption</ActionTitle>
135
- </ActionBtn>
136
- </>
137
- )
138
- }
139
- const PendingActions = ({ onApprove, onChallenge }: { onChallenge?: () => void; onApprove?: () => void }) => {
140
- return (
141
- <>
142
- <ActionBtn onClick={onApprove} type="excellent">
143
- <Image
144
- alt="approve"
145
- loader={() =>
146
- imageLoader({
147
- root: 'https://cdn-dev.fixefy.me/',
148
- src: 'actions/approve.svg',
149
- })
150
- }
151
- src={'actions/approve.svg'}
152
- width={20}
153
- height={20}
154
- onLoad={() => console.log('loaded')}
155
- onError={(e: any) => console.log('error:', e)}
156
- />
157
- <ActionTitle>approve</ActionTitle>
158
- </ActionBtn>
159
- <ActionBtn onClick={onChallenge}>
160
- <Image
161
- alt="challenge"
162
- loader={() =>
163
- imageLoader({
164
- root: 'https://cdn-dev.fixefy.me/',
165
- src: 'actions/challenge.svg',
166
- })
167
- }
168
- src={'actions/challenge.svg'}
169
- width={20}
170
- height={20}
171
- onLoad={() => console.log('loaded')}
172
- onError={(e: any) => console.log('error:', e)}
173
- />
174
- <ActionTitle>challenge</ActionTitle>
175
- </ActionBtn>
176
-
177
- <ActionBtn onClick={onChallenge}>
178
- <Image
179
- alt="dive in"
180
- loader={() =>
181
- imageLoader({
182
- root: 'https://cdn-dev.fixefy.me/',
183
- src: 'actions/dive_in.svg',
184
- })
185
- }
186
- src={'actions/dive_in.svg'}
187
- width={20}
188
- height={20}
189
- onLoad={() => console.log('loaded')}
190
- onError={(e: any) => console.log('error:', e)}
191
- />
192
- <ActionTitle>dive in</ActionTitle>
193
- </ActionBtn>
194
- </>
195
- )
196
- }
197
- const NoPricingActions = ({ onApprove, onChallenge }: { onChallenge?: () => void; onApprove?: () => void }) => {
198
- return (
199
- <>
200
- <ActionBtn onClick={onChallenge}>
201
- <Image
202
- alt="dive in"
203
- loader={() =>
204
- imageLoader({
205
- root: 'https://cdn-dev.fixefy.me/',
206
- src: 'actions/dive_in.svg',
207
- })
208
- }
209
- src={'actions/dive_in.svg'}
210
- width={20}
211
- height={20}
212
- onLoad={() => console.log('loaded')}
213
- onError={(e: any) => console.log('error:', e)}
214
- />
215
- <ActionTitle>dive in</ActionTitle>
216
- </ActionBtn>
217
- <ActionBtn onClick={onApprove}>
218
- <Image
219
- alt="solve"
220
- loader={() =>
221
- imageLoader({
222
- root: 'https://cdn-dev.fixefy.me/',
223
- src: 'actions/solve.svg',
224
- })
225
- }
226
- src={'actions/solve.svg'}
227
- width={20}
228
- height={20}
229
- onLoad={() => console.log('loaded')}
230
- onError={(e: any) => console.log('error:', e)}
231
- />
232
- <ActionTitle>solve</ActionTitle>
233
- </ActionBtn>
234
- <ActionBtn onClick={onApprove}>
235
- <Image
236
- alt="ignore and approve"
237
- loader={() =>
238
- imageLoader({
239
- root: 'https://cdn-dev.fixefy.me/',
240
- src: 'actions/ignore_and_approve.svg',
241
- })
242
- }
243
- src={'actions/ignore_and_approve.svg'}
244
- width={20}
245
- height={20}
246
- onLoad={() => console.log('loaded')}
247
- onError={(e: any) => console.log('error:', e)}
248
- />
249
- <ActionTitle>ignore & approve</ActionTitle>
250
- </ActionBtn>
251
- </>
252
- )
253
- }
254
- const ApprovedActions = ({ onChallenge }: { onChallenge?: () => void; onApprove?: () => void }) => {
255
- return (
256
- <>
257
- <ActionBtn onClick={onChallenge}>
258
- <Image
259
- alt="dive in"
260
- loader={() =>
261
- imageLoader({
262
- root: 'https://cdn-dev.fixefy.me/',
263
- src: 'actionsCards/check_exceptions.svg',
264
- })
265
- }
266
- src={'actionsCards/check_exceptions.svg'}
267
- width={20}
268
- height={20}
269
- onLoad={() => console.log('loaded')}
270
- onError={(e: any) => console.log('error:', e)}
271
- />
272
- <ActionTitle>dive in</ActionTitle>
273
- </ActionBtn>
274
- <ActionBtn onClick={onChallenge}>
275
- <Image
276
- alt="challenge"
277
- loader={() =>
278
- imageLoader({
279
- root: 'https://cdn-dev.fixefy.me/',
280
- src: 'actions/undo.svg',
281
- })
282
- }
283
- src={'actions/undo.svg'}
284
- width={20}
285
- height={20}
286
- onLoad={() => console.log('loaded')}
287
- onError={(e: any) => console.log('error:', e)}
288
- />
289
- <ActionTitle>undo</ActionTitle>
290
- </ActionBtn>
291
- </>
292
- )
293
- }
@@ -1,15 +0,0 @@
1
- export type ActionsTrayPropsType = {
2
- type: 'approved' | 'challenge' | 'pending' | 'no_pricing'
3
- onApprove?: () => void
4
- onChallenge?: () => void
5
- onClick?: () => void
6
- onClose?: () => void
7
- show: boolean
8
- chargesCount: number
9
- container?: any
10
- direction?: 'down' | 'left' | 'right' | 'up'
11
- }
12
-
13
- export type ActionButtonPropsType = {
14
- type?: 'excellent' | 'high' | 'medium' | 'low' | 'bad'
15
- }
@@ -1,3 +0,0 @@
1
- export { FxActionsTray } from './FxActionsTray'
2
-
3
- export type { ActionsTrayPropsType, ActionButtonPropsType } from './actions_tray_types'
@@ -1,90 +0,0 @@
1
- import { FxButton } from '../../FxButton'
2
- import { Typography } from '@mui/material'
3
- import { styled } from '@mui/material/styles'
4
-
5
- import { ActionButtonPropsType } from '../actions_tray_types'
6
-
7
- // const filterWhite = 'invert(99%) sepia(74%) saturate(0%) hue-rotate(253deg) brightness(108%) contrast(100%)'
8
- const filterPrimary = 'invert(46%) sepia(48%) saturate(297%) hue-rotate(145deg) brightness(97%) contrast(90%)'
9
-
10
- export const Container = styled('div')(({ theme }: { theme: any }) => ({
11
- display: 'flex',
12
- alignItems: 'center',
13
- justifyContent: 'space-between',
14
-
15
- background: theme.palette.common.white,
16
- border: '1px solid #C6DDE2',
17
- boxShadow: '0px 0px 10px rgba(86, 135, 147, 0.2)',
18
- borderRadius: 8,
19
- padding: '16px 24px',
20
- height: 38,
21
- width: 'fit-content',
22
- margin: 4,
23
- }))
24
-
25
- export const ChargesCount = styled(Typography)(({ theme }: { theme: any }) => ({
26
- ...theme.typography.table,
27
- color: theme.palette.typography.title,
28
- fontWeight: 700,
29
- marginRight: 4,
30
- }))
31
-
32
- export const ChargesTitle = styled(Typography)(({ theme }: { theme: any }) => ({
33
- ...theme.typography.table,
34
- color: theme.palette.typography.title,
35
- }))
36
-
37
- export const Close = styled(Typography)(({ theme }: { theme: any }) => ({
38
- ...theme.typography.body1,
39
- color: theme.palette.primary['500'],
40
- textTransform: 'uppercase',
41
- fontWeight: 600,
42
- letterSpacing: '0.5px',
43
- cursor: 'pointer',
44
- }))
45
-
46
- export const TitleWrapper = styled('div')(({ }: { theme: any }) => ({
47
- display: 'flex',
48
- alignItems: 'center',
49
- justifyContent: 'center',
50
- }))
51
-
52
- export const Divider = styled('div')(({ theme }: { theme: any }) => ({
53
- width: 1,
54
- height: '100%',
55
- background: theme.palette.greyscale.contrastText,
56
- marginRight: 24,
57
- marginLeft: 24,
58
- }))
59
-
60
- export const ActionBtn = styled(FxButton)<ActionButtonPropsType>(({ theme, type }: { theme: any; type: any }) => ({
61
- height: 40,
62
- maxHeight: 40,
63
- borderRadius: 100,
64
-
65
- padding: '8px 16px',
66
- color: type ? theme.palette.common.white : theme.palette.primary['500'],
67
- borderColor: type ? theme.palette.score[type] : theme.palette.primary['500'],
68
- background: type ? theme.palette.score[type] : theme.palette.common.white,
69
- marginRight: 8,
70
-
71
- ['& img']: {
72
- filter: type ? 'none' : filterPrimary,
73
- },
74
- ['&:hover']: {
75
- background: type ? theme.palette.score[type] : theme.palette.common.white,
76
- color: type ? theme.palette.common.white : theme.palette.primary['500'],
77
- borderColor: type ? theme.palette.score[type] : theme.palette.primary['500'],
78
- },
79
- }))
80
-
81
- export const ActionTitle = styled('span')(({ theme }: { theme: any }) => ({
82
- ...theme.typography.body1,
83
- color: 'inherit',
84
- textTransform: 'uppercase',
85
- fontWeight: 600,
86
- letterSpacing: '0.5px',
87
- cursor: 'pointer',
88
- marginLeft: 4,
89
- marginTop: 2,
90
- }))
@@ -1,32 +0,0 @@
1
- import React from 'react'
2
- import Stack from '@mui/material/Stack'
3
- import { structureReader } from './helpers/structureReader'
4
-
5
- import { AggreationsBarPropsType } from './aggregations_types'
6
-
7
- export const FxAggregationsBar = (props: AggreationsBarPropsType) => {
8
- const { structure, minWidth, mb, filter, initialValues } = props
9
- const { children, extended } = structure
10
- const { variables } = extended
11
- const { collapsed } = variables
12
-
13
- return (
14
- <Stack
15
- direction="row"
16
- spacing={1.5}
17
- sx={{
18
- mb: mb ? mb : 0,
19
- ['& div']: {
20
- minWidth: minWidth,
21
- },
22
- ['& > span']: {
23
- minWidth: minWidth,
24
- },
25
- }}
26
- >
27
- {children.map((child: any) => {
28
- return structureReader(child, filter, collapsed, initialValues)
29
- })}
30
- </Stack>
31
- )
32
- }
@@ -1,21 +0,0 @@
1
- export type AggregationsDataPropsType = {
2
- title: string
3
- value: number
4
- type?: 'currency' | 'percentage'
5
- loading?: boolean
6
- }
7
-
8
- export type AggreationsBarPropsType = {
9
- structure: any
10
- minWidth?: string | number
11
- mb?: string | number
12
- filter?: object
13
- initialValues?: {
14
- score?: number
15
- originalCharge?: number
16
- underContractCharges?: number
17
- fairValue?: number
18
- spendRisk?: number
19
- [x: string]: any
20
- }
21
- }
@@ -1,66 +0,0 @@
1
- import React from 'react'
2
-
3
- import { Box, Stack, Divider } from '@mui/material'
4
-
5
- import { FxScore } from '../../FxScore'
6
- import { FxStatisticsBar } from '../../FxStatisticsBar'
7
- import { FxProgressCounter } from '../../FxProgressCounter'
8
-
9
- export const structureReader = (structure: any, filter: any, collapsed: boolean, initialValues: any) => {
10
- const { extended, type } = structure
11
- switch (type) {
12
- case 'aggregations_primary_container':
13
- return structure.children.map((child: any, index: number) =>
14
- child.input_type?.value === 'percentage' ? (
15
- <FxScore structure={child} key={index} filter={filter} value={initialValues?.score} />
16
- ) : child.input_type?.value === 'progress' ? (
17
- <FxProgressCounter structure={child} filter={filter} key={index} values={initialValues} />
18
- ) : (
19
- <Box
20
- sx={{
21
- display: 'flex',
22
- justifyContent: 'center',
23
- alignItems: 'center',
24
- width: 'fit-content',
25
- padding: 2,
26
- borderRadius: 2,
27
- backgroundColor: extended?.variables?.bg || '#FFFFFF',
28
- }}
29
- >
30
- <FxStatisticsBar
31
- structure={child}
32
- key={index}
33
- filter={filter}
34
- collapsed={collapsed}
35
- value={initialValues ? initialValues[child.extended.object_path] : null}
36
- />
37
- </Box>
38
- ),
39
- )
40
- case 'aggregations_secondary_container':
41
- return (
42
- <Stack
43
- direction='row'
44
- divider={<Divider orientation='vertical' flexItem />}
45
- spacing={2}
46
- sx={{
47
- backgroundColor: extended?.variables?.bg || '#FFFFFF',
48
- borderRadius: '8px',
49
- padding: '24px 16px',
50
- }}
51
- >
52
- {structure.children.map((child: any, index: number) => {
53
- return (
54
- <FxStatisticsBar
55
- structure={child}
56
- key={index}
57
- filter={filter}
58
- collapsed={collapsed}
59
- value={initialValues ? initialValues[child.extended.object_path] : null}
60
- />
61
- )
62
- })}
63
- </Stack>
64
- )
65
- }
66
- }
@@ -1,2 +0,0 @@
1
- export { FxAggregationsBar } from './FxAggregations'
2
- export type { AggregationsDataPropsType, AggreationsBarPropsType } from './aggregations_types'
@@ -1,64 +0,0 @@
1
- import { gql } from 'graphql-tag'
2
-
3
- export const STRUCTURES = gql`
4
- query STRUCTURES {
5
- structure(where: { name: "aggregations_invoice" }) {
6
- _id
7
- bundle_name
8
- name
9
- title
10
- type
11
- input_type {
12
- name
13
- value
14
- }
15
- readable_id
16
- extended {
17
- format
18
- gql_operation
19
- title_path
20
- object_path
21
- filter
22
- variables
23
- }
24
- children(sort: { index: 1 }) {
25
- _id
26
- name
27
- title
28
- type
29
- input_type {
30
- name
31
- value
32
- }
33
- readable_id
34
- extended {
35
- format
36
- gql_operation
37
- title_path
38
- object_path
39
- filter
40
- variables
41
- }
42
- children(sort: { index: 1 }) {
43
- _id
44
- name
45
- title
46
- type
47
- input_type {
48
- name
49
- value
50
- }
51
- readable_id
52
- extended {
53
- format
54
- gql_operation
55
- title_path
56
- object_path
57
- filter
58
- variables
59
- }
60
- }
61
- }
62
- }
63
- }
64
- `