@omniumretail/component-library 1.1.57 → 1.1.60

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
@@ -19,7 +19,7 @@
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
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}.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}.C3Qrjv76hDipL39fyfzf{display:flex;align-items:center;gap:8px}.y8UJFmCyGQzEQk4XjnI9{display:none}.kknDal3CIbUXI7Lu2wPV{display:flex;align-items:center;justify-content:flex-start;gap:20px}.CIMvcFtQWcBY31wttg2C{min-width:250px}@media(max-width: 768px){.CIMvcFtQWcBY31wttg2C{min-width:150px}}.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}
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}.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}
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)}
25
25
  .rdjN4ln3xiUoa6Q0NMMm{display:flex;flex-direction:column;gap:16px;height:100%}@media(min-width: 600px){.rdjN4ln3xiUoa6Q0NMMm{display:grid;grid-template-columns:220px auto}}@media(min-width: 768px){.rdjN4ln3xiUoa6Q0NMMm{grid-template-columns:300px auto}}.Q4flbvKEPN6Jx9Cob22I{background:#ebeced;overflow:auto;padding:20px}@media(max-width: 599px){.Q4flbvKEPN6Jx9Cob22I{padding:20px 20px 0 20px;max-height:80px}}.hK3soC6m563VuiLnNutq{background:var(--color-white);overflow:auto;padding:20px}@media(max-width: 599px){.hK3soC6m563VuiLnNutq{height:100%}}.guqqOMHeZE56Bg2p5Ad8{font-size:var(--font-size-body-2);color:var(--color-blue);margin-bottom:12px;font-weight:var(--font-weight-semibold);text-transform:uppercase}@media(min-width: 768px){.guqqOMHeZE56Bg2p5Ad8{font-size:var(--font-size-body-4);margin-bottom:36px}}.wRCQxnQc_MZGDeiY1bcL{padding-bottom:15px;font-weight:var(--font-weight-bold);font-size:var(--font-size-body-2)}@media(min-width: 768px){.wRCQxnQc_MZGDeiY1bcL{font-size:var(--font-size-body-4)}}.JRmeFBsSP1f1HJwarMpc{cursor:pointer}.Y6yF3VITdrKdQzDtqTZX{padding-left:16px}.Y6yF3VITdrKdQzDtqTZX .wRCQxnQc_MZGDeiY1bcL{font-weight:var(--font-weight-semibold)}.Y6yF3VITdrKdQzDtqTZX .aKZCkmPsc0LiPdj3sEeG .Y6yF3VITdrKdQzDtqTZX .wRCQxnQc_MZGDeiY1bcL{font-weight:var(--font-weight-light)}.aKZCkmPsc0LiPdj3sEeG{display:block}.U_3frSKmaOQyTCb9oBkg{color:var(--color-orange)}.GEZDeWAneRLnZQyf4y9l{margin-bottom:16px}@media(min-width: 768px){.GEZDeWAneRLnZQyf4y9l{margin-bottom:24px}}.YcOvMLXE7vKR2Y0_BPRr{font-size:var(--font-size-body-3);color:var(--color-blue);font-weight:var(--font-weight-semibold);margin-bottom:8px}@media(min-width: 768px){.YcOvMLXE7vKR2Y0_BPRr{font-size:var(--font-size-body-4)}}.vlMh_CCr45wbKV4fMhJx{font-size:var(--font-size-body-2);font-weight:var(--font-weight-light);color:var(--color-black)}@media(min-width: 768px){.vlMh_CCr45wbKV4fMhJx{font-size:var(--font-size-body-3)}}.NZ_ohAxNxhxZsCBr2PRA{display:flex;flex-direction:row;gap:12px;margin-bottom:24px}@media(min-width: 768px){.NZ_ohAxNxhxZsCBr2PRA{margin-bottom:36px}}.CArVrMs2ac6JvM1VGLSw{flex-direction:column;border-bottom:1px solid rgba(var(--color-blue-rgb), 0.2);margin-bottom:24px}.CArVrMs2ac6JvM1VGLSw .OpqJ6gab6fPIq3KyckPO{width:100%;border-bottom:none}.CArVrMs2ac6JvM1VGLSw .E9TXHxbgaI6LGMZHG9bV{width:100%;height:auto}.CArVrMs2ac6JvM1VGLSw .E9TXHxbgaI6LGMZHG9bV .ant-input{min-height:140px}.CArVrMs2ac6JvM1VGLSw .E9TXHxbgaI6LGMZHG9bV .ant-form-item{margin-bottom:16px}.OpqJ6gab6fPIq3KyckPO{width:100%;border-bottom:1px solid rgba(var(--color-blue-rgb), 0.2)}.E9TXHxbgaI6LGMZHG9bV{width:100px;height:50px;align-self:flex-end}.xdLvKgnXC4tm2aa6tAap{font-size:var(--font-size-body-2);font-weight:var(--font-weight-semibold);margin-bottom:8px}@media(min-width: 768px){.xdLvKgnXC4tm2aa6tAap{font-size:var(--font-size-body-3)}}.r5obiTduSUBq1uL7oceW{font-weight:var(--font-weight-light);margin-bottom:4px}.CHFuXtnqohUXV_oCAEKD{font-weight:var(--font-weight-light);margin-top:20px;display:flex;gap:4px}._Bw2YaPxzqqQRpeCMde6{word-wrap:break-word;white-space:pre-wrap;max-height:100px;overflow:auto}.bIiuhNuRh643knAaSeyC{font-weight:var(--font-weight-semibold)}.DdqSfNoeh7KPEQiD0Zpe{margin-bottom:unset;width:100%}.sZh7rUlP4vu0LIE2fcab{font-weight:var(--font-weight-light);margin-bottom:4px;margin-top:16px}.mdSJ5YgFou8MwSkVypYb{margin-left:46px;margin-top:12px}.AvKaftoXc2t7E53rqtq6{display:flex;flex-direction:row;gap:4px;margin-top:12px;margin-bottom:12px;width:100%}.SgT02NKW7ogui8ih5ehj{color:var(--color-black);background-color:var(--color-white);border:1px var(--color-black) solid;min-width:100px;height:20px;font-size:10px;padding:unset}@media(max-width: 767px){.SgT02NKW7ogui8ih5ehj{min-width:0px}}.SgT02NKW7ogui8ih5ehj:hover{background-color:var(--color-grey-light);color:var(--color-black) !important;border:1px var(--color-black) solid !important}.WPOztO5lxS5PXlAz75dE{color:var(--color-black);background-color:var(--color-white);border:1px var(--color-black) solid;min-width:100px;height:20px;font-size:10px;padding:unset}@media(max-width: 767px){.WPOztO5lxS5PXlAz75dE{min-width:0px}}.WPOztO5lxS5PXlAz75dE:hover{background-color:var(--color-grey-light);color:var(--color-black) !important;border:1px var(--color-black) solid !important}.ant-upload-wrapper{line-height:12px}.ant-upload-wrapper .ant-upload-list .ant-upload-list-item{max-width:100px}
@@ -1,7 +1,8 @@
1
1
  export interface Questions {
2
2
  grade: string;
3
- questions: string;
3
+ question: string;
4
4
  info: string;
5
+ responseType?: string;
5
6
  }
6
7
  export interface Data {
7
8
  categoryName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.1.57",
3
+ "version": "1.1.60",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -14,7 +14,126 @@ const Template: Story<any> = (args) => {
14
14
  console.log(serverData);
15
15
  }, [serverData])
16
16
 
17
- return <Category {...args} chooseResponse serverReadyData={setServerData} hasHeader data={[]}></Category>
17
+ const getAnswerTypeOptions = [
18
+ {
19
+ "Id": "CD8D0F30-6229-4BA9-9888-4398CB21D392",
20
+ "Name": "Resposta Numérica",
21
+ "IsOpenAnswer": false,
22
+ "IsCheckBox": false,
23
+ "IsNumeric": true,
24
+ "HasGrade": true,
25
+ "IsEmphasis": false,
26
+ "State": "Finished",
27
+ "Grade": 4,
28
+ "Options": [
29
+ {
30
+ "Value": "string",
31
+ "Grade": 5,
32
+ "Color": "string",
33
+ "NeedsAction": true
34
+ }
35
+ ],
36
+ "CreateDate": "2024-02-29T10:21:18.448Z",
37
+ "UpdateDate": "2024-06-04T14:51:29.942Z",
38
+ "StartDate": "2024-06-04T14:51:29.942Z",
39
+ "Status": "A"
40
+ },
41
+ {
42
+ "Id": "DF873E84-1941-45E1-84C5-D2D12A0E305D",
43
+ "Name": "Sim ou Não",
44
+ "IsOpenAnswer": false,
45
+ "IsCheckBox": false,
46
+ "IsNumeric": false,
47
+ "HasGrade": false,
48
+ "IsEmphasis": false,
49
+ "State": "Draft",
50
+ "Grade": 0,
51
+ "Options": [
52
+ {
53
+ "Value": "Sim",
54
+ "Grade": 5,
55
+ "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
56
+ "NeedsAction": false
57
+ },
58
+ {
59
+ "Value": "Nao",
60
+ "Grade": 10,
61
+ "Color": "",
62
+ "NeedsAction": true
63
+ }
64
+ ],
65
+ "CreateDate": "2024-04-12T14:58:32.085Z",
66
+ "UpdateDate": "2024-04-12T14:58:32.085Z",
67
+ "StartDate": "0001-01-01T00:00:00Z",
68
+ "Status": "A"
69
+ },
70
+ {
71
+ "Id": "B867BEA8-E0A4-44D2-BBDA-7CB89334D80E",
72
+ "Name": null,
73
+ "IsOpenAnswer": false,
74
+ "IsCheckBox": false,
75
+ "IsNumeric": false,
76
+ "HasGrade": false,
77
+ "IsEmphasis": false,
78
+ "State": "Draft",
79
+ "Grade": 0,
80
+ "Options": [
81
+ {
82
+ "Value": "Sim",
83
+ "Grade": 5,
84
+ "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
85
+ "NeedsAction": false
86
+ },
87
+ {
88
+ "Value": "Nao",
89
+ "Grade": 10,
90
+ "Color": "",
91
+ "NeedsAction": true
92
+ }
93
+ ],
94
+ "CreateDate": "2024-04-12T14:58:32.085Z",
95
+ "UpdateDate": "2024-04-12T14:58:32.085Z",
96
+ "StartDate": "0001-01-01T00:00:00Z",
97
+ "Status": "A"
98
+ },
99
+ {
100
+ "Id": "058D4541-8739-49C2-85D0-A6BF3BA19E4E",
101
+ "Name": "Verdade ou mentira",
102
+ "IsOpenAnswer": false,
103
+ "IsCheckBox": false,
104
+ "IsNumeric": false,
105
+ "HasGrade": false,
106
+ "IsEmphasis": false,
107
+ "State": "Finished",
108
+ "Grade": 0,
109
+ "Options": [
110
+ {
111
+ "Value": "Verdadeiro",
112
+ "Grade": 1,
113
+ "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
114
+ "NeedsAction": false
115
+ },
116
+ {
117
+ "Value": "Mentira",
118
+ "Grade": 0,
119
+ "Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
120
+ "NeedsAction": true
121
+ }
122
+ ],
123
+ "CreateDate": "2024-04-18T16:11:59.622Z",
124
+ "UpdateDate": "2024-04-18T16:12:13.135Z",
125
+ "StartDate": "2024-04-18T16:12:13.135Z",
126
+ "Status": "A"
127
+ }
128
+ ]
129
+
130
+ const answerTypeOptions = getAnswerTypeOptions?.map((answerType) => ({
131
+ value: answerType?.Id,
132
+ label: answerType?.Name
133
+ }));
134
+
135
+
136
+ return <Category {...args} chooseResponse serverReadyData={setServerData} responseTypeOptions={answerTypeOptions} hasHeader data={[]}></Category>
18
137
  };
