@omniumretail/component-library 1.1.82 → 1.1.84

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.
package/dist/main.css CHANGED
@@ -18,7 +18,7 @@
18
18
  .gER2xKwlnobsIz4BLhGJ{background-color:var(--color-grey) !important}.gER2xKwlnobsIz4BLhGJ[aria-checked=true]{background:var(--color-orange) !important}
19
19
  .lOKzfPUFf3ukLT2wGZaY{display:grid;grid-template-columns:300px auto;gap:16px}.OIrZOBn2f036M5MGzc61,.adDQP_uvIYgNFVC4VdHj{background:#fff;padding:20px;overflow:auto}
20
20
  .yBjbWkudwA_AOwhHrnlc .ant-tree-title{font-weight:var(--font-weight-semibold)}.yBjbWkudwA_AOwhHrnlc button{margin-top:32px;width:100%}.yBjbWkudwA_AOwhHrnlc button:nth-child(3){margin-top:12px}.je000VEfsPqZupGr8ymu{font-size:var(--font-size-body-4);font-weight:600;line-height:100%;color:var(--color-blue);text-transform:uppercase}.tUDGWNXopUejF6zWJloy{margin-top:20px}
21
- .O0Juh2loT1HHb612gOA4 .ant-form-item{margin-bottom:0}.O0Juh2loT1HHb612gOA4 .ant-space{display:flex;flex-direction:column;gap:12px;border-bottom:1px solid var(--color-blue);padding:16px 10px}.O0Juh2loT1HHb612gOA4 .ant-space-item{width:100%}.hg7oiINfKCZSUt6dEq4A{display:none}.BAso_dbeoowN7VtxWiKx{display:grid;grid-template-columns:minmax(18px, auto) 1fr 90px;gap:20px;color:var(--color-black);font-size:var(--font-size-body-4);line-height:100%;font-weight:var(--font-weight-medium);align-items:center}.BAso_dbeoowN7VtxWiKx.W120L8cnn6ydwOqHngty{max-width:650px}.qg_bZXG9dQdJvLBRGuqw{display:grid;grid-template-columns:minmax(18px, auto) 1fr 90px;gap:20px;color:var(--color-grey-dark);font-size:var(--font-size-body-3);align-items:center}.GbZVOtcaUURjn4CweVjF{display:flex;gap:40px;font-size:var(--font-size-body-3);align-items:center}@media(max-width: 768px){.GbZVOtcaUURjn4CweVjF{gap:12px}}.C3Qrjv76hDipL39fyfzf{display:flex;align-items:center;gap:8px}@media(max-width: 768px){.C3Qrjv76hDipL39fyfzf{width:100%}}.kknDal3CIbUXI7Lu2wPV{display:flex;align-items:center;justify-content:flex-start;gap:20px}.CIMvcFtQWcBY31wttg2C{min-width:200px}@media(max-width: 768px){.CIMvcFtQWcBY31wttg2C{min-width:100px}}.upuPapYjj1uGowukEEIi{display:none;align-items:center;justify-content:center}.KfrJPVKxY4b6bmXeJL5U{display:flex;align-items:center;justify-content:center;gap:16px}.zRPlv7rfSSACHPLZLs16,.EHyxN8DmDHOLkQDROSV5,.NLIlnBPfo09cpWYzpZ_J{font-size:var(--font-size-body-5);cursor:pointer}.AHIc83P7PkYUr3no83sO{margin-top:24px}
21
+ .O0Juh2loT1HHb612gOA4 .ant-form-item{margin-bottom:0}.O0Juh2loT1HHb612gOA4 .ant-space{display:flex;flex-direction:column;gap:12px;border-bottom:1px solid var(--color-blue);padding:16px 10px}.O0Juh2loT1HHb612gOA4 .ant-space-item{width:100%}.hg7oiINfKCZSUt6dEq4A{display:none}.BAso_dbeoowN7VtxWiKx{display:grid;grid-template-columns:minmax(18px, auto) 1fr 90px;gap:20px;color:var(--color-black);font-size:var(--font-size-body-4);line-height:100%;font-weight:var(--font-weight-medium);align-items:center}.BAso_dbeoowN7VtxWiKx.W120L8cnn6ydwOqHngty{max-width:650px}.qg_bZXG9dQdJvLBRGuqw{display:grid;grid-template-columns:minmax(18px, auto) 1fr 90px;gap:20px;color:var(--color-grey-dark);font-size:var(--font-size-body-3);align-items:center}.GbZVOtcaUURjn4CweVjF{display:flex;gap:40px;font-size:var(--font-size-body-3);align-items:center}@media(max-width: 768px){.GbZVOtcaUURjn4CweVjF{gap:12px}}.C3Qrjv76hDipL39fyfzf{display:flex;align-items:center;gap:8px}@media(max-width: 768px){.C3Qrjv76hDipL39fyfzf{width:100%}}.kknDal3CIbUXI7Lu2wPV{display:flex;align-items:center;justify-content:flex-start;gap:20px}.CIMvcFtQWcBY31wttg2C{min-width:200px;max-width:450px}@media(max-width: 768px){.CIMvcFtQWcBY31wttg2C{min-width:100px;max-width:250px}}.upuPapYjj1uGowukEEIi{display:none;align-items:center;justify-content:center}.KfrJPVKxY4b6bmXeJL5U{display:flex;align-items:center;justify-content:center;gap:16px}.zRPlv7rfSSACHPLZLs16,.EHyxN8DmDHOLkQDROSV5,.NLIlnBPfo09cpWYzpZ_J{font-size:var(--font-size-body-5);cursor:pointer}.AHIc83P7PkYUr3no83sO{margin-top:24px}:where(.css-dev-only-do-not-override-f7vrd6).ant-cascader-dropdown .ant-cascader-menu-item-disabled{color:unset}
22
22
  .vw302ajYc4_7bIROncyM{font-size:var(--font-size-body-4);font-weight:600;line-height:100%;color:var(--color-blue);text-transform:uppercase;margin-bottom:32px}.k3OGGGQwXB0zmX0T61yt{display:flex;gap:32px}.JHuRhb2cRXyGWESiQ2TQ{width:100%}.DrsaZTs1Ny6wZ76RwDR9{font-size:var(--font-size-body-2);color:var(--color-black);font-weight:700;text-transform:uppercase}.HVSssNqaNxLcYT_1lxBL{display:grid;grid-template-columns:minmax(200px, 1fr) auto auto auto auto;gap:46px}.ACPbYsV0wNkissVLHcFh{margin-top:16px}Label{margin-bottom:8px}.mIHYAri6ebHm4Oeb1ogj{min-width:200px}@media(max-width: 768px){.mIHYAri6ebHm4Oeb1ogj{min-width:150px}}.g19LZsD26yzPPjBtV31w .ant-select{width:100%}.g19LZsD26yzPPjBtV31w .ant-select-selector{border-color:rgba(var(--color-black-rgb), 0.5) !important;height:50px !important;display:flex;align-items:center}.g19LZsD26yzPPjBtV31w .ant-select-arrow{color:var(--color-black)}.g19LZsD26yzPPjBtV31w .ant-switch{width:30px}
23
23
  .j8_c3JHTX0JOkT36fF6A{contain:inline-size}.j8_c3JHTX0JOkT36fF6A .HgmGSts5FIH3osmekIYG{height:50px;width:300px}@media(min-width: 1024px){.j8_c3JHTX0JOkT36fF6A .HgmGSts5FIH3osmekIYG{width:450px}}.j8_c3JHTX0JOkT36fF6A .xlaG0XsJDRR9AClqXzzC .ant-tag{background-color:var(--color-orange);color:var(--color-white);padding:6px 16px;max-width:240px}.j8_c3JHTX0JOkT36fF6A .xlaG0XsJDRR9AClqXzzC .anticon-close{color:var(--color-white);font-size:12px}.j8_c3JHTX0JOkT36fF6A .xlaG0XsJDRR9AClqXzzC .anticon-close:hover{color:var(--color-black)}
24
24
  .BWmwZ5nFKyctBZyOAXzg{width:100%}.GWTSauaAl_v9W8o4YPxW{background:rgba(44,45,46,.0509803922);height:100%;position:relative}.GWTSauaAl_v9W8o4YPxW .ant-menu-light{background-color:rgba(0,0,0,0) !important;border-inline-end:none !important}.GWTSauaAl_v9W8o4YPxW .ant-menu-title-content{font-size:17px;line-height:20px;font-weight:var(--font-weight-semibold)}.GWTSauaAl_v9W8o4YPxW .ant-menu-title-content:hover{color:var(--color-orange)}.GWTSauaAl_v9W8o4YPxW .ant-menu-sub .ant-menu-title-content{font-size:15px;line-height:18px;font-weight:var(--font-weight-medium)}.GWTSauaAl_v9W8o4YPxW .ant-menu-sub .ant-menu-item{height:30px;line-height:30px;margin-bottom:16px}.GWTSauaAl_v9W8o4YPxW .ant-menu-sub .ant-menu-item:first-child{margin-top:-10px}.GWTSauaAl_v9W8o4YPxW .ant-menu-submenu{border-top:1px solid var(--color-orange);border-radius:0}.GWTSauaAl_v9W8o4YPxW .ant-menu-item:hover{background-color:initial !important}.GWTSauaAl_v9W8o4YPxW .ant-menu-item-selected,.GWTSauaAl_v9W8o4YPxW .ant-menu-submenu-selected>.ant-menu-submenu-title{color:var(--color-orange);background-color:initial}.GWTSauaAl_v9W8o4YPxW .ant-menu-inline .ant-menu-sub.ant-menu-inline{background:initial}.GWTSauaAl_v9W8o4YPxW .ant-menu-submenu-title{height:50px !important;line-height:50px !important}.GWTSauaAl_v9W8o4YPxW .ant-menu-submenu-title:hover{background-color:initial !important}.GWTSauaAl_v9W8o4YPxW .ant-menu-submenu-title .anticon{color:var(--color-orange)}.GWTSauaAl_v9W8o4YPxW .ant-menu-inline.ant-menu-root .ant-menu-item>.ant-menu-title-content{overflow-x:auto;text-overflow:unset}.hWGer1IJ7RdkfQWwYfsw{position:absolute;top:24px;left:24px;right:24px;height:144px}.MD1FhirslDDwd2izGwai{font-size:var(--font-size-body-2);line-height:14px;font-weight:var(--font-weight-light);display:inline-block;padding:12px;cursor:pointer;position:absolute;right:0;top:60px}.RxGn4c38kNq8Ai4ypW_x{position:absolute;top:144px;left:24px;right:24px;bottom:0;overflow-y:auto;overflow-x:hidden;padding-bottom:24px}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{border-radius:10px;background:rgba(0,0,0,.1)}::-webkit-scrollbar-thumb{border-radius:10px;background:rgba(0,0,0,.2)}::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.4)}::-webkit-scrollbar-thumb:active{background:rgba(0,0,0,.9)}
