@micromerce/formbuilder-react 1.0.458 → 1.0.459

Sign up to get free protection for your applications and to get access to all the features.
@@ -172,7 +172,7 @@
172
172
  .rdrDateDisplayWrapper {
173
173
  display: none;
174
174
  }
175
- `,Vo=({handleDateChange:r,hidden:n,from:o,to:i})=>{const[a,s]=(0,e.useState)([{startDate:new Date,endDate:new Date,key:"selection"}]),[l,c]=(0,e.useState)(window.matchMedia("(max-width: 615px)").matches),[u,d]=(0,e.useState)(window.matchMedia("(max-width: 1200px)").matches);window.addEventListener("resize",(()=>{const e=window.matchMedia("(max-width: 1200px)").matches;e!==u&&d(e);const t=window.matchMedia("(max-width: 615px)").matches;t!==l&&c(t)})),(0,e.useEffect)((()=>{let e=[],t=[];o&&(e=o.split("-")),i&&(t=i.split("-"));const r=o?new Date(Number(e[0]),Number(e[1])-1,Number(e[2])):new Date,n=i?new Date(Number(t[0]),Number(t[1])-1,Number(t[2])):r;s([{startDate:r,endDate:n,key:"selection"}])}),[o,i,n]);const h=(e,t)=>{s(e),e[0].startDate!==e[0].endDate&&r(e[0],t)},p=()=>{r(a[0])};return t().createElement(Xo,{hidden:n,"data-testid":"dateRangeGroup__calendarModal"},l?t().createElement("div",{style:{display:"flex",flexDirection:"column"}},t().createElement(zo.C0,{onChange:e=>h([e.selection]),moveRangeOnFirstSelection:!1,ranges:a,direction:"horizontal"}),t().createElement(ct,{variant:"contained",size:"medium",sx:{display:"flex",alignItems:"center",alignSelf:"flex-end",marginRight:"16px",marginBottom:"8px",gap:"8px",width:"fit-content",backgroundColor:"#4A96D2",boxShadow:"none","&:hover":{backgroundColor:"#0B5BA6",boxShadow:"none"}},onClick:p},t().createElement("p",{style:{all:"unset"}},"CONFIRM"),t().createElement(Lo.Z,{style:{color:"white",width:"20px",height:"20px"}}))):t().createElement("div",{style:{display:"flex",flexDirection:"column"}},t().createElement("div",{style:{display:"flex"}},t().createElement(zo.P9,{ranges:a,onChange:e=>h([e.selection],!0)}),t().createElement(zo.C0,{ranges:a,onChange:e=>h([e.selection]),showDateDisplay:!1,direction:"horizontal",months:u?1:2,"data-testid":"date-range-picker"})),t().createElement(ct,{variant:"contained",size:"medium",sx:{display:"flex",alignItems:"center",alignSelf:"flex-end",marginRight:"16px",marginBottom:"8px",gap:"8px",width:"fit-content",backgroundColor:"#4A96D2",boxShadow:"none","&:hover":{backgroundColor:"#0B5BA6",boxShadow:"none"}},onClick:p},t().createElement("p",{style:{all:"unset"}},"CONFIRM"),t().createElement(Lo.Z,{style:{color:"white",width:"20px",height:"20px"}}))))},Go=$o.div`
175
+ `,Vo=({handleDateChange:r,hidden:n,from:o,to:i})=>{const[a,s]=(0,e.useState)([{startDate:new Date,endDate:new Date,key:"selection"}]),[l,c]=(0,e.useState)(window.matchMedia("(max-width: 615px)").matches),[u,d]=(0,e.useState)(window.matchMedia("(max-width: 1200px)").matches);window.addEventListener("resize",(()=>{const e=window.matchMedia("(max-width: 1200px)").matches;e!==u&&d(e);const t=window.matchMedia("(max-width: 615px)").matches;t!==l&&c(t)})),(0,e.useEffect)((()=>{let e=[],t=[];o&&(e=o.split("-")),i&&(t=i.split("-"));const r=o?new Date(Number(e[0]),Number(e[1])-1,Number(e[2])):new Date,n=i?new Date(Number(t[0]),Number(t[1])-1,Number(t[2])):r;s([{startDate:r,endDate:n,key:"selection"}])}),[o,i,n]);const h=(e,t)=>{s(e),e[0].startDate!==e[0].endDate&&r(e[0],t)},p=()=>{r(a[0])};return t().createElement(Xo,{hidden:n,"data-testid":"dateRangeGroup__calendarModal"},l?t().createElement("div",{style:{display:"flex",flexDirection:"column"}},t().createElement(zo.C0,{onChange:e=>h([e.selection]),moveRangeOnFirstSelection:!1,ranges:a,direction:"horizontal"}),t().createElement(ct,{variant:"contained",size:"medium",sx:{display:"flex",alignItems:"center",alignSelf:"flex-end",marginRight:"16px",marginBottom:"16px",gap:"8px",width:"fit-content",backgroundColor:"#4A96D2",boxShadow:"none","&:hover":{backgroundColor:"#0B5BA6",boxShadow:"none"}},onClick:p},t().createElement("p",{style:{all:"unset"}},"CONFIRM"),t().createElement(Lo.Z,{style:{color:"white",width:"20px",height:"20px"}}))):t().createElement("div",{style:{display:"flex",flexDirection:"column"}},t().createElement("div",{style:{display:"flex"}},t().createElement(zo.P9,{ranges:a,onChange:e=>h([e.selection],!0)}),t().createElement(zo.C0,{ranges:a,onChange:e=>h([e.selection]),showDateDisplay:!1,direction:"horizontal",months:u?1:2,"data-testid":"date-range-picker"})),t().createElement(ct,{variant:"contained",size:"medium",sx:{display:"flex",alignItems:"center",alignSelf:"flex-end",marginRight:"16px",marginBottom:"16px",gap:"8px",width:"fit-content",backgroundColor:"#4A96D2",boxShadow:"none","&:hover":{backgroundColor:"#0B5BA6",boxShadow:"none"}},onClick:p},t().createElement("p",{style:{all:"unset"}},"CONFIRM"),t().createElement(Lo.Z,{style:{color:"white",width:"20px",height:"20px"}}))))},Go=$o.div`
176
176
  ${(({width:e,height:t})=>Oo`
177
177
  position: relative;
178
178
  overflow: hidden;