@viswa-test/creative-workspace-ui-component 0.0.63 → 0.0.64
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/cjs/components/AssignReminders/AssignLevelAccordions.js +1 -1
- package/dist/cjs/components/AssignReminders/AssignReminderLevels.js +1 -1
- package/dist/cjs/components/AssignReminders/AssignReminderTest.js +2 -0
- package/dist/cjs/components/AssignReminders/AssignReminderTest.js.map +1 -0
- package/dist/cjs/components/AssignReminders/AssignReminderWrapper.js +1 -1
- package/dist/cjs/components/AssignReminders/components/AssignLevelsDatePicker.js +1 -1
- package/dist/cjs/components/AssignReminders/components/CustomDatePicker.js +1 -1
- package/dist/cjs/components/AssignReminders/components/LevelData.js +1 -1
- package/dist/cjs/components/AssignReminders/components/ReviewStatus.js +1 -1
- package/dist/components/AssignReminders/AssignLevelAccordions.js +1 -1
- package/dist/components/AssignReminders/AssignReminderLevels.js +1 -1
- package/dist/components/AssignReminders/AssignReminderTest.js +2 -0
- package/dist/components/AssignReminders/AssignReminderTest.js.map +1 -0
- package/dist/components/AssignReminders/AssignReminderWrapper.js +1 -1
- package/dist/components/AssignReminders/components/AssignLevelsDatePicker.js +1 -1
- package/dist/components/AssignReminders/components/CustomDatePicker.js +1 -1
- package/dist/components/AssignReminders/components/LevelData.js +1 -1
- package/dist/components/AssignReminders/components/ReviewStatus.js +1 -1
- package/dist/types/App.d.ts.map +1 -1
- package/dist/types/AssignReminderWrapper.test.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/AssignLevelAccordions.d.ts +3 -1
- package/dist/types/components/AssignReminders/AssignLevelAccordions.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/AssignReminderLevels.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/AssignReminderTest.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/AssignReminderWrapper.d.ts +1 -1
- package/dist/types/components/AssignReminders/AssignReminderWrapper.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/components/AssignAccessLevelsPopup.d.ts +22 -0
- package/dist/types/components/AssignReminders/components/AssignAccessLevelsPopup.d.ts.map +1 -0
- package/dist/types/components/AssignReminders/components/AssignLevelsDatePicker.d.ts +2 -1
- package/dist/types/components/AssignReminders/components/AssignLevelsDatePicker.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/components/CustomDatePicker.d.ts +2 -1
- package/dist/types/components/AssignReminders/components/CustomDatePicker.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/components/LevelData.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/components/ReviewStatus.d.ts +1 -1
- package/dist/types/components/AssignReminders/components/ReviewStatus.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/types/types.d.ts +12 -0
- package/dist/types/components/AssignReminders/types/types.d.ts.map +1 -1
- package/package.json +3 -8
- package/dist/types/SocketPackage.test.d.ts +0 -3
- package/dist/types/SocketPackage.test.d.ts.map +0 -1
- package/dist/types/features/cws/CwsEvent.d.ts +0 -13
- package/dist/types/features/cws/CwsEvent.d.ts.map +0 -1
- package/dist/types/features/cws/CwsEventProvider.d.ts +0 -10
- package/dist/types/features/cws/CwsEventProvider.d.ts.map +0 -1
- package/dist/types/features/cws/SocketManager.d.ts +0 -29
- package/dist/types/features/cws/SocketManager.d.ts.map +0 -1
- package/dist/types/features/cws/index.d.ts +0 -4
- package/dist/types/features/cws/index.d.ts.map +0 -1
- package/dist/types/features/cws/useCwsEvent.d.ts +0 -2
- package/dist/types/features/cws/useCwsEvent.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),t=require("lucide-react"),i=require("./utils/generateRandomColorsPair.js"),o=require("./assets/VerticalLine.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),t=require("lucide-react"),i=require("./utils/generateRandomColorsPair.js"),o=require("./assets/VerticalLine.js"),l=require("./components/AssignLevelsDatePicker.js"),a=require("./components/LevelData.js");exports.default=function(r){var d,u,p,g,c,x,h=r.level,f=r.id,y=r.accessLevelOptions,v=r.fetchUsers,_=r.onToggleMandatory,b=r.onDueDateChange,j=r.onAssigneesChange,m=r.onTitleChange,D=r.minDueDate,C=r.maxDueDate,k=r.displayConfig,F=s.useMemo(function(){return i.getRandomColorPair()},[]),w="0"===f||(null!==(u=null===(d=h.assignees)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0,S=(null!==(g=null===(p=h.assignees)||void 0===p?void 0:p.length)&&void 0!==g?g:0)>0,q=!!(null==k?void 0:k.disableRequiredButtonOnUserAdd)&&S,B="0"===f||q,R=!!q||h.isMandatory,L=s.useState(w),z=L[0],E=L[1],I=s.useState(!1),P=I[0],A=I[1];return s.useEffect(function(){var e,n;(null!==(n=null===(e=h.assignees)||void 0===e?void 0:e.length)&&void 0!==n?n:0)>0&&E(!0)},[h.assignees]),n.jsxs("div",e.__assign({style:{width:"100%",border:"1.5px solid #E2E8F0",borderRadius:"5px"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#F8FAFC",padding:"0px 10px",minHeight:"48px"}},{children:[n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:10,paddingLeft:"20px"}},{children:[n.jsx("span",e.__assign({style:{backgroundColor:F.backgroundColor,borderRadius:"10px",padding:"3px 12px",color:F.color,fontSize:"13px",fontWeight:500}},{children:h.headerName})),P?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n.jsx("input",{type:"text",value:h.title||"",onChange:function(e){return null==m?void 0:m(e.target.value)},onBlur:function(){return A(!1)},onKeyDown:function(e){return"Enter"===e.key&&A(!1)},autoFocus:!0,style:{border:"none",borderBottom:"2px solid #3B82F6",outline:"none",fontSize:"13px",fontWeight:500,color:"#374151",background:"transparent",padding:"0 2px",width:"150px"}}),n.jsx("button",e.__assign({type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),A(!1)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:"2px"}},{children:n.jsx(t.Check,{size:16,color:"#10B981"})}))]})):n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:500,color:"#374151"}},{children:h.title})),n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),A(!0)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:"2px"},title:"Edit Title"},{children:n.jsx(t.Edit2,{size:14,color:"#6B7280"})}))]}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:16,marginLeft:"auto"}},{children:[n.jsxs(n.Fragment,{children:[n.jsxs("span",e.__assign({style:{color:"#6B7280"}},{children:["Due Date: ",R&&n.jsx("sup",e.__assign({style:{color:"red"}},{children:"*"}))]})),n.jsx(l.default,{value:null!==(c=h.dueDate)&&void 0!==c?c:null,onSet:b,id:f,minDate:null!=D?D:null,maxDate:null!=C?C:null,disabled:null==k?void 0:k.disableDueDates}),n.jsx(o.default,{})]}),n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center"}},{children:n.jsxs("button",e.__assign({type:"button",onClick:B?void 0:_,disabled:B,style:{position:"relative",width:"88px",height:"26px",border:"none",borderRadius:"999px",backgroundColor:R?"#5B4FE9":"#D1D5DB",cursor:B?"not-allowed":"pointer",opacity:B?"50%":"100%",display:"flex",alignItems:"center",padding:"0 10px",transition:"all 0.2s ease",flexShrink:0}},{children:[n.jsx("span",{style:{position:"absolute",top:"3px",left:R?"65px":"3px",width:"20px",height:"20px",borderRadius:"50%",background:"#FFF",transition:"all 0.2s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.15)"}}),n.jsx("span",e.__assign({style:{color:"#FFF",fontSize:"10px",fontWeight:500,userSelect:"none",paddingLeft:R?"0":"18px",paddingRight:R?"18px":"0"}},{children:"Required"}))]}))})),n.jsx(t.ChevronDown,{size:20,onClick:function(e){e.stopPropagation(),E(function(e){return!e})},style:{cursor:"pointer",flexShrink:0,transition:"transform 0.2s ease",transform:z?"rotate(180deg)":"rotate(0deg)"}})]}))]})),z&&n.jsx("div",e.__assign({style:{width:"100%",height:"auto"}},{children:n.jsx(a.default,{assignees:null!==(x=h.assignees)&&void 0!==x?x:[],onAssigneeChange:j,accessLevelOptions:y,levelDetails:{head:h.headerName,title:h.title},fetchUsers:v,displayConfig:k})}))]}))};
|
|
2
2
|
//# sourceMappingURL=AssignLevelAccordions.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),i=require("lucide-react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),i=require("lucide-react"),a=require("./AssignLevelAccordions.js"),l=require("./components/CustomCheckbox.js"),t=require("./assets/FileCheckCorner.js"),r=require("./styles/AssignReminderStyles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(s),d=[{label:"Edit",icon:n.jsx(i.PenLine,{size:14})},{label:"Approve",icon:n.jsx(i.UserRoundCheck,{size:14})},{label:"Edit & Approve",icon:n.jsx(t.default,{})},{label:"Notify",icon:n.jsx(i.Bell,{size:14})}],c=function(e){var n=new Date(e);return n.setHours(0,0,0,0),n},p=function(e,n){var s,i=n>0?null===(s=e[n-1])||void 0===s?void 0:s.dueDate:null;return c(i||new Date)},_=function(e,n,s){var i,a=null===(i=e[n+1])||void 0===i?void 0:i.dueDate;return a?c(a):s?c(s):null};exports.AssignReminderLevels=function(s){var t=s.title,o=s.levels,v=void 0===o?[]:o,g=s.requireFinalApproval,f=void 0!==g&&g,x=s.additionalInfo,h=s.setLevels,j=s.setRequireFinalApproval,y=s.fetchUsers,A=s.accessLevelOptions,m=void 0===A?d:A,D=s.customInfoIcon,L=s.onValidationError,E=s.customStyles,S=void 0===E?{}:E,b=s.totalLevels,I=s.finalApprovalDueDate,F=s.displayConfig,R=u.default.useState(!1),w=R[0],C=R[1],M=!!(null==F?void 0:F.disableRequiredButtonOnUserAdd);u.default.useEffect(function(){M&&(null==h||h(function(n){var s=!1,i=n.map(function(n){var i,a,l=(null!==(a=null===(i=n.assignees)||void 0===i?void 0:i.length)&&void 0!==a?a:0)>0;return n.isHidden||n.isMandatory||!l?n:(s=!0,e.__assign(e.__assign({},n),{isMandatory:!0}))});return s?i:n}))},[v,h,M]);var T,q=u.default.useMemo(function(){return Array.from({length:null!=b?b:3},function(e,n){var s;return null!==(s=v[n])&&void 0!==s?s:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[v,b]),N=(v.length>0?v:q).filter(function(e){return!e.isHidden});return n.jsxs("div",e.__assign({style:e.__assign({padding:"8px",display:"flex",flexDirection:"column",gap:"18px"},S.container)},{children:[n.jsxs("span",e.__assign({style:e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.header),S.levelsHeader)},{children:[n.jsx("span",{children:null!=t?t:"Assignee Levels"}),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.infoIconWrapper),S.infoIconWrapper),onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)}},{children:[null!=D?D:n.jsx(i.InfoIcon,{width:18,height:18}),n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.tooltip),S.tooltip),w?e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.tooltipVisible),S.tooltipVisible):{})},{children:x||n.jsxs("span",{children:[n.jsx("b",{children:"How it works:"}),n.jsx("br",{}),"Level 1 is required by default, Enable Level 2 and Level 3 to add sequential approval steps for the review"]})}))]}))]})),n.jsx("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",gap:"16px"},S.accordionsContainer)},{children:N.map(function(s,i){var l,t;return n.jsx(a.default,{level:M&&(null!==(t=null===(l=s.assignees)||void 0===l?void 0:l.length)&&void 0!==t?t:0)>0?e.__assign(e.__assign({},s),{isMandatory:!0}):s,id:String(i),accessLevelOptions:m,fetchUsers:y,onToggleMandatory:function(){return function(n){var s,i,a,l=(null!==(a=null===(i=null===(s=v[n])||void 0===s?void 0:s.assignees)||void 0===i?void 0:i.length)&&void 0!==a?a:0)>0;M&&l||null==h||h(function(s){return s.map(function(s,i){return i===n?e.__assign(e.__assign({},s),{isMandatory:!s.isMandatory}):s})})}(i)},onDueDateChange:function(n){return function(n,s){var i;if(s){var a=c(s),l=p(v,n),t=_(v,n,I);if(a<l)return void(null==L||L(0===n?"Level 1 due date cannot be before today":"Level ".concat(n+1," due date cannot be before Level ").concat(n," due date")));if(t&&a>t)return void(null==L||L((null===(i=v[n+1])||void 0===i?void 0:i.dueDate)?"Level ".concat(n+1," due date cannot be after Level ").concat(n+2," due date"):"Level due date cannot be after final approval due date"))}null==h||h(function(i){return i.map(function(i,a){return a===n?e.__assign(e.__assign({},i),{dueDate:s?c(s):null}):i})})}(i,n)},onAssigneesChange:function(n){return s=i,l=(null!=(a=n)?a:[]).map(function(n){var s=n.accessLevel||n.role||"";return e.__assign(e.__assign({},n),{role:s,accessLevel:s})}),void(null==h||h(function(n){return n.map(function(n,i){return i===s?e.__assign(e.__assign({},n),{assignees:l}):n})}));var s,a,l},onTitleChange:function(n){return function(n,s){null==h||h(function(i){return i.map(function(i,a){return a===n?e.__assign(e.__assign({},i),{title:s}):i})})}(i,n)},minDueDate:p(N,i),maxDueDate:_(N,i,I),finalApprovalDueDate:I,displayConfig:F},i)})})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.finalApprovalBox),S.finalApprovalBox)},{children:[n.jsx(l.default,{getter:f,setter:null!=j?j:function(){}}),n.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",alignItems:"baseline",fontSize:"14px",fontWeight:400},S.finalApprovalTextWrapper)},{children:[n.jsx("span",e.__assign({style:e.__assign({fontWeight:500},S.finalApprovalTitle)},{children:"Require Final Approval"})),n.jsx("span",e.__assign({style:S.finalApprovalDesc},{children:"After all assignees approve, you (the owner) will be notified to give final sign-off before the redline is settled."}))]}))]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.currentApprovalFlow),S.currentApprovalFlow)},{children:[n.jsx("span",e.__assign({style:e.__assign({fontSize:"14px",fontWeight:600},S.currentApprovalFlowTitle)},{children:"Current Approval Flow"})),(T=v.filter(function(e){var n,s;return(null!==(s=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==s?s:0)>0}),n.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},S.approvalFlowItemsWrapper)},{children:T.map(function(s,a){var l,t,r=s.isHidden,o=!s.isMandatory&&!r,d=null!==(l=s.assignees)&&void 0!==l?l:[],c=r?n.jsx(i.User,{size:16}):function(e){switch(e){case 0:return n.jsx(i.Edit2,{size:16});case 1:return n.jsx(i.FileCheck,{size:16});case 2:return n.jsx(i.User,{size:16});default:return n.jsx(i.CheckSquare,{size:16})}}(a);return n.jsxs(u.default.Fragment,{children:[n.jsxs("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",fontWeight:500,color:o?"#64748B":"#374151",border:o?"1px dashed #CBD5E1":void 0,borderRadius:o?"6px":void 0,padding:o?"2px 6px":void 0},S.approvalFlowItem),title:s.title||"Level ".concat(a+1)},{children:[c,n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[d.map(function(s,i){var a,l,t=s.role||s.accessLevel||"No role assigned";return n.jsxs(u.default.Fragment,{children:[i>0&&n.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n.jsx("span",{children:s.name}),n.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:t}))]}))]},null!==(l=null!==(a=s.id)&&void 0!==a?a:s.email)&&void 0!==l?l:i)}),o&&n.jsx("span",{children:"(Optional)"})]}))]})),a<T.length-1&&n.jsx(i.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(t=s.id)&&void 0!==t?t:a)})})))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=AssignReminderLevels.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../_virtual/_tslib.js"),require("react/jsx-runtime"),require("react"),require("./AssignReminderLevels.js");exports.INITIAL_LEVELS=[{headerName:"L1",title:"Initial Review",isMandatory:!0,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L2",title:"Manager Approval",isMandatory:!1,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L3",title:"Final Sign-off",isMandatory:!1,hasDueDate:!1,dueDate:null,assignees:[]}];
|
|
2
|
+
//# sourceMappingURL=AssignReminderTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignReminderTest.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),i=require("react/jsx-runtime"),n=require("lucide-react"),a=require("react"),s=require("./AssignReminderLevels.js"),r=require("./components/ReviewStatus.js"),t=require("./components/CustomDatePicker.js"),l=require("./ManageReminders.js"),o=require("./styles/AssignReminderWrapperStyles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=d(a),u=[{headerName:"L1",title:"First Level",isMandatory:!0,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L2",title:"Second Level",isMandatory:!1,hasDueDate:!0,dueDate:null,assignees:[]}],c=[{tabName:"Assignees & Approvers",tabIcon:i.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[i.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),i.jsx("circle",{cx:"9",cy:"7",r:"4"}),i.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),i.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:i.jsx(n.Bell,{size:15})},{tabName:"Review Status",tabIcon:i.jsx(n.ClipboardList,{size:15})}],v=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];function m(e){var i=e.toLowerCase();return i.includes("reminder")?"reminders":i.includes("review")?"review":"assignees"}exports.AssignReminderWrapper=function(d){var p,f,g=d.metadata,S=void 0===g?{}:g,E=d.reviewData,R=void 0===E?{}:E,A=d.levels,D=d.setLevels,y=d.requireFinalApproval,L=d.setRequireFinalApproval,h=d.approvalDueDate,b=d.setApprovalDueDate,T=d.onClose,N=d.fetchUsers,x=d.onSave,I=d.onValidationError,P=d.totalLevels,j=d.customStyles,F=void 0===j?{}:j,w=d.isSaving,M=void 0!==w&&w,q=d.displayConfig,C=void 0===q?{}:q,W=d.onRequireFinalApproval,B=d.isOwner,U=void 0===B||B,Y=d.blockEditScreen,G=void 0!==Y&&Y,O=d.hideManageReminders,k=void 0!==O&&O,H=d.hideClearButton,z=void 0!==H&&H,V=d.hideSaveChangesButton,X=void 0!==V&&V,J=d.hideFooterActions,K=void 0!==J&&J;d.hideAssigneeApproverScreen,d.remindersData;var Q=d.remainderOwners,Z=d.setRemainderOwners,$=d.schedules,ee=d.setSchedules,ie=d.handelSendNow,ne=d.showPreviewEmail,ae=d.tabName,se=d.reminderLabels,re=d.reminderColors,te=d.reminderChipColor,le=d.reminderAssignees,oe=d.reminderFallbackRecipients,de=d.reminderRecipientsColor,_e=d.manualReminderTitle,ue=d.manualReminderDescription,ce=d.lastReminderText,ve=d.selectRecipientsLabel,me=d.previewEmailButtonLabel,pe=d.sendNowButtonLabel,fe=d.reminderSuccessTitle,ge=d.reminderSuccessDescription,Se=d.escalationTitle,Ee=d.escalationTitleTooltip,Re=d.escalationDescription,Ae=d.configureAutoReminderText,De=d.getDynamicStatement,ye=d.reminderStartDateLabel,Le=d.documentDueDateLabel,he=d.reminderFrequencyLabel,be=d.escalationRemindersLabel,Te=d.escalationTooltip,Ne=d.escalationConditionText,xe=d.daysText,Ie=d.dueDataAndRepeatText,Pe=d.reminderFrequencyOptions,je=d.escalationFrequencyOptions,Fe=d.beforeAfterOptions,we=_.default.useMemo(function(){var e;return(null===(e=S.tabData)||void 0===e?void 0:e.length)?S.tabData:c},[S.tabData]),Me=_.default.useMemo(function(){return we.filter(function(e){var i=m(e.tabName);return!((!U||G)&&"assignees"===i)&&(!k||"reminders"!==i)})},[we,U,G,k]),qe=a.useState(null!==(f=null===(p=Me[0])||void 0===p?void 0:p.tabName)&&void 0!==f?f:""),Ce=qe[0],We=qe[1],Be=m(Ce),Ue=a.useState(A||u),Ye=Ue[0],Ge=Ue[1],Oe=a.useState(y||!1),ke=Oe[0],He=Oe[1],ze=a.useState(h||null),Ve=ze[0],Xe=ze[1],Je=a.useState(null),Ke=Je[0],Qe=Je[1],Ze=a.useState([]),$e=Ze[0],ei=Ze[1],ii=a.useState(Q||v),ni=ii[0],ai=ii[1],si=void 0!==$?$:$e,ri=void 0!==ee?ee:ei,ti=void 0!==Q?Q:ni,li=function(i){return i.map(function(i,n){return 0!==n||i.isHidden?i:e.__assign(e.__assign({},i),{isMandatory:!0,hasDueDate:!0})})},oi=function(i){return i.map(function(i){var n;return e.__assign(e.__assign({},i),{assignees:(null!==(n=i.assignees)&&void 0!==n?n:[]).map(function(i){var n=i.role||i.accessLevel||"";return e.__assign(e.__assign({},i),{role:n,accessLevel:i.accessLevel||n})})})})},di=_.default.useMemo(function(){return{due_at:Ve?Ve.toISOString():"",assignee:Ye.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(i,n,a){var s;return e.__assign(e.__assign({},i),((s={})[a]=n,s))},{})}},[Ve,Ye]);a.useEffect(function(){void 0!==Q&&ai(Q)},[Q]),a.useEffect(function(){W&&W().then(function(e){Array.isArray(e)&&e.length>0?Qe(e[0]):e&&!Array.isArray(e)&&Qe(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),a.useEffect(function(){ae&&Me.some(function(e){return e.tabName===ae})&&We(ae)},[ae,Me]),a.useEffect(function(){var e,i;Me.some(function(e){return e.tabName===Ce})||We(null!==(i=null===(e=Me[0])||void 0===e?void 0:e.tabName)&&void 0!==i?i:"")},[Me,Ce]),a.useEffect(function(){A&&Ge(function(i){var n=i.find(function(e){return e.isHidden}),a=n?e.__spreadArray(e.__spreadArray([],A,!0),[n],!1):A;return oi(li(a))})},[A]),a.useEffect(function(){void 0!==y&&He(y)},[y]),a.useEffect(function(){void 0!==h&&Xe(h)},[h]),a.useEffect(function(){Ge(function(i){var n=i.filter(function(e){return!e.isHidden});if(ke){var a={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==Ke?void 0:Ke.id)||"me",email:(null==Ke?void 0:Ke.email)||"",name:(null==Ke?void 0:Ke.name)?"".concat(Ke.name," (You)"):"Username (You)",accessLevel:"Approve",role:"Final Approver"}]};return oi(e.__spreadArray(e.__spreadArray([],n,!0),[a],!1))}return oi(n)})},[ke,Ke]),a.useEffect(function(){var e=Ye.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});ai(function(i){var n=i.length===e.length&&e.every(function(e,n){var a;return(null===(a=i[n])||void 0===a?void 0:a.email)===e.email});return n?i:e.map(function(e,n){var a=i.find(function(i){return i.email===e.email});return a||{id:n+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[Ye]);var _i=Ye.filter(function(e){return!e.isHidden}),ui=_i.find(function(e,i){if(!(0===i||e.isMandatory))return!1;var n=!!e.dueDate,a=(e.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)});return!n||!a}),ci=!1!==S.showFinalApprovalDueDate,vi=M||(!!ui||ci&&!Ve),mi=S.wrapperTitle||"Assign Redline and Manage Reminders",pi=S.wrapperSubTitle||"Sec 4.1 - Technical Security Information",fi=S.wrapperPriority||"High",gi=S.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.overlay),F.overlay)},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===Be?{width:"1400px",maxWidth:"95vw"}:{}),F.modal)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.header),F.header)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.headerLeft),F.headerLeft)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modalTitle),F.modalTitle)},{children:mi})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineRow),F.redlineRow)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineName),F.redlineName)},{children:pi})),i.jsx("span",e.__assign({style:e.__assign(e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineBadge),gi),F.redlineBadge)},{children:fi}))]}))]})),i.jsx("button",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.closeBtn),F.closeBtn),onClick:T},{children:i.jsx(n.X,{size:20,color:"#6B7280"})}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabBar),F.tabBar)},{children:Me.map(function(n){var a=Ce===n.tabName;return i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tab),F.tab),a?e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabActive),F.tabActive):{}),onClick:function(){return We(n.tabName)}},{children:[n.tabIcon," ",n.tabName]}),n.tabName)})})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.body),F.body)},{children:["assignees"===Be&&i.jsxs(i.Fragment,{children:[!1!==S.showFinalApprovalDueDate&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateBar),F.dueDateBar)},{children:[i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateLabel),F.dueDateLabel)},{children:["Final Approval due date"," ",i.jsx("sup",e.__assign({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateInputWrap),F.dueDateInputWrap)},{children:i.jsx(t.default,{value:Ve?Ve.toISOString().slice(0,10):"",onChange:Xe,disabled:C.disableDueDates})})),i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.requiredToProceeed),F.requiredToProceeed)},{children:[i.jsx(n.CircleAlert,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),i.jsx(s.AssignReminderLevels,{levels:Ye,totalLevels:P,requireFinalApproval:ke,setLevels:Ge,setRequireFinalApproval:function(e){He(e)},fetchUsers:N,onValidationError:I,customStyles:F,finalApprovalDueDate:Ve,displayConfig:C})]}),"reminders"===Be&&i.jsx(l.ManageReminders,e.__assign({data:di,schedules:si,setSchedules:ri,remainderOwners:ti,setRemainderOwners:function(e){var i="function"==typeof e?e(ti):e;Z?Z(i):ai(i)},handelSendNow:function(e,i){ie&&ie(e||si,i||ti)},showPreviewEmail:null!=ne&&ne},void 0!==se&&{labels:se},void 0!==re&&{colors:re},void 0!==te&&{chipColor:te},void 0!==le&&{assignees:le},void 0!==oe&&{fallbackRecipients:oe},void 0!==de&&{recipientsColor:de},void 0!==_e&&{manualReminderTitle:_e},void 0!==ue&&{manualReminderDescription:ue},void 0!==ce&&{lastReminderText:ce},void 0!==ve&&{selectRecipientsLabel:ve},void 0!==me&&{previewEmailButtonLabel:me},void 0!==pe&&{sendNowButtonLabel:pe},void 0!==fe&&{reminderSuccessTitle:fe},void 0!==ge&&{reminderSuccessDescription:ge},void 0!==Se&&{escalationTitle:Se},void 0!==Ee&&{escalationTitleTooltip:Ee},void 0!==Re&&{escalationDescription:Re},void 0!==Ae&&{configureAutoReminderText:Ae},void 0!==De&&{getDynamicStatement:De},void 0!==ye&&{reminderStartDateLabel:ye},void 0!==Le&&{documentDueDateLabel:Le},void 0!==he&&{reminderFrequencyLabel:he},void 0!==be&&{escalationRemindersLabel:be},void 0!==Te&&{escalationTooltip:Te},void 0!==Ne&&{escalationConditionText:Ne},void 0!==xe&&{daysText:xe},void 0!==Ie&&{dueDataAndRepeatText:Ie},void 0!==Pe&&{reminderFrequencyOptions:Pe},void 0!==je&&{escalationFrequencyOptions:je},void 0!==Fe&&{beforeAfterOptions:Fe})),"review"===Be&&i.jsx(r.default,{levels:Ye,reviewData:R})]})),!K&&(!z||!X)&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.footer),F.footer)},{children:[!z&&i.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.clearBtn),F.clearBtn),M?F.actionBtnDisabled:{}),onClick:function(){Ge(li(u.map(function(i){return e.__assign(e.__assign({},i),{assignees:[],dueDate:null})}))),He(!1),Xe(null)},disabled:M},{children:"Clear"})),!X&&i.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},o.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.saveBtn),F.saveBtn),vi?e.__assign({opacity:.55,cursor:"not-allowed"},F.actionBtnDisabled):{}),onClick:function(){if(vi)M||null==I||I(function(){if(ci&&!Ve)return"Final approval due date is required";if(!ui)return"Please fill all required fields before saving";var e=_i.indexOf(ui)+1,i=[ui.dueDate?null:"due date",(ui.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)})?null:"assignee"].filter(Boolean);return"Level ".concat(e," ").concat(i.join(" and ")," ").concat(i.length>1?"are":"is"," required")}());else{var e=oi(Ye.filter(function(e){return!e.isHidden}));null==D||D(e),null==L||L(ke),null==b||b(Ve),null==x||x({levels:e,requireFinalApproval:ke,finalApprovalDueDate:Ve,activeTab:Be,schedules:si,remainderOwners:ti})}},disabled:vi},{children:"Save Changes"}))]}))]}))}))},exports.INITIAL_LEVELS=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("lucide-react"),a=require("react"),s=require("./AssignReminderLevels.js"),r=require("./components/ReviewStatus.js"),t=require("./components/CustomDatePicker.js"),o=require("./ManageReminders.js"),l=require("./styles/AssignReminderWrapperStyles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(a),_=[{headerName:"L1",title:"First Level",isMandatory:!0,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L2",title:"Second Level",isMandatory:!1,hasDueDate:!0,dueDate:null,assignees:[]}],c=[{tabName:"Assignees & Approvers",tabIcon:n.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[n.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),n.jsx("circle",{cx:"9",cy:"7",r:"4"}),n.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),n.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:n.jsx(i.Bell,{size:15})},{tabName:"Review Status",tabIcon:n.jsx(i.ClipboardList,{size:15})}],v=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];function p(e){var n=e.toLowerCase();return n.includes("reminder")?"reminders":n.includes("review")?"review":"assignees"}exports.AssignReminderWrapper=function(d){var m,f,g=d.metadata,S=void 0===g?{}:g,E=d.reviewData,R=void 0===E?{}:E,A=d.levels,D=d.setLevels,y=d.requireFinalApproval,L=d.setRequireFinalApproval,h=d.approvalDueDate,b=d.setApprovalDueDate,T=d.onClose,N=d.fetchUsers,x=d.onSave,I=d.onValidationError,P=d.showApproveAndMoveToNextLevelButton,F=d.onApproveAndMoveToNextLevel,j=d.totalLevels,w=d.customStyles,M=void 0===w?{}:w,q=d.isSaving,C=void 0!==q&&q,B=d.displayConfig,W=void 0===B?{}:B,U=d.onRequireFinalApproval,Y=d.isOwner,G=void 0===Y||Y,O=d.blockEditScreen,k=void 0!==O&&O,H=d.hideManageReminders,z=void 0!==H&&H,V=d.hideClearButton,X=void 0!==V&&V,J=d.hideSaveChangesButton,K=void 0!==J&&J,Q=d.hideFooterActions,Z=void 0!==Q&&Q;d.hideAssigneeApproverScreen,d.remindersData;var $=d.remainderOwners,ee=d.setRemainderOwners,ne=d.schedules,ie=d.setSchedules,ae=d.handelSendNow,se=d.showPreviewEmail,re=d.tabName,te=d.reminderLabels,oe=d.reminderColors,le=d.reminderChipColor,de=d.reminderAssignees,ue=d.reminderFallbackRecipients,_e=d.reminderRecipientsColor,ce=d.manualReminderTitle,ve=d.manualReminderDescription,pe=d.lastReminderText,me=d.selectRecipientsLabel,fe=d.previewEmailButtonLabel,ge=d.sendNowButtonLabel,Se=d.reminderSuccessTitle,Ee=d.reminderSuccessDescription,Re=d.escalationTitle,Ae=d.escalationTitleTooltip,De=d.escalationDescription,ye=d.configureAutoReminderText,Le=d.getDynamicStatement,he=d.reminderStartDateLabel,be=d.documentDueDateLabel,Te=d.reminderFrequencyLabel,Ne=d.escalationRemindersLabel,xe=d.escalationTooltip,Ie=d.escalationConditionText,Pe=d.daysText,Fe=d.dueDataAndRepeatText,je=d.reminderFrequencyOptions,we=d.escalationFrequencyOptions,Me=d.beforeAfterOptions,qe=u.default.useMemo(function(){var e;return(null===(e=S.tabData)||void 0===e?void 0:e.length)?S.tabData:c},[S.tabData]),Ce=u.default.useMemo(function(){return qe.filter(function(e){var n=p(e.tabName);return!((!G||k)&&"assignees"===n)&&(!z||"reminders"!==n)})},[qe,G,k,z]),Be=a.useState(null!==(f=null===(m=Ce[0])||void 0===m?void 0:m.tabName)&&void 0!==f?f:""),We=Be[0],Ue=Be[1],Ye=p(We),Ge=a.useState(A||_),Oe=Ge[0],ke=Ge[1],He=a.useState(y||!1),ze=He[0],Ve=He[1],Xe=a.useState(h||null),Je=Xe[0],Ke=Xe[1],Qe=a.useState(null),Ze=Qe[0],$e=Qe[1],en=a.useState([]),nn=en[0],an=en[1],sn=a.useState($||v),rn=sn[0],tn=sn[1],on=void 0!==ne?ne:nn,ln=void 0!==ie?ie:an,dn=void 0!==$?$:rn,un=function(n){return n.map(function(n,i){return 0!==i||n.isHidden?n:e.__assign(e.__assign({},n),{isMandatory:!0,hasDueDate:!0})})},_n=function(e){var n=new Date(e);return n.setHours(0,0,0,0),n},cn=function(){return _n(new Date)},vn=function(n){return n.map(function(n){var i;return e.__assign(e.__assign({},n),{assignees:(null!==(i=n.assignees)&&void 0!==i?i:[]).map(function(n){var i=n.accessLevel||n.role||"";return e.__assign(e.__assign({},n),{role:i,accessLevel:i})})})})},pn=u.default.useMemo(function(){return{due_at:Je?Je.toISOString():"",assignee:Oe.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(n,i,a){var s;return e.__assign(e.__assign({},n),((s={})[a]=i,s))},{})}},[Je,Oe]);a.useEffect(function(){void 0!==$&&tn($)},[$]),a.useEffect(function(){U&&U().then(function(e){Array.isArray(e)&&e.length>0?$e(e[0]):e&&!Array.isArray(e)&&$e(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),a.useEffect(function(){re&&Ce.some(function(e){return e.tabName===re})&&Ue(re)},[re,Ce]),a.useEffect(function(){var e,n;Ce.some(function(e){return e.tabName===We})||Ue(null!==(n=null===(e=Ce[0])||void 0===e?void 0:e.tabName)&&void 0!==n?n:"")},[Ce,We]),a.useEffect(function(){A&&ke(function(n){var i=n.find(function(e){return e.isHidden}),a=i?e.__spreadArray(e.__spreadArray([],A,!0),[i],!1):A;return vn(un(a))})},[A]),a.useEffect(function(){void 0!==y&&Ve(y)},[y]),a.useEffect(function(){void 0!==h&&Ke(h)},[h]),a.useEffect(function(){ke(function(n){var i=n.filter(function(e){return!e.isHidden});if(ze){var a={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==Ze?void 0:Ze.id)||"me",email:(null==Ze?void 0:Ze.email)||"",name:(null==Ze?void 0:Ze.name)?"".concat(Ze.name," (You)"):"Username (You)",accessLevel:"Approve",role:"Final Approver"}]};return vn(e.__spreadArray(e.__spreadArray([],i,!0),[a],!1))}return vn(i)})},[ze,Ze]),a.useEffect(function(){var e=Oe.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});tn(function(n){var i=n.length===e.length&&e.every(function(e,i){var a;return(null===(a=n[i])||void 0===a?void 0:a.email)===e.email});return i?n:e.map(function(e,i){var a=n.find(function(n){return n.email===e.email});return a||{id:i+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[Oe]);var mn=Oe.filter(function(e){return!e.isHidden}),fn=mn.reduce(function(e,n){if(!n.dueDate)return e;var i=_n(n.dueDate);return!e||i>e?i:e},null),gn=fn&&fn>cn()?fn:cn(),Sn=mn.find(function(e,n){if(!(0===n||e.isMandatory))return!1;var i=!!e.dueDate,a=(e.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)});return!i||!a}),En=!1!==S.showFinalApprovalDueDate,Rn=C||(!!Sn||En&&!Je),An=S.wrapperTitle||"Assign Redline and Manage Reminders",Dn=S.wrapperSubTitle||"Sec 4.1 - Technical Security Information",yn=S.wrapperPriority||"High",Ln=S.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return n.jsx("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.overlay),M.overlay)},{children:n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===Ye?{width:"1400px",maxWidth:"95vw"}:{}),M.modal)},{children:[n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.header),M.header)},{children:[n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.headerLeft),M.headerLeft)},{children:[n.jsx("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modalTitle),M.modalTitle)},{children:An})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineRow),M.redlineRow)},{children:[n.jsx("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineName),M.redlineName)},{children:Dn})),n.jsx("span",e.__assign({style:e.__assign(e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineBadge),Ln),M.redlineBadge)},{children:yn}))]}))]})),n.jsx("button",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.closeBtn),M.closeBtn),onClick:T},{children:n.jsx(i.X,{size:20,color:"#6B7280"})}))]})),n.jsx("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabBar),M.tabBar)},{children:Ce.map(function(i){var a=We===i.tabName;return n.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tab),M.tab),a?e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabActive),M.tabActive):{}),onClick:function(){return Ue(i.tabName)}},{children:[i.tabIcon," ",i.tabName]}),i.tabName)})})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.body),M.body)},{children:["assignees"===Ye&&n.jsxs(n.Fragment,{children:[!1!==S.showFinalApprovalDueDate&&n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateBar),M.dueDateBar)},{children:[n.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateLabel),M.dueDateLabel)},{children:["Final Approval due date"," ",n.jsx("sup",e.__assign({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),n.jsx("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateInputWrap),M.dueDateInputWrap)},{children:n.jsx(t.default,{value:Je?Je.toISOString().slice(0,10):"",onChange:function(e){var n="function"==typeof e?e(Je):e;n&&_n(n)<gn?null==I||I("Final approval due date cannot be before the latest level due date"):Ke(n?_n(n):null)},minDate:gn,disabled:W.disableDueDates})})),n.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.requiredToProceeed),M.requiredToProceeed)},{children:[n.jsx(i.CircleAlert,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),n.jsx(s.AssignReminderLevels,{levels:Oe,totalLevels:j,requireFinalApproval:ze,setLevels:ke,setRequireFinalApproval:function(e){Ve(e)},fetchUsers:N,onValidationError:I,customStyles:M,finalApprovalDueDate:Je,displayConfig:W})]}),"reminders"===Ye&&n.jsx(o.ManageReminders,e.__assign({data:pn,schedules:on,setSchedules:ln,remainderOwners:dn,setRemainderOwners:function(e){var n="function"==typeof e?e(dn):e;ee?ee(n):tn(n)},handelSendNow:function(e,n){ae&&ae(e||on,n||dn)},showPreviewEmail:null!=se&&se},void 0!==te&&{labels:te},void 0!==oe&&{colors:oe},void 0!==le&&{chipColor:le},void 0!==de&&{assignees:de},void 0!==ue&&{fallbackRecipients:ue},void 0!==_e&&{recipientsColor:_e},void 0!==ce&&{manualReminderTitle:ce},void 0!==ve&&{manualReminderDescription:ve},void 0!==pe&&{lastReminderText:pe},void 0!==me&&{selectRecipientsLabel:me},void 0!==fe&&{previewEmailButtonLabel:fe},void 0!==ge&&{sendNowButtonLabel:ge},void 0!==Se&&{reminderSuccessTitle:Se},void 0!==Ee&&{reminderSuccessDescription:Ee},void 0!==Re&&{escalationTitle:Re},void 0!==Ae&&{escalationTitleTooltip:Ae},void 0!==De&&{escalationDescription:De},void 0!==ye&&{configureAutoReminderText:ye},void 0!==Le&&{getDynamicStatement:Le},void 0!==he&&{reminderStartDateLabel:he},void 0!==be&&{documentDueDateLabel:be},void 0!==Te&&{reminderFrequencyLabel:Te},void 0!==Ne&&{escalationRemindersLabel:Ne},void 0!==xe&&{escalationTooltip:xe},void 0!==Ie&&{escalationConditionText:Ie},void 0!==Pe&&{daysText:Pe},void 0!==Fe&&{dueDataAndRepeatText:Fe},void 0!==je&&{reminderFrequencyOptions:je},void 0!==we&&{escalationFrequencyOptions:we},void 0!==Me&&{beforeAfterOptions:Me})),"review"===Ye&&n.jsx(r.default,{levels:Oe,reviewData:R,showApproveAndMoveToNextLevelButton:P,onApproveAndMoveToNextLevel:F})]})),!Z&&(!X||!K)&&n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.footer),M.footer)},{children:[!X&&n.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.clearBtn),M.clearBtn),C?M.actionBtnDisabled:{}),onClick:function(){ke(un(_.map(function(n){return e.__assign(e.__assign({},n),{assignees:[],dueDate:null})}))),Ve(!1),Ke(null)},disabled:C},{children:"Clear"})),!K&&n.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.saveBtn),M.saveBtn),Rn?e.__assign({opacity:.55,cursor:"not-allowed"},M.actionBtnDisabled):{}),onClick:function(){if(Rn)C||null==I||I(function(){if(En&&!Je)return"Final approval due date is required";if(!Sn)return"Please fill all required fields before saving";var e=mn.indexOf(Sn)+1,n=[Sn.dueDate?null:"due date",(Sn.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)})?null:"assignee"].filter(Boolean);return"Level ".concat(e," ").concat(n.join(" and ")," ").concat(n.length>1?"are":"is"," required")}());else{var e=vn(Oe.filter(function(e){return!e.isHidden}));null==D||D(e),null==L||L(ze),null==b||b(Je),null==x||x({levels:e,requireFinalApproval:ze,finalApprovalDueDate:Je,activeTab:Ye,schedules:on,remainderOwners:dn})}},disabled:Rn},{children:"Save Changes"}))]}))]}))}))},exports.INITIAL_LEVELS=_;
|
|
2
2
|
//# sourceMappingURL=AssignReminderWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),a=require("../styles/AssignLevelsDatePickerStyles.js"),n=function(e){if(e){var t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(a)}};exports.default=function(i){var l,s=i.value,u=i.onSet,o=i.minDate,c=i.maxDate,d=i.disabled,_=void 0!==d&&d,v=r.useRef(null),p=n(null!=o?o:new Date),S=n(c);return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},a.DATE_PICKER_STYLES.wrapper),{cursor:_?"not-allowed":a.DATE_PICKER_STYLES.wrapper.cursor,opacity:_?.65:1}),onClick:function(){var e,t;_||null===(t=null===(e=v.current)||void 0===e?void 0:e.showPicker)||void 0===t||t.call(e)}},{children:[t.jsx("span",e.__assign({style:a.DATE_PICKER_STYLES.placeholder},{children:s?s.toLocaleDateString("en-GB"):"--/--/----"})),t.jsx("input",{ref:v,type:"date",max:S,min:p,style:a.DATE_PICKER_STYLES.input,value:null!==(l=n(s))&&void 0!==l?l:"",disabled:_,onChange:function(e){if(!_){var t=e.target.value;u(t?new Date(t):null)}}})]}))};
|
|
2
2
|
//# sourceMappingURL=AssignLevelsDatePicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(n);exports.default=function(a){var o=a.value,l=a.onChange,s=a.placeholder,u=void 0===s?"dd/mm/yyyy":s,d=a.disabled,c=void 0!==d&&d,p=a.minDate,g=n.useRef(null),v=i.default.useMemo(function(){var e=null!=p?p:new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)},[p]);return t.jsxs("div",e.__assign({onClick:function(){var e,t;c||null===(t=null===(e=g.current)||void 0===e?void 0:e.showPicker)||void 0===t||t.call(e)},style:{position:"relative",width:"100%",height:"35px",padding:"0 12px",borderRadius:"12px",background:"#F3F4F6",border:"1px solid #C7CDD5",display:"flex",gap:60,alignItems:"center",cursor:c?"not-allowed":"pointer",opacity:c?.65:1,boxSizing:"border-box"}},{children:[t.jsx("input",{ref:g,type:"date",value:o,onChange:function(e){return l(e.target.value?new Date(e.target.value):null)},min:v,disabled:c,style:{position:"absolute",opacity:0,pointerEvents:"none"}}),t.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:o?"#111827":"#667085"}},{children:o?new Date(o).toLocaleDateString("en-GB"):u})),t.jsx("div",e.__assign({style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"6px"}},{children:t.jsx(r.Calendar,{size:18,color:"#667085",strokeWidth:2})}))]}))};
|
|
2
2
|
//# sourceMappingURL=CustomDatePicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("react"),s=require("./CustomDropdown.js"),l=require("./AddUserPopup.js");exports.default=function(r){var t,o,a,d,u,c=this,p=r.assignees,v=r.onAssigneeChange,g=r.accessLevelOptions,_=r.fetchUsers,x=r.wrapperEl,b=r.levelDetails,f=r.displayConfig,h=void 0===f?{}:f,m=i.useState(""),C=m[0],y=m[1],w=i.useState([]),j=w[0],A=w[1],U=i.useState(null),L=U[0],k=U[1];return i.useEffect(function(){if(!h.disableAddUser&&C.trim()){var n=setTimeout(function(){return e.__awaiter(c,void 0,void 0,function(){var n,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,_(C)];case 1:return n=e.sent(),i=new Set(p.map(function(e){return e.id})),A(n.filter(function(e){return!i.has(e.id)})),[3,3];case 2:return s=e.sent(),console.error("[LevelData]: fetchUser error:",s),A([]),[3,3];case 3:return[2]}})})},300);return function(){return clearTimeout(n)}}A([])},[C,p]),n.jsxs("div",e.__assign({style:{borderTop:"1px solid #CBD5E1",padding:"20px"}},{children:[n.jsx("span",e.__assign({style:{fontWeight:600,marginBottom:"8px",fontSize:"14px"}},{children:"Assignee Emails"})),n.jsxs("div",e.__assign({style:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"8px",marginTop:"10px",display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},{children:[p.map(function(i){var l,r,t,o=!!i.notes&&"string"==typeof i.notes&&!!i.notes.trim();return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",background:"#E9D5FF",borderRadius:"10px",padding:"2px 8px",fontSize:"12px"}},{children:[n.jsx("span",e.__assign({style:{padding:"4px"}},{children:i.name})),n.jsx(s.default,{value:null!==(t=null!==(l=i.accessLevel)&&void 0!==l?l:null===(r=g[0])||void 0===r?void 0:r.label)&&void 0!==t?t:"",options:g,onChange:function(n){return s=i.id,l=n,void(h.disableAccessLevelChange||v(p.map(function(n){return n.id===s?e.__assign(e.__assign({},n),{accessLevel:l,role:l}):n})));var s,l},disabled:h.disableAccessLevelChange}),n.jsx("div",e.__assign({style:{position:"relative",display:"inline-flex",backgroundColor:"white",borderRadius:"3px",padding:1}},{children:n.jsx("button",e.__assign({type:"button",disabled:h.disableNotes,onClick:function(){return function(n){h.disableNotes||k(e.__assign({},n))}(i)},style:{border:"none",background:"transparent",cursor:h.disableNotes?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",color:o?"#7C3AED":"#C4B5FD",opacity:h.disableNotes?.6:1}},{children:n.jsx("svg",e.__assign({width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M3.03353 3.90755H5.9502M3.03353 5.94922H7.7002M4.59905 9.44922H8.4002C9.38029 9.44922 9.87033 9.44922 10.2447 9.25848C10.574 9.0907 10.8417 8.82299 11.0095 8.4937C11.2002 8.11936 11.2002 7.62931 11.2002 6.64922V3.49922C11.2002 2.51913 11.2002 2.02908 11.0095 1.65474C10.8417 1.32545 10.574 1.05774 10.2447 0.889957C9.87033 0.699219 9.38029 0.699219 8.4002 0.699219H3.5002C2.5201 0.699219 2.03006 0.699219 1.65571 0.889957C1.32643 1.05774 1.05871 1.32545 0.890934 1.65474C0.700195 2.02908 0.700195 2.51913 0.700195 3.49922V10.8116C0.700195 11.1224 0.700195 11.2778 0.763912 11.3577C0.819325 11.4271 0.903352 11.4675 0.992177 11.4674C1.09431 11.4673 1.21567 11.3702 1.45839 11.176L2.8499 10.0628C3.13416 9.83538 3.27629 9.72167 3.43456 9.64082C3.57498 9.56908 3.72444 9.51665 3.8789 9.48495C4.053 9.44922 4.23502 9.44922 4.59905 9.44922Z",stroke:"#98A2B3","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})}))}))})),n.jsx("button",e.__assign({disabled:h.disableRemoveUser,style:{border:"none",background:"transparent",cursor:h.disableRemoveUser?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",fontSize:"12px",opacity:h.disableRemoveUser?.45:1},onClick:function(){return e=i.id,void(h.disableRemoveUser||(v(p.filter(function(n){return n.id!==e})),(null==L?void 0:L.id)===e&&k(null)));var e},"aria-label":"Remove ".concat(i.name)},{children:"✕"}))]}),i.id)}),n.jsx("input",{type:"text",value:C,placeholder:"Search users...",onChange:function(e){h.disableAddUser||y(e.target.value)},disabled:h.disableAddUser,style:{border:"none",outline:"none",flex:1,minWidth:"150px",fontSize:"12px",cursor:h.disableAddUser?"not-allowed":"text",opacity:h.disableAddUser?.65:1}})]})),j.length>0&&n.jsx("div",e.__assign({style:{border:"1px solid #CBD5E1",borderRadius:"8px",marginTop:"8px"}},{children:j.map(function(i){return n.jsxs("div",e.__assign({style:{padding:"8px",cursor:h.disableAddUser?"not-allowed":"pointer",opacity:h.disableAddUser?.65:1},onClick:function(){return function(n){var i,s,l,r,t,o,a,d;h.disableAddUser||p.some(function(e){return e.id===n.id})||(v(e.__spreadArray(e.__spreadArray([],p,!0),[e.__assign(e.__assign({},n),{accessLevel:null!==(s=null===(i=g[0])||void 0===i?void 0:i.label)&&void 0!==s?s:"",role:null!==(r=null===(l=g[0])||void 0===l?void 0:l.label)&&void 0!==r?r:"",notes:"",sendMailNow:!1})],!1)),y(""),A([]),k(e.__assign(e.__assign({},n),{accessLevel:null!==(o=null===(t=g[0])||void 0===t?void 0:t.label)&&void 0!==o?o:"",role:null!==(d=null===(a=g[0])||void 0===a?void 0:a.label)&&void 0!==d?d:""})))}(i)}},{children:[i.name,i.email&&n.jsx("span",e.__assign({style:{marginLeft:"8px",color:"#6B7280",fontSize:"11px"}},{children:i.email}))]}),i.id)})})),L&&n.jsx(l.AddUserPopup,{user:L,userLevel:{head:null!==(t=null==b?void 0:b.head)&&void 0!==t?t:"",title:null!==(o=null==b?void 0:b.title)&&void 0!==o?o:""},accessLevel:null!==(u=null!==(a=L.accessLevel)&&void 0!==a?a:null===(d=g[0])||void 0===d?void 0:d.label)&&void 0!==u?u:"",wrapperEl:x,onBackToEditing:function(){L&&(v(p.map(function(n){return n.id===L.id?e.__assign(e.__assign({},n),{notes:"",sendMailNow:!1}):n})),k(null))},onSendLater:function(n){h.disableNotes||L&&(v(p.map(function(i){return i.id===L.id?e.__assign(e.__assign({},i),{notes:n,sendMailNow:!1}):i})),k(null))},onSendNow:function(n){h.disableNotes||L&&(v(p.map(function(i){return i.id===L.id?e.__assign(e.__assign({},i),{notes:n,sendMailNow:!0}):i})),k(null))},disabled:h.disableNotes})]}))};
|
|
2
2
|
//# sourceMappingURL=LevelData.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),t=require("../styles/ReviewStatusStyles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=l(i),a=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},o=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return s[Math.abs(i)%s.length]},d=function(e){var s=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof s&&s.trim()?s:"No role assigned"};function p(i){var t,l=i.reviewLevel,r=l.level,a=l.assigneeStatuses,o=l.extendedStatus,d=null!==(t={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(n.Info,{size:14}),text:"Optional"}}[o])&&void 0!==t?t:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},p="approved"===o?"1px solid #D1FAE5":"rejected"===o?"1px solid #FCA5A5":"optional"===o?"1px dashed #CBD5E1":"1px solid #E5E7EB",c="approved"===o?"#F0FDF4":"rejected"===o?"#FEF2F2":"#F8FAFC";return!r.assignees||!Array.isArray(r.assignees)||r.assignees.length<1?null:s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:p,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:c,borderBottom:p,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(x,{name:r.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:r.title}))]})),s.jsxs("div",e.__assign({style:{backgroundColor:d.bg,color:d.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[d.icon,d.text]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:a.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:a.map(function(e,i){var n;return s.jsx(g,{assigneeStatus:e,extendedStatus:o},null!==(n=e.user.id)&&void 0!==n?n:i)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function c(i){var t,l,r,p,c=i.reviewLevel,g=c.assigneeStatuses,x=c.extendedStatus,u=null!==(t={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(n.Info,{size:14}),text:"Optional"}}[x])&&void 0!==t?t:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},_=null===(l=g[0])||void 0===l?void 0:l.user;null==_||_.email;var v=d(_);return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[_?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:o(null!==(r=_.id)&&void 0!==r?r:_.name).bg,color:o(null!==(p=_.id)&&void 0!==p?p:_.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:a(_.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:_.name})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",v]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function g(i){var t,l=i.assigneeStatus,r=i.extendedStatus,p=l.user,c=l.approved||"approved"===p.action,g=l.rejected||"rejected"===p.action,x=a(p.name),u=o(null!==(t=p.id)&&void 0!==t?t:p.name),_=d(p);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:p.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:_}))]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:p.email}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:c?s.jsx(n.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):g?s.jsx(n.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===r?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:"13px",color:"#4B5563"}}),s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):"optional"===r?s.jsx(n.MinusCircle,{size:20,color:"#CBD5E1",strokeWidth:1.5}):s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function x(i){var n=i.name,t=o(n);return s.jsx("span",e.__assign({style:{backgroundColor:t.bg,color:t.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var u=function(e){switch(e){case 0:return s.jsx(n.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(n.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(n.User,{size:16,color:"#475569"});default:return s.jsx(n.CheckCircle,{size:16,color:"#475569"})}};function _(i){var l=i.levels.filter(function(e){var s,i;return(null!==(i=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==i?i:0)>0});return s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),l.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:l.map(function(i,a){var o,p=i.isHidden,c=!i.isMandatory&&!p,g=p?s.jsx(n.User,{size:16,color:"#475569"}):u(a);return s.jsxs(r.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:c?"1px dashed #CBD5E1":void 0})},{children:[g,s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[i.assignees.map(function(i,n){var t,l,a=d(i);return s.jsxs(r.default.Fragment,{children:[n>0&&s.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:13,color:c?"#64748B":"#374151"}},{children:i.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:a}))]}))]},null!==(l=null!==(t=i.id)&&void 0!==t?t:i.email)&&void 0!==l?l:n)}),c&&s.jsx("span",e.__assign({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),a<l.length-1&&s.jsx(n.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(o=i.id)&&void 0!==o?o:"".concat(i.headerName,"-").concat(a))})})):s.jsx("p",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(i){var l=i.levels,a=i.reviewData,o=void 0===a?{}:a,d=l.map(function(e,s){var i,n,t,l=null!==(n=null!==(i=o[s])&&void 0!==i?i:o[e.headerName])&&void 0!==n?n:{},r=(null!==(t=e.assignees)&&void 0!==t?t:[]).map(function(e){return{user:e,approved:!0===l[String(e.id)]||!0===l[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===l[String(e.id)]||"rejected"===l[String(e.email)]||"rejected"===e.action}}),a="not_started";if(!0===e.isApproved)a="approved";else if(!0===e.isRejected)a="rejected";else if("approved"===e.status||"completed"===e.status)a="approved";else if("rejected"===e.status)a="rejected";else{var d=r.length>0&&r.every(function(e){return e.approved}),p=r.some(function(e){return e.rejected});d?a="approved":p&&(a="rejected")}return{level:e,assigneeStatuses:r,status:a}}),g=!1,x=d.map(function(s){var i="waiting",n=!0===s.level.isHidden;return"approved"===s.status?i="approved":"rejected"===s.status?(i="rejected",g=!0):s.level.isMandatory||n?g||(i="pending",g=!0):i="optional",e.__assign(e.__assign({},s),{extendedStatus:i,isFinalApproval:n})}),u=function(e){return e.filter(function(e){return"approved"===e.status}).length}(d),v=d.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[u," of ",v," level",1!==v?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:x.map(function(i,n){var l,r="approved"===i.extendedStatus,a="rejected"===i.extendedStatus,o="optional"===i.extendedStatus,d=0===n,p=n===v-1;return!(null===(l=i.level)||void 0===l?void 0:l.assignees)||!Array.isArray(i.level.assignees)||i.level.assignees.length<1?null:s.jsx("div",{style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:r?"#6366F1":a?"#EF4444":o?"#F1F5F9":"#E5E7EB",borderRadius:d&&p?"999px":d?"999px 0 0 999px":p?"0 999px 999px 0":"0",marginRight:p?0:3})},n)})})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:x.map(function(i,n){return s.jsx("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===i.extendedStatus?"#6366F1":"rejected"===i.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===i.extendedStatus||"rejected"===i.extendedStatus?600:400})},{children:i.level.assignees&&i.level.assignees.length>0?"".concat(i.level.headerName," - ").concat(i.level.title):""}),n)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(n.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(i,n){var t,l=n===x.length-1,a=i.isFinalApproval,o=x[n+1],d=null==o?void 0:o.isFinalApproval,g=o&&!o.level.isMandatory&&!d;return a?s.jsxs(r.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(c,{reviewLevel:i})]},n):s.jsxs(r.default.Fragment,{children:[s.jsx(p,{reviewLevel:i}),!l&&!d&&o.level.assignees&&(null===(t=o.level.assignees)||void 0===t?void 0:t.length)>0&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:g?"optional":"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},n)})}))]})),s.jsx(_,{levels:l})]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react"),l=require("../styles/ReviewStatusStyles.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},a=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],n=0,i=0;i<e.length;i++)n=e.charCodeAt(i)+((n<<5)-n);return s[Math.abs(n)%s.length]},d=function(e){var s=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof s&&s.trim()?s:"No role assigned"};function p(n){var l,t=n.reviewLevel,r=n.levelIndex,o=n.nextLevel,a=n.showApproveAndMoveToNextLevelButton,d=n.onApproveAndMoveToNextLevel,p=t.level,c=t.assigneeStatuses,u=t.extendedStatus,v=a&&"pending"===u&&!!d,_=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(i.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(i.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(i.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(i.Info,{size:14}),text:"Optional"}}[u])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},f="approved"===u?"1px solid #D1FAE5":"rejected"===u?"1px solid #FCA5A5":"optional"===u?"1px dashed #CBD5E1":"1px solid #E5E7EB",h="approved"===u?"#F0FDF4":"rejected"===u?"#FEF2F2":"#F8FAFC";return!p.assignees||!Array.isArray(p.assignees)||p.assignees.length<1?null:s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:f,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:h,borderBottom:f,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(x,{name:p.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:p.title}))]})),s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[v&&s.jsxs("button",e.__assign({type:"button",onClick:function(){return null==d?void 0:d({level:p,levelIndex:r,nextLevel:o})},style:{border:"1px solid #C7D2FE",backgroundColor:"#EEF2FF",color:"#4F46E5",borderRadius:"8px",padding:"6px 10px",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx(i.Check,{size:13}),"Approve & Move to Next Level"]})),s.jsxs("div",e.__assign({style:{backgroundColor:_.bg,color:_.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[_.icon,_.text]}))]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:c.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:c.map(function(e,n){var i;return s.jsx(g,{assigneeStatus:e,extendedStatus:u},null!==(i=e.user.id)&&void 0!==i?i:n)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function c(n){var l,t,r,p,c=n.reviewLevel,g=c.assigneeStatuses,x=c.extendedStatus,u=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(i.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(i.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(i.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(i.Info,{size:14}),text:"Optional"}}[x])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},v=null===(t=g[0])||void 0===t?void 0:t.user;null==v||v.email;var _=d(v);return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[v?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:a(null!==(r=v.id)&&void 0!==r?r:v.name).bg,color:a(null!==(p=v.id)&&void 0!==p?p:v.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:o(v.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:v.name})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",_]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function g(n){var l,t=n.assigneeStatus,r=n.extendedStatus,p=t.user,c=t.approved||"approved"===p.action,g=t.rejected||"rejected"===p.action,x=o(p.name),u=a(null!==(l=p.id)&&void 0!==l?l:p.name),v=d(p);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:p.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:v}))]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:p.email}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:c?s.jsx(i.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):g?s.jsx(i.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===r?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:"13px",color:"#4B5563"}}),s.jsx(i.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):"optional"===r?s.jsx(i.MinusCircle,{size:20,color:"#CBD5E1",strokeWidth:1.5}):s.jsx(i.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function x(n){var i=n.name,l=a(i);return s.jsx("span",e.__assign({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:i}))}var u=function(e){switch(e){case 0:return s.jsx(i.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(i.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(i.User,{size:16,color:"#475569"});default:return s.jsx(i.CheckCircle,{size:16,color:"#475569"})}};function v(n){var t=n.levels.filter(function(e){var s,n;return(null!==(n=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==n?n:0)>0});return s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),t.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:t.map(function(n,o){var a,p=n.isHidden,c=!n.isMandatory&&!p,g=p?s.jsx(i.User,{size:16,color:"#475569"}):u(o);return s.jsxs(r.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:c?"1px dashed #CBD5E1":void 0})},{children:[g,s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[n.assignees.map(function(n,i){var l,t,o=d(n);return s.jsxs(r.default.Fragment,{children:[i>0&&s.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:13,color:c?"#64748B":"#374151"}},{children:n.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:o}))]}))]},null!==(t=null!==(l=n.id)&&void 0!==l?l:n.email)&&void 0!==t?t:i)}),c&&s.jsx("span",e.__assign({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),o<t.length-1&&s.jsx(i.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(a=n.id)&&void 0!==a?a:"".concat(n.headerName,"-").concat(o))})})):s.jsx("p",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(n){var t=n.levels,o=n.reviewData,a=void 0===o?{}:o,d=n.showApproveAndMoveToNextLevelButton,g=void 0!==d&&d,x=n.onApproveAndMoveToNextLevel,u=t.map(function(e,s){var n,i,l,t=null!==(i=null!==(n=a[s])&&void 0!==n?n:a[e.headerName])&&void 0!==i?i:{},r=(null!==(l=e.assignees)&&void 0!==l?l:[]).map(function(e){return{user:e,approved:!0===t[String(e.id)]||!0===t[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===t[String(e.id)]||"rejected"===t[String(e.email)]||"rejected"===e.action}}),o="not_started";if(!0===e.isApproved)o="approved";else if(!0===e.isRejected)o="rejected";else if("approved"===e.status||"completed"===e.status)o="approved";else if("rejected"===e.status)o="rejected";else{var d=r.length>0&&r.every(function(e){return e.approved}),p=r.some(function(e){return e.rejected});d?o="approved":p&&(o="rejected")}return{level:e,assigneeStatuses:r,status:o}}),_=!1,f=u.map(function(s){var n="waiting",i=!0===s.level.isHidden;return"approved"===s.status?n="approved":"rejected"===s.status?(n="rejected",_=!0):s.level.isMandatory||i?_||(n="pending",_=!0):n="optional",e.__assign(e.__assign({},s),{extendedStatus:n,isFinalApproval:i})}),h=function(e){return e.filter(function(e){return"approved"===e.status}).length}(u),j=u.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[h," of ",j," level",1!==j?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:f.map(function(n,i){var t,r="approved"===n.extendedStatus,o="rejected"===n.extendedStatus,a="optional"===n.extendedStatus,d=0===i,p=i===j-1;return!(null===(t=n.level)||void 0===t?void 0:t.assignees)||!Array.isArray(n.level.assignees)||n.level.assignees.length<1?null:s.jsx("div",{style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:r?"#6366F1":o?"#EF4444":a?"#F1F5F9":"#E5E7EB",borderRadius:d&&p?"999px":d?"999px 0 0 999px":p?"0 999px 999px 0":"0",marginRight:p?0:3})},i)})})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:f.map(function(n,i){return s.jsx("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===n.extendedStatus?"#6366F1":"rejected"===n.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===n.extendedStatus||"rejected"===n.extendedStatus?600:400})},{children:n.level.assignees&&n.level.assignees.length>0?"".concat(n.level.headerName," - ").concat(n.level.title):""}),i)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(i.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:f.map(function(n,i){var l,t,o=i===f.length-1,a=n.isFinalApproval,d=f[i+1],u=null==d?void 0:d.isFinalApproval,v=d&&!d.level.isMandatory&&!u;return a?s.jsxs(r.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(c,{reviewLevel:n})]},i):s.jsxs(r.default.Fragment,{children:[s.jsx(p,{reviewLevel:n,levelIndex:i,nextLevel:null!==(l=null==d?void 0:d.level)&&void 0!==l?l:null,showApproveAndMoveToNextLevelButton:g,onApproveAndMoveToNextLevel:x}),!o&&!u&&d.level.assignees&&(null===(t=d.level.assignees)||void 0===t?void 0:t.length)>0&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:v?"optional":"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},i)})}))]})),s.jsx(v,{levels:t})]}))};
|
|
2
2
|
//# sourceMappingURL=ReviewStatus.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as t,Fragment as o}from"react/jsx-runtime";import{useMemo as i,useState as
|
|
1
|
+
import{__assign as e}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as t,Fragment as o}from"react/jsx-runtime";import{useMemo as i,useState as l,useEffect as r}from"react";import{Check as s,Edit2 as a,ChevronDown as d}from"lucide-react";import{getRandomColorPair as p}from"./utils/generateRandomColorsPair.js";import u from"./assets/VerticalLine.js";import c from"./components/AssignLevelsDatePicker.js";import g from"./components/LevelData.js";function f(f){var h,x,y,m,v,b,D=f.level,C=f.id,k=f.accessLevelOptions,F=f.fetchUsers,w=f.onToggleMandatory,B=f.onDueDateChange,S=f.onAssigneesChange,L=f.onTitleChange,R=f.minDueDate,j=f.maxDueDate,z=f.displayConfig,I=i(function(){return p()},[]),A="0"===C||(null!==(x=null===(h=D.assignees)||void 0===h?void 0:h.length)&&void 0!==x?x:0)>0,E=(null!==(m=null===(y=D.assignees)||void 0===y?void 0:y.length)&&void 0!==m?m:0)>0,P=!!(null==z?void 0:z.disableRequiredButtonOnUserAdd)&&E,W="0"===C||P,M=!!P||D.isMandatory,O=l(A),T=O[0],U=O[1],q=l(!1),N=q[0],_=q[1];return r(function(){var e,n;(null!==(n=null===(e=D.assignees)||void 0===e?void 0:e.length)&&void 0!==n?n:0)>0&&U(!0)},[D.assignees]),n("div",e({style:{width:"100%",border:"1.5px solid #E2E8F0",borderRadius:"5px"}},{children:[n("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#F8FAFC",padding:"0px 10px",minHeight:"48px"}},{children:[n("span",e({style:{display:"flex",alignItems:"center",gap:10,paddingLeft:"20px"}},{children:[t("span",e({style:{backgroundColor:I.backgroundColor,borderRadius:"10px",padding:"3px 12px",color:I.color,fontSize:"13px",fontWeight:500}},{children:D.headerName})),n("div",e({style:{display:"flex",alignItems:"center",gap:"6px"}},N?{children:[t("input",{type:"text",value:D.title||"",onChange:function(e){return null==L?void 0:L(e.target.value)},onBlur:function(){return _(!1)},onKeyDown:function(e){return"Enter"===e.key&&_(!1)},autoFocus:!0,style:{border:"none",borderBottom:"2px solid #3B82F6",outline:"none",fontSize:"13px",fontWeight:500,color:"#374151",background:"transparent",padding:"0 2px",width:"150px"}}),t("button",e({type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),_(!1)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:"2px"}},{children:t(s,{size:16,color:"#10B981"})}))]}:{children:[t("span",e({style:{fontSize:"13px",fontWeight:500,color:"#374151"}},{children:D.title})),t("button",e({type:"button",onClick:function(e){e.stopPropagation(),_(!0)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:"2px"},title:"Edit Title"},{children:t(a,{size:14,color:"#6B7280"})}))]}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:16,marginLeft:"auto"}},{children:[n(o,{children:[n("span",e({style:{color:"#6B7280"}},{children:["Due Date: ",M&&t("sup",e({style:{color:"red"}},{children:"*"}))]})),t(c,{value:null!==(v=D.dueDate)&&void 0!==v?v:null,onSet:B,id:C,minDate:null!=R?R:null,maxDate:null!=j?j:null,disabled:null==z?void 0:z.disableDueDates}),t(u,{})]}),t("div",e({style:{display:"flex",alignItems:"center"}},{children:n("button",e({type:"button",onClick:W?void 0:w,disabled:W,style:{position:"relative",width:"88px",height:"26px",border:"none",borderRadius:"999px",backgroundColor:M?"#5B4FE9":"#D1D5DB",cursor:W?"not-allowed":"pointer",opacity:W?"50%":"100%",display:"flex",alignItems:"center",padding:"0 10px",transition:"all 0.2s ease",flexShrink:0}},{children:[t("span",{style:{position:"absolute",top:"3px",left:M?"65px":"3px",width:"20px",height:"20px",borderRadius:"50%",background:"#FFF",transition:"all 0.2s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.15)"}}),t("span",e({style:{color:"#FFF",fontSize:"10px",fontWeight:500,userSelect:"none",paddingLeft:M?"0":"18px",paddingRight:M?"18px":"0"}},{children:"Required"}))]}))})),t(d,{size:20,onClick:function(e){e.stopPropagation(),U(function(e){return!e})},style:{cursor:"pointer",flexShrink:0,transition:"transform 0.2s ease",transform:T?"rotate(180deg)":"rotate(0deg)"}})]}))]})),T&&t("div",e({style:{width:"100%",height:"auto"}},{children:t(g,{assignees:null!==(b=D.assignees)&&void 0!==b?b:[],onAssigneeChange:S,accessLevelOptions:k,levelDetails:{head:D.headerName,title:D.title},fetchUsers:F,displayConfig:z})}))]}))}export{f as default};
|
|
2
2
|
//# sourceMappingURL=AssignLevelAccordions.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../_virtual/_tslib.js";import{jsx as n,jsxs as i}from"react/jsx-runtime";import l from"react";import{PenLine as
|
|
1
|
+
import{__assign as e}from"../../_virtual/_tslib.js";import{jsx as n,jsxs as i}from"react/jsx-runtime";import l from"react";import{PenLine as t,UserRoundCheck as r,Bell as o,InfoIcon as a,User as s,ArrowRight as d,CheckSquare as u,FileCheck as c,Edit2 as p}from"lucide-react";import v from"./AssignLevelAccordions.js";import f from"./components/CustomCheckbox.js";import g from"./assets/FileCheckCorner.js";import{DEFAULT_ASSIGN_REMINDER_STYLES as h}from"./styles/AssignReminderStyles.js";var m=[{label:"Edit",icon:n(t,{size:14})},{label:"Approve",icon:n(r,{size:14})},{label:"Edit & Approve",icon:n(g,{})},{label:"Notify",icon:n(o,{size:14})}],y=function(e){var n=new Date(e);return n.setHours(0,0,0,0),n},x=function(e,n){var i,l=n>0?null===(i=e[n-1])||void 0===i?void 0:i.dueDate:null;return y(l||new Date)},A=function(e,n,i){var l,t=null===(l=e[n+1])||void 0===l?void 0:l.dueDate;return t?y(t):i?y(i):null};function b(t){var r=t.title,o=t.levels,g=void 0===o?[]:o,b=t.requireFinalApproval,D=void 0!==b&&b,L=t.additionalInfo,F=t.setLevels,w=t.setRequireFinalApproval,C=t.fetchUsers,z=t.accessLevelOptions,I=void 0===z?m:z,M=t.customInfoIcon,W=t.onValidationError,E=t.customStyles,S=void 0===E?{}:E,H=t.totalLevels,j=t.finalApprovalDueDate,q=t.displayConfig,R=l.useState(!1),T=R[0],B=R[1],k=!!(null==q?void 0:q.disableRequiredButtonOnUserAdd);l.useEffect(function(){k&&(null==F||F(function(n){var i=!1,l=n.map(function(n){var l,t,r=(null!==(t=null===(l=n.assignees)||void 0===l?void 0:l.length)&&void 0!==t?t:0)>0;return n.isHidden||n.isMandatory||!r?n:(i=!0,e(e({},n),{isMandatory:!0}))});return i?l:n}))},[g,F,k]);var O,N=l.useMemo(function(){return Array.from({length:null!=H?H:3},function(e,n){var i;return null!==(i=g[n])&&void 0!==i?i:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[g,H]),U=(g.length>0?g:N).filter(function(e){return!e.isHidden});return i("div",e({style:e({padding:"8px",display:"flex",flexDirection:"column",gap:"18px"},S.container)},{children:[i("span",e({style:e(e({},h.header),S.levelsHeader)},{children:[n("span",{children:null!=r?r:"Assignee Levels"}),i("div",e({style:e(e({},h.infoIconWrapper),S.infoIconWrapper),onMouseEnter:function(){return B(!0)},onMouseLeave:function(){return B(!1)}},{children:[null!=M?M:n(a,{width:18,height:18}),n("div",e({style:e(e(e({},h.tooltip),S.tooltip),T?e(e({},h.tooltipVisible),S.tooltipVisible):{})},{children:L||i("span",{children:[n("b",{children:"How it works:"}),n("br",{}),"Level 1 is required by default, Enable Level 2 and Level 3 to add sequential approval steps for the review"]})}))]}))]})),n("div",e({style:e({display:"flex",flexDirection:"column",gap:"16px"},S.accordionsContainer)},{children:U.map(function(i,l){var t,r;return n(v,{level:k&&(null!==(r=null===(t=i.assignees)||void 0===t?void 0:t.length)&&void 0!==r?r:0)>0?e(e({},i),{isMandatory:!0}):i,id:String(l),accessLevelOptions:I,fetchUsers:C,onToggleMandatory:function(){return function(n){var i,l,t,r=(null!==(t=null===(l=null===(i=g[n])||void 0===i?void 0:i.assignees)||void 0===l?void 0:l.length)&&void 0!==t?t:0)>0;k&&r||null==F||F(function(i){return i.map(function(i,l){return l===n?e(e({},i),{isMandatory:!i.isMandatory}):i})})}(l)},onDueDateChange:function(n){return function(n,i){var l;if(i){var t=y(i),r=x(g,n),o=A(g,n,j);if(t<r)return void(null==W||W(0===n?"Level 1 due date cannot be before today":"Level ".concat(n+1," due date cannot be before Level ").concat(n," due date")));if(o&&t>o)return void(null==W||W((null===(l=g[n+1])||void 0===l?void 0:l.dueDate)?"Level ".concat(n+1," due date cannot be after Level ").concat(n+2," due date"):"Level due date cannot be after final approval due date"))}null==F||F(function(l){return l.map(function(l,t){return t===n?e(e({},l),{dueDate:i?y(i):null}):l})})}(l,n)},onAssigneesChange:function(n){return i=l,r=(null!=(t=n)?t:[]).map(function(n){var i=n.accessLevel||n.role||"";return e(e({},n),{role:i,accessLevel:i})}),void(null==F||F(function(n){return n.map(function(n,l){return l===i?e(e({},n),{assignees:r}):n})}));var i,t,r},onTitleChange:function(n){return function(n,i){null==F||F(function(l){return l.map(function(l,t){return t===n?e(e({},l),{title:i}):l})})}(l,n)},minDueDate:x(U,l),maxDueDate:A(U,l,j),finalApprovalDueDate:j,displayConfig:q},l)})})),i("div",e({style:e(e({},h.finalApprovalBox),S.finalApprovalBox)},{children:[n(f,{getter:D,setter:null!=w?w:function(){}}),i("div",e({style:e({display:"flex",flexDirection:"column",alignItems:"baseline",fontSize:"14px",fontWeight:400},S.finalApprovalTextWrapper)},{children:[n("span",e({style:e({fontWeight:500},S.finalApprovalTitle)},{children:"Require Final Approval"})),n("span",e({style:S.finalApprovalDesc},{children:"After all assignees approve, you (the owner) will be notified to give final sign-off before the redline is settled."}))]}))]})),i("div",e({style:e(e({},h.currentApprovalFlow),S.currentApprovalFlow)},{children:[n("span",e({style:e({fontSize:"14px",fontWeight:600},S.currentApprovalFlowTitle)},{children:"Current Approval Flow"})),(O=g.filter(function(e){var n,i;return(null!==(i=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0}),n("div",e({style:e({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},S.approvalFlowItemsWrapper)},{children:O.map(function(t,r){var o,a,v=t.isHidden,f=!t.isMandatory&&!v,g=null!==(o=t.assignees)&&void 0!==o?o:[],h=v?n(s,{size:16}):function(e){switch(e){case 0:return n(p,{size:16});case 1:return n(c,{size:16});case 2:return n(s,{size:16});default:return n(u,{size:16})}}(r);return i(l.Fragment,{children:[i("div",e({style:e({display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",fontWeight:500,color:f?"#64748B":"#374151",border:f?"1px dashed #CBD5E1":void 0,borderRadius:f?"6px":void 0,padding:f?"2px 6px":void 0},S.approvalFlowItem),title:t.title||"Level ".concat(r+1)},{children:[h,i("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[g.map(function(t,r){var o,a,s=t.role||t.accessLevel||"No role assigned";return i(l.Fragment,{children:[r>0&&n("span",e({style:{color:"#9CA3AF"}},{children:"/"})),i("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n("span",{children:t.name}),n("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:s}))]}))]},null!==(a=null!==(o=t.id)&&void 0!==o?o:t.email)&&void 0!==a?a:r)}),f&&n("span",{children:"(Optional)"})]}))]})),r<O.length-1&&n(d,{size:16,color:"#9CA3AF"})]},null!==(a=t.id)&&void 0!==a?a:r)})})))]}))]}))}export{b as AssignReminderLevels};
|
|
2
2
|
//# sourceMappingURL=AssignReminderLevels.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_tslib.js";import"react/jsx-runtime";import"react";import"./AssignReminderLevels.js";var e=[{headerName:"L1",title:"Initial Review",isMandatory:!0,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L2",title:"Manager Approval",isMandatory:!1,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L3",title:"Final Sign-off",isMandatory:!1,hasDueDate:!1,dueDate:null,assignees:[]}];export{e as INITIAL_LEVELS};
|
|
2
|
+
//# sourceMappingURL=AssignReminderTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignReminderTest.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as i}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as r,Fragment as t}from"react/jsx-runtime";import{Bell as a,ClipboardList as o,X as l,CircleAlert as s}from"lucide-react";import d,{useState as u,useEffect as c}from"react";import{AssignReminderLevels as v}from"./AssignReminderLevels.js";import m from"./components/ReviewStatus.js";import p from"./components/CustomDatePicker.js";import{ManageReminders as f}from"./ManageReminders.js";import{DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES as y}from"./styles/AssignReminderWrapperStyles.js";var h=[{headerName:"L1",title:"First Level",isMandatory:!0,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L2",title:"Second Level",isMandatory:!1,hasDueDate:!0,dueDate:null,assignees:[]}],b=[{tabName:"Assignees & Approvers",tabIcon:n("svg",e({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[r("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),r("circle",{cx:"9",cy:"7",r:"4"}),r("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),r("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:r(a,{size:15})},{tabName:"Review Status",tabIcon:r(o,{size:15})}],D=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];function g(e){var i=e.toLowerCase();return i.includes("reminder")?"reminders":i.includes("review")?"review":"assignees"}function w(a){var o,w,_=a.metadata,A=void 0===_?{}:_,L=a.reviewData,R=void 0===L?{}:L,S=a.levels,T=a.setLevels,C=a.requireFinalApproval,q=a.setRequireFinalApproval,B=a.approvalDueDate,F=a.setApprovalDueDate,N=a.onClose,x=a.fetchUsers,M=a.onSave,O=a.onValidationError,k=a.totalLevels,H=a.customStyles,I=void 0===H?{}:H,j=a.isSaving,P=void 0!==j&&j,E=a.displayConfig,W=void 0===E?{}:E,z=a.onRequireFinalApproval,U=a.isOwner,V=void 0===U||U,Y=a.blockEditScreen,G=void 0!==Y&&Y,J=a.hideManageReminders,K=void 0!==J&&J,Q=a.hideClearButton,X=void 0!==Q&&Q,Z=a.hideSaveChangesButton,$=void 0!==Z&&Z,ee=a.hideFooterActions,ie=void 0!==ee&ⅇa.hideAssigneeApproverScreen,a.remindersData;var ne=a.remainderOwners,re=a.setRemainderOwners,te=a.schedules,ae=a.setSchedules,oe=a.handelSendNow,le=a.showPreviewEmail,se=a.tabName,de=a.reminderLabels,ue=a.reminderColors,ce=a.reminderChipColor,ve=a.reminderAssignees,me=a.reminderFallbackRecipients,pe=a.reminderRecipientsColor,fe=a.manualReminderTitle,ye=a.manualReminderDescription,he=a.lastReminderText,be=a.selectRecipientsLabel,De=a.previewEmailButtonLabel,ge=a.sendNowButtonLabel,we=a.reminderSuccessTitle,_e=a.reminderSuccessDescription,Ae=a.escalationTitle,Le=a.escalationTitleTooltip,Re=a.escalationDescription,Se=a.configureAutoReminderText,Te=a.getDynamicStatement,Ce=a.reminderStartDateLabel,qe=a.documentDueDateLabel,Be=a.reminderFrequencyLabel,Fe=a.escalationRemindersLabel,Ne=a.escalationTooltip,xe=a.escalationConditionText,Me=a.daysText,Oe=a.dueDataAndRepeatText,ke=a.reminderFrequencyOptions,He=a.escalationFrequencyOptions,Ie=a.beforeAfterOptions,je=d.useMemo(function(){var e;return(null===(e=A.tabData)||void 0===e?void 0:e.length)?A.tabData:b},[A.tabData]),Pe=d.useMemo(function(){return je.filter(function(e){var i=g(e.tabName);return!((!V||G)&&"assignees"===i)&&(!K||"reminders"!==i)})},[je,V,G,K]),Ee=u(null!==(w=null===(o=Pe[0])||void 0===o?void 0:o.tabName)&&void 0!==w?w:""),We=Ee[0],ze=Ee[1],Ue=g(We),Ve=u(S||h),Ye=Ve[0],Ge=Ve[1],Je=u(C||!1),Ke=Je[0],Qe=Je[1],Xe=u(B||null),Ze=Xe[0],$e=Xe[1],ei=u(null),ii=ei[0],ni=ei[1],ri=u([]),ti=ri[0],ai=ri[1],oi=u(ne||D),li=oi[0],si=oi[1],di=void 0!==te?te:ti,ui=void 0!==ae?ae:ai,ci=void 0!==ne?ne:li,vi=function(i){return i.map(function(i,n){return 0!==n||i.isHidden?i:e(e({},i),{isMandatory:!0,hasDueDate:!0})})},mi=function(i){return i.map(function(i){var n;return e(e({},i),{assignees:(null!==(n=i.assignees)&&void 0!==n?n:[]).map(function(i){var n=i.role||i.accessLevel||"";return e(e({},i),{role:n,accessLevel:i.accessLevel||n})})})})},pi=d.useMemo(function(){return{due_at:Ze?Ze.toISOString():"",assignee:Ye.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(i,n,r){var t;return e(e({},i),((t={})[r]=n,t))},{})}},[Ze,Ye]);c(function(){void 0!==ne&&si(ne)},[ne]),c(function(){z&&z().then(function(e){Array.isArray(e)&&e.length>0?ni(e[0]):e&&!Array.isArray(e)&&ni(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),c(function(){se&&Pe.some(function(e){return e.tabName===se})&&ze(se)},[se,Pe]),c(function(){var e,i;Pe.some(function(e){return e.tabName===We})||ze(null!==(i=null===(e=Pe[0])||void 0===e?void 0:e.tabName)&&void 0!==i?i:"")},[Pe,We]),c(function(){S&&Ge(function(e){var n=e.find(function(e){return e.isHidden}),r=n?i(i([],S,!0),[n],!1):S;return mi(vi(r))})},[S]),c(function(){void 0!==C&&Qe(C)},[C]),c(function(){void 0!==B&&$e(B)},[B]),c(function(){Ge(function(e){var n=e.filter(function(e){return!e.isHidden});if(Ke){var r={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==ii?void 0:ii.id)||"me",email:(null==ii?void 0:ii.email)||"",name:(null==ii?void 0:ii.name)?"".concat(ii.name," (You)"):"Username (You)",accessLevel:"Approve",role:"Final Approver"}]};return mi(i(i([],n,!0),[r],!1))}return mi(n)})},[Ke,ii]),c(function(){var e=Ye.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});si(function(i){var n=i.length===e.length&&e.every(function(e,n){var r;return(null===(r=i[n])||void 0===r?void 0:r.email)===e.email});return n?i:e.map(function(e,n){var r=i.find(function(i){return i.email===e.email});return r||{id:n+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[Ye]);var fi=Ye.filter(function(e){return!e.isHidden}),yi=fi.find(function(e,i){if(!(0===i||e.isMandatory))return!1;var n=!!e.dueDate,r=(e.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)});return!n||!r}),hi=!1!==A.showFinalApprovalDueDate,bi=P||(!!yi||hi&&!Ze),Di=A.wrapperTitle||"Assign Redline and Manage Reminders",gi=A.wrapperSubTitle||"Sec 4.1 - Technical Security Information",wi=A.wrapperPriority||"High",_i=A.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return r("div",e({style:e(e({},y.overlay),I.overlay)},{children:n("div",e({style:e(e(e(e({},y.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===Ue?{width:"1400px",maxWidth:"95vw"}:{}),I.modal)},{children:[n("div",e({style:e(e({},y.header),I.header)},{children:[n("div",e({style:e(e({},y.headerLeft),I.headerLeft)},{children:[r("span",e({style:e(e({},y.modalTitle),I.modalTitle)},{children:Di})),n("div",e({style:e(e({},y.redlineRow),I.redlineRow)},{children:[r("span",e({style:e(e({},y.redlineName),I.redlineName)},{children:gi})),r("span",e({style:e(e(e({},y.redlineBadge),_i),I.redlineBadge)},{children:wi}))]}))]})),r("button",e({style:e(e({},y.closeBtn),I.closeBtn),onClick:N},{children:r(l,{size:20,color:"#6B7280"})}))]})),r("div",e({style:e(e({},y.tabBar),I.tabBar)},{children:Pe.map(function(i){var r=We===i.tabName;return n("button",e({style:e(e(e({},y.tab),I.tab),r?e(e({},y.tabActive),I.tabActive):{}),onClick:function(){return ze(i.tabName)}},{children:[i.tabIcon," ",i.tabName]}),i.tabName)})})),n("div",e({style:e(e({},y.body),I.body)},{children:["assignees"===Ue&&n(t,{children:[!1!==A.showFinalApprovalDueDate&&n("div",e({style:e(e({},y.dueDateBar),I.dueDateBar)},{children:[n("span",e({style:e(e({},y.dueDateLabel),I.dueDateLabel)},{children:["Final Approval due date"," ",r("sup",e({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),r("div",e({style:e(e({},y.dueDateInputWrap),I.dueDateInputWrap)},{children:r(p,{value:Ze?Ze.toISOString().slice(0,10):"",onChange:$e,disabled:W.disableDueDates})})),n("span",e({style:e(e({},y.requiredToProceeed),I.requiredToProceeed)},{children:[r(s,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),r(v,{levels:Ye,totalLevels:k,requireFinalApproval:Ke,setLevels:Ge,setRequireFinalApproval:function(e){Qe(e)},fetchUsers:x,onValidationError:O,customStyles:I,finalApprovalDueDate:Ze,displayConfig:W})]}),"reminders"===Ue&&r(f,e({data:pi,schedules:di,setSchedules:ui,remainderOwners:ci,setRemainderOwners:function(e){var i="function"==typeof e?e(ci):e;re?re(i):si(i)},handelSendNow:function(e,i){oe&&oe(e||di,i||ci)},showPreviewEmail:null!=le&&le},void 0!==de&&{labels:de},void 0!==ue&&{colors:ue},void 0!==ce&&{chipColor:ce},void 0!==ve&&{assignees:ve},void 0!==me&&{fallbackRecipients:me},void 0!==pe&&{recipientsColor:pe},void 0!==fe&&{manualReminderTitle:fe},void 0!==ye&&{manualReminderDescription:ye},void 0!==he&&{lastReminderText:he},void 0!==be&&{selectRecipientsLabel:be},void 0!==De&&{previewEmailButtonLabel:De},void 0!==ge&&{sendNowButtonLabel:ge},void 0!==we&&{reminderSuccessTitle:we},void 0!==_e&&{reminderSuccessDescription:_e},void 0!==Ae&&{escalationTitle:Ae},void 0!==Le&&{escalationTitleTooltip:Le},void 0!==Re&&{escalationDescription:Re},void 0!==Se&&{configureAutoReminderText:Se},void 0!==Te&&{getDynamicStatement:Te},void 0!==Ce&&{reminderStartDateLabel:Ce},void 0!==qe&&{documentDueDateLabel:qe},void 0!==Be&&{reminderFrequencyLabel:Be},void 0!==Fe&&{escalationRemindersLabel:Fe},void 0!==Ne&&{escalationTooltip:Ne},void 0!==xe&&{escalationConditionText:xe},void 0!==Me&&{daysText:Me},void 0!==Oe&&{dueDataAndRepeatText:Oe},void 0!==ke&&{reminderFrequencyOptions:ke},void 0!==He&&{escalationFrequencyOptions:He},void 0!==Ie&&{beforeAfterOptions:Ie})),"review"===Ue&&r(m,{levels:Ye,reviewData:R})]})),!ie&&(!X||!$)&&n("div",e({style:e(e({},y.footer),I.footer)},{children:[!X&&r("button",e({style:e(e(e({},y.clearBtn),I.clearBtn),P?I.actionBtnDisabled:{}),onClick:function(){Ge(vi(h.map(function(i){return e(e({},i),{assignees:[],dueDate:null})}))),Qe(!1),$e(null)},disabled:P},{children:"Clear"})),!$&&r("button",e({style:e(e(e({},y.saveBtn),I.saveBtn),bi?e({opacity:.55,cursor:"not-allowed"},I.actionBtnDisabled):{}),onClick:function(){if(bi)P||null==O||O(function(){if(hi&&!Ze)return"Final approval due date is required";if(!yi)return"Please fill all required fields before saving";var e=fi.indexOf(yi)+1,i=[yi.dueDate?null:"due date",(yi.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)})?null:"assignee"].filter(Boolean);return"Level ".concat(e," ").concat(i.join(" and ")," ").concat(i.length>1?"are":"is"," required")}());else{var e=mi(Ye.filter(function(e){return!e.isHidden}));null==T||T(e),null==q||q(Ke),null==F||F(Ze),null==M||M({levels:e,requireFinalApproval:Ke,finalApprovalDueDate:Ze,activeTab:Ue,schedules:di,remainderOwners:ci})}},disabled:bi},{children:"Save Changes"}))]}))]}))}))}export{w as AssignReminderWrapper,h as INITIAL_LEVELS};
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"../../_virtual/_tslib.js";import{jsxs as i,jsx as r,Fragment as t}from"react/jsx-runtime";import{Bell as a,ClipboardList as o,X as l,CircleAlert as s}from"lucide-react";import d,{useState as u,useEffect as c}from"react";import{AssignReminderLevels as v}from"./AssignReminderLevels.js";import m from"./components/ReviewStatus.js";import p from"./components/CustomDatePicker.js";import{ManageReminders as f}from"./ManageReminders.js";import{DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES as y}from"./styles/AssignReminderWrapperStyles.js";var h=[{headerName:"L1",title:"First Level",isMandatory:!0,hasDueDate:!0,dueDate:null,assignees:[]},{headerName:"L2",title:"Second Level",isMandatory:!1,hasDueDate:!0,dueDate:null,assignees:[]}],b=[{tabName:"Assignees & Approvers",tabIcon:i("svg",e({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[r("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),r("circle",{cx:"9",cy:"7",r:"4"}),r("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),r("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:r(a,{size:15})},{tabName:"Review Status",tabIcon:r(o,{size:15})}],D=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];function g(e){var n=e.toLowerCase();return n.includes("reminder")?"reminders":n.includes("review")?"review":"assignees"}function A(a){var o,A,w=a.metadata,_=void 0===w?{}:w,L=a.reviewData,R=void 0===L?{}:L,T=a.levels,S=a.setLevels,C=a.requireFinalApproval,q=a.setRequireFinalApproval,B=a.approvalDueDate,N=a.setApprovalDueDate,F=a.onClose,x=a.fetchUsers,M=a.onSave,O=a.onValidationError,k=a.showApproveAndMoveToNextLevelButton,H=a.onApproveAndMoveToNextLevel,I=a.totalLevels,j=a.customStyles,P=void 0===j?{}:j,E=a.isSaving,W=void 0!==E&&E,z=a.displayConfig,U=void 0===z?{}:z,V=a.onRequireFinalApproval,Y=a.isOwner,G=void 0===Y||Y,J=a.blockEditScreen,K=void 0!==J&&J,Q=a.hideManageReminders,X=void 0!==Q&&Q,Z=a.hideClearButton,$=void 0!==Z&&Z,ee=a.hideSaveChangesButton,ne=void 0!==ee&&ee,ie=a.hideFooterActions,re=void 0!==ie&&ie;a.hideAssigneeApproverScreen,a.remindersData;var te=a.remainderOwners,ae=a.setRemainderOwners,oe=a.schedules,le=a.setSchedules,se=a.handelSendNow,de=a.showPreviewEmail,ue=a.tabName,ce=a.reminderLabels,ve=a.reminderColors,me=a.reminderChipColor,pe=a.reminderAssignees,fe=a.reminderFallbackRecipients,ye=a.reminderRecipientsColor,he=a.manualReminderTitle,be=a.manualReminderDescription,De=a.lastReminderText,ge=a.selectRecipientsLabel,Ae=a.previewEmailButtonLabel,we=a.sendNowButtonLabel,_e=a.reminderSuccessTitle,Le=a.reminderSuccessDescription,Re=a.escalationTitle,Te=a.escalationTitleTooltip,Se=a.escalationDescription,Ce=a.configureAutoReminderText,qe=a.getDynamicStatement,Be=a.reminderStartDateLabel,Ne=a.documentDueDateLabel,Fe=a.reminderFrequencyLabel,xe=a.escalationRemindersLabel,Me=a.escalationTooltip,Oe=a.escalationConditionText,ke=a.daysText,He=a.dueDataAndRepeatText,Ie=a.reminderFrequencyOptions,je=a.escalationFrequencyOptions,Pe=a.beforeAfterOptions,Ee=d.useMemo(function(){var e;return(null===(e=_.tabData)||void 0===e?void 0:e.length)?_.tabData:b},[_.tabData]),We=d.useMemo(function(){return Ee.filter(function(e){var n=g(e.tabName);return!((!G||K)&&"assignees"===n)&&(!X||"reminders"!==n)})},[Ee,G,K,X]),ze=u(null!==(A=null===(o=We[0])||void 0===o?void 0:o.tabName)&&void 0!==A?A:""),Ue=ze[0],Ve=ze[1],Ye=g(Ue),Ge=u(T||h),Je=Ge[0],Ke=Ge[1],Qe=u(C||!1),Xe=Qe[0],Ze=Qe[1],$e=u(B||null),en=$e[0],nn=$e[1],rn=u(null),tn=rn[0],an=rn[1],on=u([]),ln=on[0],sn=on[1],dn=u(te||D),un=dn[0],cn=dn[1],vn=void 0!==oe?oe:ln,mn=void 0!==le?le:sn,pn=void 0!==te?te:un,fn=function(n){return n.map(function(n,i){return 0!==i||n.isHidden?n:e(e({},n),{isMandatory:!0,hasDueDate:!0})})},yn=function(e){var n=new Date(e);return n.setHours(0,0,0,0),n},hn=function(){return yn(new Date)},bn=function(n){return n.map(function(n){var i;return e(e({},n),{assignees:(null!==(i=n.assignees)&&void 0!==i?i:[]).map(function(n){var i=n.accessLevel||n.role||"";return e(e({},n),{role:i,accessLevel:i})})})})},Dn=d.useMemo(function(){return{due_at:en?en.toISOString():"",assignee:Je.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(n,i,r){var t;return e(e({},n),((t={})[r]=i,t))},{})}},[en,Je]);c(function(){void 0!==te&&cn(te)},[te]),c(function(){V&&V().then(function(e){Array.isArray(e)&&e.length>0?an(e[0]):e&&!Array.isArray(e)&&an(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),c(function(){ue&&We.some(function(e){return e.tabName===ue})&&Ve(ue)},[ue,We]),c(function(){var e,n;We.some(function(e){return e.tabName===Ue})||Ve(null!==(n=null===(e=We[0])||void 0===e?void 0:e.tabName)&&void 0!==n?n:"")},[We,Ue]),c(function(){T&&Ke(function(e){var i=e.find(function(e){return e.isHidden}),r=i?n(n([],T,!0),[i],!1):T;return bn(fn(r))})},[T]),c(function(){void 0!==C&&Ze(C)},[C]),c(function(){void 0!==B&&nn(B)},[B]),c(function(){Ke(function(e){var i=e.filter(function(e){return!e.isHidden});if(Xe){var r={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==tn?void 0:tn.id)||"me",email:(null==tn?void 0:tn.email)||"",name:(null==tn?void 0:tn.name)?"".concat(tn.name," (You)"):"Username (You)",accessLevel:"Approve",role:"Final Approver"}]};return bn(n(n([],i,!0),[r],!1))}return bn(i)})},[Xe,tn]),c(function(){var e=Je.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});cn(function(n){var i=n.length===e.length&&e.every(function(e,i){var r;return(null===(r=n[i])||void 0===r?void 0:r.email)===e.email});return i?n:e.map(function(e,i){var r=n.find(function(n){return n.email===e.email});return r||{id:i+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[Je]);var gn=Je.filter(function(e){return!e.isHidden}),An=gn.reduce(function(e,n){if(!n.dueDate)return e;var i=yn(n.dueDate);return!e||i>e?i:e},null),wn=An&&An>hn()?An:hn(),_n=gn.find(function(e,n){if(!(0===n||e.isMandatory))return!1;var i=!!e.dueDate,r=(e.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)});return!i||!r}),Ln=!1!==_.showFinalApprovalDueDate,Rn=W||(!!_n||Ln&&!en),Tn=_.wrapperTitle||"Assign Redline and Manage Reminders",Sn=_.wrapperSubTitle||"Sec 4.1 - Technical Security Information",Cn=_.wrapperPriority||"High",qn=_.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return r("div",e({style:e(e({},y.overlay),P.overlay)},{children:i("div",e({style:e(e(e(e({},y.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===Ye?{width:"1400px",maxWidth:"95vw"}:{}),P.modal)},{children:[i("div",e({style:e(e({},y.header),P.header)},{children:[i("div",e({style:e(e({},y.headerLeft),P.headerLeft)},{children:[r("span",e({style:e(e({},y.modalTitle),P.modalTitle)},{children:Tn})),i("div",e({style:e(e({},y.redlineRow),P.redlineRow)},{children:[r("span",e({style:e(e({},y.redlineName),P.redlineName)},{children:Sn})),r("span",e({style:e(e(e({},y.redlineBadge),qn),P.redlineBadge)},{children:Cn}))]}))]})),r("button",e({style:e(e({},y.closeBtn),P.closeBtn),onClick:F},{children:r(l,{size:20,color:"#6B7280"})}))]})),r("div",e({style:e(e({},y.tabBar),P.tabBar)},{children:We.map(function(n){var r=Ue===n.tabName;return i("button",e({style:e(e(e({},y.tab),P.tab),r?e(e({},y.tabActive),P.tabActive):{}),onClick:function(){return Ve(n.tabName)}},{children:[n.tabIcon," ",n.tabName]}),n.tabName)})})),i("div",e({style:e(e({},y.body),P.body)},{children:["assignees"===Ye&&i(t,{children:[!1!==_.showFinalApprovalDueDate&&i("div",e({style:e(e({},y.dueDateBar),P.dueDateBar)},{children:[i("span",e({style:e(e({},y.dueDateLabel),P.dueDateLabel)},{children:["Final Approval due date"," ",r("sup",e({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),r("div",e({style:e(e({},y.dueDateInputWrap),P.dueDateInputWrap)},{children:r(p,{value:en?en.toISOString().slice(0,10):"",onChange:function(e){var n="function"==typeof e?e(en):e;n&&yn(n)<wn?null==O||O("Final approval due date cannot be before the latest level due date"):nn(n?yn(n):null)},minDate:wn,disabled:U.disableDueDates})})),i("span",e({style:e(e({},y.requiredToProceeed),P.requiredToProceeed)},{children:[r(s,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),r(v,{levels:Je,totalLevels:I,requireFinalApproval:Xe,setLevels:Ke,setRequireFinalApproval:function(e){Ze(e)},fetchUsers:x,onValidationError:O,customStyles:P,finalApprovalDueDate:en,displayConfig:U})]}),"reminders"===Ye&&r(f,e({data:Dn,schedules:vn,setSchedules:mn,remainderOwners:pn,setRemainderOwners:function(e){var n="function"==typeof e?e(pn):e;ae?ae(n):cn(n)},handelSendNow:function(e,n){se&&se(e||vn,n||pn)},showPreviewEmail:null!=de&&de},void 0!==ce&&{labels:ce},void 0!==ve&&{colors:ve},void 0!==me&&{chipColor:me},void 0!==pe&&{assignees:pe},void 0!==fe&&{fallbackRecipients:fe},void 0!==ye&&{recipientsColor:ye},void 0!==he&&{manualReminderTitle:he},void 0!==be&&{manualReminderDescription:be},void 0!==De&&{lastReminderText:De},void 0!==ge&&{selectRecipientsLabel:ge},void 0!==Ae&&{previewEmailButtonLabel:Ae},void 0!==we&&{sendNowButtonLabel:we},void 0!==_e&&{reminderSuccessTitle:_e},void 0!==Le&&{reminderSuccessDescription:Le},void 0!==Re&&{escalationTitle:Re},void 0!==Te&&{escalationTitleTooltip:Te},void 0!==Se&&{escalationDescription:Se},void 0!==Ce&&{configureAutoReminderText:Ce},void 0!==qe&&{getDynamicStatement:qe},void 0!==Be&&{reminderStartDateLabel:Be},void 0!==Ne&&{documentDueDateLabel:Ne},void 0!==Fe&&{reminderFrequencyLabel:Fe},void 0!==xe&&{escalationRemindersLabel:xe},void 0!==Me&&{escalationTooltip:Me},void 0!==Oe&&{escalationConditionText:Oe},void 0!==ke&&{daysText:ke},void 0!==He&&{dueDataAndRepeatText:He},void 0!==Ie&&{reminderFrequencyOptions:Ie},void 0!==je&&{escalationFrequencyOptions:je},void 0!==Pe&&{beforeAfterOptions:Pe})),"review"===Ye&&r(m,{levels:Je,reviewData:R,showApproveAndMoveToNextLevelButton:k,onApproveAndMoveToNextLevel:H})]})),!re&&(!$||!ne)&&i("div",e({style:e(e({},y.footer),P.footer)},{children:[!$&&r("button",e({style:e(e(e({},y.clearBtn),P.clearBtn),W?P.actionBtnDisabled:{}),onClick:function(){Ke(fn(h.map(function(n){return e(e({},n),{assignees:[],dueDate:null})}))),Ze(!1),nn(null)},disabled:W},{children:"Clear"})),!ne&&r("button",e({style:e(e(e({},y.saveBtn),P.saveBtn),Rn?e({opacity:.55,cursor:"not-allowed"},P.actionBtnDisabled):{}),onClick:function(){if(Rn)W||null==O||O(function(){if(Ln&&!en)return"Final approval due date is required";if(!_n)return"Please fill all required fields before saving";var e=gn.indexOf(_n)+1,n=[_n.dueDate?null:"due date",(_n.assignees||[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)})?null:"assignee"].filter(Boolean);return"Level ".concat(e," ").concat(n.join(" and ")," ").concat(n.length>1?"are":"is"," required")}());else{var e=bn(Je.filter(function(e){return!e.isHidden}));null==S||S(e),null==q||q(Xe),null==N||N(en),null==M||M({levels:e,requireFinalApproval:Xe,finalApprovalDueDate:en,activeTab:Ye,schedules:vn,remainderOwners:pn})}},disabled:Rn},{children:"Save Changes"}))]}))]}))}))}export{A as AssignReminderWrapper,h as INITIAL_LEVELS};
|
|
2
2
|
//# sourceMappingURL=AssignReminderWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as t}from"../../../_virtual/_tslib.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{__assign as t}from"../../../_virtual/_tslib.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useRef as a}from"react";import{DATE_PICKER_STYLES as n}from"../styles/AssignLevelsDatePickerStyles.js";var l=function(t){if(t){var e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return"".concat(e,"-").concat(r,"-").concat(a)}};function i(i){var o,c=i.value,u=i.onSet,s=i.minDate,d=i.maxDate,p=i.disabled,v=void 0!==p&&p,m=a(null),f=l(null!=s?s:new Date),g=l(d);return e("div",t({style:t(t({},n.wrapper),{cursor:v?"not-allowed":n.wrapper.cursor,opacity:v?.65:1}),onClick:function(){var t,e;v||null===(e=null===(t=m.current)||void 0===t?void 0:t.showPicker)||void 0===e||e.call(t)}},{children:[r("span",t({style:n.placeholder},{children:c?c.toLocaleDateString("en-GB"):"--/--/----"})),r("input",{ref:m,type:"date",max:g,min:f,style:n.input,value:null!==(o=l(c))&&void 0!==o?o:"",disabled:v,onChange:function(t){if(!v){var e=t.target.value;u(e?new Date(e):null)}}})]}))}export{i as default};
|
|
2
2
|
//# sourceMappingURL=AssignLevelsDatePicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as
|
|
1
|
+
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import o,{useRef as i}from"react";import{Calendar as r}from"lucide-react";function a(a){var l=a.value,d=a.onChange,c=a.placeholder,u=void 0===c?"dd/mm/yyyy":c,p=a.disabled,s=void 0!==p&&p,g=a.minDate,m=i(null),v=o.useMemo(function(){var e=null!=g?g:new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(o)},[g]);return t("div",e({onClick:function(){var e,t;s||null===(t=null===(e=m.current)||void 0===e?void 0:e.showPicker)||void 0===t||t.call(e)},style:{position:"relative",width:"100%",height:"35px",padding:"0 12px",borderRadius:"12px",background:"#F3F4F6",border:"1px solid #C7CDD5",display:"flex",gap:60,alignItems:"center",cursor:s?"not-allowed":"pointer",opacity:s?.65:1,boxSizing:"border-box"}},{children:[n("input",{ref:m,type:"date",value:l,onChange:function(e){return d(e.target.value?new Date(e.target.value):null)},min:v,disabled:s,style:{position:"absolute",opacity:0,pointerEvents:"none"}}),n("span",e({style:{fontSize:"14px",fontWeight:400,color:l?"#111827":"#667085"}},{children:l?new Date(l).toLocaleDateString("en-GB"):u})),n("div",e({style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"6px"}},{children:n(r,{size:18,color:"#667085",strokeWidth:2})}))]}))}export{a as default};
|
|
2
2
|
//# sourceMappingURL=CustomDatePicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as n,__assign as i,__spreadArray as
|
|
1
|
+
import{__awaiter as e,__generator as n,__assign as i,__spreadArray as l}from"../../../_virtual/_tslib.js";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as d}from"react";import s from"./CustomDropdown.js";import{AddUserPopup as a}from"./AddUserPopup.js";function u(u){var c,p,v,f,b,m=this,g=u.assignees,x=u.onAssigneeChange,h=u.accessLevelOptions,C=u.fetchUsers,y=u.wrapperEl,w=u.levelDetails,A=u.displayConfig,U=void 0===A?{}:A,L=t(""),k=L[0],N=L[1],B=t([]),D=B[0],E=B[1],R=t(null),S=R[0],M=R[1];d(function(){if(!U.disableAddUser&&k.trim()){var i=setTimeout(function(){return e(m,void 0,void 0,function(){var e,i,l;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,C(k)];case 1:return e=n.sent(),i=new Set(g.map(function(e){return e.id})),E(e.filter(function(e){return!i.has(e.id)})),[3,3];case 2:return l=n.sent(),console.error("[LevelData]: fetchUser error:",l),E([]),[3,3];case 3:return[2]}})})},300);return function(){return clearTimeout(i)}}E([])},[k,g]);return o("div",i({style:{borderTop:"1px solid #CBD5E1",padding:"20px"}},{children:[r("span",i({style:{fontWeight:600,marginBottom:"8px",fontSize:"14px"}},{children:"Assignee Emails"})),o("div",i({style:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"8px",marginTop:"10px",display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},{children:[g.map(function(e){var n,l,t,d=!!e.notes&&"string"==typeof e.notes&&!!e.notes.trim();return o("div",i({style:{display:"flex",alignItems:"center",gap:"6px",background:"#E9D5FF",borderRadius:"10px",padding:"2px 8px",fontSize:"12px"}},{children:[r("span",i({style:{padding:"4px"}},{children:e.name})),r(s,{value:null!==(t=null!==(n=e.accessLevel)&&void 0!==n?n:null===(l=h[0])||void 0===l?void 0:l.label)&&void 0!==t?t:"",options:h,onChange:function(n){return l=e.id,o=n,void(U.disableAccessLevelChange||x(g.map(function(e){return e.id===l?i(i({},e),{accessLevel:o,role:o}):e})));var l,o},disabled:U.disableAccessLevelChange}),r("div",i({style:{position:"relative",display:"inline-flex",backgroundColor:"white",borderRadius:"3px",padding:1}},{children:r("button",i({type:"button",disabled:U.disableNotes,onClick:function(){return function(e){U.disableNotes||M(i({},e))}(e)},style:{border:"none",background:"transparent",cursor:U.disableNotes?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",color:d?"#7C3AED":"#C4B5FD",opacity:U.disableNotes?.6:1}},{children:r("svg",i({width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M3.03353 3.90755H5.9502M3.03353 5.94922H7.7002M4.59905 9.44922H8.4002C9.38029 9.44922 9.87033 9.44922 10.2447 9.25848C10.574 9.0907 10.8417 8.82299 11.0095 8.4937C11.2002 8.11936 11.2002 7.62931 11.2002 6.64922V3.49922C11.2002 2.51913 11.2002 2.02908 11.0095 1.65474C10.8417 1.32545 10.574 1.05774 10.2447 0.889957C9.87033 0.699219 9.38029 0.699219 8.4002 0.699219H3.5002C2.5201 0.699219 2.03006 0.699219 1.65571 0.889957C1.32643 1.05774 1.05871 1.32545 0.890934 1.65474C0.700195 2.02908 0.700195 2.51913 0.700195 3.49922V10.8116C0.700195 11.1224 0.700195 11.2778 0.763912 11.3577C0.819325 11.4271 0.903352 11.4675 0.992177 11.4674C1.09431 11.4673 1.21567 11.3702 1.45839 11.176L2.8499 10.0628C3.13416 9.83538 3.27629 9.72167 3.43456 9.64082C3.57498 9.56908 3.72444 9.51665 3.8789 9.48495C4.053 9.44922 4.23502 9.44922 4.59905 9.44922Z",stroke:"#98A2B3","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})}))}))})),r("button",i({disabled:U.disableRemoveUser,style:{border:"none",background:"transparent",cursor:U.disableRemoveUser?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",fontSize:"12px",opacity:U.disableRemoveUser?.45:1},onClick:function(){return n=e.id,void(U.disableRemoveUser||(x(g.filter(function(e){return e.id!==n})),(null==S?void 0:S.id)===n&&M(null)));var n},"aria-label":"Remove ".concat(e.name)},{children:"✕"}))]}),e.id)}),r("input",{type:"text",value:k,placeholder:"Search users...",onChange:function(e){U.disableAddUser||N(e.target.value)},disabled:U.disableAddUser,style:{border:"none",outline:"none",flex:1,minWidth:"150px",fontSize:"12px",cursor:U.disableAddUser?"not-allowed":"text",opacity:U.disableAddUser?.65:1}})]})),D.length>0&&r("div",i({style:{border:"1px solid #CBD5E1",borderRadius:"8px",marginTop:"8px"}},{children:D.map(function(e){return o("div",i({style:{padding:"8px",cursor:U.disableAddUser?"not-allowed":"pointer",opacity:U.disableAddUser?.65:1},onClick:function(){return function(e){var n,o,r,t,d,s,a,u;U.disableAddUser||g.some(function(n){return n.id===e.id})||(x(l(l([],g,!0),[i(i({},e),{accessLevel:null!==(o=null===(n=h[0])||void 0===n?void 0:n.label)&&void 0!==o?o:"",role:null!==(t=null===(r=h[0])||void 0===r?void 0:r.label)&&void 0!==t?t:"",notes:"",sendMailNow:!1})],!1)),N(""),E([]),M(i(i({},e),{accessLevel:null!==(s=null===(d=h[0])||void 0===d?void 0:d.label)&&void 0!==s?s:"",role:null!==(u=null===(a=h[0])||void 0===a?void 0:a.label)&&void 0!==u?u:""})))}(e)}},{children:[e.name,e.email&&r("span",i({style:{marginLeft:"8px",color:"#6B7280",fontSize:"11px"}},{children:e.email}))]}),e.id)})})),S&&r(a,{user:S,userLevel:{head:null!==(c=null==w?void 0:w.head)&&void 0!==c?c:"",title:null!==(p=null==w?void 0:w.title)&&void 0!==p?p:""},accessLevel:null!==(b=null!==(v=S.accessLevel)&&void 0!==v?v:null===(f=h[0])||void 0===f?void 0:f.label)&&void 0!==b?b:"",wrapperEl:y,onBackToEditing:function(){S&&(x(g.map(function(e){return e.id===S.id?i(i({},e),{notes:"",sendMailNow:!1}):e})),M(null))},onSendLater:function(e){U.disableNotes||S&&(x(g.map(function(n){return n.id===S.id?i(i({},n),{notes:e,sendMailNow:!1}):n})),M(null))},onSendNow:function(e){U.disableNotes||S&&(x(g.map(function(n){return n.id===S.id?i(i({},n),{notes:e,sendMailNow:!0}):n})),M(null))},disabled:U.disableNotes})]}))}export{u as default};
|
|
2
2
|
//# sourceMappingURL=LevelData.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as i,Fragment as n}from"react/jsx-runtime";import l from"react";import{Info as r,Check as o,Hourglass as s,X as d,CircleCheck as a,MinusCircle as p,User as c,ArrowRight as g,CheckCircle as v,FileCheck as u,LucidePen as x}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as f}from"../styles/ReviewStatusStyles.js";var h=function(e){var t=e.trim().split(/\s+/);return 1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()},y=function(e){for(var t=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return t[Math.abs(i)%t.length]},F=function(e){var t=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof t&&t.trim()?t:"No role assigned"};function m(n){var o=n.levels,s=n.reviewData,d=void 0===s?{}:s,a=o.map(function(e,t){var i,n,l,r=null!==(n=null!==(i=d[t])&&void 0!==i?i:d[e.headerName])&&void 0!==n?n:{},o=(null!==(l=e.assignees)&&void 0!==l?l:[]).map(function(e){return{user:e,approved:!0===r[String(e.id)]||!0===r[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===r[String(e.id)]||"rejected"===r[String(e.email)]||"rejected"===e.action}}),s="not_started";if(!0===e.isApproved)s="approved";else if(!0===e.isRejected)s="rejected";else if("approved"===e.status||"completed"===e.status)s="approved";else if("rejected"===e.status)s="rejected";else{var a=o.length>0&&o.every(function(e){return e.approved}),p=o.some(function(e){return e.rejected});a?s="approved":p&&(s="rejected")}return{level:e,assigneeStatuses:o,status:s}}),p=!1,c=a.map(function(t){var i="waiting",n=!0===t.level.isHidden;return"approved"===t.status?i="approved":"rejected"===t.status?(i="rejected",p=!0):t.level.isMandatory||n?p||(i="pending",p=!0):i="optional",e(e({},t),{extendedStatus:i,isFinalApproval:n})}),g=function(e){return e.filter(function(e){return"approved"===e.status}).length}(a),v=a.length;return t("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[t("div",{children:[t("div",e({style:f.progressHeader},{children:[i("span",e({style:f.progressTitle},{children:"Approval Progress"})),t("span",e({style:f.progressCount},{children:[g," of ",v," level",1!==v?"s":""," complete"]}))]})),i("div",e({style:f.progressBarTrack},{children:c.map(function(t,n){var l,r="approved"===t.extendedStatus,o="rejected"===t.extendedStatus,s="optional"===t.extendedStatus,d=0===n,a=n===v-1;return!(null===(l=t.level)||void 0===l?void 0:l.assignees)||!Array.isArray(t.level.assignees)||t.level.assignees.length<1?null:i("div",{style:e(e({},f.progressSegment),{backgroundColor:r?"#6366F1":o?"#EF4444":s?"#F1F5F9":"#E5E7EB",borderRadius:d&&a?"999px":d?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},n)})})),i("div",e({style:f.progressLabels},{children:c.map(function(t,n){return i("span",e({style:e(e({},f.progressLabel),{color:"approved"===t.extendedStatus?"#6366F1":"rejected"===t.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===t.extendedStatus||"rejected"===t.extendedStatus?600:400})},{children:t.level.assignees&&t.level.assignees.length>0?"".concat(t.level.headerName," - ").concat(t.level.title):""}),n)})}))]}),t("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[i("div",e({style:f.sectionHeadingRow},{children:t("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",e({style:f.sectionTitle},{children:"Approval Levels"})),i(r,{size:15,color:"#9CA3AF"})]}))})),i("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:c.map(function(n,r){var o,s=r===c.length-1,d=n.isFinalApproval,a=c[r+1],p=null==a?void 0:a.isFinalApproval,g=a&&!a.level.isMandatory&&!p;return t(l.Fragment,d?{children:[t("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),i("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),i(E,{reviewLevel:n})]}:{children:[i(b,{reviewLevel:n}),!s&&!p&&a.level.assignees&&(null===(o=a.level.assignees)||void 0===o?void 0:o.length)>0&&t("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:g?"optional":"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},r)})}))]})),i(A,{levels:o})]}))}function b(n){var l,a=n.reviewLevel,p=a.level,c=a.assigneeStatuses,g=a.extendedStatus,v=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(s,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(d,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:i(r,{size:14}),text:"Optional"}}[g])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},u="approved"===g?"1px solid #D1FAE5":"rejected"===g?"1px solid #FCA5A5":"optional"===g?"1px dashed #CBD5E1":"1px solid #E5E7EB",x="approved"===g?"#F0FDF4":"rejected"===g?"#FEF2F2":"#F8FAFC";return!p.assignees||!Array.isArray(p.assignees)||p.assignees.length<1?null:t("div",e({style:{backgroundColor:"#FFFFFF",border:u,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[t("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:x,borderBottom:u,padding:"12px 16px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[i(z,{name:p.headerName}),i("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:p.title}))]})),t("div",e({style:{backgroundColor:v.bg,color:v.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[v.icon,v.text]}))]})),i("div",e({style:{padding:"16px"}},{children:c.length>0?i("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:c.map(function(e,t){var n;return i(C,{assigneeStatus:e,extendedStatus:g},null!==(n=e.user.id)&&void 0!==n?n:t)})})):i("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function E(n){var l,a,p,c,g=n.reviewLevel,v=g.assigneeStatuses,u=g.extendedStatus,x=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(s,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(d,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:i(r,{size:14}),text:"Optional"}}[u])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},f=null===(a=v[0])||void 0===a?void 0:a.user;null==f||f.email;var m=F(f);return t("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[f?t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(p=f.id)&&void 0!==p?p:f.name).bg,color:y(null!==(c=f.id)&&void 0!==c?c:f.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(f.name)})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[i("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:f.name})),t("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",m]})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):i("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),t("div",e({style:{backgroundColor:x.bg,color:x.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[x.icon,x.text]}))]}))}function C(l){var r,o=l.assigneeStatus,s=l.extendedStatus,c=o.user,g=o.approved||"approved"===c.action,v=o.rejected||"rejected"===c.action,u=h(c.name),x=y(null!==(r=c.id)&&void 0!==r?r:c.name),f=F(c);return t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:x.bg,color:x.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:u})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[i("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),i("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:f}))]})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email}))]}))]})),i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:g?i(a,{size:20,color:"#16A34A",strokeWidth:1.5}):v?i(d,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===s?t(n,{children:[i("span",{style:{fontSize:"13px",color:"#4B5563"}}),i(p,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):i(p,"optional"===s?{size:20,color:"#CBD5E1",strokeWidth:1.5}:{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function z(t){var n=t.name,l=y(n);return i("span",e({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var S=function(e){switch(e){case 0:return i(x,{size:16,color:"#475569"});case 1:return i(u,{size:16,color:"#475569"});case 2:return i(c,{size:16,color:"#475569"});default:return i(v,{size:16,color:"#475569"})}};function A(n){var r=n.levels.filter(function(e){var t,i;return(null!==(i=null===(t=e.assignees)||void 0===t?void 0:t.length)&&void 0!==i?i:0)>0});return t("div",e({style:f.flowBox},{children:[i("span",e({style:f.flowTitle},{children:"Current Approval Flow"})),r.length>0?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:r.map(function(n,o){var s,d=n.isHidden,a=!n.isMandatory&&!d,p=d?i(c,{size:16,color:"#475569"}):S(o);return t(l.Fragment,{children:[t("span",e({style:e(e({},f.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:a?"1px dashed #CBD5E1":void 0})},{children:[p,t("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[n.assignees.map(function(n,r){var o,s,d=F(n);return t(l.Fragment,{children:[r>0&&i("span",e({style:{color:"#9CA3AF"}},{children:"/"})),t("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[i("span",e({style:{fontSize:13,color:a?"#64748B":"#374151"}},{children:n.name})),i("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:d}))]}))]},null!==(s=null!==(o=n.id)&&void 0!==o?o:n.email)&&void 0!==s?s:r)}),a&&i("span",e({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),o<r.length-1&&i(g,{size:16,color:"#9CA3AF"})]},null!==(s=n.id)&&void 0!==s?s:"".concat(n.headerName,"-").concat(o))})})):i("p",e({style:f.flowEmpty},{children:"No owners assigned yet."}))]}))}export{m as default};
|
|
1
|
+
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as n,jsx as t,Fragment as l}from"react/jsx-runtime";import i from"react";import{Info as o,Check as r,Hourglass as d,X as s,CircleCheck as a,MinusCircle as p,User as c,ArrowRight as g,CheckCircle as v,FileCheck as x,LucidePen as u}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as f}from"../styles/ReviewStatusStyles.js";var h=function(e){var n=e.trim().split(/\s+/);return 1===n.length?n[0].slice(0,2).toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()},y=function(e){for(var n=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],t=0,l=0;l<e.length;l++)t=e.charCodeAt(l)+((t<<5)-t);return n[Math.abs(t)%n.length]},F=function(e){var n=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof n&&n.trim()?n:"No role assigned"};function m(l){var r=l.levels,d=l.reviewData,s=void 0===d?{}:d,a=l.showApproveAndMoveToNextLevelButton,p=void 0!==a&&a,c=l.onApproveAndMoveToNextLevel,g=r.map(function(e,n){var t,l,i,o=null!==(l=null!==(t=s[n])&&void 0!==t?t:s[e.headerName])&&void 0!==l?l:{},r=(null!==(i=e.assignees)&&void 0!==i?i:[]).map(function(e){return{user:e,approved:!0===o[String(e.id)]||!0===o[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===o[String(e.id)]||"rejected"===o[String(e.email)]||"rejected"===e.action}}),d="not_started";if(!0===e.isApproved)d="approved";else if(!0===e.isRejected)d="rejected";else if("approved"===e.status||"completed"===e.status)d="approved";else if("rejected"===e.status)d="rejected";else{var a=r.length>0&&r.every(function(e){return e.approved}),p=r.some(function(e){return e.rejected});a?d="approved":p&&(d="rejected")}return{level:e,assigneeStatuses:r,status:d}}),v=!1,x=g.map(function(n){var t="waiting",l=!0===n.level.isHidden;return"approved"===n.status?t="approved":"rejected"===n.status?(t="rejected",v=!0):n.level.isMandatory||l?v||(t="pending",v=!0):t="optional",e(e({},n),{extendedStatus:t,isFinalApproval:l})}),u=function(e){return e.filter(function(e){return"approved"===e.status}).length}(g),h=g.length;return n("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[n("div",{children:[n("div",e({style:f.progressHeader},{children:[t("span",e({style:f.progressTitle},{children:"Approval Progress"})),n("span",e({style:f.progressCount},{children:[u," of ",h," level",1!==h?"s":""," complete"]}))]})),t("div",e({style:f.progressBarTrack},{children:x.map(function(n,l){var i,o="approved"===n.extendedStatus,r="rejected"===n.extendedStatus,d="optional"===n.extendedStatus,s=0===l,a=l===h-1;return!(null===(i=n.level)||void 0===i?void 0:i.assignees)||!Array.isArray(n.level.assignees)||n.level.assignees.length<1?null:t("div",{style:e(e({},f.progressSegment),{backgroundColor:o?"#6366F1":r?"#EF4444":d?"#F1F5F9":"#E5E7EB",borderRadius:s&&a?"999px":s?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},l)})})),t("div",e({style:f.progressLabels},{children:x.map(function(n,l){return t("span",e({style:e(e({},f.progressLabel),{color:"approved"===n.extendedStatus?"#6366F1":"rejected"===n.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===n.extendedStatus||"rejected"===n.extendedStatus?600:400})},{children:n.level.assignees&&n.level.assignees.length>0?"".concat(n.level.headerName," - ").concat(n.level.title):""}),l)})}))]}),n("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[t("div",e({style:f.sectionHeadingRow},{children:n("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[t("span",e({style:f.sectionTitle},{children:"Approval Levels"})),t(o,{size:15,color:"#9CA3AF"})]}))})),t("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(l,o){var r,d,s=o===x.length-1,a=l.isFinalApproval,g=x[o+1],v=null==g?void 0:g.isFinalApproval,u=g&&!g.level.isMandatory&&!v;return n(i.Fragment,a?{children:[n("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[t("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),t("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),t("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),t("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),t(E,{reviewLevel:l})]}:{children:[t(b,{reviewLevel:l,levelIndex:o,nextLevel:null!==(r=null==g?void 0:g.level)&&void 0!==r?r:null,showApproveAndMoveToNextLevelButton:p,onApproveAndMoveToNextLevel:c}),!s&&!v&&g.level.assignees&&(null===(d=g.level.assignees)||void 0===d?void 0:d.length)>0&&n("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[t("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),t("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:u?"optional":"then"})),t("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},o)})}))]})),t(S,{levels:r})]}))}function b(l){var i,a=l.reviewLevel,p=l.levelIndex,c=l.nextLevel,g=l.showApproveAndMoveToNextLevelButton,v=l.onApproveAndMoveToNextLevel,x=a.level,u=a.assigneeStatuses,f=a.extendedStatus,h=g&&"pending"===f&&!!v,y=null!==(i={approved:{bg:"#ECFDF5",color:"#059669",icon:t(r,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:t(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:t(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:t(s,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:t(o,{size:14}),text:"Optional"}}[f])&&void 0!==i?i:{bg:"#F3F4F6",color:"#4B5563",icon:t(d,{size:14}),text:"Waiting"},F="approved"===f?"1px solid #D1FAE5":"rejected"===f?"1px solid #FCA5A5":"optional"===f?"1px dashed #CBD5E1":"1px solid #E5E7EB",m="approved"===f?"#F0FDF4":"rejected"===f?"#FEF2F2":"#F8FAFC";return!x.assignees||!Array.isArray(x.assignees)||x.assignees.length<1?null:n("div",e({style:{backgroundColor:"#FFFFFF",border:F,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[n("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:m,borderBottom:F,padding:"12px 16px"}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[t(A,{name:x.headerName}),t("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:x.title}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[h&&n("button",e({type:"button",onClick:function(){return null==v?void 0:v({level:x,levelIndex:p,nextLevel:c})},style:{border:"1px solid #C7D2FE",backgroundColor:"#EEF2FF",color:"#4F46E5",borderRadius:"8px",padding:"6px 10px",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},{children:[t(r,{size:13}),"Approve & Move to Next Level"]})),n("div",e({style:{backgroundColor:y.bg,color:y.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[y.icon,y.text]}))]}))]})),t("div",e({style:{padding:"16px"}},{children:u.length>0?t("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:u.map(function(e,n){var l;return t(C,{assigneeStatus:e,extendedStatus:f},null!==(l=e.user.id)&&void 0!==l?l:n)})})):t("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function E(l){var i,a,p,c,g=l.reviewLevel,v=g.assigneeStatuses,x=g.extendedStatus,u=null!==(i={approved:{bg:"#ECFDF5",color:"#059669",icon:t(r,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:t(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:t(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:t(s,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:t(o,{size:14}),text:"Optional"}}[x])&&void 0!==i?i:{bg:"#F3F4F6",color:"#4B5563",icon:t(d,{size:14}),text:"Waiting"},f=null===(a=v[0])||void 0===a?void 0:a.user;null==f||f.email;var m=F(f);return n("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[f?n("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(p=f.id)&&void 0!==p?p:f.name).bg,color:y(null!==(c=f.id)&&void 0!==c?c:f.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(f.name)})),n("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[t("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:f.name})),n("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",m]})),t("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):t("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),n("div",e({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function C(i){var o,r=i.assigneeStatus,d=i.extendedStatus,c=r.user,g=r.approved||"approved"===c.action,v=r.rejected||"rejected"===c.action,x=h(c.name),u=y(null!==(o=c.id)&&void 0!==o?o:c.name),f=F(c);return n("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),n("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[t("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),t("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:f}))]})),t("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email}))]}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:g?t(a,{size:20,color:"#16A34A",strokeWidth:1.5}):v?t(s,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===d?n(l,{children:[t("span",{style:{fontSize:"13px",color:"#4B5563"}}),t(p,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):t(p,"optional"===d?{size:20,color:"#CBD5E1",strokeWidth:1.5}:{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function A(n){var l=n.name,i=y(l);return t("span",e({style:{backgroundColor:i.bg,color:i.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:l}))}var z=function(e){switch(e){case 0:return t(u,{size:16,color:"#475569"});case 1:return t(x,{size:16,color:"#475569"});case 2:return t(c,{size:16,color:"#475569"});default:return t(v,{size:16,color:"#475569"})}};function S(l){var o=l.levels.filter(function(e){var n,t;return(null!==(t=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==t?t:0)>0});return n("div",e({style:f.flowBox},{children:[t("span",e({style:f.flowTitle},{children:"Current Approval Flow"})),o.length>0?t("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:o.map(function(l,r){var d,s=l.isHidden,a=!l.isMandatory&&!s,p=s?t(c,{size:16,color:"#475569"}):z(r);return n(i.Fragment,{children:[n("span",e({style:e(e({},f.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:a?"1px dashed #CBD5E1":void 0})},{children:[p,n("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[l.assignees.map(function(l,o){var r,d,s=F(l);return n(i.Fragment,{children:[o>0&&t("span",e({style:{color:"#9CA3AF"}},{children:"/"})),n("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[t("span",e({style:{fontSize:13,color:a?"#64748B":"#374151"}},{children:l.name})),t("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:s}))]}))]},null!==(d=null!==(r=l.id)&&void 0!==r?r:l.email)&&void 0!==d?d:o)}),a&&t("span",e({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),r<o.length-1&&t(g,{size:16,color:"#9CA3AF"})]},null!==(d=l.id)&&void 0!==d?d:"".concat(l.headerName,"-").concat(r))})})):t("p",e({style:f.flowEmpty},{children:"No owners assigned yet."}))]}))}export{m as default};
|
|
2
2
|
//# sourceMappingURL=ReviewStatus.js.map
|
package/dist/types/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA0E1B,iBAAS,GAAG,sBAMX;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignReminderWrapper.test.d.ts","sourceRoot":"","sources":["../../src/AssignReminderWrapper.test.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,yBAAyB,
|
|
1
|
+
{"version":3,"file":"AssignReminderWrapper.test.d.ts","sourceRoot":"","sources":["../../src/AssignReminderWrapper.test.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,yBAAyB,sBAyGhD"}
|
|
@@ -3,8 +3,10 @@ import { LevelAccordionProps } from "./types/types";
|
|
|
3
3
|
interface ExtendedLevelAccordionProps extends LevelAccordionProps {
|
|
4
4
|
onTitleChange?: (title: string) => void;
|
|
5
5
|
onDeleteLevel?: () => void;
|
|
6
|
+
minDueDate?: Date | null;
|
|
7
|
+
maxDueDate?: Date | null;
|
|
6
8
|
finalApprovalDueDate?: Date | null;
|
|
7
9
|
}
|
|
8
|
-
export default function LevelAccordion({ level, id, accessLevelOptions, fetchUsers, onToggleMandatory, onDueDateChange, onAssigneesChange, onTitleChange,
|
|
10
|
+
export default function LevelAccordion({ level, id, accessLevelOptions, fetchUsers, onToggleMandatory, onDueDateChange, onAssigneesChange, onTitleChange, minDueDate, maxDueDate, displayConfig, }: ExtendedLevelAccordionProps): React.JSX.Element;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=AssignLevelAccordions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignLevelAccordions.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignLevelAccordions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAMpD,UAAU,2BAA4B,SAAQ,mBAAmB;IAC7D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,oBAAoB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACnC,KAAK,EACL,EAAE,EACF,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"AssignLevelAccordions.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignLevelAccordions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAMpD,UAAU,2BAA4B,SAAQ,mBAAmB;IAC7D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACnC,KAAK,EACL,EAAE,EACF,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACV,aAAa,GAChB,EAAE,2BAA2B,qBAwN7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignReminderLevels.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderLevels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,yBAAyB,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"AssignReminderLevels.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderLevels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,yBAAyB,EAAS,MAAM,eAAe,CAAC;AA6CjE,iBAAS,oBAAoB,CAAC,EAC1B,KAAK,EACL,MAAW,EACX,oBAA4B,EAC5B,cAAc,EACd,SAAS,EACT,uBAAuB,EACvB,UAAU,EACV,kBAAiD,EACjD,cAAc,EACd,iBAAiB,EACjB,YAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,aAAa,GAChB,EAAE,yBAAyB,qBAwV3B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignReminderTest.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderTest.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAepD,eAAO,MAAM,cAAc,UAAiB,MAAM,KAAG,QAAQ,YAAY,EAAE,CAQ1E,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAAK,EAyBjC,CAAC;AAGF,MAAM,CAAC,OAAO,UAAU,wBAAwB,
|
|
1
|
+
{"version":3,"file":"AssignReminderTest.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderTest.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAepD,eAAO,MAAM,cAAc,UAAiB,MAAM,KAAG,QAAQ,YAAY,EAAE,CAQ1E,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAAK,EAyBjC,CAAC;AAGF,MAAM,CAAC,OAAO,UAAU,wBAAwB,gCA+E/C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AssignReminderWrapperProps, Level } from "./types/types";
|
|
3
3
|
export declare const INITIAL_LEVELS: Level[];
|
|
4
|
-
declare function AssignReminderWrapper({ metadata, reviewData, levels, setLevels, requireFinalApproval, setRequireFinalApproval, approvalDueDate, setApprovalDueDate, onClose, fetchUsers, onSave, onValidationError, totalLevels, customStyles, isSaving, displayConfig, onRequireFinalApproval, isOwner, blockEditScreen, hideManageReminders, hideClearButton, hideSaveChangesButton, hideFooterActions, hideAssigneeApproverScreen, remindersData, remainderOwners: remainderOwnersProp, setRemainderOwners: setRemainderOwnersProp, schedules: schedulesProp, setSchedules: setSchedulesProp, handelSendNow, showPreviewEmail, tabName, reminderLabels, reminderColors, reminderChipColor, reminderAssignees, reminderFallbackRecipients, reminderRecipientsColor, manualReminderTitle, manualReminderDescription, lastReminderText, selectRecipientsLabel, previewEmailButtonLabel, sendNowButtonLabel, reminderSuccessTitle, reminderSuccessDescription, escalationTitle, escalationTitleTooltip, escalationDescription, configureAutoReminderText, getDynamicStatement, reminderStartDateLabel, documentDueDateLabel, reminderFrequencyLabel, escalationRemindersLabel, escalationTooltip, escalationConditionText, daysText, dueDataAndRepeatText, reminderFrequencyOptions, escalationFrequencyOptions, beforeAfterOptions, }: AssignReminderWrapperProps): React.JSX.Element;
|
|
4
|
+
declare function AssignReminderWrapper({ metadata, reviewData, levels, setLevels, requireFinalApproval, setRequireFinalApproval, approvalDueDate, setApprovalDueDate, onClose, fetchUsers, onSave, onValidationError, showApproveAndMoveToNextLevelButton, onApproveAndMoveToNextLevel, totalLevels, customStyles, isSaving, displayConfig, onRequireFinalApproval, isOwner, blockEditScreen, hideManageReminders, hideClearButton, hideSaveChangesButton, hideFooterActions, hideAssigneeApproverScreen, remindersData, remainderOwners: remainderOwnersProp, setRemainderOwners: setRemainderOwnersProp, schedules: schedulesProp, setSchedules: setSchedulesProp, handelSendNow, showPreviewEmail, tabName, reminderLabels, reminderColors, reminderChipColor, reminderAssignees, reminderFallbackRecipients, reminderRecipientsColor, manualReminderTitle, manualReminderDescription, lastReminderText, selectRecipientsLabel, previewEmailButtonLabel, sendNowButtonLabel, reminderSuccessTitle, reminderSuccessDescription, escalationTitle, escalationTitleTooltip, escalationDescription, configureAutoReminderText, getDynamicStatement, reminderStartDateLabel, documentDueDateLabel, reminderFrequencyLabel, escalationRemindersLabel, escalationTooltip, escalationConditionText, daysText, dueDataAndRepeatText, reminderFrequencyOptions, escalationFrequencyOptions, beforeAfterOptions, }: AssignReminderWrapperProps): React.JSX.Element;
|
|
5
5
|
export { AssignReminderWrapper };
|
|
6
6
|
//# sourceMappingURL=AssignReminderWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignReminderWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EACH,0BAA0B,EAC1B,KAAK,EAIR,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,cAAc,EAAE,KAAK,EAiBjC,CAAC;AAuEF,iBAAS,qBAAqB,CAAC,EAC3B,QAAa,EACb,UAAe,EACf,MAAM,EACN,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,YAAiB,EACjB,QAAgB,EAChB,aAAkB,EAClB,sBAAsB,EACtB,OAAc,EAGd,eAAuB,EACvB,mBAA2B,EAC3B,eAAuB,EACvB,qBAA6B,EAC7B,iBAAyB,EACzB,0BAAgC,EAGhC,aAAa,EACb,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,sBAAsB,EAC1C,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EACb,gBAAgB,EAChB,OAAO,EAGP,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,GACrB,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"AssignReminderWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EACH,0BAA0B,EAC1B,KAAK,EAIR,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,cAAc,EAAE,KAAK,EAiBjC,CAAC;AAuEF,iBAAS,qBAAqB,CAAC,EAC3B,QAAa,EACb,UAAe,EACf,MAAM,EACN,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,mCAAmC,EACnC,2BAA2B,EAC3B,WAAW,EACX,YAAiB,EACjB,QAAgB,EAChB,aAAkB,EAClB,sBAAsB,EACtB,OAAc,EAGd,eAAuB,EACvB,mBAA2B,EAC3B,eAAuB,EACvB,qBAA6B,EAC7B,iBAAyB,EACzB,0BAAgC,EAGhC,aAAa,EACb,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,sBAAsB,EAC1C,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EACb,gBAAgB,EAChB,OAAO,EAGP,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,GACrB,EAAE,0BAA0B,qBA6nB5B;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropdownOption } from "../types/types";
|
|
3
|
+
interface AccessLevelPopupValue {
|
|
4
|
+
accessLevel: string;
|
|
5
|
+
notes: string;
|
|
6
|
+
sendMailNow: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface AccessLevelPopupProps {
|
|
9
|
+
value: AccessLevelPopupValue;
|
|
10
|
+
onConfirm: (value: AccessLevelPopupValue) => void;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
accessLevelOptions?: DropdownOption[];
|
|
13
|
+
/**
|
|
14
|
+
* Pass the AssignWrapper's root element so the overlay is scoped to it.
|
|
15
|
+
* Falls back to covering the full viewport if not provided.
|
|
16
|
+
*/
|
|
17
|
+
wrapperEl?: HTMLElement | null;
|
|
18
|
+
}
|
|
19
|
+
declare function AccessLevelPopup({ value, onConfirm, onClose, accessLevelOptions, wrapperEl, }: AccessLevelPopupProps): React.JSX.Element;
|
|
20
|
+
export { AccessLevelPopup };
|
|
21
|
+
export type { AccessLevelPopupValue, AccessLevelPopupProps };
|
|
22
|
+
//# sourceMappingURL=AssignAccessLevelsPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignAccessLevelsPopup.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/AssignAccessLevelsPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOhD,UAAU,qBAAqB;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,qBAAqB;IAC3B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,SAAS,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC;AA6MD,iBAAS,gBAAgB,CAAC,EACtB,KAAK,EACL,SAAS,EACT,OAAO,EACP,kBAAoC,EACpC,SAAS,GACZ,EAAE,qBAAqB,qBA8HvB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare function AssignLevelDatePicker({ value, onSet, maxDate, disabled, }: {
|
|
2
|
+
declare function AssignLevelDatePicker({ value, onSet, minDate, maxDate, disabled, }: {
|
|
3
3
|
value: Date | null;
|
|
4
4
|
onSet: (val: Date | null) => void;
|
|
5
5
|
id: string;
|
|
6
|
+
minDate?: Date | null;
|
|
6
7
|
maxDate: Date | null;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignLevelsDatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/AssignLevelsDatePicker.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AssignLevelsDatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/AssignLevelsDatePicker.tsx"],"names":[],"mappings":";AAaA,iBAAS,qBAAqB,CAAC,EAC7B,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAgB,GACjB,EAAE;IACD,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BAsCA;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -4,7 +4,8 @@ interface CustomDatePickerProps {
|
|
|
4
4
|
onChange: React.Dispatch<React.SetStateAction<Date | null>>;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
minDate?: Date | null;
|
|
7
8
|
}
|
|
8
|
-
export default function CustomDatePicker({ value, onChange, placeholder, disabled, }: CustomDatePickerProps): React.JSX.Element;
|
|
9
|
+
export default function CustomDatePicker({ value, onChange, placeholder, disabled, minDate, }: CustomDatePickerProps): React.JSX.Element;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=CustomDatePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/CustomDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,UAAU,qBAAqB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomDatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/CustomDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,UAAU,qBAAqB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB;AAMD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACrC,KAAK,EACL,QAAQ,EACR,WAA0B,EAC1B,QAAgB,EAChB,OAAO,GACV,EAAE,qBAAqB,qBAmFvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LevelData.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/LevelData.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzD,UAAU,sBAAuB,SAAQ,cAAc;IACnD,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,SAAS,CAAC,EACf,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,aAAkB,GACrB,EAAE,sBAAsB,+
|
|
1
|
+
{"version":3,"file":"LevelData.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/LevelData.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzD,UAAU,sBAAuB,SAAQ,cAAc;IACnD,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,SAAS,CAAC,EACf,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,aAAkB,GACrB,EAAE,sBAAsB,+BAgRxB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReviewStatusProps } from "../types/types";
|
|
3
|
-
export default function ReviewStatus({ levels, reviewData }: ReviewStatusProps): React.JSX.Element;
|
|
3
|
+
export default function ReviewStatus({ levels, reviewData, showApproveAndMoveToNextLevelButton, onApproveAndMoveToNextLevel, }: ReviewStatusProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ReviewStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/ReviewStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAIH,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ReviewStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/ReviewStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAIH,iBAAiB,EAEpB,MAAM,gBAAgB,CAAC;AAiDxB,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACjC,MAAM,EACN,UAAe,EACf,mCAA2C,EAC3C,2BAA2B,GAC9B,EAAE,iBAAiB,qBA0NnB"}
|
|
@@ -5,6 +5,7 @@ export interface AssigneeUser {
|
|
|
5
5
|
name: string;
|
|
6
6
|
id: any;
|
|
7
7
|
accessLevel?: string;
|
|
8
|
+
role?: string;
|
|
8
9
|
action?: "approved" | "rejected" | "iterated";
|
|
9
10
|
action_taken_at?: string;
|
|
10
11
|
notes?: string;
|
|
@@ -57,6 +58,7 @@ export interface AssignReminderDisplayConfig {
|
|
|
57
58
|
disableNotes?: boolean;
|
|
58
59
|
disableAccessLevelChange?: boolean;
|
|
59
60
|
disableDueDates?: boolean;
|
|
61
|
+
disableRequiredButtonOnUserAdd?: boolean;
|
|
60
62
|
}
|
|
61
63
|
export interface AssignReminderWrapperProps {
|
|
62
64
|
metadata?: MetaData;
|
|
@@ -72,6 +74,8 @@ export interface AssignReminderWrapperProps {
|
|
|
72
74
|
onClose?: () => void;
|
|
73
75
|
onValidationError?: (message: string) => void;
|
|
74
76
|
onSave?: (payload: SavePayload) => void;
|
|
77
|
+
showApproveAndMoveToNextLevelButton?: boolean;
|
|
78
|
+
onApproveAndMoveToNextLevel?: (payload: ReviewStatusActionPayload) => void;
|
|
75
79
|
customStyles?: Record<string, React.CSSProperties>;
|
|
76
80
|
isOwner?: boolean;
|
|
77
81
|
isSaving?: boolean;
|
|
@@ -90,6 +94,7 @@ export interface AssignReminderWrapperProps {
|
|
|
90
94
|
hideSaveChangesButton?: boolean;
|
|
91
95
|
hideFooterActions?: boolean;
|
|
92
96
|
hideAssigneeApproverScreen?: boolean;
|
|
97
|
+
disableRequiredeButtonOnUsersAdd?: boolean;
|
|
93
98
|
showPreviewEmail?: boolean;
|
|
94
99
|
reminderLabels?: string[];
|
|
95
100
|
reminderColors?: ColorConfig[];
|
|
@@ -168,6 +173,13 @@ export interface AssigneeApprovalStatus {
|
|
|
168
173
|
export interface ReviewStatusProps {
|
|
169
174
|
levels: Level[];
|
|
170
175
|
reviewData?: Record<string | number, any>;
|
|
176
|
+
showApproveAndMoveToNextLevelButton?: boolean;
|
|
177
|
+
onApproveAndMoveToNextLevel?: (payload: ReviewStatusActionPayload) => void;
|
|
178
|
+
}
|
|
179
|
+
export interface ReviewStatusActionPayload {
|
|
180
|
+
level: Level;
|
|
181
|
+
levelIndex: number;
|
|
182
|
+
nextLevel?: Level | null;
|
|
171
183
|
}
|
|
172
184
|
export interface ColorConfig {
|
|
173
185
|
bg: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,YAAY;IACzB,KAAK,EAAS,MAAM,CAAC;IACrB,IAAI,EAAU,MAAM,CAAC;IACrB,EAAE,EAAY,GAAG,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAO,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,KAAK;IAClB,UAAU,EAAG,MAAM,CAAC;IACpB,KAAK,EAAQ,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAK,IAAI,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAI,OAAO,CAAC;IACrB,SAAS,CAAC,EAAG,YAAY,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAM,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;CAC9F;AAID,MAAM,MAAM,cAAc,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAChC;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;AAE5E,MAAM,WAAW,QAAQ;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,OAAO;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IACpB,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,2BAA2B;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/types/types.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viswa-test/creative-workspace-ui-component",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"author": "
|
|
3
|
+
"version": "0.0.64",
|
|
4
|
+
"author": "Viswa Koduru",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
|
-
"start": "PORT=
|
|
27
|
+
"start": "PORT=3007 craco start",
|
|
28
28
|
"build": "rollup -c && npm run copy:styles",
|
|
29
29
|
"copy:styles": "mkdir -p dist/features/lsc-guidelines dist/cjs/features/lsc-guidelines && cp src/features/lsc-guidelines/theme.css dist/features/lsc-guidelines/theme.css && cp src/features/lsc-guidelines/theme.css dist/cjs/features/lsc-guidelines/theme.css",
|
|
30
30
|
"tsupBuild": "tsup src/index.ts",
|
|
@@ -77,11 +77,6 @@
|
|
|
77
77
|
"require": "./dist/cjs/components/ScopeTree/TreeSidebar.js",
|
|
78
78
|
"types": "./dist/types/components/ScopeTree/TreeSidebar.d.ts"
|
|
79
79
|
},
|
|
80
|
-
"./CwsService": {
|
|
81
|
-
"import": "./dist/features/cws/index.js",
|
|
82
|
-
"require": "./dist/cjs/features/cws/index.js",
|
|
83
|
-
"types": "./dist/types/features/cws/index.d.ts"
|
|
84
|
-
},
|
|
85
80
|
"./lsc-guidelines": {
|
|
86
81
|
"import": "./dist/features/lsc-guidelines/index.js",
|
|
87
82
|
"require": "./dist/cjs/features/lsc-guidelines/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SocketPackage.test.d.ts","sourceRoot":"","sources":["../../src/SocketPackage.test.tsx"],"names":[],"mappings":";AA0DA,MAAM,CAAC,OAAO,UAAU,UAAU,gCAiFjC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SocketConfig } from "./SocketManager";
|
|
2
|
-
type Handler<T = any> = (payload: T) => void;
|
|
3
|
-
export default class CwsEvent {
|
|
4
|
-
private static handlers;
|
|
5
|
-
static initialize(config: SocketConfig): void;
|
|
6
|
-
private static dispatch;
|
|
7
|
-
static on<T>(type: string, handler: (payload: T) => void): () => void;
|
|
8
|
-
static off(type: string, handler: Handler): void;
|
|
9
|
-
static emit(type: string, payload: any): void;
|
|
10
|
-
static isInitialized(): boolean;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=CwsEvent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CwsEvent.d.ts","sourceRoot":"","sources":["../../../../src/features/cws/CwsEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3E,KAAK,OAAO,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,QAAQ;IAEzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmC;IAE1D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY;IAgBtC,OAAO,CAAC,MAAM,CAAC,QAAQ;IAWvB,MAAM,CAAC,EAAE,CAAC,CAAC,EACP,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAejC,MAAM,CAAC,GAAG,CACN,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO;IAiBpB,MAAM,CAAC,IAAI,CACP,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,GAAG;IAYhB,MAAM,CAAC,aAAa;CAIvB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface Props {
|
|
3
|
-
baseUrl: string;
|
|
4
|
-
applicationId: string;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
authToken: string;
|
|
7
|
-
}
|
|
8
|
-
export default function CwsEventProvider({ baseUrl, applicationId, children, authToken, }: Props): import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=CwsEventProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CwsEventProvider.d.ts","sourceRoot":"","sources":["../../../../src/features/cws/CwsEventProvider.tsx"],"names":[],"mappings":";AAGA,UAAU,KAAK;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACrC,OAAO,EACP,aAAa,EACb,QAAQ,EACR,SAAS,GACZ,EAAE,KAAK,+BAYP"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface SocketEvent {
|
|
2
|
-
type: string;
|
|
3
|
-
payload: any;
|
|
4
|
-
}
|
|
5
|
-
type EventListener = (event: SocketEvent) => void;
|
|
6
|
-
export interface SocketConfig {
|
|
7
|
-
baseUrl: string;
|
|
8
|
-
wakeupUrl?: string;
|
|
9
|
-
applicationId: string;
|
|
10
|
-
authToken: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class SocketManager {
|
|
13
|
-
private static instance;
|
|
14
|
-
private socket;
|
|
15
|
-
private listener?;
|
|
16
|
-
private applicationId;
|
|
17
|
-
private authToken;
|
|
18
|
-
private isInitialized;
|
|
19
|
-
private constructor();
|
|
20
|
-
static getInstance(): SocketManager;
|
|
21
|
-
initialize(config: SocketConfig): Promise<void>;
|
|
22
|
-
private wakeupServer;
|
|
23
|
-
setListener(listener: EventListener): void;
|
|
24
|
-
publish(type: string, payload: any): void;
|
|
25
|
-
disconnect(): void;
|
|
26
|
-
getInitStatus(): boolean;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=SocketManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SocketManager.d.ts","sourceRoot":"","sources":["../../../../src/features/cws/SocketManager.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;CAChB;AAED,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAElD,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,aAAa;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IAEvC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,QAAQ,CAAC,CAAgB;IACjC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,aAAa,CAAkB;IAEvC,OAAO;IAEP,MAAM,CAAC,WAAW;IAQZ,UAAU,CAAC,MAAM,EAAE,YAAY;YAoCvB,YAAY;IAmB1B,WAAW,CAAC,QAAQ,EAAE,aAAa;IAInC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAQlC,UAAU;IAIV,aAAa;CAGhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/cws/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCwsEvent.d.ts","sourceRoot":"","sources":["../../../../src/features/cws/useCwsEvent.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,QAWjC"}
|