@omniumretail/component-library 1.1.53 → 1.1.54

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
@@ -22,7 +22,8 @@
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}.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: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}
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}.CHFuXtnqohUXV_oCAEKD{font-weight:var(--font-weight-light);margin-top:20px;display:flex;gap:4px}.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}.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}
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}
26
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)}
27
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%}
28
29
  .vhUOPe6KeB6afW8Pj3M1{font-size:32px}
@@ -4,7 +4,9 @@ interface CategoryResponse {
4
4
  serverReadyData: any;
5
5
  onNextCategoryAvailabilityChange: (hasNext: boolean) => void;
6
6
  onPreviousCategoryAvailabilityChange: (hasPrevious: boolean) => void;
7
- selectYesNoOption: any;
7
+ selectYesNoOption?: any;
8
+ addAction?: () => void;
9
+ addButtons?: boolean;
8
10
  }
9
11
  export declare const CategoryResponse: React.ForwardRefExoticComponent<CategoryResponse & React.RefAttributes<unknown>>;
10
12
  export {};
@@ -1,9 +1,12 @@
1
1
  import type { UploadFile, UploadProps } from 'antd/es/upload/interface';
2
+ import { Dispatch, SetStateAction } from 'react';
2
3
  interface UploadPropsExtended extends UploadProps {
3
4
  onImageChange?: (file: UploadFile | null) => void;
4
5
  initialFileList?: UploadFile[];
5
6
  initialImageUrl?: string;
6
7
  disable?: boolean;
8
+ file?: boolean;
9
+ setFiles?: Dispatch<SetStateAction<UploadFile<any>[]>> | any;
7
10
  }
8
11
  export declare const Upload: (props: UploadPropsExtended) => import("react/jsx-runtime").JSX.Element;
9
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.1.53",
3
+ "version": "1.1.54",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -31,7 +31,7 @@ const Template: Story<any> = (args) => {
31
31
  }
32
32
 
33
33
  useEffect(() => {
34
- console.log(serverData);
34
+ // console.log(serverData);
35
35
  }, [serverData])
36
36
 
