@solace-health/ui 0.3.19 → 0.3.20
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -641,7 +641,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
|
|
|
641
641
|
left: 20px;
|
|
642
642
|
`,u3=o(c.Body)`
|
|
643
643
|
margin-bottom: 24px;
|
|
644
|
-
`,h3=({label:e="",name:t,details:r="",options:n=[],allowInput:i=!1,previewOnly:s=!1,formOptions:l={}})=>{let a=useRef(),C=useFormContext();C.register(t,l);let[p,x]=useState(!1),[f,S]=useState(""),[L,y]=useState(n),w=useSpring(p?{opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:150}}:{opacity:0,transform:"translate(0px, -2px)",display:"none",config:{duration:150}});useEffect(()=>{let g=h=>{p&&a.current&&!a.current.contains(h.target)&&x(!1);};return document.addEventListener("mousedown",h=>g(h)),()=>{document.removeEventListener("mousedown",h=>g(h));}},[p]);let b=n.find(g=>g.value===C.getValues(t))?.label,B=g=>{S(""),C.setValue(t,g.value),C.trigger(t),x(!1);};useEffect(()=>{if(x(!!f),f){let g=n.filter(h=>h.value.match(f.toLowerCase()));y(g),C.setValue(t,f);}else y(n);},[f]);let $=g=>{g.code==="Enter"&&g.preventDefault();};return jsxs(l3,{children:[jsx(p3,{size:"lg",children:e}),r&&jsx(d3,{children:r}),s?jsx(u3,{size:"md",children:b||"N/A"}):jsxs(c3,{onClick:()=>x(!p),children:[b,i&&jsx(m3,{onKeyDown:$,value:f,onChange:g=>S(g.target.value),type:"text"}),jsx(E.Caret,{direction:p?"up":"down"}),jsx(C3,{style:w,ref:a,children:L.map(g=>{let{label:h}=g,m=g.label===b;return jsxs(g3,{onClick:()=>B(g),children:[jsx(c.Body,{size:"lg",children:h}),jsx(f3,{isCurrent:m,children:jsx(E.Check,{color:"#fff"})})]},g.value)})})]})]})},n1=h3;var L3=({label:e="Submit",isSubmitting:t=!1,hideWhenInvalid:r=!1,...n})=>{let i=useFormContext(),{isValid:s}=i.formState,a=useSpring((r?s:!0)?{position:"relative",zIndex:0,opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:250}}:{opacity:0,transform:"translate(0px, -3px)",display:"none",config:{duration:250}});return jsx(animated.div,{style:a,...n,children:jsx(o2.Primary,{type:"submit",isSubmitting:t,...n,children:e})})},s1=L3;var z3=o.div`
|
|
644
|
+
`,h3=({label:e="",name:t,details:r="",options:n=[],allowInput:i=!1,previewOnly:s=!1,formOptions:l={}})=>{let a=useRef(),C=useFormContext();C.register(t,l);let[p,x]=useState(!1),[f,S]=useState(""),[L,y]=useState(n),w=useSpring(p?{opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:150}}:{opacity:0,transform:"translate(0px, -2px)",display:"none",config:{duration:150}});useEffect(()=>{let g=h=>{p&&a.current&&!a.current.contains(h.target)&&x(!1);};return document.addEventListener("mousedown",h=>g(h)),()=>{document.removeEventListener("mousedown",h=>g(h));}},[p]);let b=n.find(g=>g.value===C.getValues(t))?.label,B=g=>{S(""),C.setValue(t,g.value),C.trigger(t),x(!1);};useEffect(()=>{if(x(!!f),f){let g=n.filter(h=>h.value.match(f.toLowerCase()));y(g),C.setValue(t,f);}else y(n);},[f,n.length]);let $=g=>{g.code==="Enter"&&g.preventDefault();};return jsxs(l3,{children:[jsx(p3,{size:"lg",children:e}),r&&jsx(d3,{children:r}),s?jsx(u3,{size:"md",children:b||"N/A"}):jsxs(c3,{onClick:()=>x(!p),children:[b,i&&jsx(m3,{onKeyDown:$,value:f,onChange:g=>S(g.target.value),type:"text"}),jsx(E.Caret,{direction:p?"up":"down"}),jsx(C3,{style:w,ref:a,children:L.map(g=>{let{label:h}=g,m=g.label===b;return jsxs(g3,{onClick:()=>B(g),children:[jsx(c.Body,{size:"lg",children:h}),jsx(f3,{isCurrent:m,children:jsx(E.Check,{color:"#fff"})})]},g.value)})})]})]})},n1=h3;var L3=({label:e="Submit",isSubmitting:t=!1,hideWhenInvalid:r=!1,...n})=>{let i=useFormContext(),{isValid:s}=i.formState,a=useSpring((r?s:!0)?{position:"relative",zIndex:0,opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:250}}:{opacity:0,transform:"translate(0px, -3px)",display:"none",config:{duration:250}});return jsx(animated.div,{style:a,...n,children:jsx(o2.Primary,{type:"submit",isSubmitting:t,...n,children:e})})},s1=L3;var z3=o.div`
|
|
645
645
|
position: relative;
|
|
646
646
|
margin-bottom: 24px;
|
|
647
647
|
z-index: 20;
|