19
138
 
20
139
  export const Primary = Template.bind({});
@@ -102,21 +102,41 @@ export const CategoryContent = (props: categoryContent) => {
102
102
  form={form}
103
103
  >
104
104
  <div className={styles.formHeader}>
105
- <div className={styles.category}>
106
- <Label isUppercase>
107
- {t('components.categoryContent.categoryName')}
108
- </Label>
109
- <Form.Item
110
- name={['categoryName']}
111
- rules={[{ required: true, message: t('components.categoryContent.categoryNameError')! }]}
112
- validateTrigger="onBlur"
113
- >
114
- <InputField
115
- disabled={categorySidebarData?.data?.key === "0" && hasHeader}
116
- placeholder={t('components.categoryContent.categoryName')!}
117
- onBlur={handleInputChange}
118
- />
119
- </Form.Item>
105
+ <div className={styles.categoryNameContainer}>
106
+ <div className={styles.categoryName}>
107
+ <Label isUppercase>
108
+ {t('components.categoryContent.categoryName')}
109
+ </Label>
110
+ <Form.Item
111
+ name={['categoryName']}
112
+ rules={[{ required: true, message: t('components.categoryContent.categoryNameError')! }]}
113
+ validateTrigger="onBlur"
114
+ >
115
+ <InputField
116
+ disabled={categorySidebarData?.data?.key === "0" && hasHeader}
117
+ placeholder={t('components.categoryContent.categoryName')!}
118
+ onBlur={handleInputChange}
119
+ />
120
+ </Form.Item>
121
+ </div>
122
+
123
+ { categorySidebarData?.data?.key === "0" && hasHeader &&
124
+ <div className={styles.categoryName}>
125
+ <Label isUppercase>
126
+ {t('components.categoryContent.tamplateName')}
127
+ </Label>
128
+ <Form.Item
129
+ name={['name']}
130
+ rules={[{ required: true, message: t('components.categoryContent.templateNameError')! }]}
131
+ validateTrigger="onBlur"
132
+ >
133
+ <InputField
134
+ placeholder={t('components.categoryContent.tamplateName')!}
135
+ onBlur={handleInputChange}
136
+ />
137
+ </Form.Item>
138
+ </div>
139
+ }
120
140
  </div>
121
141
 
122
142
  {categorySidebarData?.data?.children?.length > 0 &&
@@ -7,6 +7,15 @@
7
7
  margin-bottom: 32px;
8
8
  }
9
9
 
10
+ .categoryNameContainer {
11
+ display: flex;
12
+ gap: 32px;
13
+ }
14
+
15
+ .categoryName {
16
+ width: 100%;
17
+ }
18
+
10
19
  .uncheckedCategory {
11
20
  font-size: var(--font-size-body-2);
12
21
  color: var(--color-black);
@@ -8,8 +8,9 @@ import { t } from 'i18next';
8
8
 
9
9
  export interface Questions {
10
10
  grade: string;
11
- questions: string;
11
+ question: string;
12
12
  info: string;
13
+ responseType?: string;
13
14
  }
14
15
  export interface Data {
15
16
  categoryName: string;
@@ -90,14 +91,33 @@ export const CategorySidebar = (props: SidebarProps) => {
90
91
  // Adiciona a categoria "Header" se hasHeader for true
91
92
  if (hasHeader && data?.length === 0) {
92
93
  const headerCategory: DataNode = {
93
- title: 'Header',
94
+ title: t('components.category.header'),
94
95
  key: '0',
95
96
  data: {
96
- categoryName: 'Header',
97
+ categoryName: t('components.category.header'),
97
98
  generalEvaluationLevel: '',
98
99
  grade: '',
99
100
  openAnswer: false,
100
- questions: []
101
+ questions: [
102
+ {
103
+ grade: '',
104
+ question: 'Loja',
105
+ info: '',
106
+ responseType: '-1'
107
+ },
108
+ {
109
+ grade: '',
110
+ question: 'Autor',
111
+ info: '',
112
+ responseType: '-1'
113
+ },
114
+ {
115
+ grade: '',
116
+ question: 'Localidade',
117
+ info: '',
118
+ responseType: '-1'
119
+ }
120
+ ]
101
121
  },
102
122
  children: []
103
123
  };
@@ -193,22 +213,22 @@ export const CategorySidebar = (props: SidebarProps) => {
193
213
 
194
214
  function generateCategoryKeys(categories: DataNode[], parentKey: string = ''): DataNode[] {
195
215
  let keyCounter = parentKey === '' ? 1 : parseInt(parentKey, 10) + 1; // Inicia o contador de chaves
196
-
216
+
197
217
  return categories.map((category: DataNode) => {
198
218
  if (hasHeader && (category.key === '0')) {
199
219
  return category; // Mantém a chave do Header fixa
200
220
  }
201
-
221
+
202
222
  const categoryKey = `${keyCounter++}`; // Incrementa o contador para cada categoria
203
-
223
+
204
224
  let children: DataNode[] = [];
205
225
  if (category.children) {
206
226
  children = generateCategoryKeys(category.children, categoryKey); // Gera chaves para os filhos recursivamente
207
227
  }
208
-
228
+
209
229
  return { ...category, key: categoryKey, children }; // Atualiza a chave e os filhos
210
230
  });
211
- }
231
+ }
212
232
 
213
233
  setGData(generateCategoryKeys(data));
214
234
  };
@@ -277,10 +297,10 @@ export const CategorySidebar = (props: SidebarProps) => {
277
297
 
278
298
  {
279
299
  sidebarInfo && (hasHeader ? sidebarInfo[0] !== '0' : true) && (
280
- <Button icon={<MinusOutlined />} onClick={removeCategory}>
281
- {t('components.categorySidBar.removeCategory')}
282
- </Button>
283
- )}
300
+ <Button icon={<MinusOutlined />} onClick={removeCategory}>
301
+ {t('components.categorySidBar.removeCategory')}
302
+ </Button>
303
+ )}
284
304
 
285
305
 
286
306
  <div className={styles.categoryViewer}>
@@ -60,11 +60,13 @@ export const TagField = (props: customTagProps) => {
60
60
  if (inputValue && allTags.indexOf(inputValue) === -1) {
61
61
  const [, value] = inputValue.split('=');
62
62
 
63
- const newAllTags = props.addSwitch ? [inputValue] : [...allTags, inputValue];
64
- const newTags = props.addSwitch ? [inputValue] : [...tags, inputValue];
65
-
66
- setAllTags(newAllTags);
67
- setTags(newTags);
63
+ if (props.addSwitch) {
64
+ const newTags = props.addSwitch ? [inputValue] : [...tags, inputValue];
65
+ setTags(newTags);
66
+ setAllTags([inputValue]);
67
+ } else {
68
+ setAllTags([...allTags, inputValue]);
69
+ }
68
70
 
69
71
  const matchedFilter = advancedTags && advancedTags.find(filter => filter.display === inputValue.split('=')[0]);
70
72
 
@@ -75,8 +77,10 @@ export const TagField = (props: customTagProps) => {
75
77
  };
76
78
 
77
79
  setAdvancedTagList([...advancedTagList, newTag]);
80
+
78
81
  } else if (props.addSwitch) {
79
82
  setTags([inputValue]);
83
+
80
84
  } else {
81
85
  setTags([...tags, inputValue]);
82
86
  }
@@ -123,8 +127,14 @@ export const TagField = (props: customTagProps) => {
123
127
  // Adiciona a nova tag ao allTags usando a prop addExtraTags
124
128
  if (props.addExtraTags && typeof props.addExtraTags === "string") {
125
129
  const newTags = props.addSwitch ? [props.addExtraTags] : [...tags, props.addExtraTags];
126
- setTags(newTags);
127
- setAllTags(newTags);
130
+
131
+ if (props.addSwitch) {
132
+ setTags([props.addExtraTags]);
133
+ setAllTags([props.addExtraTags]);
134
+ } else {
135
+ setTags([...tags, props.addExtraTags]);
136
+ setAllTags([...allTags, props.addExtraTags]);
137
+ }
128
138
  }
129
139
  }, [props.addExtraTags, props.addSwitch]);
130
140
 
@@ -48,7 +48,8 @@
48
48
  "mandatoryAnswer": "Mandatory answer",
49
49
  "emphasisAnswer": "Highlight",
50
50
  "responseType": "Response Type",
51
- "errorResponseType": "Response type missing"
51
+ "errorResponseType": "Response type missing",
52
+ "header": "Header"
52
53
  },
53
54
  "categorySidBar": {
54
55
  "addCategory": "Add Category",
@@ -57,8 +58,10 @@
57
58
  "categoryContent": {
58
59
  "message": "Please select a category in the sidebar",
59
60
  "categoryName": "Category Name",
61
+ "tamplateName": "Template Name",
60
62
  "editCategory": "Edit Category",
61
63
  "categoryNameError": "Error/Missing Category Name",
64
+ "templateNameError": "Error/Missing Template Name",
62
65
  "weighting": "Weighting",
63
66
  "openAnswer": "Open Answer",
64
67
  "yesNoAnswer": "Yes/No Answer",
@@ -48,7 +48,8 @@
48
48
  "mandatoryAnswer": "Respuesta obligatoria",
49
49
  "emphasisAnswer": "Resaltar",
50
50
  "responseType": "Tipo de respuesta",
51
- "errorResponseType": "Tipo de respuesta faltante"
51
+ "errorResponseType": "Tipo de respuesta faltante",
52
+ "header": "Cabecera"
52
53
  },
53
54
  "categorySidBar": {
54
55
  "addCategory": "Agregar Categoría",
@@ -57,8 +58,10 @@
57
58
  "categoryContent": {
58
59
  "message": "Por favor, seleccione una categoría en la barra lateral",
59
60
  "categoryName": "Nombre de la Categoría",
61
+ "tamplateName": "Nome de la plantilla",
60
62
  "editCategory": "Editar Categoría",
61
63
  "categoryNameError": "Error/Nombre de Categoría Faltante",
64
+ "templateNameError": "Error/Nombre de la plantilla",
62
65
  "weighting": "Ponderación",
63
66
  "openAnswer": "Respuesta Abierta",
64
67
  "yesNoAnswer": "Respuesta Si/No",
@@ -48,7 +48,8 @@
48
48
  "mandatoryAnswer": "Resposta obrigatória",
49
49
  "emphasisAnswer": "Destaque",
50
50
  "responseType": "Tipo de resposta",
51
- "errorResponseType": "Tipo de resposta em falta"
51
+ "errorResponseType": "Tipo de resposta em falta",
52
+ "header": "Cabeçalho"
52
53
  },
53
54
  "categorySidBar": {
54
55
  "addCategory": "Adicionar categoria",
@@ -57,8 +58,10 @@
57
58
  "categoryContent": {
58
59
  "message": "Por favor selecione uma categoria na barra lateral",
59
60
  "categoryName": "Nome da categoria",
61
+ "tamplateName": "Nome do template",
60
62
  "editCategory": "Editar Categoria",
61
63
  "categoryNameError": "Nome categoria em falta",
64
+ "templateNameError": "Nome da template em falta",
62
65
  "weighting": "Ponderação",
63
66
  "openAnswer": "Resposta aberta",
64
67
  "yesNoAnswer": "Resposta Sim/Não",