@omniumretail/component-library 1.1.51 → 1.1.53
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/bundle.js +1 -1
- package/dist/main.css +2 -2
- package/dist/types/components/Category/CategoryContent/index.d.ts +2 -0
- package/dist/types/components/Category/index.d.ts +2 -0
- package/dist/types/components/Questions/SingleQuestion/index.d.ts +1 -1
- package/dist/types/components/Questions/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Category/Category.stories.tsx +23 -3
- package/src/components/Category/CategoryContent/index.tsx +44 -32
- package/src/components/Category/CategoryContent/styles.module.scss +9 -0
- package/src/components/Category/index.tsx +18 -3
- package/src/components/Questions/SingleQuestion/index.tsx +73 -22
- package/src/components/Questions/SingleQuestion/styles.module.scss +21 -0
- package/src/components/Questions/index.tsx +7 -1
- package/src/locales/en.json +6 -1
- package/src/locales/es.json +6 -1
- package/src/locales/pt.json +6 -1
package/dist/main.css
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
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}.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}.y8UJFmCyGQzEQk4XjnI9{display:none}.kknDal3CIbUXI7Lu2wPV{display:flex;align-items:center;justify-content:flex-start;gap:20px}.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}.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}
|
|
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}
|
|
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:calc(100% - 112px);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}
|
|
@@ -2,6 +2,8 @@ interface categoryContent {
|
|
|
2
2
|
categoryContentShow: boolean;
|
|
3
3
|
categoryContentInfo: any;
|
|
4
4
|
categorySidebarData: any;
|
|
5
|
+
chooseResponseType?: boolean;
|
|
6
|
+
responseTypeOptions?: any;
|
|
5
7
|
}
|
|
6
8
|
export declare const CategoryContent: (props: categoryContent) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -2,6 +2,8 @@ import { DataNode } from './CategorySidebar';
|
|
|
2
2
|
interface Category {
|
|
3
3
|
data: DataNode[];
|
|
4
4
|
serverReadyData: any;
|
|
5
|
+
chooseResponse?: boolean;
|
|
6
|
+
responseTypeOptions?: any;
|
|
5
7
|
}
|
|
6
8
|
export declare const Category: (props: Category) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SingleQuestion: ({ key, provided, snapshot, remove, name, showGrade, handleChanges, ...restField }: any) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const SingleQuestion: ({ key, provided, snapshot, remove, name, showGrade, handleChanges, showCheckbox, responseTypeOptions, ...restField }: any) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -13,8 +13,8 @@ const Template: Story<any> = (args) => {
|
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
console.log(serverData);
|
|
15
15
|
}, [serverData])
|
|
16
|
-
|
|
17
|
-
return <Category {...args} serverReadyData={setServerData} data={[
|
|
16
|
+
|
|
17
|
+
return <Category {...args} chooseResponse serverReadyData={setServerData} data={[
|
|
18
18
|
{
|
|
19
19
|
"title": "2 (Q: 0) (G: 2)",
|
|
20
20
|
"key": "0",
|
|
@@ -24,7 +24,14 @@ const Template: Story<any> = (args) => {
|
|
|
24
24
|
"isYesOrNo": true,
|
|
25
25
|
"generalEvaluationLevel": "0",
|
|
26
26
|
"grade": "2",
|
|
27
|
-
"questions": [
|
|
27
|
+
"questions": [
|
|
28
|
+
{
|
|
29
|
+
"emphasis": true,
|
|
30
|
+
"info": "lol",
|
|
31
|
+
"mandatory": false,
|
|
32
|
+
"question": ""
|
|
33
|
+
}
|
|
34
|
+
]
|
|
28
35
|
},
|
|
29
36
|
"children": []
|
|
30
37
|
},
|
|
@@ -82,6 +89,19 @@ const Template: Story<any> = (args) => {
|
|
|
82
89
|
},
|
|
83
90
|
"children": []
|
|
84
91
|
}
|
|
92
|
+
]} responseTypeOptions={[
|
|
93
|
+
{
|
|
94
|
+
"value": "B867BEA8-E0A4-44D2-BBDA-7CB89334D80E",
|
|
95
|
+
"label": "teste3Update",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"value": "B8267BEA8-E0A4-44D2-BBDA-7CB89334D80E",
|
|
99
|
+
"label": "test2eUpdate",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"value": "B867B4EA8-E0A4-44D2-BBDA-7CB89334D80E",
|
|
103
|
+
"label": "testeU4pdate",
|
|
104
|
+
}
|
|
85
105
|
]}></Category>
|
|
86
106
|
};
|
|
87
107
|
|
|
@@ -5,7 +5,7 @@ import { InputField } from '../../Input';
|
|
|
5
5
|
import { Label } from '../../Label';
|
|
6
6
|
import { Questions } from '../../Questions';
|
|
7
7
|
import { Switch } from '../../Switch';
|
|
8
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
8
|
+
import { SetStateAction, useCallback, useEffect, useState } from 'react';
|
|
9
9
|
import styles from './styles.module.scss';
|
|
10
10
|
import { t } from 'i18next';
|
|
11
11
|
|
|
@@ -13,19 +13,24 @@ interface categoryContent {
|
|
|
13
13
|
categoryContentShow: boolean;
|
|
14
14
|
categoryContentInfo: any;
|
|
15
15
|
categorySidebarData: any;
|
|
16
|
+
chooseResponseType?: boolean;
|
|
17
|
+
responseTypeOptions?: any;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const defaultInitialValues = {
|
|
19
21
|
generalEvaluationLevel: "0",
|
|
20
22
|
questions: [],
|
|
21
23
|
openAnswer: false,
|
|
22
|
-
isYesOrNo: false
|
|
24
|
+
isYesOrNo: false,
|
|
25
|
+
emphasis: false
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
export const CategoryContent = (props: categoryContent) => {
|
|
26
29
|
const {
|
|
27
30
|
categoryContentShow,
|
|
28
|
-
categorySidebarData
|
|
31
|
+
categorySidebarData,
|
|
32
|
+
chooseResponseType,
|
|
33
|
+
responseTypeOptions
|
|
29
34
|
} = props;
|
|
30
35
|
|
|
31
36
|
const [contentInfo, setContentInfo] = useState<any>(defaultInitialValues);
|
|
@@ -76,7 +81,7 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
76
81
|
|
|
77
82
|
return (
|
|
78
83
|
<div className={styles.categoryContent}>
|
|
79
|
-
<div className={styles.title}>
|
|
84
|
+
<div className={styles.title}>{t('components.categoryContent.editCategory')}</div>
|
|
80
85
|
|
|
81
86
|
{
|
|
82
87
|
!categoryContentShow
|
|
@@ -121,7 +126,7 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
121
126
|
|
|
122
127
|
{!categorySidebarData?.data?.children?.length &&
|
|
123
128
|
<>
|
|
124
|
-
{!switchYesOrNoAnswStatus &&
|
|
129
|
+
{(!switchYesOrNoAnswStatus && !chooseResponseType) &&
|
|
125
130
|
<div className={styles.openAnswer}>
|
|
126
131
|
<Label isUppercase>
|
|
127
132
|
{t('components.categoryContent.openAnswer')}
|
|
@@ -135,7 +140,7 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
135
140
|
</div>
|
|
136
141
|
}
|
|
137
142
|
|
|
138
|
-
{!switchOpenAnswStatus &&
|
|
143
|
+
{(!switchOpenAnswStatus && !chooseResponseType) &&
|
|
139
144
|
<div className={styles.yesNoAnswer}>
|
|
140
145
|
<Label isUppercase>
|
|
141
146
|
{t('components.categoryContent.yesNoAnswer')}
|
|
@@ -150,7 +155,7 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
150
155
|
}
|
|
151
156
|
|
|
152
157
|
{
|
|
153
|
-
!switchOpenAnswStatus && !switchYesOrNoAnswStatus &&
|
|
158
|
+
(!switchOpenAnswStatus && !switchYesOrNoAnswStatus && !chooseResponseType) &&
|
|
154
159
|
<>
|
|
155
160
|
<div className={styles.generalEvaluationLevel}>
|
|
156
161
|
<Label isUppercase>
|
|
@@ -159,34 +164,39 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
159
164
|
<Form.Item
|
|
160
165
|
name={['generalEvaluationLevel']}
|
|
161
166
|
>
|
|
162
|
-
<Select
|
|
163
|
-
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
< Select
|
|
168
|
+
options={[
|
|
169
|
+
{
|
|
170
|
+
value: '0',
|
|
171
|
+
label: '1 a 5',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
value: '1',
|
|
175
|
+
label: '1 a 4',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
value: '2',
|
|
179
|
+
label: '1 a 5 ou “Não Aplicável”',
|
|
180
|
+
},
|
|
181
|
+
]}
|
|
182
|
+
onBlur={handleInputChange}
|
|
176
183
|
/>
|
|
177
184
|
</Form.Item>
|
|
178
185
|
</div>
|
|
179
186
|
|
|
180
|
-
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
{!chooseResponseType &&
|
|
188
|
+
<div className={styles.grade}>
|
|
189
|
+
<Label isUppercase>
|
|
190
|
+
{t('components.categoryContent.weighting')}
|
|
191
|
+
</Label>
|
|
192
|
+
<Form.Item
|
|
193
|
+
name={['grade']}
|
|
194
|
+
>
|
|
195
|
+
<InputField placeholder={'EX: 15%'} onBlur={handleInputChange} />
|
|
196
|
+
</Form.Item>
|
|
197
|
+
</div>
|
|
198
|
+
}
|
|
199
|
+
|
|
190
200
|
</>
|
|
191
201
|
}
|
|
192
202
|
</>
|
|
@@ -200,8 +210,10 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
200
210
|
</Label>
|
|
201
211
|
<Form.Item>
|
|
202
212
|
<Questions
|
|
203
|
-
showGrade={(switchOpenAnswStatus || switchYesOrNoAnswStatus) === true ? false : true}
|
|
213
|
+
showGrade={(switchOpenAnswStatus || switchYesOrNoAnswStatus || chooseResponseType) === true ? false : true}
|
|
214
|
+
showCheckbox={chooseResponseType && true}
|
|
204
215
|
handleChanges={handleInputChange}
|
|
216
|
+
responseTypeOptions={responseTypeOptions}
|
|
205
217
|
/>
|
|
206
218
|
</Form.Item>
|
|
207
219
|
</div>
|
|
@@ -28,6 +28,14 @@ Label {
|
|
|
28
28
|
margin-bottom: 8px;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.selectResponseType {
|
|
32
|
+
min-width: 200px;
|
|
33
|
+
|
|
34
|
+
@media(max-width: 768px) {
|
|
35
|
+
min-width: 150px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
.categoryContent {
|
|
32
40
|
:global {
|
|
33
41
|
.ant-select {
|
|
@@ -40,6 +48,7 @@ Label {
|
|
|
40
48
|
display: flex;
|
|
41
49
|
align-items: center;
|
|
42
50
|
}
|
|
51
|
+
|
|
43
52
|
.ant-select-arrow {
|
|
44
53
|
color: var(--color-black);
|
|
45
54
|
}
|
|
@@ -6,11 +6,15 @@ import { CategoryContent } from './CategoryContent';
|
|
|
6
6
|
interface Category {
|
|
7
7
|
data: DataNode[];
|
|
8
8
|
serverReadyData: any;
|
|
9
|
+
chooseResponse?: boolean;
|
|
10
|
+
responseTypeOptions?: any;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export const Category = (props: Category) => {
|
|
12
14
|
const {
|
|
13
|
-
data
|
|
15
|
+
data,
|
|
16
|
+
chooseResponse,
|
|
17
|
+
responseTypeOptions
|
|
14
18
|
} = props;
|
|
15
19
|
|
|
16
20
|
const [categoryContentInfo, setCategoryContentInfo] = useState<any>();
|
|
@@ -29,10 +33,21 @@ export const Category = (props: Category) => {
|
|
|
29
33
|
return (
|
|
30
34
|
<div className={styles.category}>
|
|
31
35
|
<div className={styles.sidebarWrapper}>
|
|
32
|
-
<CategorySidebar
|
|
36
|
+
<CategorySidebar
|
|
37
|
+
categorySidebarInfo={setCategorySidebarInfo}
|
|
38
|
+
categoryContentData={categoryContentInfo}
|
|
39
|
+
data={data}
|
|
40
|
+
categoryContentFinalData={setFinalData}
|
|
41
|
+
/>
|
|
33
42
|
</div>
|
|
34
43
|
<div className={styles.contentWrapper}>
|
|
35
|
-
<CategoryContent
|
|
44
|
+
<CategoryContent
|
|
45
|
+
chooseResponseType={chooseResponse}
|
|
46
|
+
responseTypeOptions={responseTypeOptions}
|
|
47
|
+
categoryContentInfo={setCategoryContentInfo}
|
|
48
|
+
categoryContentShow={showContent}
|
|
49
|
+
categorySidebarData={categorySidebarInfo}
|
|
50
|
+
/>
|
|
36
51
|
</div>
|
|
37
52
|
</div>
|
|
38
53
|
)
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { DeleteOutlined, HolderOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
|
2
|
-
import { Form, Input, Space } from 'antd';
|
|
2
|
+
import { Checkbox, Form, Input, Space } from 'antd';
|
|
3
3
|
import { t } from 'i18next';
|
|
4
4
|
import styles from './styles.module.scss';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { Select } from 'antd';
|
|
7
|
+
|
|
8
|
+
export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrade, handleChanges, showCheckbox, responseTypeOptions, ...restField }: any) => {
|
|
9
|
+
const [mandatoryCheckbox, setMandatoryCheckbox] = useState<boolean>(false);
|
|
10
|
+
const [emphasisCheckbox, setEmphasisCheckbox] = useState<boolean>(false);
|
|
11
|
+
|
|
12
|
+
const onCheckboxMandatoryHandler = (checked: boolean) => {
|
|
13
|
+
setMandatoryCheckbox(checked);
|
|
14
|
+
handleChanges();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const onCheckboxEmphasisHandler = (checked: boolean) => {
|
|
18
|
+
setEmphasisCheckbox(checked);
|
|
19
|
+
handleChanges();
|
|
20
|
+
}
|
|
5
21
|
|
|
6
|
-
export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrade, handleChanges, ...restField }: any) => {
|
|
7
22
|
return (
|
|
8
|
-
<div
|
|
23
|
+
<div
|
|
9
24
|
key={key}
|
|
10
25
|
ref={provided.innerRef}
|
|
11
26
|
snapshot={snapshot}
|
|
@@ -18,10 +33,12 @@ export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrad
|
|
|
18
33
|
<div className={styles.drag}>
|
|
19
34
|
<HolderOutlined />
|
|
20
35
|
</div>
|
|
36
|
+
|
|
21
37
|
<div className={styles.content}>
|
|
22
38
|
<div className={styles.label}>
|
|
23
39
|
abc
|
|
24
40
|
</div>
|
|
41
|
+
|
|
25
42
|
<Form.Item
|
|
26
43
|
{...restField}
|
|
27
44
|
name={[name, 'question']}
|
|
@@ -29,44 +46,33 @@ export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrad
|
|
|
29
46
|
<Input placeholder={`${t('components.category.placeholderQuestion')}`} onBlur={handleChanges} />
|
|
30
47
|
</Form.Item>
|
|
31
48
|
</div>
|
|
32
|
-
<div className={styles.actions}>
|
|
33
|
-
{/* <div className={styles.edit}>
|
|
34
|
-
<div className={styles.notEditing}
|
|
35
|
-
// onClick={() => handleStartEdit(index)}
|
|
36
|
-
>
|
|
37
|
-
<EditOutlined />
|
|
38
|
-
</div>
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
<CheckOutlined style={{ color: 'var( --color-confirmation-600)' }}
|
|
42
|
-
onClick={() => handleSaveEdit()}
|
|
43
|
-
/>
|
|
44
|
-
<CloseOutlined style={{ color: 'var( --color-warning-500)' }}
|
|
45
|
-
//onClick={() => handleCancelEdit(index)}
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
</div> */}
|
|
50
|
+
<div className={styles.actions}>
|
|
49
51
|
<div className={styles.delete}>
|
|
50
52
|
<DeleteOutlined onClick={() => remove(name)} />
|
|
51
53
|
</div>
|
|
52
54
|
</div>
|
|
53
55
|
</div>
|
|
56
|
+
|
|
54
57
|
<div className={styles.information}>
|
|
55
58
|
<div className={styles.infoIcon}>
|
|
56
59
|
<InfoCircleOutlined />
|
|
57
60
|
</div>
|
|
61
|
+
|
|
58
62
|
<div className={styles.content}>
|
|
59
63
|
<div className={styles.label}>
|
|
60
64
|
xpto
|
|
61
65
|
</div>
|
|
66
|
+
|
|
62
67
|
<Form.Item
|
|
63
68
|
{...restField}
|
|
64
69
|
name={[name, 'info']}
|
|
65
70
|
>
|
|
66
|
-
<Input placeholder={`${t('components.category.placeholderInfo')}`} onBlur={handleChanges}/>
|
|
71
|
+
<Input placeholder={`${t('components.category.placeholderInfo')}`} onBlur={handleChanges} />
|
|
67
72
|
</Form.Item>
|
|
68
73
|
</div>
|
|
69
|
-
|
|
74
|
+
|
|
75
|
+
{showGrade &&
|
|
70
76
|
<div className={styles.grade}>
|
|
71
77
|
<Form.Item
|
|
72
78
|
{...restField}
|
|
@@ -76,8 +82,53 @@ export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrad
|
|
|
76
82
|
</Form.Item>
|
|
77
83
|
</div>
|
|
78
84
|
}
|
|
79
|
-
|
|
80
85
|
</div>
|
|
86
|
+
|
|
87
|
+
{showCheckbox &&
|
|
88
|
+
<div className={styles.questionFooter}>
|
|
89
|
+
<div />
|
|
90
|
+
|
|
91
|
+
<div className={styles.checkboxContainer}>
|
|
92
|
+
<Form.Item
|
|
93
|
+
{...restField}
|
|
94
|
+
name={[name, 'mandatory']}
|
|
95
|
+
valuePropName='checked'
|
|
96
|
+
>
|
|
97
|
+
<Checkbox onChange={(e) => onCheckboxMandatoryHandler(e.target.checked)} checked={mandatoryCheckbox} />
|
|
98
|
+
</Form.Item>
|
|
99
|
+
|
|
100
|
+
<span>{t('components.category.mandatoryAnswer')}</span>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<div className={styles.checkboxContainer}>
|
|
104
|
+
<Form.Item
|
|
105
|
+
{...restField}
|
|
106
|
+
name={[name, 'emphasis']}
|
|
107
|
+
valuePropName='checked'
|
|
108
|
+
>
|
|
109
|
+
<Checkbox onChange={(e) => onCheckboxEmphasisHandler(e.target.checked)} checked={emphasisCheckbox} />
|
|
110
|
+
</Form.Item>
|
|
111
|
+
|
|
112
|
+
<span>{t('components.category.emphasisAnswer')}</span>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div className={styles.checkboxContainer}>
|
|
116
|
+
<Form.Item
|
|
117
|
+
{...restField}
|
|
118
|
+
name={[name, 'responseType']}
|
|
119
|
+
rules={[{ required: true, message: t('components.category.errorResponseType')! }]}
|
|
120
|
+
>
|
|
121
|
+
<Select
|
|
122
|
+
options={responseTypeOptions}
|
|
123
|
+
onBlur={handleChanges}
|
|
124
|
+
className={styles.selectResponseType}
|
|
125
|
+
/>
|
|
126
|
+
</Form.Item>
|
|
127
|
+
|
|
128
|
+
<span>{t('components.category.responseType')}</span>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
}
|
|
81
132
|
</Space>
|
|
82
133
|
</div>
|
|
83
134
|
);
|
|
@@ -45,6 +45,19 @@ $questionAndInformationGap: 20px;
|
|
|
45
45
|
align-items: center;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
.questionFooter {
|
|
49
|
+
display: flex;
|
|
50
|
+
gap: 40px;
|
|
51
|
+
font-size: var(--font-size-body-3);
|
|
52
|
+
align-items: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.checkboxContainer {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 8px;
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
.input {
|
|
49
62
|
display: none;
|
|
50
63
|
}
|
|
@@ -56,6 +69,14 @@ $questionAndInformationGap: 20px;
|
|
|
56
69
|
gap: 20px;
|
|
57
70
|
}
|
|
58
71
|
|
|
72
|
+
.selectResponseType {
|
|
73
|
+
min-width: 250px;
|
|
74
|
+
|
|
75
|
+
@media(max-width: 768px) {
|
|
76
|
+
min-width: 150px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
59
80
|
.notEditing {
|
|
60
81
|
display: none;
|
|
61
82
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
1
|
+
import { Dispatch, SetStateAction, useContext } from 'react';
|
|
2
2
|
import { PlusOutlined } from '@ant-design/icons';
|
|
3
3
|
import { Form } from 'antd';
|
|
4
4
|
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
|
|
@@ -9,13 +9,17 @@ import { t } from 'i18next';
|
|
|
9
9
|
|
|
10
10
|
export interface QuestionsProps {
|
|
11
11
|
showGrade?: boolean;
|
|
12
|
+
showCheckbox?: boolean;
|
|
12
13
|
handleChanges: any;
|
|
14
|
+
responseTypeOptions: any;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export const Questions = (props: QuestionsProps) => {
|
|
16
18
|
const {
|
|
17
19
|
showGrade = true,
|
|
20
|
+
showCheckbox,
|
|
18
21
|
handleChanges,
|
|
22
|
+
responseTypeOptions
|
|
19
23
|
} = props;
|
|
20
24
|
|
|
21
25
|
const formContext = useContext(FieldContext);
|
|
@@ -54,7 +58,9 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
54
58
|
remove={remove}
|
|
55
59
|
name={name}
|
|
56
60
|
showGrade={showGrade}
|
|
61
|
+
showCheckbox={showCheckbox}
|
|
57
62
|
handleChanges={handleChanges}
|
|
63
|
+
responseTypeOptions={responseTypeOptions}
|
|
58
64
|
/>
|
|
59
65
|
</>
|
|
60
66
|
)}
|
package/src/locales/en.json
CHANGED
|
@@ -44,7 +44,11 @@
|
|
|
44
44
|
"errorQuestion": "Error/Missing Question",
|
|
45
45
|
"placeholderGrade": "Grade",
|
|
46
46
|
"errorGrade": "Error/Missing Grade",
|
|
47
|
-
"newCategory": "New Category"
|
|
47
|
+
"newCategory": "New Category",
|
|
48
|
+
"mandatoryAnswer": "Mandatory answer",
|
|
49
|
+
"emphasisAnswer": "Highlight",
|
|
50
|
+
"responseType": "Response Type",
|
|
51
|
+
"errorResponseType": "Response type missing"
|
|
48
52
|
},
|
|
49
53
|
"categorySidBar": {
|
|
50
54
|
"addCategory": "Add Category",
|
|
@@ -53,6 +57,7 @@
|
|
|
53
57
|
"categoryContent": {
|
|
54
58
|
"message": "Please select a category in the sidebar",
|
|
55
59
|
"categoryName": "Category Name",
|
|
60
|
+
"editCategory": "Edit Category",
|
|
56
61
|
"categoryNameError": "Error/Missing Category Name",
|
|
57
62
|
"weighting": "Weighting",
|
|
58
63
|
"openAnswer": "Open Answer",
|
package/src/locales/es.json
CHANGED
|
@@ -44,7 +44,11 @@
|
|
|
44
44
|
"errorQuestion": "Error/Pregunta Faltante",
|
|
45
45
|
"placeholderGrade": "Calificación",
|
|
46
46
|
"errorGrade": "Error/Calificación Faltante",
|
|
47
|
-
"newCategory": "Nueva Categoría"
|
|
47
|
+
"newCategory": "Nueva Categoría",
|
|
48
|
+
"mandatoryAnswer": "Respuesta obligatoria",
|
|
49
|
+
"emphasisAnswer": "Resaltar",
|
|
50
|
+
"responseType": "Tipo de respuesta",
|
|
51
|
+
"errorResponseType": "Tipo de respuesta faltante"
|
|
48
52
|
},
|
|
49
53
|
"categorySidBar": {
|
|
50
54
|
"addCategory": "Agregar Categoría",
|
|
@@ -53,6 +57,7 @@
|
|
|
53
57
|
"categoryContent": {
|
|
54
58
|
"message": "Por favor, seleccione una categoría en la barra lateral",
|
|
55
59
|
"categoryName": "Nombre de la Categoría",
|
|
60
|
+
"editCategory": "Editar Categoría",
|
|
56
61
|
"categoryNameError": "Error/Nombre de Categoría Faltante",
|
|
57
62
|
"weighting": "Ponderación",
|
|
58
63
|
"openAnswer": "Respuesta Abierta",
|
package/src/locales/pt.json
CHANGED
|
@@ -44,7 +44,11 @@
|
|
|
44
44
|
"errorQuestion": "Questão em falta",
|
|
45
45
|
"placeholderGrade": "Ponderação",
|
|
46
46
|
"errorGrade": "Ponderação em falta",
|
|
47
|
-
"newCategory": "Nova categoria"
|
|
47
|
+
"newCategory": "Nova categoria",
|
|
48
|
+
"mandatoryAnswer": "Resposta obrigatória",
|
|
49
|
+
"emphasisAnswer": "Destaque",
|
|
50
|
+
"responseType": "Tipo de resposta",
|
|
51
|
+
"errorResponseType": "Tipo de resposta em falta"
|
|
48
52
|
},
|
|
49
53
|
"categorySidBar": {
|
|
50
54
|
"addCategory": "Adicionar categoria",
|
|
@@ -53,6 +57,7 @@
|
|
|
53
57
|
"categoryContent": {
|
|
54
58
|
"message": "Por favor selecione uma categoria na barra lateral",
|
|
55
59
|
"categoryName": "Nome da categoria",
|
|
60
|
+
"editCategory": "Editar Categoria",
|
|
56
61
|
"categoryNameError": "Nome categoria em falta",
|
|
57
62
|
"weighting": "Ponderação",
|
|
58
63
|
"openAnswer": "Resposta aberta",
|