aravint-ui-form-controls 1.0.41 → 1.0.42
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.
|
@@ -223,4 +223,4 @@
|
|
|
223
223
|
appearance: auto;
|
|
224
224
|
-webkit-appearance: menulist;
|
|
225
225
|
}
|
|
226
|
-
`}),k.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:k.jsx(gm,{ref:O,...w?{selectsRange:!0}:{},dateFormat:I,placeholderText:i||_,formatWeekDay:A=>A.substring(0,3),selected:w?e??void 0:n??void 0,startDate:w?e??void 0:void 0,endDate:w?a??void 0:void 0,onChange:E,shouldCloseOnSelect:!w,calendarClassName:"cdp-calendar",minDate:c??void 0,maxDate:l??void 0,disabled:u,filterDate:R,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:A,decreaseMonth:N,increaseMonth:M,changeYear:z,prevMonthButtonDisabled:q,nextMonthButtonDisabled:ve})=>{const Me=A.getFullYear();return k.jsxs("div",{className:"flex items-center justify-between px-1 relative",children:[k.jsx("button",{onClick:N,disabled:q,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:q?.3:1},children:"‹"}),k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("span",{className:"text-[14px] font-bold text-gray-900",children:xm[A.getMonth()]}),k.jsx("select",{className:"cdp-year-select",value:Me,onChange:ee=>z(Number(ee.target.value)),style:{fontSize:"13px",fontWeight:600,color:"#221f1f",border:`1px solid ${f}`,borderRadius:"6px",padding:"2px 6px",background:"#fff",cursor:"pointer",outline:"none"},children:B.map(ee=>k.jsx("option",{value:ee,children:ee},ee))})]}),k.jsx("button",{onClick:M,disabled:ve,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:ve?.3:1},children:"›"})]})},calendarContainer:({className:A,children:N})=>k.jsxs("div",{className:A,children:[N,w&&k.jsxs("div",{className:"border-t border-gray-100 mt-2 pl-1 py-2 text-[7px] text-gray-500",children:[k.jsx("span",{style:{fontSize:"11px"},className:"font-semibold text-gray-700 text-[9px]",children:"Note:"})," ",k.jsxs("span",{style:{fontSize:"11px"},className:"text-[9px] text-gray-500",children:["Date range selection is limited to ",s," year."]})]})]}),customInput:k.jsx(wm,{value:w?W:n?Ir(n):"",placeholder:i||_,onClear:j,showClear:w?!!e:!!n,className:m})},r)})]})});var Fs={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},No=g.createContext&&g.createContext(Fs),Cm=["attr","size","title"];function Sm(r,n){if(r==null)return{};var t,e,a=_m(r,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)t=o[e],n.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(a[t]=r[t])}return a}function _m(r,n){if(r==null)return{};var t={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(n.indexOf(e)!==-1)continue;t[e]=r[e]}return t}function rn(){return rn=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var e in t)({}).hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},rn.apply(null,arguments)}function To(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,e)}return t}function nn(r){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?To(Object(t),!0).forEach(function(e){Em(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):To(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function Em(r,n,t){return(n=Mm(n))in r?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,r}function Mm(r){var n=Pm(r,"string");return typeof n=="symbol"?n:n+""}function Pm(r,n){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var e=t.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function Ls(r){return r&&r.map((n,t)=>g.createElement(n.tag,nn({key:t},n.attr),Ls(n.child)))}function mn(r){return n=>g.createElement(Om,rn({attr:nn({},r.attr)},n),Ls(r.child))}function Om(r){var n=t=>{var e=r.attr,a=r.size,o=r.title,i=Sm(r,Cm),s=a||t.size||"1em",c;return t.className&&(c=t.className),r.className&&(c=(c?c+" ":"")+r.className),g.createElement("svg",rn({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,e,i,{className:c,style:nn(nn({color:r.color||t.color},t.style),r.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&g.createElement("title",null,o),r.children)};return No!==void 0?g.createElement(No.Consumer,null,t=>n(t)):n(Fs)}function Rm(r){return mn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 428 339.92 303.9a160.48 160.48 0 0 0 30.72-94.58C370.64 120.37 298.27 48 209.32 48S48 120.37 48 209.32s72.37 161.32 161.32 161.32a160.48 160.48 0 0 0 94.58-30.72L428 464zM209.32 319.69a110.38 110.38 0 1 1 110.37-110.37 110.5 110.5 0 0 1-110.37 110.37"},child:[]}]})(r)}function Nm(r){return mn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M400 145.49 366.51 112 256 222.51 145.49 112 112 145.49 222.51 256 112 366.51 145.49 400 256 289.49 366.51 400 400 366.51 289.49 256z"},child:[]}]})(r)}function Tm(r){return mn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"},child:[]}]})(r)}function Im(r){return mn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"},child:[]}]})(r)}const Am=Rm,Fm=Im,Lm=Tm,Ym=Nm,Wm=({label:r,options:n,value:t,placeholder:e="Select",onChange:a,disabled:o=!1,hoverOptionStyle:i={backgroundColor:"#BEFFDB",color:"#13785F"},selectedOptionStyle:s={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:c="Search...",showSearch:l=!0,ArrowDownIcon:u,ArrowUpIcon:d})=>{const[f,p]=g.useState(!1),[h,m]=g.useState(""),[v,y]=g.useState(null),x=g.useRef(null),D=n.find(w=>String(w.value)===String(t)),C=n.filter(w=>w.label.toLowerCase().includes(h.toLowerCase())),O=f?d||Lm:u||Fm;return g.useEffect(()=>{const w=_=>{x.current&&!x.current.contains(_.target)&&p(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]),k.jsxs("div",{className:"relative w-full",ref:x,children:[r&&k.jsx("label",{children:r}),k.jsxs("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&&p(!f),children:[k.jsx("span",{className:"truncate",style:{fontSize:"12px",fontWeight:400,color:D?"#1F2937":"#9CA3AF"},children:(D==null?void 0:D.label)||e}),k.jsx(O,{className:"transition duration-200 text-gray-500 text-[16px]"})]}),f&&!o&&k.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&&k.jsx("div",{className:"p-2 border-b bg-white",children:k.jsxs("div",{className:"relative",children:[k.jsx("div",{className:"absolute flex items-center justify-center pointer-events-none",style:{left:8,top:6},children:k.jsx(Am,{className:"w-4 h-4 text-slate-400"})}),k.jsx("input",{type:"text",placeholder:c,value:h,onChange:w=>m(w.target.value),className:"w-full h-9 rounded-lg border border-[#D1D5DB] text-sm text-slate-700 placeholder:text-slate-400 outline-none transition focus:border-[#10B981] focus:ring-1 focus:ring-[#10B981]/20",style:{paddingLeft:28,paddingRight:h?26:16,fontSize:12,lineHeight:"16px",height:28,backgroundColor:"#F9F9F9"}}),h&&k.jsx("button",{type:"button",onClick:()=>m(""),className:"absolute flex items-center justify-center",style:{right:6,top:6,background:"none",border:"none",padding:0,cursor:"pointer"},children:k.jsx(Ym,{className:"w-4 h-4 text-slate-400 hover:text-slate-600"})})]})}),k.jsx("div",{className:"overflow-x-hidden bg-white",style:{maxHeight:208,overflowY:"auto",overflowX:"hidden"},children:C.map(w=>{const _=String(t)===String(w.value),I=v===w.value,E={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",..._?s:I?i:{},...I&&!_?{transform:"translateX(2px)",fontWeight:700}:{}};return k.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:E,onMouseEnter:()=>y(w.value),onMouseLeave:()=>y(null),onClick:()=>{a(w.value),p(!1),m("")},children:w.label},w.value)})})]})]})},jm=({value:r,icon:n})=>{const[t,e]=g.useState(!1);return k.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[n,t&&k.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,k.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"}})]})]})},Hm=({onPaste:r,enabled:n=!0,ignoreInputs:t=!0,onNonImagePaste:e})=>{g.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=Qs;exports.CustomDatePicker=km;exports.DragDropUpload=Pd;exports.Input=ss;exports.MultiSelect=Md;exports.Radio=zs;exports.Select=Rd;exports.SingleSelect=Wm;exports.Textarea=Ko;exports.ToggleSwitch=Vs;exports.Tooltip=jm;exports.useClipboardImagePaste=Hm;
|
|
226
|
+
`}),k.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:k.jsx(gm,{ref:O,...w?{selectsRange:!0}:{},dateFormat:I,placeholderText:i||_,formatWeekDay:A=>A.substring(0,3),selected:w?e??void 0:n??void 0,startDate:w?e??void 0:void 0,endDate:w?a??void 0:void 0,onChange:E,shouldCloseOnSelect:!w,calendarClassName:"cdp-calendar",minDate:c??void 0,maxDate:l??void 0,disabled:u,filterDate:R,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:A,decreaseMonth:N,increaseMonth:M,changeYear:z,prevMonthButtonDisabled:q,nextMonthButtonDisabled:ve})=>{const Me=A.getFullYear();return k.jsxs("div",{className:"flex items-center justify-between px-1 relative",children:[k.jsx("button",{onClick:N,disabled:q,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:q?.3:1},children:"‹"}),k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("span",{className:"text-[14px] font-bold text-gray-900",children:xm[A.getMonth()]}),k.jsx("select",{className:"cdp-year-select",value:Me,onChange:ee=>z(Number(ee.target.value)),style:{fontSize:"13px",fontWeight:600,color:"#221f1f",border:`1px solid ${f}`,borderRadius:"6px",padding:"2px 6px",background:"#fff",cursor:"pointer",outline:"none"},children:B.map(ee=>k.jsx("option",{value:ee,children:ee},ee))})]}),k.jsx("button",{onClick:M,disabled:ve,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:ve?.3:1},children:"›"})]})},calendarContainer:({className:A,children:N})=>k.jsxs("div",{className:A,children:[N,w&&k.jsxs("div",{className:"border-t border-gray-100 mt-2 pl-1 py-2 text-[7px] text-gray-500",children:[k.jsx("span",{style:{fontSize:"11px"},className:"font-semibold text-gray-700 text-[9px]",children:"Note:"})," ",k.jsxs("span",{style:{fontSize:"11px"},className:"text-[9px] text-gray-500",children:["Date range selection is limited to ",s," year."]})]})]}),customInput:k.jsx(wm,{value:w?W:n?Ir(n):"",placeholder:i||_,onClear:j,showClear:w?!!e:!!n,className:m})},r)})]})});var Fs={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},No=g.createContext&&g.createContext(Fs),Cm=["attr","size","title"];function Sm(r,n){if(r==null)return{};var t,e,a=_m(r,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)t=o[e],n.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(a[t]=r[t])}return a}function _m(r,n){if(r==null)return{};var t={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(n.indexOf(e)!==-1)continue;t[e]=r[e]}return t}function rn(){return rn=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var e in t)({}).hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},rn.apply(null,arguments)}function To(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,e)}return t}function nn(r){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?To(Object(t),!0).forEach(function(e){Em(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):To(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function Em(r,n,t){return(n=Mm(n))in r?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,r}function Mm(r){var n=Pm(r,"string");return typeof n=="symbol"?n:n+""}function Pm(r,n){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var e=t.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function Ls(r){return r&&r.map((n,t)=>g.createElement(n.tag,nn({key:t},n.attr),Ls(n.child)))}function mn(r){return n=>g.createElement(Om,rn({attr:nn({},r.attr)},n),Ls(r.child))}function Om(r){var n=t=>{var e=r.attr,a=r.size,o=r.title,i=Sm(r,Cm),s=a||t.size||"1em",c;return t.className&&(c=t.className),r.className&&(c=(c?c+" ":"")+r.className),g.createElement("svg",rn({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,e,i,{className:c,style:nn(nn({color:r.color||t.color},t.style),r.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&g.createElement("title",null,o),r.children)};return No!==void 0?g.createElement(No.Consumer,null,t=>n(t)):n(Fs)}function Rm(r){return mn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 428 339.92 303.9a160.48 160.48 0 0 0 30.72-94.58C370.64 120.37 298.27 48 209.32 48S48 120.37 48 209.32s72.37 161.32 161.32 161.32a160.48 160.48 0 0 0 94.58-30.72L428 464zM209.32 319.69a110.38 110.38 0 1 1 110.37-110.37 110.5 110.5 0 0 1-110.37 110.37"},child:[]}]})(r)}function Nm(r){return mn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M400 145.49 366.51 112 256 222.51 145.49 112 112 145.49 222.51 256 112 366.51 145.49 400 256 289.49 366.51 400 400 366.51 289.49 256z"},child:[]}]})(r)}function Tm(r){return mn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"},child:[]}]})(r)}function Im(r){return mn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"},child:[]}]})(r)}const Am=Rm,Fm=Im,Lm=Tm,Ym=Nm,Wm=({label:r,options:n,value:t,placeholder:e="Select",onChange:a,disabled:o=!1,hoverOptionStyle:i={backgroundColor:"#BEFFDB",color:"#13785F"},selectedOptionStyle:s={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:c="Search...",showSearch:l=!0,ArrowDownIcon:u,ArrowUpIcon:d})=>{const[f,p]=g.useState(!1),[h,m]=g.useState(""),[v,y]=g.useState(null),x=g.useRef(null),D=n.find(w=>String(w.value)===String(t)),C=n.filter(w=>w.label.toLowerCase().includes(h.toLowerCase())),O=f?d||Lm:u||Fm;return g.useEffect(()=>{const w=_=>{x.current&&!x.current.contains(_.target)&&p(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]),k.jsxs("div",{className:"relative w-full",ref:x,children:[r&&k.jsx("label",{children:r}),k.jsxs("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&&p(!f),children:[k.jsx("span",{className:"truncate",style:{fontSize:"12px",fontWeight:400,color:D?"#1F2937":"#9CA3AF"},children:(D==null?void 0:D.label)||e}),k.jsx(O,{className:"transition duration-200 text-gray-500 text-[16px]"})]}),f&&!o&&k.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&&k.jsx("div",{className:"p-2 border-b bg-white",children:k.jsxs("div",{className:"relative",children:[k.jsx("div",{className:"absolute flex items-center justify-center pointer-events-none",style:{left:8,top:6},children:k.jsx(Am,{className:"w-4 h-4 text-slate-400"})}),k.jsx("input",{type:"text",placeholder:c,value:h,onChange:w=>m(w.target.value),className:"w-full h-9 rounded-lg border border-[#D1D5DB] text-sm text-slate-700 placeholder:text-slate-400 outline-none transition focus:border-[#10B981] focus:ring-1 focus:ring-[#10B981]/20",style:{paddingLeft:28,paddingRight:h?26:16,fontSize:12,lineHeight:"16px",height:28,backgroundColor:"#F9F9F9"}}),h&&k.jsx("button",{type:"button",onClick:()=>m(""),className:"absolute flex items-center justify-center",style:{right:6,top:6,background:"none",border:"none",padding:0,cursor:"pointer"},children:k.jsx(Ym,{className:"w-4 h-4 text-slate-400 hover:text-slate-600"})})]})}),k.jsx("div",{className:"overflow-x-hidden thin-scrollbar bg-white",style:{maxHeight:208,overflowY:"auto",overflowX:"hidden"},children:C.map(w=>{const _=String(t)===String(w.value),I=v===w.value,E={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",..._?s:I?i:{},...I&&!_?{transform:"translateX(2px)",fontWeight:700}:{}};return k.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:E,onMouseEnter:()=>y(w.value),onMouseLeave:()=>y(null),onClick:()=>{a(w.value),p(!1),m("")},children:w.label},w.value)})})]})]})},jm=({value:r,icon:n})=>{const[t,e]=g.useState(!1);return k.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[n,t&&k.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,k.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"}})]})]})},Hm=({onPaste:r,enabled:n=!0,ignoreInputs:t=!0,onNonImagePaste:e})=>{g.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=Qs;exports.CustomDatePicker=km;exports.DragDropUpload=Pd;exports.Input=ss;exports.MultiSelect=Md;exports.Radio=zs;exports.Select=Rd;exports.SingleSelect=Wm;exports.Textarea=Ko;exports.ToggleSwitch=Vs;exports.Tooltip=jm;exports.useClipboardImagePaste=Hm;
|
package/dist/form-controls.es.js
CHANGED
|
@@ -13719,7 +13719,7 @@ const zm = Wm, Vm = $m, jm = Bm, Qm = Hm, sv = ({
|
|
|
13719
13719
|
/* @__PURE__ */ C(
|
|
13720
13720
|
"div",
|
|
13721
13721
|
{
|
|
13722
|
-
className: "overflow-x-hidden bg-white",
|
|
13722
|
+
className: "overflow-x-hidden thin-scrollbar bg-white",
|
|
13723
13723
|
style: { maxHeight: 208, overflowY: "auto", overflowX: "hidden" },
|
|
13724
13724
|
children: k.map((y) => {
|
|
13725
13725
|
const S = String(t) === String(y.value), I = v === y.value, E = {
|