@viswa-test/creative-workspace-ui-component 0.0.66 → 0.0.68
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/components/AssignReminders/AssignLevelAccordions.js +1 -1
- package/dist/components/AssignReminders/AssignReminderLevels.js +1 -1
- package/dist/types/components/AssignReminders/AssignLevelAccordions.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/AssignReminderLevels.d.ts.map +1 -1
- package/package.json +1 -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"),l=require("./components/AssignLevelsDatePicker.js"),a=require("./components/LevelData.js");exports.default=function(r){var d,u,p,g,c,x
|
|
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=r.level,h=r.id,f=r.accessLevelOptions,y=r.fetchUsers,v=r.onToggleMandatory,_=r.onDueDateChange,b=r.onAssigneesChange,j=r.onTitleChange,m=r.minDueDate,D=r.maxDueDate,C=r.displayConfig,k=s.useMemo(function(){return i.getRandomColorPair()},[]),F="0"===h||(null!==(u=null===(d=x.assignees)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0,w=(null!==(p=x.assignees)&&void 0!==p?p:[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)||!!(null==e?void 0:e.name)}),S=!!(null==C?void 0:C.disableRequiredButtonOnUserAdd)&&w,q="0"===h||S,B=!!S||x.isMandatory,R=s.useState(F),L=R[0],z=R[1],E=s.useState(!1),I=E[0],P=E[1];return s.useEffect(function(){var e,n;(null!==(n=null===(e=x.assignees)||void 0===e?void 0:e.length)&&void 0!==n?n:0)>0&&z(!0)},[x.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:k.backgroundColor,borderRadius:"10px",padding:"3px 12px",color:k.color,fontSize:"13px",fontWeight:500}},{children:x.headerName})),I?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n.jsx("input",{type:"text",value:x.title||"",onChange:function(e){return null==j?void 0:j(e.target.value)},onBlur:function(){return P(!1)},onKeyDown:function(e){return"Enter"===e.key&&P(!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(),P(!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:x.title})),n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),P(!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: ",B&&n.jsx("sup",e.__assign({style:{color:"red"}},{children:"*"}))]})),n.jsx(l.default,{value:null!==(g=x.dueDate)&&void 0!==g?g:null,onSet:_,id:h,minDate:null!=m?m:null,maxDate:null!=D?D:null,disabled:null==C?void 0:C.disableDueDates}),n.jsx(o.default,{})]}),n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center"}},{children:n.jsxs("button",e.__assign({type:"button",onClick:q?void 0:v,disabled:q,style:{position:"relative",width:"88px",height:"26px",border:"none",borderRadius:"999px",backgroundColor:B?"#5B4FE9":"#D1D5DB",cursor:q?"not-allowed":"pointer",opacity:q?"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:B?"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:B?"0":"18px",paddingRight:B?"18px":"0"}},{children:"Required"}))]}))})),n.jsx(t.ChevronDown,{size:20,onClick:function(e){e.stopPropagation(),z(function(e){return!e})},style:{cursor:"pointer",flexShrink:0,transition:"transform 0.2s ease",transform:L?"rotate(180deg)":"rotate(0deg)"}})]}))]})),L&&n.jsx("div",e.__assign({style:{width:"100%",height:"auto"}},{children:n.jsx(a.default,{assignees:null!==(c=x.assignees)&&void 0!==c?c:[],onAssigneeChange:b,accessLevelOptions:f,levelDetails:{head:x.headerName,title:x.title},fetchUsers:y,displayConfig:C})}))]}))};
|
|
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"),
|
|
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("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(i),d=[{label:"Edit & Approve",icon:n.jsx(t.default,{})},{label:"Edit",icon:n.jsx(s.PenLine,{size:14})},{label:"Approve",icon:n.jsx(s.UserRoundCheck,{size:14})},{label:"Notify",icon:n.jsx(s.Bell,{size:14})}],c=function(e){var n=new Date(e);return n.setHours(0,0,0,0),n},p=function(e,n){var i,s=n>0?null===(i=e[n-1])||void 0===i?void 0:i.dueDate:null;return c(s||new Date)},_=function(e,n,i){var s,a=null===(s=e[n+1])||void 0===s?void 0:s.dueDate;return a?c(a):i?c(i):null};exports.AssignReminderLevels=function(i){var t=i.title,o=i.levels,v=void 0===o?[]:o,f=i.requireFinalApproval,g=void 0!==f&&f,x=i.additionalInfo,h=i.setLevels,j=i.setRequireFinalApproval,y=i.fetchUsers,A=i.accessLevelOptions,m=void 0===A?d:A,D=i.customInfoIcon,L=i.onValidationError,E=i.customStyles,S=void 0===E?{}:E,b=i.totalLevels,I=i.finalApprovalDueDate,F=i.displayConfig,R=u.default.useState(!1),M=R[0],w=R[1],C=!!(null==F?void 0:F.disableRequiredButtonOnUserAdd),T=function(e){return(null!=e?e:[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)||!!(null==e?void 0:e.name)})};u.default.useEffect(function(){C&&(null==h||h(function(n){var i=!1,s=n.map(function(n){var s,a,l=(null!==(a=null===(s=n.assignees)||void 0===s?void 0:s.length)&&void 0!==a?a:0)>0;return n.isHidden||n.isMandatory||!l?n:(i=!0,e.__assign(e.__assign({},n),{isMandatory:!0}))});return i?s:n}))},[v,h,C]);var q,N=u.default.useMemo(function(){return Array.from({length:null!=b?b:3},function(e,n){var i;return null!==(i=v[n])&&void 0!==i?i:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[v,b]),z=(v.length>0?v:N).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 w(!0)},onMouseLeave:function(){return w(!1)}},{children:[null!=D?D:n.jsx(s.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),M?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:z.map(function(i,s){return n.jsx(a.default,{level:C&&T(i.assignees)?e.__assign(e.__assign({},i),{isMandatory:!0}):i,id:String(s),accessLevelOptions:m,fetchUsers:y,onToggleMandatory:function(){return function(n){var i,s,a,l=(null!==(a=null===(s=null===(i=v[n])||void 0===i?void 0:i.assignees)||void 0===s?void 0:s.length)&&void 0!==a?a:0)>0;C&&l||null==h||h(function(i){return i.map(function(i,s){return s===n?e.__assign(e.__assign({},i),{isMandatory:!i.isMandatory}):i})})}(s)},onDueDateChange:function(n){return function(n,i){var s;if(i){var a=c(i),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===(s=v[n+1])||void 0===s?void 0:s.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(s){return s.map(function(s,a){return a===n?e.__assign(e.__assign({},s),{dueDate:i?c(i):null}):s})})}(s,n)},onAssigneesChange:function(n){return i=s,l=(null!=(a=n)?a:[]).map(function(n){var i=n.accessLevel||n.role||"";return e.__assign(e.__assign({},n),{role:i,accessLevel:i})}),t=C&&T(l),void(null==h||h(function(n){return n.map(function(n,s){return s===i?e.__assign(e.__assign({},n),{assignees:l,isMandatory:!!t||n.isMandatory}):n})}));var i,a,l,t},onTitleChange:function(n){return function(n,i){null==h||h(function(s){return s.map(function(s,a){return a===n?e.__assign(e.__assign({},s),{title:i}):s})})}(s,n)},minDueDate:p(z,s),maxDueDate:_(z,s,I),finalApprovalDueDate:I,displayConfig:F},s)})})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.DEFAULT_ASSIGN_REMINDER_STYLES.finalApprovalBox),S.finalApprovalBox)},{children:[n.jsx(l.default,{getter:g,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"})),(q=v.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.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},S.approvalFlowItemsWrapper)},{children:q.map(function(i,a){var l,t,r=i.isHidden,o=!i.isMandatory&&!r,d=null!==(l=i.assignees)&&void 0!==l?l:[],c=r?n.jsx(s.User,{size:16}):function(e){switch(e){case 0:return n.jsx(s.Edit2,{size:16});case 1:return n.jsx(s.FileCheck,{size:16});case 2:return n.jsx(s.User,{size:16});default:return n.jsx(s.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:i.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(i,s){var a,l,t=i.role||i.accessLevel||"No role assigned";return n.jsxs(u.default.Fragment,{children:[s>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:i.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=i.id)&&void 0!==a?a:i.email)&&void 0!==l?l:s)}),o&&n.jsx("span",{children:"(Optional)"})]}))]})),a<q.length-1&&n.jsx(s.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(t=i.id)&&void 0!==t?t:a)})})))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=AssignReminderLevels.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 l,useEffect as r}from"react";import{Check 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 a,Edit2 as s,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,m,y,v,b=f.level,D=f.id,C=f.accessLevelOptions,k=f.fetchUsers,F=f.onToggleMandatory,w=f.onDueDateChange,B=f.onAssigneesChange,S=f.onTitleChange,L=f.minDueDate,R=f.maxDueDate,j=f.displayConfig,z=i(function(){return p()},[]),I="0"===D||(null!==(x=null===(h=b.assignees)||void 0===h?void 0:h.length)&&void 0!==x?x:0)>0,A=(null!==(m=b.assignees)&&void 0!==m?m:[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)||!!(null==e?void 0:e.name)}),E=!!(null==j?void 0:j.disableRequiredButtonOnUserAdd)&&A,P="0"===D||E,W=!!E||b.isMandatory,M=l(I),O=M[0],T=M[1],U=l(!1),q=U[0],N=U[1];return r(function(){var e,n;(null!==(n=null===(e=b.assignees)||void 0===e?void 0:e.length)&&void 0!==n?n:0)>0&&T(!0)},[b.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:z.backgroundColor,borderRadius:"10px",padding:"3px 12px",color:z.color,fontSize:"13px",fontWeight:500}},{children:b.headerName})),n("div",e({style:{display:"flex",alignItems:"center",gap:"6px"}},q?{children:[t("input",{type:"text",value:b.title||"",onChange:function(e){return null==S?void 0:S(e.target.value)},onBlur:function(){return N(!1)},onKeyDown:function(e){return"Enter"===e.key&&N(!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(),N(!1)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:"2px"}},{children:t(a,{size:16,color:"#10B981"})}))]}:{children:[t("span",e({style:{fontSize:"13px",fontWeight:500,color:"#374151"}},{children:b.title})),t("button",e({type:"button",onClick:function(e){e.stopPropagation(),N(!0)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:"2px"},title:"Edit Title"},{children:t(s,{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: ",W&&t("sup",e({style:{color:"red"}},{children:"*"}))]})),t(c,{value:null!==(y=b.dueDate)&&void 0!==y?y:null,onSet:w,id:D,minDate:null!=L?L:null,maxDate:null!=R?R:null,disabled:null==j?void 0:j.disableDueDates}),t(u,{})]}),t("div",e({style:{display:"flex",alignItems:"center"}},{children:n("button",e({type:"button",onClick:P?void 0:F,disabled:P,style:{position:"relative",width:"88px",height:"26px",border:"none",borderRadius:"999px",backgroundColor:W?"#5B4FE9":"#D1D5DB",cursor:P?"not-allowed":"pointer",opacity:P?"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:W?"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:W?"0":"18px",paddingRight:W?"18px":"0"}},{children:"Required"}))]}))})),t(d,{size:20,onClick:function(e){e.stopPropagation(),T(function(e){return!e})},style:{cursor:"pointer",flexShrink:0,transition:"transform 0.2s ease",transform:O?"rotate(180deg)":"rotate(0deg)"}})]}))]})),O&&t("div",e({style:{width:"100%",height:"auto"}},{children:t(g,{assignees:null!==(v=b.assignees)&&void 0!==v?v:[],onAssigneeChange:B,accessLevelOptions:C,levelDetails:{head:b.headerName,title:b.title},fetchUsers:k,displayConfig:j})}))]}))}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 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(
|
|
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 & Approve",icon:n(g,{})},{label:"Edit",icon:n(t,{size:14})},{label:"Approve",icon:n(r,{size:14})},{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,M=void 0===z?m:z,I=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),O=function(e){return(null!=e?e:[]).some(function(e){return!!(null==e?void 0:e.email)||!!(null==e?void 0:e.id)||!!(null==e?void 0:e.name)})};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 N,U=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]),V=(g.length>0?g:U).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!=I?I: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:V.map(function(i,l){return n(v,{level:k&&O(i.assignees)?e(e({},i),{isMandatory:!0}):i,id:String(l),accessLevelOptions:M,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})}),o=k&&O(r),void(null==F||F(function(n){return n.map(function(n,l){return l===i?e(e({},n),{assignees:r,isMandatory:!!o||n.isMandatory}):n})}));var i,t,r,o},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(V,l),maxDueDate:A(V,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"})),(N=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:N.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<N.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
|
|
@@ -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,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,
|
|
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,qBA6N7B"}
|
|
@@ -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;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,
|
|
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,qBAmW3B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|