aravint-ui-form-controls 1.0.62 → 1.0.63
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.
|
@@ -265,4 +265,4 @@
|
|
|
265
265
|
.custom-react-datepicker__navigation--next::disabled{
|
|
266
266
|
cursor: not-allowed !important;
|
|
267
267
|
}
|
|
268
|
-
`}),x.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:x.jsx(Wm,{ref:P,...E?{selectsRange:!0}:{},dateFormat:S,placeholderText:i||D,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:A,shouldCloseOnSelect:!E,calendarClassName:"cdp-calendar",minDate:$,maxDate:R,disabled:u,filterDate:I,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:$m[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(Bm,{value:E?N:n?Nr(n):"",placeholder:i||D,onClear:M,showClear:E?!!e:!!n,className:m})},r)})]})}),Um=ys,Km=Ds,qm=xs,Gm=ws,Xm=({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,k]=b.useState(null),w=b.useRef(null),C=n.find(S=>String(S.value)===String(t)),_=n.filter(S=>S.label.toLowerCase().includes(m.toLowerCase())),D=p?f||qm:d||Km;return b.useEffect(()=>{const S=N=>{w.current&&!w.current.contains(N.target)&&h(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),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:S=>S.stopPropagation(),onFocus:()=>!o&&h(!0),onChange:S=>{const N=S.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:S=>{S.stopPropagation(),h(!p)},className:"flex items-center",children:x.jsx(D,{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(D,{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&&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(Um,{className:"w-4 h-4 text-[#131B2E]"})}),x.jsx("input",{type:"text",placeholder:c,value:m,onChange:S=>v(S.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(Gm,{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:_.map(S=>{const N=String(t)===String(S.value),A=y===S.value,L={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",...N?s:A?i:{},...A&&!N?{transform:"translateX(2px)",fontWeight:700}:{}};return x.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:L,onMouseEnter:()=>k(S.value),onMouseLeave:()=>k(null),onClick:()=>{a(S.value),h(!1),v("")},children:S.label},S.value)})})]})]})},Zm=({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"}})]})]})},Jm=({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=Qm;exports.DragDropUpload=Kd;exports.Input=Cs;exports.MultiSelect=Ud;exports.Radio=oc;exports.Select=Gd;exports.SingleSelect=Xm;exports.Textarea=Jo;exports.ToggleSwitch=ic;exports.Tooltip=Zm;exports.useClipboardImagePaste=Jm;
|
|
268
|
+
`}),x.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:x.jsx(Wm,{ref:P,...E?{selectsRange:!0}:{},dateFormat:S,placeholderText:i||D,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:A,shouldCloseOnSelect:!E,calendarClassName:"cdp-calendar",minDate:$,maxDate:R,disabled:u,filterDate:I,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:$m[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(Bm,{value:E?N:n?Nr(n):"",placeholder:i||D,onClear:M,showClear:E?!!e:!!n,className:m})},r)})]})}),Um=ys,Km=Ds,qm=xs,Gm=ws,Xm=({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,k]=b.useState(null),w=b.useRef(null),C=n.find(S=>String(S.value)===String(t)),_=n.filter(S=>S.label.toLowerCase().includes(m.toLowerCase())),D=p?f||qm:d||Km;return b.useEffect(()=>{const S=N=>{w.current&&!w.current.contains(N.target)&&h(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),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:S=>S.stopPropagation(),onFocus:()=>!o&&h(!0),onChange:S=>{const N=S.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:S=>{S.stopPropagation(),h(!p)},className:"flex items-center",children:x.jsx(D,{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(D,{className:"transition duration-200 text-gray-500 text-[16px]"})]})}),p&&!o&&(!u||_.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(Um,{className:"w-4 h-4 text-[#131B2E]"})}),x.jsx("input",{type:"text",placeholder:c,value:m,onChange:S=>v(S.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(Gm,{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:_.map(S=>{const N=String(t)===String(S.value),A=y===S.value,L={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",...N?s:A?i:{},...A&&!N?{transform:"translateX(2px)",fontWeight:700}:{}};return x.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:L,onMouseEnter:()=>k(S.value),onMouseLeave:()=>k(null),onClick:()=>{a(S.value),h(!1),v("")},children:S.label},S.value)})})]})]})},Zm=({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"}})]})]})},Jm=({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=Qm;exports.DragDropUpload=Kd;exports.Input=Cs;exports.MultiSelect=Ud;exports.Radio=oc;exports.Select=Gd;exports.SingleSelect=Xm;exports.Textarea=Jo;exports.ToggleSwitch=ic;exports.Tooltip=Zm;exports.useClipboardImagePaste=Jm;
|
package/dist/form-controls.es.js
CHANGED
|
@@ -13955,13 +13955,13 @@ const vv = Uo(
|
|
|
13955
13955
|
] })
|
|
13956
13956
|
}
|
|
13957
13957
|
),
|
|
13958
|
-
p && !o && /* @__PURE__ */ j(
|
|
13958
|
+
p && !o && (!u || _.length > 0) && /* @__PURE__ */ j(
|
|
13959
13959
|
"div",
|
|
13960
13960
|
{
|
|
13961
13961
|
className: " absolute left-0 top-full mt-1 w-full bg-white border border-[#9CA3AF] rounded-md shadow-lg",
|
|
13962
13962
|
style: { zIndex: 9999 },
|
|
13963
13963
|
children: [
|
|
13964
|
-
l && /* @__PURE__ */ S("div", { className: "p-2 border-b bg-white", children: /* @__PURE__ */ j("div", { className: "relative", children: [
|
|
13964
|
+
l && !u && /* @__PURE__ */ S("div", { className: "p-2 border-b bg-white", children: /* @__PURE__ */ j("div", { className: "relative", children: [
|
|
13965
13965
|
/* @__PURE__ */ S(
|
|
13966
13966
|
"div",
|
|
13967
13967
|
{
|