@omniumretail/component-library 1.1.98 → 1.2.0
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 +1 -1
- package/package.json +1 -1
- package/src/components/CategoryResponse/CategoryResponse.stories.tsx +13 -0
- package/src/components/CategoryResponse/index.tsx +5 -5
- package/src/components/CategoryResponse/styles.module.scss +9 -0
- package/src/components/Questions/SingleQuestion/index.tsx +13 -5
- package/src/components/Questions/index.tsx +23 -5
package/dist/main.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
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)}
|
|
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:12px;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}.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}.WPOztO5lxS5PXlAz75dE:hover{background-color:var(--color-grey-light);color:var(--color-black) !important;border:1px var(--color-black) solid !important}.Yz6q7yIXvsA956q84MoK{min-width:100% !important}.ant-upload-wrapper{line-height:12px}.ant-upload-wrapper .ant-upload-list .ant-upload-list-item{max-width:100px !important}@media(max-width: 767px){.ant-upload-wrapper .ant-upload-list .ant-upload-list-item{max-width:90px !important}}
|
|
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:12px;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}.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}.WPOztO5lxS5PXlAz75dE:hover{background-color:var(--color-grey-light);color:var(--color-black) !important;border:1px var(--color-black) solid !important}.Yz6q7yIXvsA956q84MoK{min-width:100% !important}.wNWP4ysIqgPu6PZjqhL4{width:25%;height:40px}@media(max-width: 767px){.wNWP4ysIqgPu6PZjqhL4{width:50%}}.ant-upload-wrapper{line-height:12px}.ant-upload-wrapper .ant-upload-list .ant-upload-list-item{max-width:100px !important}@media(max-width: 767px){.ant-upload-wrapper .ant-upload-list .ant-upload-list-item{max-width:90px !important}}
|
|
26
26
|
.lvTuRa6cS5HtBGBJWfyE{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){.lvTuRa6cS5HtBGBJWfyE{min-width:0px}}.lvTuRa6cS5HtBGBJWfyE: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}
|
|
27
27
|
.qaO99d3JMWSM8DLS1LvS{display:flex;flex-direction:column;background-color:var(--white-color);padding:24px;color:var(--color-black);width:150px;word-wrap:break-word}.G3bzjyAQXu8uaFGhNMLG{width:150px}.Zv6hI_F5yvuBDnPK8u2C{color:var(--color-blue) !important;font-size:var(--font-size-body-5);font-weight:var(--font-weight-bold)}.JxTKMPM3nEvZB42uuV1e{font-weight:var(--font-weight-semibold);font-size:var(--font-size-label);margin-top:0px}.JKKhO8apIWdMp0JLU0iD{font-weight:var(--font-weight-bold);font-size:var(--font-size-body-base)}.GqgjW40ocDFW4xi4Mszm{font-weight:var(--font-weight-regular);font-size:var(--font-size-label)}
|
|
28
28
|
.zsvRMmfrmqBj9iRjtQpO{display:grid;grid-template-columns:300px auto;gap:16px;height:100%}.pb4QP8qfuDG2T6wfXkUC{overflow:auto;background:#ebeced}.gP05vt1R1r67eWteznvr{overflow:auto;background:var(--color-white)}.pb4QP8qfuDG2T6wfXkUC,.gP05vt1R1r67eWteznvr{padding:20px}.btRPAI8631Q2XXYP6nZ7{font-size:var(--font-size-body-4);color:var(--color-blue);margin-bottom:36px;font-weight:var(--font-weight-semibold);text-transform:uppercase}.SbA9dHRh1JSG4xp1Aqie{padding-bottom:15px;font-weight:var(--font-weight-bold);font-size:var(--font-size-body-4)}.ZsQJQ__gMgYGYau95r8U{cursor:pointer}.PPF4FGgo1aDsBm13cNj8{padding-left:16px}.PPF4FGgo1aDsBm13cNj8 .SbA9dHRh1JSG4xp1Aqie{font-weight:var(--font-weight-semibold)}.PPF4FGgo1aDsBm13cNj8 .QEsWraNRLBQux4k4KNAE .PPF4FGgo1aDsBm13cNj8 .SbA9dHRh1JSG4xp1Aqie{font-weight:var(--font-weight-light)}.QEsWraNRLBQux4k4KNAE{display:block}.VQ09MnwMcIzpW1iabb4A{color:var(--color-orange)}.cmcMqdZJEUjlu34ag1Md{margin-bottom:32px;display:flex;justify-content:space-between;align-items:center}.i_U4mKg0Sxl4EvVzgv0L{font-size:var(--font-size-body-4);color:var(--color-blue);font-weight:var(--font-weight-semibold);margin-bottom:8px}.Tnut0v2OeSU0e7XwrCXI{font-size:var(--font-size-body-3);font-weight:var(--font-weight-light);color:var(--color-black)}.W2hZQFsItdqKPcBu4UrA{display:flex;flex-direction:row;gap:36px;margin-bottom:36px;border-bottom:1px solid rgba(var(--color-blue-rgb), 0.2);padding-bottom:4px}.tIVLagS5XxibJ4PBCNpp{flex-direction:column;border-bottom:1px solid rgba(var(--color-blue-rgb), 0.2);margin-bottom:24px}.tIVLagS5XxibJ4PBCNpp .RenA6EOwu2sFJGoqYbYz{width:100%;border-bottom:none}.tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9{width:100%;height:auto}.tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 .ant-input{min-height:140px}.tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 .ant-form-item{margin-bottom:16px}.RenA6EOwu2sFJGoqYbYz{width:calc(100% - 149px);display:flex;align-items:center}.N0_FbFF8bLYtEcr8_2B9{width:130px;min-width:130px;align-self:flex-end;display:flex;justify-content:space-between;padding-right:15px}.GaBbmrXh2G03hz6ha5vB{display:none}.QYrBVtDmfSFNxJFztXVl{min-width:130px;align-self:flex-end;display:flex;justify-content:space-between;gap:34px}.V_qOYQwuQ9mXa8aniYgl{font-size:var(--font-size-body-3);font-weight:var(--font-weight-medium)}.pvSzNydRHp3dkh3WrOeA{font-weight:var(--font-weight-light);margin-bottom:4px}.Ehgx39o1k8blh7IDJ2mg{padding:6px;font-size:var(--font-size-body-4);font-weight:var(--font-weight-medium);color:var(--color-white);border-radius:5px;display:inline-flex;letter-spacing:3px}.ifR0bkZtK7yVHD6YZ_Zz{background-color:rgba(217,217,217,.5);border-radius:5px;padding:8px 15px;display:flex;flex-direction:row;gap:50px;align-items:center}.NL5HeemkTIg0oPHDXVtO{font-size:var(--font-size-body-3);font-weight:var(--font-weight-medium);color:var(--color-black)}.koYqEMOf6wzxWpwvrFkL{display:flex;justify-content:space-between;margin-bottom:12px;margin-left:16px;gap:40px;width:100%}
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { Button } from "components/Button";
|
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { CategoryResponse } from '.';
|
|
5
5
|
import { UploadFile } from "antd";
|
|
6
|
+
import moment from "moment";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
title: 'CategoryResponse',
|
|
@@ -140,6 +141,18 @@ Primary.args = {
|
|
|
140
141
|
"Description": "This is a description ",
|
|
141
142
|
"Grade": "0",
|
|
142
143
|
"Note": "asasas",
|
|
144
|
+
"Disabled": true,
|
|
145
|
+
"Answer": moment(),
|
|
146
|
+
"IsDate": true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"Id": "85562A64-A24B-425A-A345-560238CA2468",
|
|
150
|
+
"QuestionId": "8D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
151
|
+
"Subject": "Data",
|
|
152
|
+
"Description": "This is a description ",
|
|
153
|
+
"Grade": "0",
|
|
154
|
+
"Note": "asasas",
|
|
155
|
+
"Disabled": false,
|
|
143
156
|
"Answer": [],
|
|
144
157
|
"IsDate": true
|
|
145
158
|
}
|
|
@@ -10,7 +10,6 @@ import React from 'react';
|
|
|
10
10
|
import { t } from 'i18next';
|
|
11
11
|
import { Button } from '../Button';
|
|
12
12
|
import dayjs from 'dayjs';
|
|
13
|
-
import moment from 'moment';
|
|
14
13
|
|
|
15
14
|
interface CategoryResponse {
|
|
16
15
|
data: any;
|
|
@@ -102,6 +101,9 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
|
|
|
102
101
|
const [isNoteVisible, setIsNoteVisible] = useState<{ categoryIndex: number; questionIndex: number } | null>(null);
|
|
103
102
|
const [form] = useForm();
|
|
104
103
|
|
|
104
|
+
console.log(initialValues, "initialValues");
|
|
105
|
+
console.log(data, "data");
|
|
106
|
+
|
|
105
107
|
useEffect(() => {
|
|
106
108
|
if (props.initialFileList) {
|
|
107
109
|
setFileLists(props.initialFileList);
|
|
@@ -312,8 +314,6 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
|
|
|
312
314
|
{selectedCategory?.Data?.Questions.map((question: any, index: number) => {
|
|
313
315
|
const isOpenAnswer = selectedCategory.Data.OpenAnswer || question.IsOpenAnswer;
|
|
314
316
|
|
|
315
|
-
const isHeaderDate = question.Subject === t('components.category.date') && selectedCategory.Data.Key === "0";
|
|
316
|
-
|
|
317
317
|
const questionWrapper = classNames({
|
|
318
318
|
[styles.questionWrapperOpenAnswer]: isOpenAnswer || props.addButtons,
|
|
319
319
|
}, [styles.questionWrapper]);
|
|
@@ -393,13 +393,13 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
|
|
|
393
393
|
name={["Questions", index, "Answer"]}
|
|
394
394
|
>
|
|
395
395
|
<DatePicker
|
|
396
|
-
className={styles.
|
|
396
|
+
className={styles.datePickerStyle}
|
|
397
397
|
placeholder={''}
|
|
398
398
|
format={dateFormatList}
|
|
399
399
|
value={dataValue}
|
|
400
400
|
defaultValue={form.getFieldValue(`Questions`)?.[index].Answer}
|
|
401
401
|
onChange={(value) => setDataValue(value)}
|
|
402
|
-
disabled={
|
|
402
|
+
disabled={question.Disabled}
|
|
403
403
|
/>
|
|
404
404
|
</Form.Item>
|
|
405
405
|
|
|
@@ -91,6 +91,8 @@ export const SingleQuestion = ({
|
|
|
91
91
|
handleChanges();
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
+
const canDrag = !((restField.fieldKey === 0 || restField.fieldKey === 1) && isTheHeader);
|
|
95
|
+
|
|
94
96
|
const questionStyle = classnames({
|
|
95
97
|
[styles.responseTypeQuestion]: responseTypeComponent
|
|
96
98
|
}, [styles.question]);
|
|
@@ -106,10 +108,14 @@ export const SingleQuestion = ({
|
|
|
106
108
|
>
|
|
107
109
|
<Space>
|
|
108
110
|
<div className={questionStyle}>
|
|
111
|
+
|
|
109
112
|
<div className={styles.drag}>
|
|
110
|
-
|
|
113
|
+
{canDrag &&
|
|
114
|
+
<HolderOutlined />
|
|
115
|
+
}
|
|
111
116
|
</div>
|
|
112
117
|
|
|
118
|
+
|
|
113
119
|
<div className={styles.content}>
|
|
114
120
|
<div className={styles.label}>
|
|
115
121
|
abc
|
|
@@ -127,11 +133,13 @@ export const SingleQuestion = ({
|
|
|
127
133
|
</Form.Item>
|
|
128
134
|
</div>
|
|
129
135
|
|
|
130
|
-
|
|
131
|
-
<div className={styles.
|
|
132
|
-
<
|
|
136
|
+
{canDrag &&
|
|
137
|
+
<div className={styles.actions}>
|
|
138
|
+
<div className={styles.delete}>
|
|
139
|
+
<DeleteOutlined onClick={() => remove(name)} />
|
|
140
|
+
</div>
|
|
133
141
|
</div>
|
|
134
|
-
|
|
142
|
+
}
|
|
135
143
|
</div>
|
|
136
144
|
|
|
137
145
|
{!responseTypeComponent &&
|
|
@@ -28,10 +28,24 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
28
28
|
} = props;
|
|
29
29
|
|
|
30
30
|
const items = Form.useWatch('questions');
|
|
31
|
+
|
|
31
32
|
const onDragEnd = (result: any) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
if (!result.destination) return; // Se o destino for inválido, não faz nada
|
|
34
|
+
|
|
35
|
+
const sourceIndex = result?.source?.index;
|
|
36
|
+
const destinationIndex = result?.destination?.index;
|
|
37
|
+
|
|
38
|
+
// Bloquear drag-and-drop apenas para os itens 0 e 1 quando isTheHeader for true
|
|
39
|
+
const isProtectedSource = ((sourceIndex === 0 || sourceIndex === 1) && isTheHeader);
|
|
40
|
+
const isProtectedDestination = ((destinationIndex === 0 || destinationIndex === 1) && isTheHeader);
|
|
41
|
+
|
|
42
|
+
if (isProtectedSource || isProtectedDestination) {
|
|
43
|
+
return; // Impede o drag-and-drop se for um dos itens protegidos
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const newItems: any = [...items];
|
|
47
|
+
const [removed] = newItems.splice(result?.source?.index, 1);
|
|
48
|
+
newItems.splice(result.destination?.index, 0, removed);
|
|
35
49
|
props.form.setFieldValue('questions', newItems);
|
|
36
50
|
};
|
|
37
51
|
|
|
@@ -50,16 +64,20 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
50
64
|
return field = { ...field, name: index, key: index, fieldKey: index };
|
|
51
65
|
})
|
|
52
66
|
|
|
67
|
+
const isDropDisabled = ((fieldsUpdated[0] || fieldsUpdated[1]) && isTheHeader);
|
|
68
|
+
|
|
53
69
|
return (
|
|
54
70
|
<>
|
|
55
71
|
<DragDropContext onDragEnd={onDragEnd}>
|
|
56
|
-
<Droppable droppableId="droppable">
|
|
72
|
+
<Droppable droppableId="droppable" isDropDisabled={isDropDisabled}>
|
|
57
73
|
{(provided) => (
|
|
58
74
|
<div {...provided.droppableProps} ref={provided.innerRef}>
|
|
59
75
|
<>
|
|
60
76
|
{fieldsUpdated?.map(({ key, name, ...restField }) => {
|
|
77
|
+
const cantDrag = ((restField.fieldKey === 0 || restField.fieldKey === 1) && isTheHeader);
|
|
78
|
+
|
|
61
79
|
return (
|
|
62
|
-
<Draggable key={key} draggableId={`${key}`} index={key}>
|
|
80
|
+
<Draggable isDragDisabled={cantDrag} key={key} draggableId={`${key}`} index={key}>
|
|
63
81
|
{(provided, snapshot) => (
|
|
64
82
|
<>
|
|
65
83
|
<SingleQuestion
|