37
37
  return (
@@ -43,6 +43,7 @@ const Template: Story<any> = (args) => {
43
43
  ref={categoryResponseRef}
44
44
  onNextCategoryAvailabilityChange={handleNextCategoryAvailabilityChange}
45
45
  onPreviousCategoryAvailabilityChange={handlePreviousCategoryAvailabilityChange}
46
+ addButtons
46
47
  >
47
48
  </CategoryResponse>
48
49
  </div>
@@ -89,9 +90,11 @@ Primary.args = {
89
90
  "Id": "65562A64-A24B-425A-A345-560238CA2468",
90
91
  "QuestionId": "7D17A8A5-E299-47D3-AB49-684135DB23A3",
91
92
  "Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
92
- "Description": "This is a description",
93
+ "Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
93
94
  "Grade": "0",
94
- "Answer": null
95
+ "Note": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
96
+ "Answer": null,
97
+ "ActionNames": ["Ação12345662323", "A"]
95
98
  },
96
99
  {
97
100
  "Id": "85562A64-A24B-425A-A345-560238CA2468",
@@ -99,6 +102,7 @@ Primary.args = {
99
102
  "Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit",
100
103
  "Description": "This is a description ",
101
104
  "Grade": "0",
105
+ "Note": "asasas",
102
106
  "Answer": null
103
107
  }
104
108
  ]
@@ -231,7 +235,7 @@ Primary.args = {
231
235
  "Subject": "This is a Subject",
232
236
  "Description": "This is a description",
233
237
  "Grade": "0",
234
- "Answer": null
238
+ "Answer": "dwjdiwjdiwjdi"
235
239
  },
236
240
  {
237
241
  "Id": "93862A64-A24B-425A-A345-560238CA2468",
@@ -1,6 +1,6 @@
1
1
  import styles from './styles.module.scss';
2
2
  import { useEffect, useImperativeHandle, useState } from 'react';
3
- import { Form } from 'antd';
3
+ import { Form, UploadFile, Upload } from 'antd';
4
4
  import { useForm } from 'antd/es/form/Form';
5
5
  import classNames from 'classnames';
6
6
  import TextArea from 'antd/es/input/TextArea';
@@ -8,13 +8,16 @@ import { Select } from '../Select';
8
8
  import { evaluationOptions } from './evaluationOptions';
9
9
  import React from 'react';
10
10
  import { t } from 'i18next';
11
+ import { Button } from '../Button';
11
12
 
12
13
  interface CategoryResponse {
13
14
  data: any;
14
15
  serverReadyData: any;
15
16
  onNextCategoryAvailabilityChange: (hasNext: boolean) => void;
16
17
  onPreviousCategoryAvailabilityChange: (hasPrevious: boolean) => void;
17
- selectYesNoOption: any;
18
+ selectYesNoOption?: any;
19
+ addAction?: () => void;
20
+ addButtons?: boolean;
18
21
  };
19
22
 
20
23
  type Category = {
@@ -24,13 +27,18 @@ type Category = {
24
27
  Children?: Category[];
25
28
  };
26
29
 
30
+ function generateRandomString() {
31
+ return Math.random().toString(36).substring(2, 14);
32
+ }
33
+
27
34
  const updateCategoryAnswers = (CategoryAnswers: any[], categoryToUpdate: any, updatedQuestions: any) => {
28
35
  CategoryAnswers.forEach((category: any) => {
29
36
  if (category.Data.CategoryId === categoryToUpdate.CategoryId) {
30
37
  category.Data.Questions = category.Data.Questions.map((question: any, index: any) => {
31
38
  return {
32
39
  ...question,
33
- Answer: updatedQuestions[index].Answer
40
+ Answer: updatedQuestions[index].Answer,
41
+ Note: updatedQuestions[index].Note
34
42
  };
35
43
  });
36
44
  }
@@ -96,9 +104,10 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
96
104
  // Setting first set of questions as default open
97
105
  const [selectedCategory, setSelectedCategory] = useState<any>(data.CategoryAnswers[0]);
98
106
  const [initialValues, setInitialValues] = useState<any>(data.CategoryAnswers[0].Data);
107
+ const [fileLists, setFileLists] = useState<Record<string, UploadFile[]>>({});
108
+ const [isNoteVisible, setIsNoteVisible] = useState<{ categoryIndex: number; questionIndex: number } | null>(null);
99
109
  const [form] = useForm();
100
110
 
101
-
102
111
  const updateInitialValues = (data: any) => {
103
112
  const {
104
113
  Questions,
@@ -110,7 +119,8 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
110
119
  Questions: Questions.map((question: any) => ({
111
120
  Subject: question.Subject,
112
121
  Description: question.Description,
113
- Answer: question.Answer || ""
122
+ Answer: question.Answer || "",
123
+ Note: question.Note || ""
114
124
  })),
115
125
  OpenAnswer: OpenAnswer,
116
126
  IsYesOrNo: IsYesOrNo
@@ -126,11 +136,36 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
126
136
  setCurrentKey(index);
127
137
  };
128
138
 
139
+ const handleFileChange = (fileList: UploadFile[], categoryIndex: number, questionIndex: number) => {
140
+ const key = `${categoryIndex}_${questionIndex}`;
141
+ setFileLists((prev) => ({
142
+ ...prev,
143
+ [key]: fileList,
144
+ }));
145
+ };
146
+
147
+ const onPreview = async (file: UploadFile) => {
148
+ let src = file.url as string;
149
+ if (!src) {
150
+ src = await new Promise((resolve) => {
151
+ const reader = new FileReader();
152
+ reader.readAsDataURL(file.originFileObj!);
153
+ reader.onload = () => resolve(reader.result as string);
154
+ });
155
+ }
156
+ const image = new Image();
157
+ image.src = src;
158
+ const imgWindow = window.open(src);
159
+ imgWindow?.document.write(image.outerHTML);
160
+ };
161
+
129
162
  const onFinish = (values: any) => {
130
163
  const updatedQuestions = initialValues.Questions.map((question: any, index: number) => {
131
164
  return {
132
165
  ...question,
133
- Answer: values.Questions[index].Answer
166
+ Answer: values.Questions[index].Answer,
167
+ Note: values.Questions[index].Note,
168
+ Files: fileLists[`${selectedCategory.Data.CategoryId}_${index}`] || [], // Include files in the form data
134
169
  };
135
170
  });
136
171
 
@@ -204,6 +239,25 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
204
239
  props.serverReadyData(localData);
205
240
  }, [localData]);
206
241
 
242
+ // useEffect(() => {
243
+ // const initialFileLists: Record<string, UploadFile[]> = {};
244
+
245
+ // localData.CategoryAnswers.forEach((category: any) => {
246
+ // category.Data.Questions.forEach((question: any, questionIndex: number) => {
247
+ // if (question.Image && question.Image.length > 0) {
248
+ // initialFileLists[`${category.Data.CategoryId}_${questionIndex}`] = question.Files.map((file: any) => ({
249
+ // uid: file.uid || generateRandomString(), // Use a unique id or generate one
250
+ // name: file.name,
251
+ // status: 'done',
252
+ // url: file.url || file.response?.url, // Ensure the file has a URL for preview
253
+ // }));
254
+ // }
255
+ // });
256
+ // });
257
+
258
+ // setFileLists(initialFileLists);
259
+ // }, [localData]);
260
+
207
261
  useEffect(() => {
208
262
  const hasNext = hasCategory(currentKey, localData.CategoryAnswers, 'next');
209
263
  props.onNextCategoryAvailabilityChange(hasNext);
@@ -250,9 +304,55 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
250
304
  <div className={styles.subject}>
251
305
  {question.Subject}
252
306
  </div>
307
+
253
308
  <div className={styles.description}>
254
309
  {question.Description}
255
310
  </div>
311
+
312
+ {props.addButtons &&
313
+ <>
314
+ {(form.getFieldValue(`Questions`)?.[index].Note || isNoteVisible) &&
315
+ <div className={styles.noteContainer}>
316
+ <span className={styles.note}>{t('components.categoryResponse.note')}: </span>
317
+
318
+ {isNoteVisible?.categoryIndex === currentKey && isNoteVisible?.questionIndex === index ?
319
+ <Form.Item name={["Questions", index, "Note"]} className={styles.form}><TextArea onBlur={() => setIsNoteVisible(null)} /></Form.Item>
320
+ : form.getFieldValue(`Questions`)?.[index].Note}
321
+ </div>
322
+ }
323
+
324
+ {question?.ActionNames &&
325
+ <div className={styles.actionContainer}>
326
+ <span className={styles.note}>{t('components.categoryResponse.actions')}: </span>
327
+
328
+ {question?.ActionNames?.map((action: any, index: number) => (
329
+ <span key={index} className={index > 0 ? styles.action : ''}>
330
+ {action}
331
+ <br />
332
+ </span>
333
+ ))}
334
+ </div>
335
+ }
336
+
337
+ <div className={styles.actionsButtonsContainer}>
338
+ <Upload
339
+ listType={"text"}
340
+ fileList={fileLists[`${selectedCategory.Data.CategoryId}_${index}`] || []}
341
+ beforeUpload={() => false} // Prevent automatic upload
342
+ onChange={({ fileList }) => handleFileChange(fileList, selectedCategory.Data.CategoryId, index)}
343
+ onPreview={onPreview}
344
+ >
345
+ <Button customClass={styles.loadFile}>{t('components.upload.loadFile')}</Button>
346
+ </Upload>
347
+
348
+ <Button customClass={styles.actionsButtons} onClick={() => setIsNoteVisible({ categoryIndex: currentKey, questionIndex: index })}>
349
+ {form.getFieldValue(`Questions`)?.[index].Note ? t('components.categoryResponse.editNote') : t('components.categoryResponse.addNote')}
350
+ </Button>
351
+
352
+ <Button customClass={styles.actionsButtons} onClick={props.addAction}>{t('components.categoryResponse.createAction')}</Button>
353
+ </div>
354
+ </>
355
+ }
256
356
  </div>
257
357
  <div className={styles.answer}>
258
358
  {selectedCategory.Data.OpenAnswer
@@ -262,28 +362,25 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
262
362
  <TextArea />
263
363
  </Form.Item>
264
364
 
265
- : selectedCategory.Data.IsYesOrNo
266
- ? <Form.Item
267
- name={["Questions", index, "Answer"]}
268
- >
269
- <Select options={props.selectYesNoOption}
270
- style={{ minWidth: '100%' }}
271
- />
272
- </Form.Item>
273
-
274
- : <Form.Item
275
- name={["Questions", index, "Answer"]}
276
- >
277
- <Select options={evaluationOptions[selectedEvaluationOption]}
278
- style={{ minWidth: '100%' }}
279
- />
280
- </Form.Item>
365
+ : <Form.Item
366
+ name={["Questions", index, "Answer"]}
367
+ >
368
+ <Select
369
+ options={selectedCategory.Data.IsYesOrNo
370
+ ? props.selectYesNoOption
371
+ : question?.Options?.length > 0
372
+ ? question?.Options?.map((option: any) => ({ label: option.Value, value: option.Value }))
373
+ : evaluationOptions[selectedEvaluationOption]
374
+ }
375
+ style={{ minWidth: '100%' }}
376
+ />
377
+ </Form.Item>
281
378
  }
282
379
  </div>
283
380
  </div>
284
381
  ))}
285
382
  </Form>
286
- </div>
287
- </div>
383
+ </div >
384
+ </div >
288
385
  );
289
386
  });
@@ -178,3 +178,88 @@
178
178
  font-weight: var(--font-weight-light);
179
179
  margin-bottom: 4px;
180
180
  }
181
+
182
+ .noteContainer {
183
+ font-weight: var(--font-weight-light);
184
+ margin-top: 20px;
185
+ display: flex;
186
+ gap: 4px
187
+ }
188
+
189
+ .note {
190
+ font-weight: var(--font-weight-semibold);
191
+ }
192
+
193
+ .form {
194
+ margin-bottom: unset;
195
+ width: 100%;
196
+ }
197
+
198
+ .actionContainer {
199
+ font-weight: var(--font-weight-light);
200
+ margin-bottom: 4px;
201
+ margin-top: 16px;
202
+ }
203
+
204
+ .action {
205
+ margin-left: 46px;
206
+ margin-top: 12px;
207
+ }
208
+
209
+ .actionsButtonsContainer {
210
+ display: flex;
211
+ flex-direction: row;
212
+ gap: 4px;
213
+ margin-top: 12px;
214
+ margin-bottom: 12px;
215
+ }
216
+
217
+ .actionsButtons {
218
+ color: var(--color-black);
219
+ background-color: var(--color-white);
220
+ border: 1px var(--color-black) solid;
221
+ min-width: 100px;
222
+ height: 20px;
223
+ font-size: 10px;
224
+ padding: unset;
225
+
226
+ @media(max-width: 767px) {
227
+ min-width: 0px;
228
+ }
229
+
230
+ &:hover {
231
+ background-color: var(--color-grey-light);
232
+ color: var(--color-black) !important;
233
+ border: 1px var(--color-black) solid !important;
234
+ }
235
+ }
236
+
237
+ .loadFile {
238
+ color: var(--color-black);
239
+ background-color: var(--color-white);
240
+ border: 1px var(--color-black) solid;
241
+ min-width: 100px;
242
+ height: 20px;
243
+ font-size: 10px;
244
+ padding: unset;
245
+
246
+ @media(max-width: 767px) {
247
+ min-width: 0px;
248
+ }
249
+
250
+ &:hover {
251
+ background-color: var(--color-grey-light);
252
+ color: var(--color-black) !important;
253
+ border: 1px var(--color-black) solid !important;
254
+ }
255
+ }
256
+
257
+ :global {
258
+ .ant-upload-wrapper {
259
+ line-height: 12px;
260
+ }
261
+
262
+ .ant-upload-wrapper .ant-upload-list .ant-upload-list-item {
263
+ max-width: 100px;
264
+ }
265
+ }
@@ -11,10 +11,9 @@ const Template: Story<NavigationProps> = (args) => <Navigation {...args}></Navig
11
11
  export const Primary = Template.bind({});
12
12
  Primary.args = {
13
13
  backLink: true,
14
- homeLink: false,
14
+ homeLink: true,
15
15
  title: 'Gestão de Aplicações',
16
16
  loginLink: true,
17
- userName: "Diogo Silva Coutinho",
18
17
  options: [
19
18
  { label: 'Option 1', action: () => alert('Option 1 clicked') },
20
19
  { label: 'Option 2', action: () => alert('Option 2 clicked') },
@@ -1,13 +1,18 @@
1
+ import styles from './styles.module.scss';
1
2
  import { Upload as UploadAntd } from 'antd';
2
3
  import ImgCrop from 'antd-img-crop';
3
4
  import type { RcFile, UploadFile, UploadProps } from 'antd/es/upload/interface';
4
- import { useEffect, useState } from 'react';
5
+ import { Button } from '../Button';
6
+ import { Dispatch, SetStateAction, useEffect, useState } from 'react';
7
+ import { useTranslation } from 'react-i18next';
5
8
 
6
9
  interface UploadPropsExtended extends UploadProps {
7
10
  onImageChange?: (file: UploadFile | null) => void;
8
11
  initialFileList?: UploadFile[];
9
12
  initialImageUrl?: string;
10
13
  disable?: boolean;
14
+ file?: boolean;
15
+ setFiles?: Dispatch<SetStateAction<UploadFile<any>[]>> | any;
11
16
  }
12
17
 
13
18
  function generateRandomString() {
@@ -19,8 +24,11 @@ export const Upload = (props: UploadPropsExtended) => {
19
24
  onImageChange,
20
25
  initialFileList,
21
26
  initialImageUrl,
22
- disable
27
+ disable,
28
+ setFiles
23
29
  } = props;
30
+
31
+ const { t } = useTranslation();
24
32
  const [fileList, setFileList] = useState<UploadFile[]>(initialFileList || []);
25
33
 
26
34
  // when component mounts or initialImageUrl changes, update fileList
@@ -36,6 +44,12 @@ export const Upload = (props: UploadPropsExtended) => {
36
44
  }
37
45
  }, [initialImageUrl]);
38
46
 
47
+ useEffect(() => {
48
+ if (setFiles) {
49
+ setFiles(fileList);
50
+ }
51
+ }, [fileList, setFiles]);
52
+
39
53
  const beforeUpload: UploadProps['beforeUpload'] = async (file: RcFile) => {
40
54
  const newFile: UploadFile = {
41
55
  uid: file.uid,
@@ -45,7 +59,7 @@ export const Upload = (props: UploadPropsExtended) => {
45
59
  originFileObj: file,
46
60
  status: 'done',
47
61
  };
48
-
62
+
49
63
  setFileList((prevFileList) => [...prevFileList, newFile]);
50
64
  if (onImageChange) {
51
65
  onImageChange(newFile);
@@ -80,14 +94,18 @@ export const Upload = (props: UploadPropsExtended) => {
80
94
  return (
81
95
  <ImgCrop rotationSlider>
82
96
  <UploadAntd
83
- listType="picture-card"
97
+ listType={props.file ? "text" : "picture-card"}
84
98
  fileList={fileList}
85
99
  beforeUpload={beforeUpload}
86
100
  onChange={onChange}
87
101
  onPreview={onPreview}
88
102
  disabled={disable}
89
103
  >
90
- {fileList.length < 1 && '+ Upload'}
104
+ {props.file
105
+ ? <Button customClass={styles.loadFile}>{t('components.upload.loadFile')}</Button>
106
+
107
+ : fileList.length < 1 && '+ Upload'
108
+ }
91
109
  </UploadAntd>
92
110
  </ImgCrop>
93
111
  );
@@ -0,0 +1,29 @@
1
+ .loadFile {
2
+ color: var(--color-black);
3
+ background-color: var(--color-white);
4
+ border: 1px var(--color-black) solid;
5
+ min-width: 100px;
6
+ height: 20px;
7
+ font-size: 10px;
8
+ padding: unset;
9
+
10
+ @media(max-width: 767px) {
11
+ min-width: 0px;
12
+ }
13
+
14
+ &:hover {
15
+ background-color: var(--color-grey-light);
16
+ color: var(--color-black) !important;
17
+ border: 1px var(--color-black) solid !important;
18
+ }
19
+ }
20
+
21
+ :global {
22
+ .ant-upload-wrapper {
23
+ line-height: 12px;
24
+ }
25
+
26
+ .ant-upload-wrapper .ant-upload-list .ant-upload-list-item {
27
+ max-width: 100px;
28
+ }
29
+ }
@@ -69,7 +69,12 @@
69
69
  "notApplicable": "Not Applicable",
70
70
  "answer": "Answer",
71
71
  "yes": "Yes",
72
- "no": "No"
72
+ "no": "No",
73
+ "note": "Note",
74
+ "actions": "Actions",
75
+ "editNote": "Edit Note",
76
+ "addNote": "Add Note",
77
+ "createAction": "Create Action"
73
78
  },
74
79
  "categoryReadOnly": {
75
80
  "categories": "Categories",
@@ -97,6 +102,9 @@
97
102
  "takePhoto": "Take Photo",
98
103
  "confirm": "Confirm",
99
104
  "takeAgain": "Take Again"
100
- }
105
+ },
106
+ "upload": {
107
+ "loadFile": "Upload file"
108
+ }
101
109
  }
102
110
  }
@@ -69,7 +69,12 @@
69
69
  "notApplicable": "No Aplicable",
70
70
  "answer": "Respuesta",
71
71
  "yes": "Si",
72
- "no": "No"
72
+ "no": "No",
73
+ "note": "Nota",
74
+ "actions": "Acciones",
75
+ "editNote": "Editar Nota",
76
+ "addNote": "Agregar Nota",
77
+ "createAction": "Crear Acción"
73
78
  },
74
79
  "categoryReadOnly": {
75
80
  "categories": "Categorías",
@@ -97,6 +102,9 @@
97
102
  "takePhoto": "Tomar foto",
98
103
  "confirm": "Confirme",
99
104
  "takeAgain": "Tomar de nuevo"
100
- }
105
+ },
106
+ "upload": {
107
+ "loadFile": "Cargar archivo"
108
+ }
101
109
  }
102
110
  }
@@ -69,7 +69,12 @@
69
69
  "notApplicable": "Não Aplicável",
70
70
  "answer": "Resposta",
71
71
  "yes": "Sim",
72
- "no": "Não"
72
+ "no": "Não",
73
+ "note": "Nota",
74
+ "actions": "Ações",
75
+ "editNote": "Editar Nota",
76
+ "addNote": "Adicionar Nota",
77
+ "createAction": "Criar ação"
73
78
  },
74
79
  "categoryReadOnly": {
75
80
  "categories": "Categorias",
@@ -97,6 +102,9 @@
97
102
  "takePhoto": "Tirar Foto",
98
103
  "confirm": "Confirmar",
99
104
  "takeAgain": "Tirar Novamente"
105
+ },
106
+ "upload": {
107
+ "loadFile": "Carregar ficheiro"
100
108
  }
101
109
  }
102
110
  }