@omniumretail/component-library 1.2.71 → 1.2.73

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 (191) hide show
  1. package/package.json +6 -3
  2. package/NPMPUBLISH.md +0 -29
  3. package/bitbucket-pipelines.yml +0 -95
  4. package/dist/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -5
  5. package/dist/components/BellNotifications/BellNotifications.stories.d.ts +0 -5
  6. package/dist/components/Button/Button.stories.d.ts +0 -6
  7. package/dist/components/Category/Category.stories.d.ts +0 -3
  8. package/dist/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -3
  9. package/dist/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -3
  10. package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -5
  11. package/dist/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -5
  12. package/dist/components/DropdownButton/DropdownButton.stories.d.ts +0 -5
  13. package/dist/components/ExportTableData/ExportTableData.stories.d.ts +0 -3
  14. package/dist/components/Footer/Footer.stories.d.ts +0 -5
  15. package/dist/components/Footer2/Footer.stories.d.ts +0 -6
  16. package/dist/components/Header/Header.stories.d.ts +0 -5
  17. package/dist/components/Input/Input.stories.d.ts +0 -5
  18. package/dist/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -5
  19. package/dist/components/Label/Label.stories.d.ts +0 -6
  20. package/dist/components/Link/Link.stories.d.ts +0 -7
  21. package/dist/components/Menu/Menu.stories.d.ts +0 -5
  22. package/dist/components/MobileTable/MobileTable.stories.d.ts +0 -5
  23. package/dist/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -5
  24. package/dist/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -5
  25. package/dist/components/Navigation/Navigation.stories.d.ts +0 -5
  26. package/dist/components/Notification/Notification.stories.d.ts +0 -5
  27. package/dist/components/Questions/Questions.stories.d.ts +0 -3
  28. package/dist/components/Radio/Radio.stories.d.ts +0 -5
  29. package/dist/components/ResponseType/ResponseType.stories.d.ts +0 -3
  30. package/dist/components/ResponsiveTable/ResponsiveTable.stories.d.ts +0 -9
  31. package/dist/components/Select/Select.stories.d.ts +0 -6
  32. package/dist/components/Separator/Separator.stories.d.ts +0 -6
  33. package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -6
  34. package/dist/components/Switch/Switch.stories.d.ts +0 -5
  35. package/dist/components/Table/Table.stories.d.ts +0 -9
  36. package/dist/components/Tag/Tag.stories.d.ts +0 -5
  37. package/dist/components/Upload/Upload.stories.d.ts +0 -3
  38. package/dist/components/UserInfo/UserInfo.stories.d.ts +0 -3
  39. package/dist/components/WebCam/WebCam.stories.d.ts +0 -3
  40. package/dist/types/index.d.ts +0 -2
  41. package/public/index.ts +0 -0
  42. package/src/assets/code-brackets.svg +0 -1
  43. package/src/assets/colors.svg +0 -1
  44. package/src/assets/comments.svg +0 -1
  45. package/src/assets/direction.svg +0 -1
  46. package/src/assets/flow.svg +0 -1
  47. package/src/assets/fonts/Silka-Bold.woff2 +0 -0
  48. package/src/assets/fonts/Silka-Regular.woff2 +0 -0
  49. package/src/assets/images/A2AI-logo.png +0 -0
  50. package/src/assets/images/omnium-retail-logo-white.png +0 -0
  51. package/src/assets/images/omnium-retail-logo.png +0 -0
  52. package/src/assets/images/omnium-retail_icon.png +0 -0
  53. package/src/assets/plugin.svg +0 -1
  54. package/src/assets/repo.svg +0 -1
  55. package/src/assets/scss/_combinations.scss +0 -0
  56. package/src/assets/scss/_global.scss +0 -89
  57. package/src/assets/scss/index.scss +0 -2
  58. package/src/assets/stackalt.svg +0 -1
  59. package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +0 -236
  60. package/src/components/AnalyticsBar/helpers/codeMutation.tsx +0 -19
  61. package/src/components/AnalyticsBar/index.tsx +0 -76
  62. package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +0 -13
  63. package/src/components/AnalyticsBar/styles.module.scss +0 -137
  64. package/src/components/BellNotifications/BellNotifications.stories.tsx +0 -200
  65. package/src/components/BellNotifications/index.tsx +0 -154
  66. package/src/components/BellNotifications/styles.module.scss +0 -239
  67. package/src/components/Button/Button.stories.tsx +0 -26
  68. package/src/components/Button/index.tsx +0 -24
  69. package/src/components/Button/styles.module.scss +0 -70
  70. package/src/components/Category/Category.stories.tsx +0 -371
  71. package/src/components/Category/CategoryContent/index.tsx +0 -255
  72. package/src/components/Category/CategoryContent/styles.module.scss +0 -69
  73. package/src/components/Category/CategorySidebar/index.tsx +0 -344
  74. package/src/components/Category/CategorySidebar/styles.module.scss +0 -28
  75. package/src/components/Category/index.tsx +0 -58
  76. package/src/components/Category/styles.module.scss +0 -13
  77. package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +0 -274
  78. package/src/components/CategoryReadOnly/evaluationOptions.tsx +0 -81
  79. package/src/components/CategoryReadOnly/index.tsx +0 -328
  80. package/src/components/CategoryReadOnly/styles.module.scss +0 -214
  81. package/src/components/CategoryResponse/CategoryResponse.stories.tsx +0 -311
  82. package/src/components/CategoryResponse/evaluationOptions.tsx +0 -81
  83. package/src/components/CategoryResponse/index.tsx +0 -502
  84. package/src/components/CategoryResponse/styles.module.scss +0 -365
  85. package/src/components/DatePicker/DatePicker.stories.tsx +0 -16
  86. package/src/components/DatePicker/index.tsx +0 -38
  87. package/src/components/DatePicker/styles.module.scss +0 -3
  88. package/src/components/DatePickerTag/DatePickerTag.stories.tsx +0 -19
  89. package/src/components/DatePickerTag/index.tsx +0 -91
  90. package/src/components/DatePickerTag/styles.module.scss +0 -32
  91. package/src/components/DropdownButton/DropdownButton.stories.tsx +0 -24
  92. package/src/components/DropdownButton/index.tsx +0 -36
  93. package/src/components/DropdownButton/styles.module.scss +0 -9
  94. package/src/components/ExportTableData/ExportTableData.stories.tsx +0 -43
  95. package/src/components/ExportTableData/index.tsx +0 -37
  96. package/src/components/ExportTableData/styles.module.scss +0 -4
  97. package/src/components/Footer/Footer.stories.tsx +0 -15
  98. package/src/components/Footer/index.tsx +0 -45
  99. package/src/components/Footer/styles.module.scss +0 -38
  100. package/src/components/Footer2/Footer.stories.tsx +0 -184
  101. package/src/components/Footer2/index.tsx +0 -322
  102. package/src/components/Footer2/styles.module.scss +0 -292
  103. package/src/components/Header/Header.data.ts +0 -26
  104. package/src/components/Header/Header.stories.tsx +0 -236
  105. package/src/components/Header/Header.types.ts +0 -32
  106. package/src/components/Header/README.md +0 -38
  107. package/src/components/Header/index.tsx +0 -200
  108. package/src/components/Header/styles.module.scss +0 -216
  109. package/src/components/Input/Input.stories.tsx +0 -13
  110. package/src/components/Input/index.tsx +0 -31
  111. package/src/components/Input/styles.module.scss +0 -8
  112. package/src/components/InputCountryCode/index.tsx +0 -79
  113. package/src/components/InputCountryCode/inputCountryCode.stories.tsx +0 -55
  114. package/src/components/InputCountryCode/styles.module.scss +0 -3
  115. package/src/components/Label/Label.stories.tsx +0 -21
  116. package/src/components/Label/index.tsx +0 -19
  117. package/src/components/Label/styles.module.scss +0 -17
  118. package/src/components/Link/Link.stories.tsx +0 -30
  119. package/src/components/Link/index.tsx +0 -21
  120. package/src/components/Link/styles.module.scss +0 -24
  121. package/src/components/Menu/Menu.stories.tsx +0 -178
  122. package/src/components/Menu/helpers/codeMutation.tsx +0 -19
  123. package/src/components/Menu/index.tsx +0 -24
  124. package/src/components/Menu/styles.module.scss +0 -0
  125. package/src/components/MobileTable/MobileTable.stories.tsx +0 -27
  126. package/src/components/MobileTable/index.tsx +0 -102
  127. package/src/components/MobileTable/styles.module.scss +0 -75
  128. package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +0 -40
  129. package/src/components/ModalConfirmation/ModalStatusList.tsx +0 -5
  130. package/src/components/ModalConfirmation/index.tsx +0 -71
  131. package/src/components/ModalConfirmation/styles.module.scss +0 -62
  132. package/src/components/ModalWithTable/ModalWithTable.stories.tsx +0 -99
  133. package/src/components/ModalWithTable/index.tsx +0 -238
  134. package/src/components/ModalWithTable/styles.module.scss +0 -77
  135. package/src/components/Navigation/Navigation.stories.tsx +0 -21
  136. package/src/components/Navigation/index.tsx +0 -91
  137. package/src/components/Navigation/styles.module.scss +0 -91
  138. package/src/components/Notification/Notification.stories.tsx +0 -32
  139. package/src/components/Notification/index.tsx +0 -28
  140. package/src/components/Questions/Questions.stories.tsx +0 -37
  141. package/src/components/Questions/SingleQuestion/index.tsx +0 -337
  142. package/src/components/Questions/SingleQuestion/styles.module.scss +0 -142
  143. package/src/components/Questions/index.tsx +0 -124
  144. package/src/components/Questions/styles.modules.scss +0 -0
  145. package/src/components/Radio/Radio.stories.tsx +0 -43
  146. package/src/components/Radio/index.tsx +0 -26
  147. package/src/components/Radio/styles.module.scss +0 -24
  148. package/src/components/ResponseType/ResponseType.stories.tsx +0 -393
  149. package/src/components/ResponseType/index.tsx +0 -100
  150. package/src/components/ResponseType/styles.module.scss +0 -31
  151. package/src/components/ResponsiveTable/ResponsiveTable.stories.tsx +0 -386
  152. package/src/components/ResponsiveTable/index.tsx +0 -389
  153. package/src/components/ResponsiveTable/styles.module.scss +0 -153
  154. package/src/components/Select/Select.stories.tsx +0 -39
  155. package/src/components/Select/index.tsx +0 -27
  156. package/src/components/Select/styles.module.scss +0 -19
  157. package/src/components/Separator/Separator.stories.tsx +0 -22
  158. package/src/components/Separator/index.tsx +0 -27
  159. package/src/components/Separator/styles.module.scss +0 -25
  160. package/src/components/Sidebar/Sidebar.stories.tsx +0 -85
  161. package/src/components/Sidebar/index.tsx +0 -127
  162. package/src/components/Sidebar/styles.module.scss +0 -141
  163. package/src/components/Switch/Switch.stories.tsx +0 -14
  164. package/src/components/Switch/index.tsx +0 -18
  165. package/src/components/Switch/styles.module.scss +0 -7
  166. package/src/components/Table/Table.stories.tsx +0 -337
  167. package/src/components/Table/index.tsx +0 -313
  168. package/src/components/Table/styles.module.scss +0 -97
  169. package/src/components/Tag/Tag.stories.tsx +0 -32
  170. package/src/components/Tag/index.tsx +0 -295
  171. package/src/components/Tag/styles.module.scss +0 -104
  172. package/src/components/Upload/Upload.stories.tsx +0 -45
  173. package/src/components/Upload/index.tsx +0 -112
  174. package/src/components/Upload/styles.module.scss +0 -29
  175. package/src/components/UserInfo/UserInfo.stories.tsx +0 -38
  176. package/src/components/UserInfo/index.tsx +0 -77
  177. package/src/components/UserInfo/styles.module.scss +0 -35
  178. package/src/components/WebCam/WebCam.stories.tsx +0 -24
  179. package/src/components/WebCam/index.tsx +0 -73
  180. package/src/components/WebCam/styles.module.scss +0 -37
  181. package/src/components/index.tsx +0 -34
  182. package/src/constants/i18n.ts +0 -25
  183. package/src/constants/logoCompanyHelper.ts +0 -52
  184. package/src/constants/translationHelper.ts +0 -7
  185. package/src/index.ts +0 -3
  186. package/src/locales/en.json +0 -142
  187. package/src/locales/es.json +0 -142
  188. package/src/locales/pt.json +0 -142
  189. package/src/types/Global.d.ts +0 -4
  190. package/tsconfig.json +0 -24
  191. package/vite.config.js +0 -51
