aravint-ui-form-controls 1.0.21 → 1.0.23
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.
|
@@ -160,4 +160,4 @@
|
|
|
160
160
|
.cdp-calendar .react-datepicker__day--today {
|
|
161
161
|
font-weight: 700 !important;
|
|
162
162
|
}
|
|
163
|
-
`}),y.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:y.jsx(Nu,{ref:P,...S?{selectsRange:!0}:{},dateFormat:b,placeholderText:s||F,selected:S?e??void 0:a??void 0,startDate:S?e??void 0:void 0,endDate:S?r??void 0:void 0,onChange:R,shouldCloseOnSelect:!S,calendarClassName:"cdp-calendar",minDate:l??void 0,maxDate:c??void 0,disabled:u,filterDate:E,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:I,decreaseMonth:L,increaseMonth:B,prevMonthButtonDisabled:W,nextMonthButtonDisabled:Y})=>y.jsxs("div",{className:"flex items-center justify-between px-1",children:[y.jsx("button",{onClick:L,disabled:W,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:W?.3:1},children:"‹"}),y.jsxs("span",{className:"text-[14px] font-bold text-gray-900",children:[Iu[I.getMonth()]," ",I.getFullYear()]}),y.jsx("button",{onClick:B,disabled:Y,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:Y?.3:1},children:"›"})]}),calendarContainer:({className:I,children:L})=>y.jsxs("div",{className:I,children:[L,S&&y.jsxs("div",{className:"border-t border-gray-100 mt-2 px-1 py-2 text-[11px] text-gray-500",children:[y.jsx("span",{className:"font-semibold text-gray-700",children:"Note:"})," ","Date range selection is limited to ",i," year."]})]}),customInput:y.jsx(Fu,{value:S?_:a?er(a):"",placeholder:s||F,onClear:j,showClear:S?!!e:!!a,className:v})},n)})]})});var so={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},aa=m.createContext&&m.createContext(so),Au=["attr","size","title"];function Wu(n,a){if(n==null)return{};var t,e,r=Hu(n,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(e=0;e<o.length;e++)t=o[e],a.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Hu(n,a){if(n==null)return{};var t={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(a.indexOf(e)!==-1)continue;t[e]=n[e]}return t}function yr(){return yr=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var e in t)({}).hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},yr.apply(null,arguments)}function oa(n,a){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);a&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,e)}return t}function xr(n){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?arguments[a]:{};a%2?oa(Object(t),!0).forEach(function(e){ju(n,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}return n}function ju(n,a,t){return(a=Bu(a))in n?Object.defineProperty(n,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[a]=t,n}function Bu(n){var a=zu(n,"string");return typeof a=="symbol"?a:a+""}function zu(n,a){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,a);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}function io(n){return n&&n.map((a,t)=>m.createElement(a.tag,xr({key:t},a.attr),io(a.child)))}function pn(n){return a=>m.createElement(Qu,yr({attr:xr({},n.attr)},a),io(n.child))}function Qu(n){var a=t=>{var e=n.attr,r=n.size,o=n.title,s=Wu(n,Au),i=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),m.createElement("svg",yr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,e,s,{className:l,style:xr(xr({color:n.color||t.color},t.style),n.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),n.children)};return aa!==void 0?m.createElement(aa.Consumer,null,t=>a(t)):a(so)}function Vu(n){return pn({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:[]}]})(n)}function Ku(n){return pn({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:[]}]})(n)}function $u(n){return pn({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:[]}]})(n)}const qu=Vu,Uu=$u,Gu=Ku,Xu=({label:n,options:a,value:t,placeholder:e="Select",onChange:r,disabled:o=!1,hoverOptionStyle:s={backgroundColor:"#BEFFDB",color:"#13785F"},selectedOptionStyle:i={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:l="Search...",showSearch:c=!0,ArrowDownIcon:u,ArrowUpIcon:d})=>{const[p,f]=m.useState(!1),[h,v]=m.useState(""),[g,w]=m.useState(null),x=m.useRef(null),D=a.find(b=>String(b.value)===String(t)),C=a.filter(b=>b.label.toLowerCase().includes(h.toLowerCase())),F=p?d||Gu:u||Uu;return m.useEffect(()=>{const b=_=>{x.current&&!x.current.contains(_.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]),y.jsxs("div",{className:"relative w-full",ref:x,children:[n&&y.jsx("label",{children:n}),y.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&&f(!p),children:[y.jsx("span",{className:"truncate
|
|
163
|
+
`}),y.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:y.jsx(Nu,{ref:P,...S?{selectsRange:!0}:{},dateFormat:b,placeholderText:s||F,selected:S?e??void 0:a??void 0,startDate:S?e??void 0:void 0,endDate:S?r??void 0:void 0,onChange:R,shouldCloseOnSelect:!S,calendarClassName:"cdp-calendar",minDate:l??void 0,maxDate:c??void 0,disabled:u,filterDate:E,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:I,decreaseMonth:L,increaseMonth:B,prevMonthButtonDisabled:W,nextMonthButtonDisabled:Y})=>y.jsxs("div",{className:"flex items-center justify-between px-1",children:[y.jsx("button",{onClick:L,disabled:W,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:W?.3:1},children:"‹"}),y.jsxs("span",{className:"text-[14px] font-bold text-gray-900",children:[Iu[I.getMonth()]," ",I.getFullYear()]}),y.jsx("button",{onClick:B,disabled:Y,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:Y?.3:1},children:"›"})]}),calendarContainer:({className:I,children:L})=>y.jsxs("div",{className:I,children:[L,S&&y.jsxs("div",{className:"border-t border-gray-100 mt-2 px-1 py-2 text-[11px] text-gray-500",children:[y.jsx("span",{className:"font-semibold text-gray-700",children:"Note:"})," ","Date range selection is limited to ",i," year."]})]}),customInput:y.jsx(Fu,{value:S?_:a?er(a):"",placeholder:s||F,onClear:j,showClear:S?!!e:!!a,className:v})},n)})]})});var so={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},aa=m.createContext&&m.createContext(so),Au=["attr","size","title"];function Wu(n,a){if(n==null)return{};var t,e,r=Hu(n,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(e=0;e<o.length;e++)t=o[e],a.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Hu(n,a){if(n==null)return{};var t={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(a.indexOf(e)!==-1)continue;t[e]=n[e]}return t}function yr(){return yr=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var e in t)({}).hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},yr.apply(null,arguments)}function oa(n,a){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);a&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,e)}return t}function xr(n){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?arguments[a]:{};a%2?oa(Object(t),!0).forEach(function(e){ju(n,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}return n}function ju(n,a,t){return(a=Bu(a))in n?Object.defineProperty(n,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[a]=t,n}function Bu(n){var a=zu(n,"string");return typeof a=="symbol"?a:a+""}function zu(n,a){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,a);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}function io(n){return n&&n.map((a,t)=>m.createElement(a.tag,xr({key:t},a.attr),io(a.child)))}function pn(n){return a=>m.createElement(Qu,yr({attr:xr({},n.attr)},a),io(n.child))}function Qu(n){var a=t=>{var e=n.attr,r=n.size,o=n.title,s=Wu(n,Au),i=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),m.createElement("svg",yr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,e,s,{className:l,style:xr(xr({color:n.color||t.color},t.style),n.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),n.children)};return aa!==void 0?m.createElement(aa.Consumer,null,t=>a(t)):a(so)}function Vu(n){return pn({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:[]}]})(n)}function Ku(n){return pn({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:[]}]})(n)}function $u(n){return pn({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:[]}]})(n)}const qu=Vu,Uu=$u,Gu=Ku,Xu=({label:n,options:a,value:t,placeholder:e="Select",onChange:r,disabled:o=!1,hoverOptionStyle:s={backgroundColor:"#BEFFDB",color:"#13785F"},selectedOptionStyle:i={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:l="Search...",showSearch:c=!0,ArrowDownIcon:u,ArrowUpIcon:d})=>{const[p,f]=m.useState(!1),[h,v]=m.useState(""),[g,w]=m.useState(null),x=m.useRef(null),D=a.find(b=>String(b.value)===String(t)),C=a.filter(b=>b.label.toLowerCase().includes(h.toLowerCase())),F=p?d||Gu:u||Uu;return m.useEffect(()=>{const b=_=>{x.current&&!x.current.contains(_.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]),y.jsxs("div",{className:"relative w-full",ref:x,children:[n&&y.jsx("label",{children:n}),y.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&&f(!p),children:[y.jsx("span",{className:"truncate",style:{fontSize:"12px",fontWeight:400,color:D?"#1F2937":"#9CA3AF"},children:(D==null?void 0:D.label)||e}),y.jsx(F,{className:"transition duration-200 text-gray-500 text-[16px]"})]}),p&&!o&&y.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:[c&&y.jsx("div",{className:"p-2 border-b bg-white",children:y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute flex items-center justify-center pointer-events-none",style:{left:8,top:6},children:y.jsx(qu,{className:"w-4 h-4 text-slate-400"})}),y.jsx("input",{type:"text",placeholder:l,value:h,onChange:b=>v(b.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:16,fontSize:12,lineHeight:"16px",height:28,backgroundColor:"#F9F9F9"}})]})}),y.jsx("div",{className:"overflow-x-hidden bg-white",style:{maxHeight:208,overflowY:"auto"},children:C.map(b=>{const _=String(t)===String(b.value),R=g===b.value,E={transition:"all 150ms ease",boxShadow:"0px 1px 2px 0px #0000000D",..._?i:R?s:{},...R&&!_?{transform:"translateX(2px)",fontWeight:700}:{}};return y.jsx("div",{className:"px-3 py-2 text-xs cursor-pointer",style:E,onMouseEnter:()=>w(b.value),onMouseLeave:()=>w(null),onClick:()=>{r(b.value),f(!1),v("")},children:b.label},b.value)})})]})]})},Zu=({value:n,icon:a})=>{const[t,e]=m.useState(!1);return y.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[a,t&&y.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:[n,y.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"}})]})]})};exports.Checkbox=ho;exports.CustomDatePicker=Lu;exports.DragDropUpload=Go;exports.Input=xa;exports.MultiSelect=Uo;exports.Radio=po;exports.Select=Zo;exports.SingleSelect=Xu;exports.Textarea=wa;exports.ToggleSwitch=fo;exports.Tooltip=Zu;
|
package/dist/form-controls.es.js
CHANGED
|
@@ -11524,11 +11524,11 @@ const ed = Xu, td = Ju, rd = Zu, md = ({
|
|
|
11524
11524
|
/* @__PURE__ */ S(
|
|
11525
11525
|
"span",
|
|
11526
11526
|
{
|
|
11527
|
-
className: "truncate
|
|
11527
|
+
className: "truncate",
|
|
11528
11528
|
style: {
|
|
11529
11529
|
fontSize: "12px",
|
|
11530
11530
|
fontWeight: 400,
|
|
11531
|
-
color: D ? "#1F2937" : "#
|
|
11531
|
+
color: D ? "#1F2937" : "#9CA3AF"
|
|
11532
11532
|
},
|
|
11533
11533
|
children: (D == null ? void 0 : D.label) || e
|
|
11534
11534
|
}
|