@@ -1 +1 @@
1
- export declare const SingleQuestion: ({ key, provided, snapshot, remove, name, showGrade, handleChanges, showCheckbox, responseTypeOptions, hasHeader, responseTypeComponent, ...restField }: any) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const SingleQuestion: ({ key, provided, snapshot, remove, name, showGrade, handleChanges, showCheckbox, responseTypeOptions, hasHeader, responseTypeComponent, form, ...restField }: any) => import("react/jsx-runtime").JSX.Element;
@@ -5,5 +5,6 @@ export interface QuestionsProps {
5
5
  responseTypeOptions: any;
6
6
  hasHeader?: boolean;
7
7
  responseTypeComponent?: boolean;
8
+ form?: any;
8
9
  }
9
10
  export declare const Questions: (props: QuestionsProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.1.82",
3
+ "version": "1.1.84",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -21,10 +21,13 @@ const Template: Story<any> = (args) => {
21
21
  "IsOpenAnswer": false,
22
22
  "IsCheckBox": false,
23
23
  "IsNumeric": true,
24
+ "IsDate": false,
24
25
  "HasGrade": true,
25
26
  "IsEmphasis": false,
26
- "State": "Finished",
27
+ "IsMultipleChoise": false,
28
+ "State": "Deleted",
27
29
  "Grade": 4,
30
+ "Rank": 1,
28
31
  "Options": [
29
32
  {
30
33
  "Value": "string",
@@ -34,9 +37,10 @@ const Template: Story<any> = (args) => {
34
37
  }
35
38
  ],
36
39
  "CreateDate": "2024-02-29T10:21:18.448Z",
37
- "UpdateDate": "2024-06-04T14:51:29.942Z",
40
+ "UpdateDate": "2024-08-09T10:48:32.487Z",
38
41
  "StartDate": "2024-06-04T14:51:29.942Z",
39
- "Status": "A"
42
+ "Status": "A",
43
+ "ShowAnswerType": false
40
44
  },
41
45
  {
42
46
  "Id": "DF873E84-1941-45E1-84C5-D2D12A0E305D",
@@ -44,89 +48,308 @@ const Template: Story<any> = (args) => {
44
48
  "IsOpenAnswer": false,
45
49
  "IsCheckBox": false,
46
50
  "IsNumeric": false,
51
+ "IsDate": false,
47
52
  "HasGrade": false,
48
53
  "IsEmphasis": false,
49
54
  "IsMultipleChoise": true,
50
- "State": "Draft",
55
+ "State": "Finished",
51
56
  "Grade": 0,
57
+ "Rank": 0,
52
58
  "Options": [
53
59
  {
54
60
  "Value": "Sim",
55
61
  "Grade": 5,
56
- "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
62
+ "Color": "#b75959",
57
63
  "NeedsAction": false
58
64
  },
59
65
  {
60
66
  "Value": "Nao",
61
67
  "Grade": 10,
62
- "Color": "",
68
+ "Color": "#00000",
63
69
  "NeedsAction": true
64
70
  }
65
71
  ],
66
72
  "CreateDate": "2024-04-12T14:58:32.085Z",
67
- "UpdateDate": "2024-04-12T14:58:32.085Z",
68
- "StartDate": "0001-01-01T00:00:00Z",
69
- "Status": "A"
73
+ "UpdateDate": "2024-08-23T15:27:35.196Z",
74
+ "StartDate": "2024-08-23T15:27:35.196Z",
75
+ "Status": "A",
76
+ "ShowAnswerType": true
70
77
  },
71
78
  {
72
- "Id": "B867BEA8-E0A4-44D2-BBDA-7CB89334D80E",
73
- "Name": null,
79
+ "Id": "058D4541-8739-49C2-85D0-A6BF3BA19E4E",
80
+ "Name": "Verdade ou mentira",
74
81
  "IsOpenAnswer": false,
75
82
  "IsCheckBox": false,
76
83
  "IsNumeric": false,
84
+ "IsDate": false,
77
85
  "HasGrade": false,
78
86
  "IsEmphasis": false,
79
87
  "IsMultipleChoise": true,
80
88
  "State": "Draft",
81
89
  "Grade": 0,
90
+ "Rank": 4,
82
91
  "Options": [
83
92
  {
84
- "Value": "Sim",
85
- "Grade": 5,
93
+ "Value": "Verdadeiro",
94
+ "Grade": 1,
95
+ "Color": "#00ff12",
96
+ "NeedsAction": false
97
+ },
98
+ {
99
+ "Value": "Mentira",
100
+ "Grade": 0,
86
101
  "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
102
+ "NeedsAction": true
103
+ }
104
+ ],
105
+ "CreateDate": "2024-04-18T16:11:59.622Z",
106
+ "UpdateDate": "2024-07-17T13:26:55.766Z",
107
+ "StartDate": "2024-04-18T16:12:13.135Z",
108
+ "Status": "A",
109
+ "ShowAnswerType": true
110
+ },
111
+ {
112
+ "Id": "65E6051B-E9D1-46BA-9486-4099D470613F",
113
+ "Name": "Sim/Não/Não Sei",
114
+ "IsOpenAnswer": false,
115
+ "IsCheckBox": false,
116
+ "IsNumeric": false,
117
+ "IsDate": false,
118
+ "HasGrade": false,
119
+ "IsEmphasis": false,
120
+ "IsMultipleChoise": true,
121
+ "State": "Draft",
122
+ "Grade": 0,
123
+ "Rank": 5,
124
+ "Options": [
125
+ {
126
+ "Value": "Sim",
127
+ "Grade": 2,
128
+ "Color": "#14f116",
87
129
  "NeedsAction": false
88
130
  },
89
131
  {
90
- "Value": "Nao",
91
- "Grade": 10,
92
- "Color": "",
132
+ "Value": "Não",
133
+ "Grade": 1,
134
+ "Color": "#ef0f0f",
93
135
  "NeedsAction": true
136
+ },
137
+ {
138
+ "Value": "Não sei",
139
+ "Grade": 0,
140
+ "Color": "#0003f7",
141
+ "NeedsAction": false
94
142
  }
95
143
  ],
96
- "CreateDate": "2024-04-12T14:58:32.085Z",
97
- "UpdateDate": "2024-04-12T14:58:32.085Z",
144
+ "CreateDate": "2024-07-02T10:31:08.974Z",
145
+ "UpdateDate": "2024-07-17T13:27:17.646Z",
98
146
  "StartDate": "0001-01-01T00:00:00Z",
99
- "Status": "A"
147
+ "Status": "A",
148
+ "ShowAnswerType": true
100
149
  },
101
150
  {
102
- "Id": "058D4541-8739-49C2-85D0-A6BF3BA19E4E",
103
- "Name": "Verdade ou mentira",
151
+ "Id": "93AF03D8-07B4-4622-A45C-D0206AB2A98D",
152
+ "Name": "Verdadeiro e falso",
104
153
  "IsOpenAnswer": false,
105
154
  "IsCheckBox": false,
106
155
  "IsNumeric": false,
156
+ "IsDate": false,
107
157
  "HasGrade": false,
108
158
  "IsEmphasis": false,
109
- "IsMultipleChoise": false,
159
+ "IsMultipleChoise": true,
110
160
  "State": "Finished",
111
161
  "Grade": 0,
162
+ "Rank": 6,
112
163
  "Options": [
113
164
  {
114
- "Value": "Verdadeiro",
165
+ "Value": "V",
115
166
  "Grade": 1,
116
- "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
167
+ "Color": "#12e662",
117
168
  "NeedsAction": false
118
169
  },
119
170
  {
120
- "Value": "Mentira",
171
+ "Value": "F",
121
172
  "Grade": 0,
122
- "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
173
+ "Color": "#d91818",
123
174
  "NeedsAction": true
124
175
  }
125
176
  ],
126
- "CreateDate": "2024-04-18T16:11:59.622Z",
127
- "UpdateDate": "2024-04-18T16:12:13.135Z",
128
- "StartDate": "2024-04-18T16:12:13.135Z",
129
- "Status": "A"
177
+ "CreateDate": "2024-07-02T16:29:26.101Z",
178
+ "UpdateDate": "2024-07-02T16:29:27.755Z",
179
+ "StartDate": "2024-07-02T16:29:27.755Z",
180
+ "Status": "A",
181
+ "ShowAnswerType": true
182
+ },
183
+ {
184
+ "Id": "F0CCAFB5-A9E7-42A3-9E9D-3827C1461065",
185
+ "Name": "Sim / Não / N/A",
186
+ "IsOpenAnswer": false,
187
+ "IsCheckBox": false,
188
+ "IsNumeric": false,
189
+ "IsDate": false,
190
+ "HasGrade": false,
191
+ "IsEmphasis": false,
192
+ "IsMultipleChoise": true,
193
+ "State": "Finished",
194
+ "Grade": 0,
195
+ "Rank": 7,
196
+ "Options": [
197
+ {
198
+ "Value": "Sim",
199
+ "Grade": 2,
200
+ "Color": "#02e235",
201
+ "NeedsAction": false
202
+ },
203
+ {
204
+ "Value": "Não",
205
+ "Grade": 0,
206
+ "Color": "#f40000",
207
+ "NeedsAction": false
208
+ },
209
+ {
210
+ "Value": "N/A",
211
+ "Grade": 0,
212
+ "Color": "#00000",
213
+ "NeedsAction": false
214
+ }
215
+ ],
216
+ "CreateDate": "2024-07-04T10:02:07.001Z",
217
+ "UpdateDate": "2024-07-04T10:02:08.783Z",
218
+ "StartDate": "2024-07-04T10:02:08.783Z",
219
+ "Status": "A",
220
+ "ShowAnswerType": true
221
+ },
222
+ {
223
+ "Id": "57859452-4B79-4005-BB6C-3695C78270FD",
224
+ "Name": "Lojas",
225
+ "IsOpenAnswer": false,
226
+ "IsCheckBox": false,
227
+ "IsNumeric": false,
228
+ "IsDate": false,
229
+ "HasGrade": false,
230
+ "IsEmphasis": false,
231
+ "IsMultipleChoise": true,
232
+ "State": "Finished",
233
+ "Grade": 0,
234
+ "Rank": 8,
235
+ "Options": [
236
+ {
237
+ "Value": "NorteShopping",
238
+ "Grade": 0,
239
+ "Color": "#f12a2a",
240
+ "NeedsAction": true
241
+ },
242
+ {
243
+ "Value": "GaiaShopping",
244
+ "Grade": 0,
245
+ "Color": "#191be7",
246
+ "NeedsAction": false
247
+ },
248
+ {
249
+ "Value": "CatarinaShopping",
250
+ "Grade": 0,
251
+ "Color": "#00000",
252
+ "NeedsAction": false
253
+ }
254
+ ],
255
+ "CreateDate": "2024-07-04T11:32:36.118Z",
256
+ "UpdateDate": "2024-08-23T15:28:07.14Z",
257
+ "StartDate": "2024-08-23T15:28:07.14Z",
258
+ "Status": "A",
259
+ "ShowAnswerType": true
260
+ },
261
+ {
262
+ "Id": "90DA4D64-9DB6-4D7D-A9C6-5E128905B71C",
263
+ "Name": "teste",
264
+ "IsOpenAnswer": false,
265
+ "IsCheckBox": false,
266
+ "IsNumeric": false,
267
+ "IsDate": false,
268
+ "HasGrade": false,
269
+ "IsEmphasis": false,
270
+ "IsMultipleChoise": true,
271
+ "State": "Draft",
272
+ "Grade": 0,
273
+ "Rank": 8,
274
+ "Options": [
275
+ {
276
+ "Value": "teste",
277
+ "Grade": 0,
278
+ "Color": "#00000",
279
+ "NeedsAction": true
280
+ }
281
+ ],
282
+ "CreateDate": "2024-08-23T08:35:24.04Z",
283
+ "UpdateDate": "2024-08-23T08:35:24.041Z",
284
+ "StartDate": "0001-01-01T00:00:00Z",
285
+ "Status": "A",
286
+ "ShowAnswerType": true
287
+ },
288
+ {
289
+ "Id": "CD8D0F30-6229-4BA9-9888-4398CB333392",
290
+ "Name": "Data",
291
+ "IsOpenAnswer": false,
292
+ "IsCheckBox": false,
293
+ "IsNumeric": true,
294
+ "IsDate": true,
295
+ "HasGrade": true,
296
+ "IsEmphasis": false,
297
+ "IsMultipleChoise": false,
298
+ "State": "Finished",
299
+ "Grade": 4,
300
+ "Rank": 2,
301
+ "Options": [
302
+ {
303
+ "Value": "string",
304
+ "Grade": 5,
305
+ "Color": "string",
306
+ "NeedsAction": true
307
+ }
308
+ ],
309
+ "CreateDate": "2024-02-29T10:21:18.448Z",
310
+ "UpdateDate": "2024-08-09T10:48:32.487Z",
311
+ "StartDate": "2024-06-04T14:51:29.942Z",
312
+ "Status": "A",
313
+ "ShowAnswerType": false
314
+ },
315
+ {
316
+ "Id": "A45656EF-27D3-42C0-AE91-550289415357",
317
+ "Name": "Horas de inspeção",
318
+ "IsOpenAnswer": false,
319
+ "IsCheckBox": false,
320
+ "IsNumeric": false,
321
+ "IsDate": false,
322
+ "HasGrade": false,
323
+ "IsEmphasis": false,
324
+ "IsMultipleChoise": true,
325
+ "State": "Finished",
326
+ "Grade": 0,
327
+ "Rank": 8,
328
+ "Options": [
329
+ {
330
+ "Value": "1",
331
+ "Grade": 1,
332
+ "Color": "#00000",
333
+ "NeedsAction": false
334
+ },
335
+ {
336
+ "Value": "2",
337
+ "Grade": 0,
338
+ "Color": "#00000",
339
+ "NeedsAction": false
340
+ },
341
+ {
342
+ "Value": "3+",
343
+ "Grade": 0,
344
+ "Color": "#00000",
345
+ "NeedsAction": false
346
+ }
347
+ ],
348
+ "CreateDate": "2024-08-27T16:18:45.76Z",
349
+ "UpdateDate": "2024-08-27T16:18:46.187Z",
350
+ "StartDate": "2024-08-27T16:18:46.187Z",
351
+ "Status": "A",
352
+ "ShowAnswerType": true
130
353
  }
131
354
  ]
132
355
 
@@ -241,6 +241,7 @@ export const CategoryContent = (props: categoryContent) => {
241
241
  handleChanges={handleInputChange}
242
242
  responseTypeOptions={responseTypeOptions}
243
243
  hasHeader={categorySidebarData?.data?.key === "0" && hasHeader}
244
+ form={form}
244
245
  />
245
246
  </Form.Item>
246
247
  </div>
@@ -1,11 +1,9 @@
1
1
  import { DeleteOutlined, HolderOutlined, InfoCircleOutlined } from '@ant-design/icons';
2
- import { Checkbox, ColorPicker, Form, Input, Space } from 'antd';
2
+ import { Checkbox, ColorPicker, Form, Input, Select, Space } from 'antd';
3
3
  import { t } from 'i18next';
4
4
  import styles from './styles.module.scss';
5
- import { useContext, useState } from 'react';
6
- import { Select } from 'antd';
5
+ import { useState } from 'react';
7
6
  import classnames from 'classnames';
8
- import { FieldContext } from 'rc-field-form';
9
7
 
10
8
  export const SingleQuestion = ({
11
9
  key,
@@ -19,24 +17,58 @@ export const SingleQuestion = ({
19
17
  responseTypeOptions,
20
18
  hasHeader,
21
19
  responseTypeComponent,
20
+ form,
22
21
  ...restField
23
22
  }: any) => {
24
23
  const [mandatoryCheckbox, setMandatoryCheckbox] = useState<boolean>(false);
25
24
  const [emphasisCheckbox, setEmphasisCheckbox] = useState<boolean>(false);
26
25
  const [multipleChoiseCheckbox, setMultipleChoiseCheckbox] = useState<boolean>(false);
27
26
 
28
- const formContext = useContext(FieldContext);
29
-
30
27
  const filteredIds = responseTypeOptions
31
28
  ?.filter((item: { IsMultipleChoise: any; }) => item.IsMultipleChoise)
32
- .map((item: { Id: any; }) => item.Id);
33
-
34
- const answerTypeOptions = responseTypeOptions?.map((answerType: any) => ({
35
- value: answerType?.Id,
36
- label: answerType?.Name
37
- }));
38
-
39
- console.log(filteredIds);
29
+ ?.map((item: { Id: any; }) => item.Id);
30
+
31
+ const sortedAnswerTypeOptions = responseTypeOptions?.sort((a: any, b: any) => {
32
+ return Number(a.IsMultipleChoise) - Number(b.IsMultipleChoise);
33
+ });
34
+
35
+ const answerTypeOptions = sortedAnswerTypeOptions?.map((answerType: any, index: number) => {
36
+ const formattedOptions = answerType.Options?.map((option: any, idx: number) => {
37
+ const flag = option.NeedsAction ? "🚩" : "";
38
+ return (
39
+ <span key={idx} style={{ color: option.Color }}>
40
+ {option.Value} ({option.Grade}) {flag}
41
+ </span>
42
+ );
43
+ }).reduce((acc: any[], curr: any, idx: number, arr: any[]) => {
44
+ if (idx === arr.length - 1) {
45
+ return acc.concat(curr);
46
+ } else {
47
+ return acc.concat(curr, ', ');
48
+ }
49
+ }, []);
50
+
51
+ return {
52
+ value: answerType.Id,
53
+ label: (
54
+ <div>{answerType?.IsMultipleChoise ? formattedOptions : answerType.Name}</div>
55
+ ),
56
+ };
57
+ });
58
+
59
+ const handleResponseType = (selectedValue: string) => {
60
+ const selectedResponseType = sortedAnswerTypeOptions.find(
61
+ (type: any) => type.Id === selectedValue
62
+ );
63
+
64
+ if (selectedResponseType) {
65
+ const hasNeedsAction = selectedResponseType.Options.some(
66
+ (option: any) => option.NeedsAction === true
67
+ );
68
+
69
+ setEmphasisCheckbox(hasNeedsAction);
70
+ }
71
+ };
40
72
 
41
73
  const onCheckboxMultipeChoiseHandler = (checked: boolean) => {
42
74
  setMultipleChoiseCheckbox(checked);
@@ -51,7 +83,8 @@ export const SingleQuestion = ({
51
83
  const onCheckboxEmphasisHandler = (checked: boolean) => {
52
84
  setEmphasisCheckbox(checked);
53
85
  handleChanges();
54
- }
86
+ };
87
+
55
88
 
56
89
  const questionStyle = classnames({
57
90
  [styles.responseTypeQuestion]: responseTypeComponent
@@ -152,14 +185,18 @@ export const SingleQuestion = ({
152
185
  {...restField}
153
186
  name={[name, 'emphasis']}
154
187
  valuePropName='checked'
188
+ // getValueProps={() => ({ checked: emphasisCheckbox })}
155
189
  >
156
- <Checkbox onChange={(e) => onCheckboxEmphasisHandler(e.target.checked)} checked={emphasisCheckbox} />
190
+ <Checkbox
191
+ onChange={(e) => onCheckboxEmphasisHandler(e.target.checked)}
192
+ checked={emphasisCheckbox}
193
+ />
157
194
  </Form.Item>
158
195
 
159
196
  <span>{t('components.category.emphasisAnswer')}</span>
160
197
  </div>
161
198
 
162
- {filteredIds?.includes(formContext.getFieldsValue().questions?.[name]?.responseType) &&
199
+ {filteredIds?.includes(form.getFieldsValue().questions?.[name]?.responseType) &&
163
200
  < div className={styles.checkboxContainer}>
164
201
  <Form.Item
165
202
  {...restField}
@@ -184,11 +221,11 @@ export const SingleQuestion = ({
184
221
  >
185
222
  <Select
186
223
  options={answerTypeOptions}
187
- onBlur={handleChanges}
188
224
  className={styles.selectResponseType}
225
+ // onChange={handleResponseType}
226
+ dropdownStyle={{ minWidth: 500 }}
189
227
  />
190
228
  </Form.Item>
191
-
192
229
  <span>{t('components.category.responseType')}</span>
193
230
  </div>
194
231
  </div>
@@ -79,9 +79,11 @@ $questionAndInformationGap: 20px;
79
79
 
80
80
  .selectResponseType {
81
81
  min-width: 200px;
82
+ max-width: 450px;
82
83
 
83
84
  @media(max-width: 768px) {
84
85
  min-width: 100px;
86
+ max-width: 250px;
85
87
  }
86
88
  }
87
89
 
@@ -108,3 +110,9 @@ $questionAndInformationGap: 20px;
108
110
  .addQuestion {
109
111
  margin-top: 24px;
110
112
  }
113
+
114
+ :global {
115
+ :where(.css-dev-only-do-not-override-f7vrd6).ant-cascader-dropdown .ant-cascader-menu-item-disabled {
116
+ color: unset;
117
+ }
118
+ }
@@ -1,10 +1,8 @@
1
- import { Dispatch, SetStateAction, useContext } from 'react';
2
1
  import { PlusOutlined } from '@ant-design/icons';
3
2
  import { Form } from 'antd';
4
3
  import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
5
4
  import { SingleQuestion } from "./SingleQuestion";
6
5
  import { Link } from '../Link';
7
- import { FieldContext } from 'rc-field-form';
8
6
  import { t } from 'i18next';
9
7
 
10
8
  export interface QuestionsProps {
@@ -14,6 +12,7 @@ export interface QuestionsProps {
14
12
  responseTypeOptions: any;
15
13
  hasHeader?: boolean;
16
14
  responseTypeComponent?: boolean;
15
+ form?: any
17
16
  }
18
17
 
19
18
  export const Questions = (props: QuestionsProps) => {
@@ -26,14 +25,12 @@ export const Questions = (props: QuestionsProps) => {
26
25
  responseTypeComponent
27
26
  } = props;
28
27
 
29
- const formContext = useContext(FieldContext);
30
-
31
28
  const items = Form.useWatch('questions');
32
29
  const onDragEnd = (result: any) => {
33
30
  const newItems: any = items;
34
31
  const [removed] = newItems.splice(result.source.index, 1);
35
32
  newItems.splice(result.destination.index, 0, removed);
36
- formContext.setFieldValue('questions', newItems);
33
+ props.form.setFieldValue('questions', newItems);
37
34
  };
38
35
 
39
36
  return (
@@ -47,7 +44,7 @@ export const Questions = (props: QuestionsProps) => {
47
44
  }, 1);
48
45
  }
49
46
 
50
- const fieldsUpdated = fields.map((field, index) => {
47
+ const fieldsUpdated = fields?.map((field, index) => {
51
48
  return field = { ...field, name: index, key: index, fieldKey: index };
52
49
  })
53
50
 
@@ -58,7 +55,7 @@ export const Questions = (props: QuestionsProps) => {
58
55
  {(provided) => (
59
56
  <div {...provided.droppableProps} ref={provided.innerRef}>
60
57
  <>
61
- {fieldsUpdated.map(({ key, name, ...restField }) => {
58
+ {fieldsUpdated?.map(({ key, name, ...restField }) => {
62
59
  return (
63
60
  <Draggable key={key} draggableId={`${key}`} index={key}>
64
61
  {(provided, snapshot) => (
@@ -76,6 +73,7 @@ export const Questions = (props: QuestionsProps) => {
76
73
  responseTypeOptions={responseTypeOptions}
77
74
  hasHeader={hasHeader}
78
75
  responseTypeComponent={responseTypeComponent}
76
+ form={props.form}
79
77
  />
80
78
  </>
81
79
  )}