rharuow-ds 1.0.8 → 1.0.9
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.
- package/dist/rharuow-ds.cjs.js +1 -1
- package/dist/rharuow-ds.es.js +74 -74
- package/package.json +1 -1
package/dist/rharuow-ds.cjs.js
CHANGED
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,g,p,V,p),K[p+g]=!0)}if(p=null,b!==void 0&&(a(b),p=""+b),E(r)&&(a(r.key),p=""+r.key),"key"in r){b={};for(var X in r)X!=="key"&&(b[X]=r[X])}else b=r;return p&&_(b,typeof e=="function"?e.displayName||e.name||"Unknown":e),W(e,p,O,M,u(),b,G,H)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===j&&e._store&&(e._store.validated=1)}var R=ne,j=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),S=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),A=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,d=Object.prototype.hasOwnProperty,n=Array.isArray,w=console.createTask?console.createTask:function(){return null};R={"react-stack-bottom-frame":function(e){return e()}};var L,z={},Z=R["react-stack-bottom-frame"].bind(R,m)(),Q=w(o(m)),K={};B.Fragment=s,B.jsx=function(e,r,b,g,M){var O=1e4>A.recentlyCreatedOwnerStacks++;return T(e,r,b,!1,g,M,O?Error("react-stack-top-frame"):Z,O?w(o(e)):Q)},B.jsxs=function(e,r,b,g,M){var O=1e4>A.recentlyCreatedOwnerStacks++;return T(e,r,b,!0,g,M,O?Error("react-stack-top-frame"):Z,O?w(o(e)):Q)}}()),B}var re;function fe(){return re||(re=1,process.env.NODE_ENV==="production"?J.exports=ue():J.exports=de()),J.exports}var l=fe();function ae(t){var i,a,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var u=t.length;for(i=0;i<u;i++)t[i]&&(a=ae(t[i]))&&(o&&(o+=" "),o+=a)}else for(a in t)t[a]&&(o&&(o+=" "),o+=a);return o}function be(){for(var t,i,a=0,o="",u=arguments.length;a<u;a++)(t=arguments[a])&&(i=ae(t))&&(o&&(o+=" "),o+=i);return o}function y(...t){return be(...t)}const me=({children:t,variant:i="default",className:a="",...o})=>{const u="px-4 py-2 rounded font-medium transition",m={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return l.jsx("button",{className:y(u,m[i],a),...o,children:t})},oe=N.forwardRef(({name:t,className:i,type:a="text",label:o,onFocus:u,onBlur:m,Icon:E,iconClassName:_,iconAction:c,containerClassName:W,...T},v)=>{var F,I,Y;const[R,j]=N.useState(!1),x=U.useFormContext(),s=x==null?void 0:x.control,C=x==null?void 0:x.register,D=s&&t?U.useWatch({control:s,name:t}):void 0,f=T.value??D??"",S=(Y=(I=(F=x==null?void 0:x.formState)==null?void 0:F.errors)==null?void 0:I[t])==null?void 0:Y.message,$=R||!!f;return l.jsxs("div",{className:y("relative",W),children:[l.jsx("input",{id:T.id||t,type:a,className:y("peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",i),onFocus:h=>{j(!0),u&&u(h)},...x&&t?(()=>{const h=C(t),P=h.onBlur;return{...h,ref:k=>{typeof v=="function"?v(k):v&&(v.current=k),h.ref&&h.ref(k)},onBlur:k=>{j(!1),m&&m(k),P&&P(k)}}})():{ref:v,onBlur:h=>{j(!1),m&&m(h)}},...T}),o&&l.jsx("label",{htmlFor:T.id||t,className:y("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5"),children:o}),E&&l.jsx("div",{className:y("absolute top-1/2 right-3 -translate-y-1/2 text-white",_),onClick:c,children:l.jsx(E,{})}),S&&l.jsx("span",{className:"text-red-500 text-xs mt-1 block",children:S})]})});oe.displayName="Input";const se=N.forwardRef(({name:t,label:i,options:a,className:o,containerClassName:u,isClearable:m,onFocus:E,onBlur:_,...c},W)=>{var h,P,k,A;const[T,v]=N.useState(!1),[R,j]=N.useState(!1),x=N.useRef(null),s=U.useFormContext(),C=s==null?void 0:s.control,D=C&&t?U.useWatch({control:C,name:t}):void 0,f=c.value??D??"",S=(k=(P=(h=s==null?void 0:s.formState)==null?void 0:h.errors)==null?void 0:P[t])==null?void 0:k.message,$=T||!!f;N.useEffect(()=>{const d=n=>{x.current&&!x.current.contains(n.target)&&(j(!1),v(!1))};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]);const F=()=>{j(d=>!d),v(!0)},I=d=>{v(!0),E&&E(d)},Y=d=>{_&&_(d)};return l.jsxs("div",{className:y("relative",u),ref:x,children:[l.jsxs("div",{id:c.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":R,className:y("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",o),onClick:F,onFocus:I,onBlur:Y,ref:W,children:[l.jsx("span",{className:y("block truncate",!f&&"text-gray-400"),children:(A=a.find(d=>d.value===f))==null?void 0:A.label}),m&&f&&l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:d=>{if(d.stopPropagation(),s&&t&&s.setValue(t,""),c.onChange){const n={target:{value:""}};c.onChange(n)}j(!1),v(!1)},children:"✕"})]}),i&&l.jsx("label",{htmlFor:c.id||t,className:y("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5"),children:i}),l.jsx("div",{className:y("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",R?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:R?"9.5rem":"0",overflowY:a.length>3?"auto":"hidden"},children:a.map(d=>l.jsx("div",{className:y("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",f===d.value&&"bg-blue-100"),onMouseDown:()=>{if(s&&t&&s.setValue(t,d.value),c.onChange){const n={target:{value:d.value}};c.onChange(n)}v(!0)},children:d.label},d.value))}),S&&l.jsx("span",{className:"text-red-500 text-xs mt-1 block",children:S})]})});se.displayName="Select";const le=N.forwardRef(({name:t,label:i,options:a,className:o,containerClassName:u,isClearable:m,onFocus:E,onBlur:_,...c},W)=>{var k,A,d;const[T,v]=N.useState(!1),[R,j]=N.useState(!1),x=N.useRef(null),s=U.useFormContext(),C=s==null?void 0:s.control,D=C&&t?U.useWatch({control:C,name:t}):void 0,f=c.value??D??[],S=(d=(A=(k=s==null?void 0:s.formState)==null?void 0:k.errors)==null?void 0:A[t])==null?void 0:d.message,$=T||f&&f.length>0;N.useEffect(()=>{const n=w=>{x.current&&!x.current.contains(w.target)&&(j(!1),v(!1))};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[]);const F=()=>{j(n=>!n),v(!0)},I=n=>{v(!0),E&&E(n)},Y=n=>{_&&_(n)},h=n=>{var L;let w;f.includes(n)?w=f.filter(z=>z!==n):w=[...f,n],s&&t&&s.setValue(t,w),c.onChange&&((L=c.onChange)==null||L.call(c,{target:{value:w}})),v(!0)},P=n=>{var w;n.stopPropagation(),s&&t&&s.setValue(t,[]),c.onChange&&((w=c.onChange)==null||w.call(c,{target:{value:[]}})),j(!1),v(!1)};return l.jsxs("div",{className:y("relative",u),ref:x,children:[l.jsxs("div",{id:c.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":R,className:y("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",o),onClick:F,onFocus:I,onBlur:Y,ref:W,children:[l.jsx("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"},children:f&&f.length>0?a.filter(n=>f.includes(n.value)).map(n=>l.jsxs("span",{className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",style:{maxWidth:"140px"},children:[l.jsx("span",{className:"truncate",title:n.label,children:n.label}),l.jsx("button",{type:"button",className:"ml-1 text-blue-400 hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${n.label}`,tabIndex:-1,onClick:w=>{w.stopPropagation();const L=f.filter(z=>z!==n.value);s&&t&&s.setValue(t,L),c.onChange&&c.onChange({target:{value:L}})},children:l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},n.value)):l.jsx("span",{className:"text-gray-400 text-sm",children:"Selecione..."})}),m&&f&&f.length>0&&l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:P,children:"✕"})]}),i&&l.jsx("label",{htmlFor:c.id||t,className:y("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5"),children:i}),l.jsx("div",{className:y("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",R?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:R?"9.5rem":"0",overflowY:a.length>3?"auto":"hidden"},children:a.map(n=>l.jsxs("div",{className:y("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",f.includes(n.value)&&"bg-blue-100 font-semibold"),onMouseDown:()=>h(n.value),children:[l.jsx("input",{type:"checkbox",checked:f.includes(n.value),readOnly:!0,className:"accent-blue-500"}),n.label]},n.value))}),S&&l.jsx("span",{className:"text-red-500 text-xs mt-1 block",children:S})]})});le.displayName="MultiSelect";exports.Button=me;exports.Input=oe;exports.MultiSelect=le;exports.Select=se;
|
|
22
|
+
<%s key={someKey} {...props} />`,g,p,V,p),K[p+g]=!0)}if(p=null,b!==void 0&&(a(b),p=""+b),E(r)&&(a(r.key),p=""+r.key),"key"in r){b={};for(var X in r)X!=="key"&&(b[X]=r[X])}else b=r;return p&&_(b,typeof e=="function"?e.displayName||e.name||"Unknown":e),W(e,p,O,M,u(),b,G,H)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===j&&e._store&&(e._store.validated=1)}var R=ne,j=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),S=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),A=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,d=Object.prototype.hasOwnProperty,n=Array.isArray,w=console.createTask?console.createTask:function(){return null};R={"react-stack-bottom-frame":function(e){return e()}};var L,z={},Z=R["react-stack-bottom-frame"].bind(R,m)(),Q=w(o(m)),K={};B.Fragment=s,B.jsx=function(e,r,b,g,M){var O=1e4>A.recentlyCreatedOwnerStacks++;return T(e,r,b,!1,g,M,O?Error("react-stack-top-frame"):Z,O?w(o(e)):Q)},B.jsxs=function(e,r,b,g,M){var O=1e4>A.recentlyCreatedOwnerStacks++;return T(e,r,b,!0,g,M,O?Error("react-stack-top-frame"):Z,O?w(o(e)):Q)}}()),B}var re;function fe(){return re||(re=1,process.env.NODE_ENV==="production"?J.exports=ue():J.exports=de()),J.exports}var l=fe();function ae(t){var i,a,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var u=t.length;for(i=0;i<u;i++)t[i]&&(a=ae(t[i]))&&(o&&(o+=" "),o+=a)}else for(a in t)t[a]&&(o&&(o+=" "),o+=a);return o}function be(){for(var t,i,a=0,o="",u=arguments.length;a<u;a++)(t=arguments[a])&&(i=ae(t))&&(o&&(o+=" "),o+=i);return o}function y(...t){return be(...t)}const me=({children:t,variant:i="default",className:a="",...o})=>{const u="px-4 py-2 rounded font-medium transition",m={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return l.jsx("button",{className:y(u,m[i],a),...o,children:t})},oe=N.forwardRef(({name:t,className:i,type:a="text",label:o,onFocus:u,onBlur:m,Icon:E,iconClassName:_,iconAction:c,containerClassName:W,...T},v)=>{var F,I,Y;const[R,j]=N.useState(!1),x=U.useFormContext(),s=x==null?void 0:x.control,C=x==null?void 0:x.register,D=s&&t?U.useWatch({control:s,name:t}):void 0,f=T.value??D??"",S=(Y=(I=(F=x==null?void 0:x.formState)==null?void 0:F.errors)==null?void 0:I[t])==null?void 0:Y.message,$=R||!!f;return l.jsxs("div",{className:y("relative",W),children:[l.jsx("input",{id:T.id||t,type:a,className:y("peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",i),onFocus:h=>{j(!0),u&&u(h)},...x&&t?(()=>{const h=C(t),P=h.onBlur;return{...h,ref:k=>{typeof v=="function"?v(k):v&&(v.current=k),h.ref&&h.ref(k)},onBlur:k=>{j(!1),m&&m(k),P&&P(k)}}})():{ref:v,onBlur:h=>{j(!1),m&&m(h)}},...T}),o&&l.jsx("label",{htmlFor:T.id||t,className:y("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5"),children:o}),E&&l.jsx("div",{className:y("absolute top-1/2 right-3 -translate-y-1/2 text-white",_),onClick:c,children:l.jsx(E,{})}),S&&l.jsx("span",{className:"text-red-500 text-xs mt-1 block",children:S})]})});oe.displayName="Input";const se=N.forwardRef(({name:t,label:i,options:a,className:o,containerClassName:u,isClearable:m,onFocus:E,onBlur:_,...c},W)=>{var h,P,k,A;const[T,v]=N.useState(!1),[R,j]=N.useState(!1),x=N.useRef(null),s=U.useFormContext(),C=s==null?void 0:s.control,D=C&&t?U.useWatch({control:C,name:t}):void 0,f=c.value??D??"",S=(k=(P=(h=s==null?void 0:s.formState)==null?void 0:h.errors)==null?void 0:P[t])==null?void 0:k.message,$=T||!!f;N.useEffect(()=>{const d=n=>{x.current&&!x.current.contains(n.target)&&(j(!1),v(!1))};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]);const F=()=>{j(d=>!d),v(!0)},I=d=>{v(!0),E&&E(d)},Y=d=>{_&&_(d)};return l.jsxs("div",{className:y("relative",u),ref:x,children:[l.jsxs("div",{id:c.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":R,className:y("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",o),onClick:F,onFocus:I,onBlur:Y,ref:W,children:[l.jsx("span",{className:y("block truncate",!f&&"text-gray-400"),children:((A=a.find(d=>d.value===f))==null?void 0:A.label)||!i&&"Selecione..."}),m&&f&&l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:d=>{if(d.stopPropagation(),s&&t&&s.setValue(t,""),c.onChange){const n={target:{value:""}};c.onChange(n)}j(!1),v(!1)},children:"✕"})]}),i&&l.jsx("label",{htmlFor:c.id||t,className:y("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5"),children:i}),l.jsx("div",{className:y("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",R?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:R?"9.5rem":"0",overflowY:a.length>3?"auto":"hidden"},children:a.map(d=>l.jsx("div",{className:y("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",f===d.value&&"bg-blue-100"),onMouseDown:()=>{if(s&&t&&s.setValue(t,d.value),c.onChange){const n={target:{value:d.value}};c.onChange(n)}v(!0)},children:d.label},d.value))}),S&&l.jsx("span",{className:"text-red-500 text-xs mt-1 block",children:S})]})});se.displayName="Select";const le=N.forwardRef(({name:t,label:i,options:a,className:o,containerClassName:u,isClearable:m,onFocus:E,onBlur:_,...c},W)=>{var k,A,d;const[T,v]=N.useState(!1),[R,j]=N.useState(!1),x=N.useRef(null),s=U.useFormContext(),C=s==null?void 0:s.control,D=C&&t?U.useWatch({control:C,name:t}):void 0,f=c.value??D??[],S=(d=(A=(k=s==null?void 0:s.formState)==null?void 0:k.errors)==null?void 0:A[t])==null?void 0:d.message,$=T||f&&f.length>0;N.useEffect(()=>{const n=w=>{x.current&&!x.current.contains(w.target)&&(j(!1),v(!1))};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[]);const F=()=>{j(n=>!n),v(!0)},I=n=>{v(!0),E&&E(n)},Y=n=>{_&&_(n)},h=n=>{var L;let w;f.includes(n)?w=f.filter(z=>z!==n):w=[...f,n],s&&t&&s.setValue(t,w),c.onChange&&((L=c.onChange)==null||L.call(c,{target:{value:w}})),v(!0)},P=n=>{var w;n.stopPropagation(),s&&t&&s.setValue(t,[]),c.onChange&&((w=c.onChange)==null||w.call(c,{target:{value:[]}})),j(!1),v(!1)};return l.jsxs("div",{className:y("relative",u),ref:x,children:[l.jsxs("div",{id:c.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":R,className:y("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",o),onClick:F,onFocus:I,onBlur:Y,ref:W,children:[l.jsx("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"},children:f&&f.length>0?a.filter(n=>f.includes(n.value)).map(n=>l.jsxs("span",{className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",style:{maxWidth:"140px"},children:[l.jsx("span",{className:"truncate",title:n.label,children:n.label}),l.jsx("button",{type:"button",className:"ml-1 text-blue-400 hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${n.label}`,tabIndex:-1,onClick:w=>{w.stopPropagation();const L=f.filter(z=>z!==n.value);s&&t&&s.setValue(t,L),c.onChange&&c.onChange({target:{value:L}})},children:l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},n.value)):!i&&l.jsx("span",{className:"text-gray-400 text-sm",children:"Selecione..."})}),m&&f&&f.length>0&&l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:P,children:"✕"})]}),i&&l.jsx("label",{htmlFor:c.id||t,className:y("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5"),children:i}),l.jsx("div",{className:y("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",R?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:R?"9.5rem":"0",overflowY:a.length>3?"auto":"hidden"},children:a.map(n=>l.jsxs("div",{className:y("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",f.includes(n.value)&&"bg-blue-100 font-semibold"),onMouseDown:()=>h(n.value),children:[l.jsx("input",{type:"checkbox",checked:f.includes(n.value),readOnly:!0,className:"accent-blue-500"}),n.label]},n.value))}),S&&l.jsx("span",{className:"text-red-500 text-xs mt-1 block",children:S})]})});le.displayName="MultiSelect";exports.Button=me;exports.Input=oe;exports.MultiSelect=le;exports.Select=se;
|
package/dist/rharuow-ds.es.js
CHANGED
|
@@ -15,23 +15,23 @@ var te;
|
|
|
15
15
|
function le() {
|
|
16
16
|
if (te) return U;
|
|
17
17
|
te = 1;
|
|
18
|
-
var t = Symbol.for("react.transitional.element"),
|
|
19
|
-
function l(s,
|
|
18
|
+
var t = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
|
|
19
|
+
function l(s, u, m) {
|
|
20
20
|
var w = null;
|
|
21
|
-
if (m !== void 0 && (w = "" + m),
|
|
21
|
+
if (m !== void 0 && (w = "" + m), u.key !== void 0 && (w = "" + u.key), "key" in u) {
|
|
22
22
|
m = {};
|
|
23
|
-
for (var _ in
|
|
24
|
-
_ !== "key" && (m[_] =
|
|
25
|
-
} else m =
|
|
26
|
-
return
|
|
23
|
+
for (var _ in u)
|
|
24
|
+
_ !== "key" && (m[_] = u[_]);
|
|
25
|
+
} else m = u;
|
|
26
|
+
return u = m.ref, {
|
|
27
27
|
$$typeof: t,
|
|
28
28
|
type: s,
|
|
29
29
|
key: w,
|
|
30
|
-
ref:
|
|
30
|
+
ref: u !== void 0 ? u : null,
|
|
31
31
|
props: m
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return U.Fragment =
|
|
34
|
+
return U.Fragment = i, U.jsx = l, U.jsxs = l, U;
|
|
35
35
|
}
|
|
36
36
|
var J = {};
|
|
37
37
|
/**
|
|
@@ -89,12 +89,12 @@ function ie() {
|
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function i(e) {
|
|
93
93
|
return "" + e;
|
|
94
94
|
}
|
|
95
95
|
function l(e) {
|
|
96
96
|
try {
|
|
97
|
-
|
|
97
|
+
i(e);
|
|
98
98
|
var r = !1;
|
|
99
99
|
} catch {
|
|
100
100
|
r = !0;
|
|
@@ -106,7 +106,7 @@ function ie() {
|
|
|
106
106
|
r,
|
|
107
107
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
108
|
g
|
|
109
|
-
),
|
|
109
|
+
), i(e);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
function s(e) {
|
|
@@ -120,7 +120,7 @@ function ie() {
|
|
|
120
120
|
return "<...>";
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function u() {
|
|
124
124
|
var e = P.A;
|
|
125
125
|
return e === null ? null : e.getOwner();
|
|
126
126
|
}
|
|
@@ -128,7 +128,7 @@ function ie() {
|
|
|
128
128
|
return Error("react-stack-top-frame");
|
|
129
129
|
}
|
|
130
130
|
function w(e) {
|
|
131
|
-
if (
|
|
131
|
+
if (d.call(e, "key")) {
|
|
132
132
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
133
133
|
if (r && r.isReactWarning) return !1;
|
|
134
134
|
}
|
|
@@ -146,7 +146,7 @@ function ie() {
|
|
|
146
146
|
configurable: !0
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function c() {
|
|
150
150
|
var e = t(this.type);
|
|
151
151
|
return z[e] || (z[e] = !0, console.error(
|
|
152
152
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
@@ -161,7 +161,7 @@ function ie() {
|
|
|
161
161
|
_owner: W
|
|
162
162
|
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
163
|
enumerable: !1,
|
|
164
|
-
get:
|
|
164
|
+
get: c
|
|
165
165
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
@@ -197,7 +197,7 @@ function ie() {
|
|
|
197
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
198
|
);
|
|
199
199
|
else x(p);
|
|
200
|
-
if (
|
|
200
|
+
if (d.call(r, "key")) {
|
|
201
201
|
p = t(e);
|
|
202
202
|
var V = Object.keys(r).filter(function(oe) {
|
|
203
203
|
return oe !== "key";
|
|
@@ -228,7 +228,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
228
228
|
p,
|
|
229
229
|
C,
|
|
230
230
|
W,
|
|
231
|
-
|
|
231
|
+
u(),
|
|
232
232
|
b,
|
|
233
233
|
B,
|
|
234
234
|
G
|
|
@@ -237,7 +237,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
237
237
|
function x(e) {
|
|
238
238
|
typeof e == "object" && e !== null && e.$$typeof === j && e._store && (e._store.validated = 1);
|
|
239
239
|
}
|
|
240
|
-
var R = se, j = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), f = Symbol.for("react.consumer"), S = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), P = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
240
|
+
var R = se, j = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), f = Symbol.for("react.consumer"), S = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), P = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, d = Object.prototype.hasOwnProperty, n = Array.isArray, E = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
243
|
R = {
|
|
@@ -282,16 +282,16 @@ function ce() {
|
|
|
282
282
|
}
|
|
283
283
|
var o = ce();
|
|
284
284
|
function ae(t) {
|
|
285
|
-
var
|
|
285
|
+
var i, l, s = "";
|
|
286
286
|
if (typeof t == "string" || typeof t == "number") s += t;
|
|
287
287
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
288
|
-
var
|
|
289
|
-
for (
|
|
288
|
+
var u = t.length;
|
|
289
|
+
for (i = 0; i < u; i++) t[i] && (l = ae(t[i])) && (s && (s += " "), s += l);
|
|
290
290
|
} else for (l in t) t[l] && (s && (s += " "), s += l);
|
|
291
291
|
return s;
|
|
292
292
|
}
|
|
293
293
|
function ue() {
|
|
294
|
-
for (var t,
|
|
294
|
+
for (var t, i, l = 0, s = "", u = arguments.length; l < u; l++) (t = arguments[l]) && (i = ae(t)) && (s && (s += " "), s += i);
|
|
295
295
|
return s;
|
|
296
296
|
}
|
|
297
297
|
function y(...t) {
|
|
@@ -299,27 +299,27 @@ function y(...t) {
|
|
|
299
299
|
}
|
|
300
300
|
const ve = ({
|
|
301
301
|
children: t,
|
|
302
|
-
variant:
|
|
302
|
+
variant: i = "default",
|
|
303
303
|
className: l = "",
|
|
304
304
|
...s
|
|
305
305
|
}) => {
|
|
306
|
-
const
|
|
306
|
+
const u = "px-4 py-2 rounded font-medium transition", m = {
|
|
307
307
|
default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
|
|
308
308
|
outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
|
|
309
309
|
secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
|
|
310
310
|
};
|
|
311
|
-
return /* @__PURE__ */ o.jsx("button", { className: y(
|
|
311
|
+
return /* @__PURE__ */ o.jsx("button", { className: y(u, m[i], l), ...s, children: t });
|
|
312
312
|
}, de = N.forwardRef(
|
|
313
313
|
({
|
|
314
314
|
name: t,
|
|
315
|
-
className:
|
|
315
|
+
className: i,
|
|
316
316
|
type: l = "text",
|
|
317
317
|
label: s,
|
|
318
|
-
onFocus:
|
|
318
|
+
onFocus: u,
|
|
319
319
|
onBlur: m,
|
|
320
320
|
Icon: w,
|
|
321
321
|
iconClassName: _,
|
|
322
|
-
iconAction:
|
|
322
|
+
iconAction: c,
|
|
323
323
|
containerClassName: M,
|
|
324
324
|
...T
|
|
325
325
|
}, x) => {
|
|
@@ -333,10 +333,10 @@ const ve = ({
|
|
|
333
333
|
type: l,
|
|
334
334
|
className: y(
|
|
335
335
|
"peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",
|
|
336
|
-
|
|
336
|
+
i
|
|
337
337
|
),
|
|
338
338
|
onFocus: (h) => {
|
|
339
|
-
j(!0),
|
|
339
|
+
j(!0), u && u(h);
|
|
340
340
|
},
|
|
341
341
|
...v && t ? (() => {
|
|
342
342
|
const h = O(t), A = h.onBlur;
|
|
@@ -376,7 +376,7 @@ const ve = ({
|
|
|
376
376
|
"absolute top-1/2 right-3 -translate-y-1/2 text-white",
|
|
377
377
|
_
|
|
378
378
|
),
|
|
379
|
-
onClick:
|
|
379
|
+
onClick: c,
|
|
380
380
|
children: /* @__PURE__ */ o.jsx(w, {})
|
|
381
381
|
}
|
|
382
382
|
),
|
|
@@ -388,37 +388,37 @@ de.displayName = "Input";
|
|
|
388
388
|
const fe = N.forwardRef(
|
|
389
389
|
({
|
|
390
390
|
name: t,
|
|
391
|
-
label:
|
|
391
|
+
label: i,
|
|
392
392
|
options: l,
|
|
393
393
|
className: s,
|
|
394
|
-
containerClassName:
|
|
394
|
+
containerClassName: u,
|
|
395
395
|
isClearable: m,
|
|
396
396
|
onFocus: w,
|
|
397
397
|
onBlur: _,
|
|
398
|
-
...
|
|
398
|
+
...c
|
|
399
399
|
}, M) => {
|
|
400
400
|
var h, A, k, P;
|
|
401
|
-
const [T, x] = N.useState(!1), [R, j] = N.useState(!1), v = N.useRef(null), a = H(), O = a == null ? void 0 : a.control, D = O && t ? Z({ control: O, name: t }) : void 0, f =
|
|
401
|
+
const [T, x] = N.useState(!1), [R, j] = N.useState(!1), v = N.useRef(null), a = H(), O = a == null ? void 0 : a.control, D = O && t ? Z({ control: O, name: t }) : void 0, f = c.value ?? D ?? "", S = (k = (A = (h = a == null ? void 0 : a.formState) == null ? void 0 : h.errors) == null ? void 0 : A[t]) == null ? void 0 : k.message, $ = T || !!f;
|
|
402
402
|
N.useEffect(() => {
|
|
403
|
-
const
|
|
403
|
+
const d = (n) => {
|
|
404
404
|
v.current && !v.current.contains(n.target) && (j(!1), x(!1));
|
|
405
405
|
};
|
|
406
|
-
return document.addEventListener("mousedown",
|
|
407
|
-
document.removeEventListener("mousedown",
|
|
406
|
+
return document.addEventListener("mousedown", d), () => {
|
|
407
|
+
document.removeEventListener("mousedown", d);
|
|
408
408
|
};
|
|
409
409
|
}, []);
|
|
410
410
|
const F = () => {
|
|
411
|
-
j((
|
|
412
|
-
}, Y = (
|
|
413
|
-
x(!0), w && w(
|
|
414
|
-
}, I = (
|
|
415
|
-
_ && _(
|
|
411
|
+
j((d) => !d), x(!0);
|
|
412
|
+
}, Y = (d) => {
|
|
413
|
+
x(!0), w && w(d);
|
|
414
|
+
}, I = (d) => {
|
|
415
|
+
_ && _(d);
|
|
416
416
|
};
|
|
417
|
-
return /* @__PURE__ */ o.jsxs("div", { className: y("relative",
|
|
417
|
+
return /* @__PURE__ */ o.jsxs("div", { className: y("relative", u), ref: v, children: [
|
|
418
418
|
/* @__PURE__ */ o.jsxs(
|
|
419
419
|
"div",
|
|
420
420
|
{
|
|
421
|
-
id:
|
|
421
|
+
id: c.id || t,
|
|
422
422
|
tabIndex: 0,
|
|
423
423
|
role: "button",
|
|
424
424
|
"aria-haspopup": "listbox",
|
|
@@ -432,7 +432,7 @@ const fe = N.forwardRef(
|
|
|
432
432
|
onBlur: I,
|
|
433
433
|
ref: M,
|
|
434
434
|
children: [
|
|
435
|
-
/* @__PURE__ */ o.jsx("span", { className: y("block truncate", !f && "text-gray-400"), children: (P = l.find((
|
|
435
|
+
/* @__PURE__ */ o.jsx("span", { className: y("block truncate", !f && "text-gray-400"), children: ((P = l.find((d) => d.value === f)) == null ? void 0 : P.label) || !i && "Selecione..." }),
|
|
436
436
|
m && f && /* @__PURE__ */ o.jsx(
|
|
437
437
|
"button",
|
|
438
438
|
{
|
|
@@ -440,12 +440,12 @@ const fe = N.forwardRef(
|
|
|
440
440
|
tabIndex: -1,
|
|
441
441
|
"aria-label": "Limpar seleção",
|
|
442
442
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
443
|
-
onClick: (
|
|
444
|
-
if (
|
|
443
|
+
onClick: (d) => {
|
|
444
|
+
if (d.stopPropagation(), a && t && a.setValue(t, ""), c.onChange) {
|
|
445
445
|
const n = {
|
|
446
446
|
target: { value: "" }
|
|
447
447
|
};
|
|
448
|
-
|
|
448
|
+
c.onChange(n);
|
|
449
449
|
}
|
|
450
450
|
j(!1), x(!1);
|
|
451
451
|
},
|
|
@@ -455,15 +455,15 @@ const fe = N.forwardRef(
|
|
|
455
455
|
]
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
|
-
|
|
458
|
+
i && /* @__PURE__ */ o.jsx(
|
|
459
459
|
"label",
|
|
460
460
|
{
|
|
461
|
-
htmlFor:
|
|
461
|
+
htmlFor: c.id || t,
|
|
462
462
|
className: y(
|
|
463
463
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
464
464
|
$ ? "top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
465
465
|
),
|
|
466
|
-
children:
|
|
466
|
+
children: i
|
|
467
467
|
}
|
|
468
468
|
),
|
|
469
469
|
/* @__PURE__ */ o.jsx(
|
|
@@ -478,25 +478,25 @@ const fe = N.forwardRef(
|
|
|
478
478
|
// 3 options * 2.5rem + padding
|
|
479
479
|
overflowY: l.length > 3 ? "auto" : "hidden"
|
|
480
480
|
},
|
|
481
|
-
children: l.map((
|
|
481
|
+
children: l.map((d) => /* @__PURE__ */ o.jsx(
|
|
482
482
|
"div",
|
|
483
483
|
{
|
|
484
484
|
className: y(
|
|
485
485
|
"px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",
|
|
486
|
-
f ===
|
|
486
|
+
f === d.value && "bg-blue-100"
|
|
487
487
|
),
|
|
488
488
|
onMouseDown: () => {
|
|
489
|
-
if (a && t && a.setValue(t,
|
|
489
|
+
if (a && t && a.setValue(t, d.value), c.onChange) {
|
|
490
490
|
const n = {
|
|
491
|
-
target: { value:
|
|
491
|
+
target: { value: d.value }
|
|
492
492
|
};
|
|
493
|
-
|
|
493
|
+
c.onChange(n);
|
|
494
494
|
}
|
|
495
495
|
x(!0);
|
|
496
496
|
},
|
|
497
|
-
children:
|
|
497
|
+
children: d.label
|
|
498
498
|
},
|
|
499
|
-
|
|
499
|
+
d.value
|
|
500
500
|
))
|
|
501
501
|
}
|
|
502
502
|
),
|
|
@@ -508,17 +508,17 @@ fe.displayName = "Select";
|
|
|
508
508
|
const be = N.forwardRef(
|
|
509
509
|
({
|
|
510
510
|
name: t,
|
|
511
|
-
label:
|
|
511
|
+
label: i,
|
|
512
512
|
options: l,
|
|
513
513
|
className: s,
|
|
514
|
-
containerClassName:
|
|
514
|
+
containerClassName: u,
|
|
515
515
|
isClearable: m,
|
|
516
516
|
onFocus: w,
|
|
517
517
|
onBlur: _,
|
|
518
|
-
...
|
|
518
|
+
...c
|
|
519
519
|
}, M) => {
|
|
520
|
-
var k, P,
|
|
521
|
-
const [T, x] = N.useState(!1), [R, j] = N.useState(!1), v = N.useRef(null), a = H(), O = a == null ? void 0 : a.control, D = O && t ? Z({ control: O, name: t }) : void 0, f =
|
|
520
|
+
var k, P, d;
|
|
521
|
+
const [T, x] = N.useState(!1), [R, j] = N.useState(!1), v = N.useRef(null), a = H(), O = a == null ? void 0 : a.control, D = O && t ? Z({ control: O, name: t }) : void 0, f = c.value ?? D ?? [], S = (d = (P = (k = a == null ? void 0 : a.formState) == null ? void 0 : k.errors) == null ? void 0 : P[t]) == null ? void 0 : d.message, $ = T || f && f.length > 0;
|
|
522
522
|
N.useEffect(() => {
|
|
523
523
|
const n = (E) => {
|
|
524
524
|
v.current && !v.current.contains(E.target) && (j(!1), x(!1));
|
|
@@ -536,20 +536,20 @@ const be = N.forwardRef(
|
|
|
536
536
|
}, h = (n) => {
|
|
537
537
|
var L;
|
|
538
538
|
let E;
|
|
539
|
-
f.includes(n) ? E = f.filter((z) => z !== n) : E = [...f, n], a && t && a.setValue(t, E),
|
|
539
|
+
f.includes(n) ? E = f.filter((z) => z !== n) : E = [...f, n], a && t && a.setValue(t, E), c.onChange && ((L = c.onChange) == null || L.call(c, {
|
|
540
540
|
target: { value: E }
|
|
541
541
|
})), x(!0);
|
|
542
542
|
}, A = (n) => {
|
|
543
543
|
var E;
|
|
544
|
-
n.stopPropagation(), a && t && a.setValue(t, []),
|
|
544
|
+
n.stopPropagation(), a && t && a.setValue(t, []), c.onChange && ((E = c.onChange) == null || E.call(c, {
|
|
545
545
|
target: { value: [] }
|
|
546
546
|
})), j(!1), x(!1);
|
|
547
547
|
};
|
|
548
|
-
return /* @__PURE__ */ o.jsxs("div", { className: y("relative",
|
|
548
|
+
return /* @__PURE__ */ o.jsxs("div", { className: y("relative", u), ref: v, children: [
|
|
549
549
|
/* @__PURE__ */ o.jsxs(
|
|
550
550
|
"div",
|
|
551
551
|
{
|
|
552
|
-
id:
|
|
552
|
+
id: c.id || t,
|
|
553
553
|
tabIndex: 0,
|
|
554
554
|
role: "button",
|
|
555
555
|
"aria-haspopup": "listbox",
|
|
@@ -585,7 +585,7 @@ const be = N.forwardRef(
|
|
|
585
585
|
onClick: (E) => {
|
|
586
586
|
E.stopPropagation();
|
|
587
587
|
const L = f.filter((z) => z !== n.value);
|
|
588
|
-
a && t && a.setValue(t, L),
|
|
588
|
+
a && t && a.setValue(t, L), c.onChange && c.onChange({
|
|
589
589
|
target: { value: L }
|
|
590
590
|
});
|
|
591
591
|
},
|
|
@@ -613,7 +613,7 @@ const be = N.forwardRef(
|
|
|
613
613
|
]
|
|
614
614
|
},
|
|
615
615
|
n.value
|
|
616
|
-
)) : /* @__PURE__ */ o.jsx("span", { className: "text-gray-400 text-sm", children: "Selecione..." })
|
|
616
|
+
)) : !i && /* @__PURE__ */ o.jsx("span", { className: "text-gray-400 text-sm", children: "Selecione..." })
|
|
617
617
|
}
|
|
618
618
|
),
|
|
619
619
|
m && f && f.length > 0 && /* @__PURE__ */ o.jsx(
|
|
@@ -630,15 +630,15 @@ const be = N.forwardRef(
|
|
|
630
630
|
]
|
|
631
631
|
}
|
|
632
632
|
),
|
|
633
|
-
|
|
633
|
+
i && /* @__PURE__ */ o.jsx(
|
|
634
634
|
"label",
|
|
635
635
|
{
|
|
636
|
-
htmlFor:
|
|
636
|
+
htmlFor: c.id || t,
|
|
637
637
|
className: y(
|
|
638
638
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
639
639
|
$ ? "top-0 scale-90 -translate-y-1 text-xs text-blue-400 p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
640
640
|
),
|
|
641
|
-
children:
|
|
641
|
+
children: i
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
644
|
/* @__PURE__ */ o.jsx(
|