aravint-ui-form-controls 1.0.55 → 1.0.56
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.
|
@@ -254,4 +254,4 @@
|
|
|
254
254
|
.custom-react-datepicker__navigation--next::disabled{
|
|
255
255
|
cursor: not-allowed !important;
|
|
256
256
|
}
|
|
257
|
-
`}),x.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:x.jsx(Fm,{ref:P,...E?{selectsRange:!0}:{},dateFormat:_,placeholderText:i||k,formatWeekDay:B=>B.substring(0,3),selected:E?e??void 0:n??void 0,startDate:E?e??void 0:void 0,endDate:E?a??void 0:void 0,onChange:I,shouldCloseOnSelect:!E,calendarClassName:"cdp-calendar",minDate:$,maxDate:R,disabled:u,filterDate:A,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:B,decreaseMonth:V,increaseMonth:se,changeYear:pe,prevMonthButtonDisabled:Z,nextMonthButtonDisabled:re})=>{const Fe=B.getFullYear();return x.jsxs("div",{className:"flex items-center justify-between px-1 relative",children:[x.jsx("button",{onClick:V,disabled:Z,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"20px",lineHeight:1,color:"#4B5563",opacity:Z?.3:1},children:"‹"}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-[13px] !font-[600] !text-[#111827]",children:Hm[B.getMonth()]}),x.jsx("select",{className:"cdp-year-select",value:Fe,onChange:xe=>pe(Number(xe.target.value)),style:{fontSize:"12px",color:"#221f1f",border:"1px solid #d1d5db",borderRadius:"6px",padding:"4px 6px",background:"#fff",cursor:"pointer",outline:"none"},children:O.map(xe=>x.jsx("option",{value:xe,children:xe},xe))})]}),x.jsx("button",{onClick:se,disabled:re,className:"custom-react-datepicker__navigation--next",style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"20px",lineHeight:1,color:"#4B5563",opacity:re?.3:1},children:"›"})]})},calendarContainer:({className:B,children:V})=>x.jsxs("div",{className:B,children:[V,E&&x.jsxs("div",{className:"border-t border-gray-100 mt-2 pl-1 py-2 text-[7px] text-gray-500",children:[x.jsx("span",{style:{fontSize:"11px"},className:"font-semibold text-gray-700 text-[9px]",children:"Note:"})," ",x.jsxs("span",{style:{fontSize:"11px"},className:"mini-calendar-note",children:["Date range selection is limited to ",s," year."]})]})]}),customInput:x.jsx(Wm,{value:E?N:n?Nr(n):"",placeholder:i||k,onClear:M,showClear:E?!!e:!!n,className:m})},r)})]})}),Vm=ys,Qm=Ds,Um=xs,Km=ws,qm=({label:r,options:n,value:t,placeholder:e="Select",onChange:a,disabled:o=!1,hoverOptionStyle:i={backgroundColor:"#BEFFDB",color:"#3A264B"},selectedOptionStyle:s={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:c="Search...",showSearch:l=!0,allowCustomValue:u=!1,ArrowDownIcon:d,ArrowUpIcon:f})=>{const[p,h]=b.useState(!1),[m,v]=b.useState(""),[y,D]=b.useState(null),w=b.useRef(null),C=n.find(_=>String(_.value)===String(t)),S=n.filter(_=>_.label.toLowerCase().includes(m.toLowerCase())),k=p?f||Um:d||Qm;return b.useEffect(()=>{const _=N=>{w.current&&!w.current.contains(N.target)&&h(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]),x.jsxs("div",{className:"relative w-full",ref:w,children:[r&&x.jsx("label",{children:r}),x.jsx("div",{className:"h-8 w-full border-0 rounded-md px-2 flex items-center justify-between text-xs",style:{backgroundColor:o?"#F3F3F3":"#FFFFFF",cursor:o?"not-allowed":"pointer"},onClick:()=>!o&&h(!p),children:u?x.jsxs(x.Fragment,{children:[x.jsx("input",{type:"text",value:(C==null?void 0:C.label)||t||"",placeholder:e,disabled:o,onClick:_=>_.stopPropagation(),onFocus:()=>!o&&h(!0),onChange:_=>{const N=_.target.value;a(N),v(N),h(!0)},className:"min-w-0 flex-1 bg-transparent outline-none text-xs",style:{fontSize:"12px",fontWeight:400,color:C||t?"#1F2937":"#9CA3AF"}}),x.jsx("button",{type:"button","aria-label":p?"Close options":"Open options",disabled:o,onClick:_=>{_.stopPropagation(),h(!p)},className:"flex items-center",children:x.jsx(k,{className:"transition duration-200 text-gray-500 text-[16px]"})})]}):x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"truncate",style:{fontSize:"12px",fontWeight:400,color:C?"#1F2937":"#9CA3AF"},children:(C==null?void 0:C.label)||e}),x.jsx(k,{className:"transition duration-200 text-gray-500 text-[16px]"})]})}),p&&!o&&x.jsxs("div",{className:" absolute left-0 top-full mt-1 w-full bg-white border border-[#9CA3AF] rounded-md shadow-lg",style:{zIndex:9999},children:[l&&!u&&x.jsx("div",{className:"p-2 border-b bg-white",children:x.jsxs("div",{className:"relative",children:[x.jsx("div",{className:"absolute flex items-center justify-center pointer-events-none",style:{left:8,top:6},children:x.jsx(Vm,{className:"w-4 h-4 text-[#131B2E]"})}),x.jsx("input",{type:"text",placeholder:c,value:m,onChange:_=>v(_.target.value),className:"w-full h-9 rounded-lg text-sm text-slate-700 placeholder:text-slate-400 outline-none transition ",style:{paddingLeft:28,paddingRight:m?26:16,fontSize:12,lineHeight:"16px",border:"1px solid #E5E7EB",height:28,backgroundColor:"#F9F9F9"}}),m&&x.jsx("button",{type:"button",onClick:()=>v(""),className:"absolute flex items-center justify-center",style:{right:6,top:6,background:"none",border:"none",padding:0,cursor:"pointer"},children:x.jsx(Km,{className:"w-4 h-4 text-slate-400 hover:text-slate-600"})})]})}),x.jsx("div",{className:"overflow-x-hidden thin-scrollbar bg-white",style:{maxHeight:208,overflowY:"auto",overflowX:"hidden"},children:S.map(_=>{const N=String(t)===String(_.value),I=y===_.value,L={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",...N?s:I?i:{},...I&&!N?{transform:"translateX(2px)",fontWeight:700}:{}};return x.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:L,onMouseEnter:()=>D(_.value),onMouseLeave:()=>D(null),onClick:()=>{a(_.value),h(!1),v("")},children:_.label},_.value)})})]})]})},Gm=({value:r,icon:n})=>{const[t,e]=b.useState(!1);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[n,t&&x.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 z-[99999]",style:{top:"calc(100% + 8px)",background:"#202124",color:"#FFFFFF",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",width:"max-content",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:[r,x.jsx("div",{style:{position:"absolute",top:"-5px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:"5px solid #202124"}})]})]})},Xm=({onPaste:r,enabled:n=!0,ignoreInputs:t=!0,onNonImagePaste:e})=>{b.useEffect(()=>{if(!n)return;const a=o=>{var u,d;const i=o,s=document.activeElement;if(t&&(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||(s==null?void 0:s.getAttribute("contenteditable"))==="true"))return;const c=(u=i.clipboardData)==null?void 0:u.items;if(!c)return;const l=[];for(const f of c){if(!f.type.startsWith("image/"))continue;const p=f.getAsFile();p&&l.push(p)}if(!l.length){e==null||e();return}(d=i.preventDefault)==null||d.call(i),r(l)};return document.addEventListener("paste",a),()=>{document.removeEventListener("paste",a)}},[n,t,r,e])};exports.Checkbox=sc;exports.CustomDatePicker=zm;exports.DragDropUpload=Kd;exports.Input=Cs;exports.MultiSelect=Ud;exports.Radio=oc;exports.Select=Gd;exports.SingleSelect=qm;exports.Textarea=Jo;exports.ToggleSwitch=ic;exports.Tooltip=Gm;exports.useClipboardImagePaste=Xm;
|
|
257
|
+
`}),x.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:x.jsx(Fm,{ref:P,...E?{selectsRange:!0}:{},dateFormat:_,placeholderText:i||k,formatWeekDay:B=>B.substring(0,3),selected:E?e??void 0:n??void 0,startDate:E?e??void 0:void 0,endDate:E?a??void 0:void 0,onChange:I,shouldCloseOnSelect:!E,calendarClassName:"cdp-calendar",minDate:$,maxDate:R,disabled:u,filterDate:A,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:B,decreaseMonth:V,increaseMonth:se,changeYear:pe,prevMonthButtonDisabled:Z,nextMonthButtonDisabled:re})=>{const Fe=B.getFullYear();return x.jsxs("div",{className:"flex items-center justify-between px-1 relative",children:[x.jsx("button",{onClick:V,disabled:Z,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"20px",lineHeight:1,color:"#4B5563",opacity:Z?.3:1},children:"‹"}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-[13px] !font-[600] !text-[#111827]",children:Hm[B.getMonth()]}),x.jsx("select",{className:"cdp-year-select",value:Fe,onChange:xe=>pe(Number(xe.target.value)),style:{fontSize:"12px",color:"#221f1f",border:"1px solid #d1d5db",borderRadius:"6px",padding:"4px 6px",background:"#fff",cursor:"pointer",outline:"none"},children:O.map(xe=>x.jsx("option",{value:xe,children:xe},xe))})]}),x.jsx("button",{onClick:se,disabled:re,className:"custom-react-datepicker__navigation--next",style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"20px",lineHeight:1,color:"#4B5563",opacity:re?.3:1},children:"›"})]})},calendarContainer:({className:B,children:V})=>x.jsxs("div",{className:B,children:[V,E&&x.jsxs("div",{className:"border-t border-gray-100 mt-2 pl-1 py-2 text-[7px] text-gray-500",children:[x.jsx("span",{style:{fontSize:"11px"},className:"font-semibold text-gray-700 text-[9px]",children:"Note:"})," ",x.jsxs("span",{style:{fontSize:"11px"},className:"mini-calendar-note",children:["Date range selection is limited to ",s," year."]})]})]}),customInput:x.jsx(Wm,{value:E?N:n?Nr(n):"",placeholder:i||k,onClear:M,showClear:E?!!e:!!n,className:m})},r)})]})}),Vm=ys,Qm=Ds,Um=xs,Km=ws,qm=({label:r,options:n,value:t,placeholder:e="Select",onChange:a,disabled:o=!1,hoverOptionStyle:i={backgroundColor:"#BEFFDB",color:"#3A264B"},selectedOptionStyle:s={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:c="Search...",showSearch:l=!0,allowCustomValue:u=!1,ArrowDownIcon:d,ArrowUpIcon:f})=>{const[p,h]=b.useState(!1),[m,v]=b.useState(""),[y,D]=b.useState(null),w=b.useRef(null),C=n.find(_=>String(_.value)===String(t)),S=n.filter(_=>_.label.toLowerCase().includes(m.toLowerCase())),k=p?f||Um:d||Qm;return b.useEffect(()=>{const _=N=>{w.current&&!w.current.contains(N.target)&&h(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]),x.jsxs("div",{className:"relative w-full",ref:w,children:[r&&x.jsx("label",{children:r}),x.jsx("div",{className:"h-8 w-full border-0 rounded-md px-2 flex items-center justify-between text-xs",style:{backgroundColor:o?"#F3F3F3":"#FFFFFF",cursor:o?"not-allowed":"pointer"},onClick:()=>!o&&h(!p),children:u?x.jsxs(x.Fragment,{children:[x.jsx("input",{type:"text",value:(C==null?void 0:C.label)||t||"",placeholder:e,disabled:o,onClick:_=>_.stopPropagation(),onFocus:()=>!o&&h(!0),onChange:_=>{const N=_.target.value;a(N),v(N),h(!0)},className:"min-w-0 flex-1 bg-transparent outline-none text-xs",style:{fontSize:"12px",fontWeight:400,color:C||t?"#1F2937":"#9CA3AF"}}),x.jsx("button",{type:"button","aria-label":p?"Close options":"Open options",disabled:o,onClick:_=>{_.stopPropagation(),h(!p)},className:"flex items-center",children:x.jsx(k,{className:"transition duration-200 text-gray-500 text-[16px]"})})]}):x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"truncate",style:{fontSize:"12px",fontWeight:400,color:C?"#1F2937":"#9CA3AF"},children:(C==null?void 0:C.label)||e}),x.jsx(k,{className:"transition duration-200 text-gray-500 text-[16px]"})]})}),p&&!o&&(!u||S.length>0)&&x.jsxs("div",{className:" absolute left-0 top-full mt-1 w-full bg-white border border-[#9CA3AF] rounded-md shadow-lg",style:{zIndex:9999},children:[l&&!u&&x.jsx("div",{className:"p-2 border-b bg-white",children:x.jsxs("div",{className:"relative",children:[x.jsx("div",{className:"absolute flex items-center justify-center pointer-events-none",style:{left:8,top:6},children:x.jsx(Vm,{className:"w-4 h-4 text-[#131B2E]"})}),x.jsx("input",{type:"text",placeholder:c,value:m,onChange:_=>v(_.target.value),className:"w-full h-9 rounded-lg text-sm text-slate-700 placeholder:text-slate-400 outline-none transition ",style:{paddingLeft:28,paddingRight:m?26:16,fontSize:12,lineHeight:"16px",border:"1px solid #E5E7EB",height:28,backgroundColor:"#F9F9F9"}}),m&&x.jsx("button",{type:"button",onClick:()=>v(""),className:"absolute flex items-center justify-center",style:{right:6,top:6,background:"none",border:"none",padding:0,cursor:"pointer"},children:x.jsx(Km,{className:"w-4 h-4 text-slate-400 hover:text-slate-600"})})]})}),x.jsx("div",{className:"overflow-x-hidden thin-scrollbar bg-white",style:{maxHeight:208,overflowY:"auto",overflowX:"hidden"},children:S.map(_=>{const N=String(t)===String(_.value),I=y===_.value,L={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",...N?s:I?i:{},...I&&!N?{transform:"translateX(2px)",fontWeight:700}:{}};return x.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:L,onMouseEnter:()=>D(_.value),onMouseLeave:()=>D(null),onClick:()=>{a(_.value),h(!1),v("")},children:_.label},_.value)})})]})]})},Gm=({value:r,icon:n})=>{const[t,e]=b.useState(!1);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[n,t&&x.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 z-[99999]",style:{top:"calc(100% + 8px)",background:"#202124",color:"#FFFFFF",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",width:"max-content",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:[r,x.jsx("div",{style:{position:"absolute",top:"-5px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:"5px solid #202124"}})]})]})},Xm=({onPaste:r,enabled:n=!0,ignoreInputs:t=!0,onNonImagePaste:e})=>{b.useEffect(()=>{if(!n)return;const a=o=>{var u,d;const i=o,s=document.activeElement;if(t&&(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||(s==null?void 0:s.getAttribute("contenteditable"))==="true"))return;const c=(u=i.clipboardData)==null?void 0:u.items;if(!c)return;const l=[];for(const f of c){if(!f.type.startsWith("image/"))continue;const p=f.getAsFile();p&&l.push(p)}if(!l.length){e==null||e();return}(d=i.preventDefault)==null||d.call(i),r(l)};return document.addEventListener("paste",a),()=>{document.removeEventListener("paste",a)}},[n,t,r,e])};exports.Checkbox=sc;exports.CustomDatePicker=zm;exports.DragDropUpload=Kd;exports.Input=Cs;exports.MultiSelect=Ud;exports.Radio=oc;exports.Select=Gd;exports.SingleSelect=qm;exports.Textarea=Jo;exports.ToggleSwitch=ic;exports.Tooltip=Gm;exports.useClipboardImagePaste=Xm;
|
package/dist/form-controls.es.js
CHANGED
|
@@ -13875,7 +13875,7 @@ const hv = Uo(
|
|
|
13875
13875
|
] })
|
|
13876
13876
|
}
|
|
13877
13877
|
),
|
|
13878
|
-
p && !o && /* @__PURE__ */ Q(
|
|
13878
|
+
p && !o && (!u || S.length > 0) && /* @__PURE__ */ Q(
|
|
13879
13879
|
"div",
|
|
13880
13880
|
{
|
|
13881
13881
|
className: " absolute left-0 top-full mt-1 w-full bg-white border border-[#9CA3AF] rounded-md shadow-lg",
|