@@ -1,26 +0,0 @@
1
- import { Radio as RadioAntd } from 'antd';
2
- import type { RadioProps } from 'antd';
3
- import type { RadioGroupProps } from 'antd/lib/radio';
4
- import styles from './styles.module.scss';
5
-
6
- export const Radio = ({...radioProps }: RadioProps) => {
7
- return (
8
- <RadioAntd className={styles.radio} {...radioProps} />
9
- )
10
- };
11
-
12
- export interface CustomRadioGroupProps extends RadioGroupProps {
13
- options: { label: string; value: string }[];
14
- }
15
-
16
- export const RadioGroup = ({ options, ...radioGroupProps }: CustomRadioGroupProps) => {
17
- return (
18
- <RadioAntd.Group {...radioGroupProps}>
19
- {options.map((option) => (
20
- <Radio key={option.value} value={option.value}>
21
- {option.label}
22
- </Radio>
23
- ))}
24
- </RadioAntd.Group>
25
- );
26
- };
@@ -1,24 +0,0 @@
1
- .radio {
2
- :global {
3
- .ant-radio-checked .ant-radio-inner{
4
- border-color: var(--color-black);
5
- }
6
-
7
- .ant-radio-checked .ant-radio-inner:after{
8
- background-color: var(--color-black);
9
- }
10
-
11
- .ant-radio-checked:hover .ant-radio-inner:after{
12
- background-color: var(--color-orange);
13
- }
14
-
15
- .ant-radio:hover .ant-radio-inner {
16
- border-color: var(--color-orange);
17
- }
18
- }
19
-
20
- font-weight: var(--font-weight-medium);
21
- font-size: var(--font-size-body-3);
22
- margin-right: 44px;
23
- margin-top: 18px;
24
- }
@@ -1,393 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react-vite";
2
- import { useEffect, useState } from "react";
3
- import { ResponseType } from '.';
4
-
5
- export default {
6
- title: 'ResponseType',
7
- component: ResponseType,
8
- } as Meta;
9
-
10
- const Template: StoryFn<any> = (args: any) => {
11
- const [categoryContentInfo, setCategoryContentInfo] = useState<any>();
12
-
13
- const getAnswer = {
14
- "Id": "57859452-4B79-4005-BB6C-3695C78270FD",
15
- "Name": "Levi's Stores",
16
- "IsOpenAnswer": false,
17
- "IsCheckBox": false,
18
- "IsNumeric": false,
19
- "IsDate": false,
20
- "HasGrade": false,
21
- "IsEmphasis": false,
22
- "IsMultipleChoise": false,
23
- "IsStore": false,
24
- "State": "Finished",
25
- "Grade": 0,
26
- "Rank": 8,
27
- "Options": [
28
- {
29
- "Value": "2 - LS Via Catarina Shopping",
30
- "Grade": "N/A",
31
- "Color": "#000000",
32
- "NeedsAction": false
33
- },
34
- {
35
- "Value": "4 - LS Amoreiras Shopping",
36
- "Grade": "N/A",
37
- "Color": "#000000",
38
- "NeedsAction": false
39
- },
40
- {
41
- "Value": "5 - Levis GaiaShopping",
42
- "Grade": "N/A",
43
- "Color": "#000000",
44
- "NeedsAction": false
45
- },
46
- {
47
- "Value": "6 - LS Arrábida Shopping",
48
- "Grade": "N/A",
49
- "Color": "#00000",
50
- "NeedsAction": false
51
- },
52
- {
53
- "Value": "9 - LS Artea",
54
- "Grade": "N/A",
55
- "Color": "#00000",
56
- "NeedsAction": false
57
- },
58
- {
59
- "Value": "10 - LS Nova Arcada",
60
- "Grade": "N/A",
61
- "Color": "#00000",
62
- "NeedsAction": false
63
- },
64
- {
65
- "Value": "11 - LS Rio Shopping",
66
- "Grade": "N/A",
67
- "Color": "#00000",
68
- "NeedsAction": false
69
- },
70
- {
71
- "Value": "12 - LS Garbera",
72
- "Grade": "N/A",
73
- "Color": "#00000",
74
- "NeedsAction": false
75
- },
76
- {
77
- "Value": "13 - LS La Maquinista",
78
- "Grade": "N/A",
79
- "Color": "#00000",
80
- "NeedsAction": false
81
- },
82
- {
83
- "Value": "14 - LS GuimarãesShopping",
84
- "Grade": "N/A",
85
- "Color": "#00000",
86
- "NeedsAction": false
87
- },
88
- {
89
- "Value": "15 - LS Moyua",
90
- "Grade": "N/A",
91
- "Color": "#00000",
92
- "NeedsAction": false
93
- },
94
- {
95
- "Value": "17 - LS As Cancelas",
96
- "Grade": "N/A",
97
- "Color": "#00000",
98
- "NeedsAction": false
99
- },
100
- {
101
- "Value": "19 - LS Intu-Asturias",
102
- "Grade": "N/A",
103
- "Color": "#00000",
104
- "NeedsAction": false
105
- },
106
- {
107
- "Value": "20 - LS Gran Via II",
108
- "Grade": "N/A",
109
- "Color": "#00000",
110
- "NeedsAction": false
111
- },
112
- {
113
- "Value": "21 - LS NorteShopping",
114
- "Grade": "N/A",
115
- "Color": "#00000",
116
- "NeedsAction": false
117
- },
118
- {
119
- "Value": "22 - LS Forum Coimbra",
120
- "Grade": "N/A",
121
- "Color": "#00000",
122
- "NeedsAction": false
123
- },
124
- {
125
- "Value": "24 - LS Marineda City",
126
- "Grade": "N/A",
127
- "Color": "#00000",
128
- "NeedsAction": false
129
- },
130
- {
131
- "Value": "26 - LS Girona",
132
- "Grade": "N/A",
133
- "Color": "#00000",
134
- "NeedsAction": false
135
- },
136
- {
137
- "Value": "27 - LS Vasco da Gama",
138
- "Grade": "N/A",
139
- "Color": "#00000",
140
- "NeedsAction": false
141
- },
142
- {
143
- "Value": "30 - LS Alameda Shop & Spot",
144
- "Grade": "N/A",
145
- "Color": "#00000",
146
- "NeedsAction": false
147
- },
148
- {
149
- "Value": "31 - LS AlgarveShopping",
150
- "Grade": "N/A",
151
- "Color": "#00000",
152
- "NeedsAction": false
153
- },
154
- {
155
- "Value": "32 - LS CascaiShopping",
156
- "Grade": "N/A",
157
- "Color": "#00000",
158
- "NeedsAction": false
159
- },
160
- {
161
- "Value": "33 - LS Vitoria Boulevard",
162
- "Grade": "N/A",
163
- "Color": "#00000",
164
- "NeedsAction": false
165
- },
166
- {
167
- "Value": "34 - LS Oeiras Parque",
168
- "Grade": "N/A",
169
- "Color": "#00000",
170
- "NeedsAction": false
171
- },
172
- {
173
- "Value": "35 - LS LeiriaShopping",
174
- "Grade": "N/A",
175
- "Color": "#00000",
176
- "NeedsAction": false
177
- },
178
- {
179
- "Value": "36 - LS Braga Parque",
180
- "Grade": "N/A",
181
- "Color": "#00000",
182
- "NeedsAction": false
183
- },
184
- {
185
- "Value": "37 - LS Alegro Sintra",
186
- "Grade": "N/A",
187
- "Color": "#00000",
188
- "NeedsAction": false
189
- },
190
- {
191
- "Value": "42 - LS Palácio do Gelo",
192
- "Grade": "N/A",
193
- "Color": "#00000",
194
- "NeedsAction": false
195
- },
196
- {
197
- "Value": "44 - LS Chiado",
198
- "Grade": "N/A",
199
- "Color": "#00000",
200
- "NeedsAction": false
201
- },
202
- {
203
- "Value": "45 - LS Colombo",
204
- "Grade": "N/A",
205
- "Color": "#00000",
206
- "NeedsAction": false
207
- },
208
- {
209
- "Value": "47 - LS Almada Forum",
210
- "Grade": "N/A",
211
- "Color": "#00000",
212
- "NeedsAction": false
213
- },
214
- {
215
- "Value": "48 - LS MarShopping",
216
- "Grade": "N/A",
217
- "Color": "#00000",
218
- "NeedsAction": false
219
- },
220
- {
221
- "Value": "49 - LS Forum Aveiro",
222
- "Grade": "N/A",
223
- "Color": "#00000",
224
- "NeedsAction": false
225
- },
226
- {
227
- "Value": "50 - LS Berceo Mall",
228
- "Grade": "N/A",
229
- "Color": "#00000",
230
- "NeedsAction": false
231
- },
232
- {
233
- "Value": "51 - LS Sant Cugat",
234
- "Grade": "N/A",
235
- "Color": "#00000",
236
- "NeedsAction": false
237
- },
238
- {
239
- "Value": "53 - LS Anec Blau",
240
- "Grade": "N/A",
241
- "Color": "#00000",
242
- "NeedsAction": false
243
- },
244
- {
245
- "Value": "54 - LS Puerto Venecia",
246
- "Grade": "N/A",
247
- "Color": "#00000",
248
- "NeedsAction": false
249
- },
250
- {
251
- "Value": "55 - LS FAN Mallorca",
252
- "Grade": "N/A",
253
- "Color": "#00000",
254
- "NeedsAction": false
255
- },
256
- {
257
- "Value": "56 - LS Ramblas",
258
- "Grade": "N/A",
259
- "Color": "#00000",
260
- "NeedsAction": false
261
- },
262
- {
263
- "Value": "57 - LS Ubbo",
264
- "Grade": "N/A",
265
- "Color": "#00000",
266
- "NeedsAction": false
267
- },
268
- {
269
- "Value": "58 - LS Forum Algarve",
270
- "Grade": "N/A",
271
- "Color": "#00000",
272
- "NeedsAction": false
273
- },
274
- {
275
- "Value": "59 - LS Parc Central",
276
- "Grade": "N/A",
277
- "Color": "#00000",
278
- "NeedsAction": false
279
- },
280
- {
281
- "Value": "60 - LS Pamplona La Morea",
282
- "Grade": "N/A",
283
- "Color": "#00000",
284
- "NeedsAction": false
285
- },
286
- {
287
- "Value": "65 - LS Santander",
288
- "Grade": "N/A",
289
- "Color": "#00000",
290
- "NeedsAction": false
291
- },
292
- {
293
- "Value": "68 - LS Principe",
294
- "Grade": "N/A",
295
- "Color": "#00000",
296
- "NeedsAction": false
297
- },
298
- {
299
- "Value": "69 - LS Restauradores",
300
- "Grade": "N/A",
301
- "Color": "#00000",
302
- "NeedsAction": false
303
- },
304
- {
305
- "Value": "78 - LS Espacio Leon",
306
- "Grade": "N/A",
307
- "Color": "#00000",
308
- "NeedsAction": false
309
- },
310
- {
311
- "Value": "80 - LS Salamanca",
312
- "Grade": "N/A",
313
- "Color": "#00000",
314
- "NeedsAction": false
315
- },
316
- {
317
- "Value": "81 - LS Porto Pi",
318
- "Grade": "N/A",
319
- "Color": "#00000",
320
- "NeedsAction": false
321
- },
322
- {
323
- "Value": "82 - LS Mataró Parc",
324
- "Grade": "N/A",
325
- "Color": "#00000",
326
- "NeedsAction": false
327
- },
328
- {
329
- "Value": "83 - LS Diagonal 605",
330
- "Grade": "N/A",
331
- "Color": "#00000",
332
- "NeedsAction": false
333
- },
334
- {
335
- "Value": "85 - LS Arcs",
336
- "Grade": "N/A",
337
- "Color": "#00000",
338
- "NeedsAction": false
339
- },
340
- {
341
- "Value": "86 - LS Lleida",
342
- "Grade": "N/A",
343
- "Color": "#00000",
344
- "NeedsAction": false
345
- },
346
- {
347
- "Value": "88 - LS Valle Real Santander",
348
- "Grade": "N/A",
349
- "Color": "#00000",
350
- "NeedsAction": false
351
- },
352
- {
353
- "Value": "25 - Levis La Vaguada",
354
- "Grade": "N/A",
355
- "Color": "#00000",
356
- "NeedsAction": false
357
- }
358
- ],
359
- "CreateDate": "2024-07-04T11:32:36.118Z",
360
- "UpdateDate": "2024-12-26T13:18:23.016Z",
361
- "StartDate": "2024-12-26T13:18:23.016Z",
362
- "Status": "A",
363
- "ShowAnswerType": true,
364
- "IsInUse": false,
365
- "UseName": true
366
- };
367
-
368
- let initialValues;
369
-
370
- initialValues = {
371
- name: getAnswer?.Name,
372
- questions: getAnswer?.Options?.map((option) => ({
373
- question: option?.Value,
374
- score: option?.Grade,
375
- color: option?.Color,
376
- flagged: option?.NeedsAction
377
-
378
- }))
379
- };
380
-
381
- useEffect(() => {
382
- console.log(categoryContentInfo);
383
- }, [categoryContentInfo])
384
-
385
- return <ResponseType {...args} categoryContentInfo={setCategoryContentInfo} data={initialValues} ></ResponseType>
386
- };
387
-
388
- export const Primary = Template.bind({});
389
- Primary.args = {
390
- };
391
-
392
-
393
-
@@ -1,100 +0,0 @@
1
- import { Form } from 'antd';
2
- import { useForm } from 'antd/es/form/Form';
3
- import { InputField } from '../Input';
4
- import { Label } from '../Label';
5
- import { Questions } from '../Questions';
6
- import { useCallback, useEffect, useState } from 'react';
7
- import styles from './styles.module.scss';
8
- import { t } from 'i18next';
9
-
10
- interface categoryContent {
11
- categoryContentInfo: any;
12
- responseTypeOptions?: any;
13
- data?: any;
14
- }
15
-
16
- const defaultInitialValues = {
17
- questions: [],
18
- };
19
-
20
- export const ResponseType = (props: categoryContent) => {
21
- const {
22
- responseTypeOptions,
23
- data
24
- } = props;
25
-
26
- const [contentInfo, setContentInfo] = useState<any>(data);
27
- const [initialValues,] = useState<any>(data || defaultInitialValues)
28
- const [form] = useForm();
29
-
30
- const onFinish = (values: any) => {
31
- const combinedValues = { ...initialValues, ...values };
32
- setContentInfo(combinedValues);
33
- };
34
-
35
- const handleInputChange = useCallback(() => {
36
- // Check if all required fields are filled
37
- const allRequiredFieldsFilled = form.getFieldsError().every(fieldError => !fieldError.errors.length);
38
-
39
- if (allRequiredFieldsFilled) {
40
- // Add a small delay before submitting the form
41
- form.submit();
42
- }
43
- }, [form]);
44
-
45
- useEffect(() => {
46
- props.categoryContentInfo(contentInfo);
47
- }, [contentInfo]);
48
-
49
- useEffect(() => {
50
- form.resetFields();
51
- form.setFieldsValue(initialValues);
52
- }, [form, initialValues]);
53
-
54
- return (
55
- <div className={styles.categoryContent}>
56
- <Form
57
- initialValues={initialValues}
58
- name="dynamic_form_nest_item"
59
- onFinish={onFinish}
60
- autoComplete="off"
61
- form={form}
62
- >
63
- <div className={styles.formHeader}>
64
- <div className={styles.categoryNameContainer}>
65
- <div className={styles.categoryName}>
66
- <Label isUppercase>
67
- {t('components.category.responseTypeName')}
68
- </Label>
69
- <Form.Item
70
- name={['name']}
71
- rules={[{ required: true, message: t('components.category.typeResponseNameIsMissing')! }]}
72
- validateTrigger="onBlur"
73
- >
74
- <InputField
75
- placeholder={t('components.category.responseTypeName')!}
76
- onBlur={handleInputChange}
77
- customClass={styles.input}
78
- />
79
- </Form.Item>
80
- </div>
81
- </div>
82
- </div>
83
-
84
- <div className={styles.questionsWrapper}>
85
- <Label isUppercase>
86
- {t('components.categoryContent.answers')}
87
- </Label>
88
- <Form.Item>
89
- <Questions
90
- handleChanges={handleInputChange}
91
- responseTypeOptions={responseTypeOptions}
92
- responseTypeComponent
93
- form={form}
94
- />
95
- </Form.Item>
96
- </div>
97
- </Form>
98
- </div>
99
- );
100
- };
@@ -1,31 +0,0 @@
1
-
2
- .categoryNameContainer {
3
- display: flex;
4
- gap: 32px;
5
- }
6
-
7
- .categoryContent {
8
- padding: 12px;
9
- }
10
-
11
- .categoryName {
12
- width: 100%;
13
- }
14
-
15
- .formHeader {
16
- display: grid;
17
- grid-template-columns: minmax(200px, 1fr) auto auto auto auto;
18
- gap: 46px;
19
- }
20
-
21
- .questionsWrapper {
22
- margin-top: 16px;
23
- }
24
-
25
- Label {
26
- margin-bottom: 8px;
27
- }
28
-
29
- .input {
30
- height: 36px;
31
- }