@omniumretail/component-library 1.1.50 → 1.1.52
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 +1 -0
- package/package.json +1 -1
- package/src/components/Category/Category.stories.tsx +10 -3
- package/src/components/Category/CategoryContent/index.tsx +53 -33
- package/src/components/Category/CategoryContent/styles.module.scss +8 -0
- package/src/components/Category/index.tsx +18 -3
- package/src/components/CategoryResponse/evaluationOptions.tsx +2 -2
- package/src/components/Questions/SingleQuestion/index.tsx +56 -22
- package/src/components/Questions/SingleQuestion/styles.module.scss +13 -0
- package/src/components/Questions/index.tsx +6 -3
- package/src/locales/en.json +4 -1
- package/src/locales/es.json +4 -1
- package/src/locales/pt.json +4 -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}.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, ...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
|
},
|
|
@@ -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) &&
|
|
154
159
|
<>
|
|
155
160
|
<div className={styles.generalEvaluationLevel}>
|
|
156
161
|
<Label isUppercase>
|
|
@@ -159,34 +164,48 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
159
164
|
<Form.Item
|
|
160
165
|
name={['generalEvaluationLevel']}
|
|
161
166
|
>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
167
|
+
{!chooseResponseType ?
|
|
168
|
+
< Select
|
|
169
|
+
options={[
|
|
170
|
+
{
|
|
171
|
+
value: '0',
|
|
172
|
+
label: '1 a 5',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
value: '1',
|
|
176
|
+
label: '1 a 4',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
value: '2',
|
|
180
|
+
label: '1 a 5 ou “Não Aplicável”',
|
|
181
|
+
},
|
|
182
|
+
]}
|
|
183
|
+
onBlur={handleInputChange}
|
|
184
|
+
/>
|
|
185
|
+
:
|
|
186
|
+
< Select
|
|
187
|
+
options={responseTypeOptions}
|
|
188
|
+
onBlur={handleInputChange}
|
|
189
|
+
className={styles.selectResponseType}
|
|
190
|
+
/>
|
|
191
|
+
}
|
|
179
192
|
|
|
180
|
-
<div className={styles.grade}>
|
|
181
|
-
<Label isUppercase>
|
|
182
|
-
{t('components.categoryContent.weighting')}
|
|
183
|
-
</Label>
|
|
184
|
-
<Form.Item
|
|
185
|
-
name={['grade']}
|
|
186
|
-
>
|
|
187
|
-
<InputField placeholder={'EX: 15%'} onBlur={handleInputChange} />
|
|
188
193
|
</Form.Item>
|
|
189
194
|
</div>
|
|
195
|
+
|
|
196
|
+
{!chooseResponseType &&
|
|
197
|
+
<div className={styles.grade}>
|
|
198
|
+
<Label isUppercase>
|
|
199
|
+
{t('components.categoryContent.weighting')}
|
|
200
|
+
</Label>
|
|
201
|
+
<Form.Item
|
|
202
|
+
name={['grade']}
|
|
203
|
+
>
|
|
204
|
+
<InputField placeholder={'EX: 15%'} onBlur={handleInputChange} />
|
|
205
|
+
</Form.Item>
|
|
206
|
+
</div>
|
|
207
|
+
}
|
|
208
|
+
|
|
190
209
|
</>
|
|
191
210
|
}
|
|
192
211
|
</>
|
|
@@ -200,7 +219,8 @@ export const CategoryContent = (props: categoryContent) => {
|
|
|
200
219
|
</Label>
|
|
201
220
|
<Form.Item>
|
|
202
221
|
<Questions
|
|
203
|
-
showGrade={(switchOpenAnswStatus || switchYesOrNoAnswStatus) === true ? false : true}
|
|
222
|
+
showGrade={(switchOpenAnswStatus || switchYesOrNoAnswStatus || chooseResponseType) === true ? false : true}
|
|
223
|
+
showCheckbox={chooseResponseType && true}
|
|
204
224
|
handleChanges={handleInputChange}
|
|
205
225
|
/>
|
|
206
226
|
</Form.Item>
|
|
@@ -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,25 @@
|
|
|
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';
|
|
5
6
|
|
|
6
|
-
export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrade, handleChanges, ...restField }: any) => {
|
|
7
|
+
export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrade, handleChanges, showCheckbox, ...restField }: any) => {
|
|
8
|
+
const [mandatoryCheckbox, setMandatoryCheckbox] = useState<boolean>(false);
|
|
9
|
+
const [emphasisCheckbox, setEmphasisCheckbox] = useState<boolean>(false);
|
|
10
|
+
|
|
11
|
+
const onCheckboxMandatoryHandler = (checked: boolean) => {
|
|
12
|
+
setMandatoryCheckbox(checked);
|
|
13
|
+
handleChanges();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const onCheckboxEmphasisHandler = (checked: boolean) => {
|
|
17
|
+
setEmphasisCheckbox(checked);
|
|
18
|
+
handleChanges();
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
return (
|
|
8
|
-
<div
|
|
22
|
+
<div
|
|
9
23
|
key={key}
|
|
10
24
|
ref={provided.innerRef}
|
|
11
25
|
snapshot={snapshot}
|
|
@@ -18,10 +32,12 @@ export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrad
|
|
|
18
32
|
<div className={styles.drag}>
|
|
19
33
|
<HolderOutlined />
|
|
20
34
|
</div>
|
|
35
|
+
|
|
21
36
|
<div className={styles.content}>
|
|
22
37
|
<div className={styles.label}>
|
|
23
38
|
abc
|
|
24
39
|
</div>
|
|
40
|
+
|
|
25
41
|
<Form.Item
|
|
26
42
|
{...restField}
|
|
27
43
|
name={[name, 'question']}
|
|
@@ -29,44 +45,33 @@ export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrad
|
|
|
29
45
|
<Input placeholder={`${t('components.category.placeholderQuestion')}`} onBlur={handleChanges} />
|
|
30
46
|
</Form.Item>
|
|
31
47
|
</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
48
|
|
|
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> */}
|
|
49
|
+
<div className={styles.actions}>
|
|
49
50
|
<div className={styles.delete}>
|
|
50
51
|
<DeleteOutlined onClick={() => remove(name)} />
|
|
51
52
|
</div>
|
|
52
53
|
</div>
|
|
53
54
|
</div>
|
|
55
|
+
|
|
54
56
|
<div className={styles.information}>
|
|
55
57
|
<div className={styles.infoIcon}>
|
|
56
58
|
<InfoCircleOutlined />
|
|
57
59
|
</div>
|
|
60
|
+
|
|
58
61
|
<div className={styles.content}>
|
|
59
62
|
<div className={styles.label}>
|
|
60
63
|
xpto
|
|
61
64
|
</div>
|
|
65
|
+
|
|
62
66
|
<Form.Item
|
|
63
67
|
{...restField}
|
|
64
68
|
name={[name, 'info']}
|
|
65
69
|
>
|
|
66
|
-
<Input placeholder={`${t('components.category.placeholderInfo')}`} onBlur={handleChanges}/>
|
|
70
|
+
<Input placeholder={`${t('components.category.placeholderInfo')}`} onBlur={handleChanges} />
|
|
67
71
|
</Form.Item>
|
|
68
72
|
</div>
|
|
69
|
-
|
|
73
|
+
|
|
74
|
+
{showGrade &&
|
|
70
75
|
<div className={styles.grade}>
|
|
71
76
|
<Form.Item
|
|
72
77
|
{...restField}
|
|
@@ -76,8 +81,37 @@ export const SingleQuestion = ({ key, provided, snapshot, remove, name, showGrad
|
|
|
76
81
|
</Form.Item>
|
|
77
82
|
</div>
|
|
78
83
|
}
|
|
79
|
-
|
|
80
84
|
</div>
|
|
85
|
+
|
|
86
|
+
{showCheckbox &&
|
|
87
|
+
<div className={styles.questionFooter}>
|
|
88
|
+
<div />
|
|
89
|
+
|
|
90
|
+
<div className={styles.checkboxContainer}>
|
|
91
|
+
<Form.Item
|
|
92
|
+
{...restField}
|
|
93
|
+
name={[name, 'mandatory']}
|
|
94
|
+
valuePropName='checked'
|
|
95
|
+
>
|
|
96
|
+
<Checkbox onChange={(e) => onCheckboxMandatoryHandler(e.target.checked)} checked={mandatoryCheckbox} />
|
|
97
|
+
</Form.Item>
|
|
98
|
+
|
|
99
|
+
<span>{t('components.category.mandatoryAnswer')}</span>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div className={styles.checkboxContainer}>
|
|
103
|
+
<Form.Item
|
|
104
|
+
{...restField}
|
|
105
|
+
name={[name, 'emphasis']}
|
|
106
|
+
valuePropName='checked'
|
|
107
|
+
>
|
|
108
|
+
<Checkbox onChange={(e) => onCheckboxEmphasisHandler(e.target.checked)} checked={emphasisCheckbox} />
|
|
109
|
+
</Form.Item>
|
|
110
|
+
|
|
111
|
+
<span>{t('components.category.emphasisAnswer')}</span>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
}
|
|
81
115
|
</Space>
|
|
82
116
|
</div>
|
|
83
117
|
);
|
|
@@ -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
|
}
|
|
@@ -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,15 @@ import { t } from 'i18next';
|
|
|
9
9
|
|
|
10
10
|
export interface QuestionsProps {
|
|
11
11
|
showGrade?: boolean;
|
|
12
|
+
showCheckbox?: boolean;
|
|
12
13
|
handleChanges: any;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const Questions = (props: QuestionsProps) => {
|
|
16
17
|
const {
|
|
17
18
|
showGrade = true,
|
|
18
|
-
|
|
19
|
+
showCheckbox,
|
|
20
|
+
handleChanges
|
|
19
21
|
} = props;
|
|
20
22
|
|
|
21
23
|
const formContext = useContext(FieldContext);
|
|
@@ -54,7 +56,8 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
54
56
|
remove={remove}
|
|
55
57
|
name={name}
|
|
56
58
|
showGrade={showGrade}
|
|
57
|
-
|
|
59
|
+
showCheckbox={showCheckbox}
|
|
60
|
+
handleChanges={handleChanges}
|
|
58
61
|
/>
|
|
59
62
|
</>
|
|
60
63
|
)}
|
package/src/locales/en.json
CHANGED
|
@@ -44,7 +44,9 @@
|
|
|
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"
|
|
48
50
|
},
|
|
49
51
|
"categorySidBar": {
|
|
50
52
|
"addCategory": "Add Category",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"categoryContent": {
|
|
54
56
|
"message": "Please select a category in the sidebar",
|
|
55
57
|
"categoryName": "Category Name",
|
|
58
|
+
"editCategory": "Edit Category",
|
|
56
59
|
"categoryNameError": "Error/Missing Category Name",
|
|
57
60
|
"weighting": "Weighting",
|
|
58
61
|
"openAnswer": "Open Answer",
|
package/src/locales/es.json
CHANGED
|
@@ -44,7 +44,9 @@
|
|
|
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"
|
|
48
50
|
},
|
|
49
51
|
"categorySidBar": {
|
|
50
52
|
"addCategory": "Agregar Categoría",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"categoryContent": {
|
|
54
56
|
"message": "Por favor, seleccione una categoría en la barra lateral",
|
|
55
57
|
"categoryName": "Nombre de la Categoría",
|
|
58
|
+
"editCategory": "Editar Categoría",
|
|
56
59
|
"categoryNameError": "Error/Nombre de Categoría Faltante",
|
|
57
60
|
"weighting": "Ponderación",
|
|
58
61
|
"openAnswer": "Respuesta Abierta",
|
package/src/locales/pt.json
CHANGED
|
@@ -44,7 +44,9 @@
|
|
|
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"
|
|
48
50
|
},
|
|
49
51
|
"categorySidBar": {
|
|
50
52
|
"addCategory": "Adicionar categoria",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"categoryContent": {
|
|
54
56
|
"message": "Por favor selecione uma categoria na barra lateral",
|
|
55
57
|
"categoryName": "Nome da categoria",
|
|
58
|
+
"editCategory": "Editar Categoria",
|
|
56
59
|
"categoryNameError": "Nome categoria em falta",
|
|
57
60
|
"weighting": "Ponderação",
|
|
58
61
|
"openAnswer": "Resposta aberta",
|