@theroutingcompany/components 0.0.51-alpha.1 → 0.0.51-alpha.2
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.
|
@@ -2368,7 +2368,7 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var ee=ce(q,re,Y,ie,le+"
|
|
|
2368
2368
|
`,$N=O.default.span`
|
|
2369
2369
|
display: none !important;
|
|
2370
2370
|
position: absolute;
|
|
2371
|
-
`,Xw=({children:e,placeholder:t,value:r="",editValue:n,hideIcon:o,p:a="7px 8px",onChange:i=()=>!1,onToggle:l=g=>g,onCancel:s=()=>!1,disabled:d=!1,valid:u=!0,label:f,labelId:m,allowedOutsideClickContainers:h,...b})=>{const g=c.useRef(null),[v,$]=c.useState(!1),[y,_]=c.useState(!1),D=Et(b,Vt.propNames??[]),P=Et(b,$i.propNames??[]),L=c.useCallback(()=>{$(!1),l(!1),_(!1)},[l]),T=c.useCallback(()=>{l(!0),_(!0)},[l]),x=c.useCallback(E=>{if(n&&n===r){L();return}$(!0),(async()=>{try{await i()}catch{throw new Error("failed to handle async inline edit change")}})().then(()=>{L()}).catch(()=>{L()})},[n,i,L,r]);c.useEffect(()=>{const E=()=>{L(),s()};return document.addEventListener("mousedown",V=>qw(V,g,E,h)),()=>document.removeEventListener("mousedown",V=>qw(V,g,E,h))},[h,s,L]),c.useEffect(()=>L,[]);const I=c.useCallback(()=>f&&typeof f=="string"?w(We,{bold:!0,size:"medium",htmlFor:f,color:p.color_gray_52,onClick:()=>!d&&T(),mb:p.spacing_100,children:f}):w(Ir,{children:f}),[d,T,f]);if(y)return Q(Ir,{children:[w(I,{}),w(Wd,{tabIndex:0,ref:g,right:w(gt,{ml:p.spacing_100,children:w(Zw,{onClick:x,disabled:v,children:v?w(ye.Loop,{}):w(ye.Check,{})})}),children:w(gN,{saving:v,children:e})})]});const z={p:a,...D,...P};return m?z.id=m:f!==void 0&&(z.id=f),Q(Ir,{children:[w(I,{}),Q(yN,{onClick:T,...z,"data-id":b["data-id"],disabled:d,children:[`${r}`||w(vN,{children:t}),!o&&!d&&w($N,{valid:u,children:w(ye.Edit,{})})]})]})};Xw.displayName="InlineEdit";const _N=O.default(Mt)`
|
|
2371
|
+
`,Xw=({children:e,placeholder:t,value:r="",editValue:n,hideIcon:o,p:a="7px 8px",onChange:i=()=>!1,onToggle:l=g=>g,onCancel:s=()=>!1,disabled:d=!1,valid:u=!0,label:f,labelId:m,allowedOutsideClickContainers:h,...b})=>{const g=c.useRef(null),[v,$]=c.useState(!1),[y,_]=c.useState(!1),D=Et(b,Vt.propNames??[]),P=Et(b,$i.propNames??[]),L=c.useCallback(()=>{$(!1),l(!1),_(!1)},[l]),T=c.useCallback(()=>{l(!0),_(!0)},[l]),x=c.useCallback(E=>{if(n&&n===r){L();return}$(!0),(async()=>{try{await i()}catch{throw new Error("failed to handle async inline edit change")}})().then(()=>{L()}).catch(()=>{L()})},[n,i,L,r]);c.useEffect(()=>{const E=()=>{L(),s()};return document.addEventListener("mousedown",V=>qw(V,g,E,h)),()=>document.removeEventListener("mousedown",V=>qw(V,g,E,h))},[h,s,L]),c.useEffect(()=>L,[]);const I=c.useCallback(()=>f&&typeof f=="string"?w(We,{bold:!0,size:"medium",htmlFor:f,color:p.color_gray_52,onClick:()=>!d&&T(),mb:p.spacing_100,children:f}):w(Ir,{children:f}),[d,T,f]);if(y)return Q(Ir,{children:[w(I,{}),w(Wd,{tabIndex:0,ref:g,right:w(gt,{ml:p.spacing_100,children:w(Zw,{onClick:x,disabled:v,"aria-label":"save",children:v?w(ye.Loop,{}):w(ye.Check,{})})}),children:w(gN,{saving:v,children:e})})]});const z={p:a,...D,...P};return m?z.id=m:f!==void 0&&(z.id=f),Q(Ir,{children:[w(I,{}),Q(yN,{onClick:T,...z,"data-id":b["data-id"],disabled:d,children:[`${r}`||w(vN,{children:t}),!o&&!d&&w($N,{valid:u,children:w(ye.Edit,{})})]})]})};Xw.displayName="InlineEdit";const _N=O.default(Mt)`
|
|
2372
2372
|
font-family: ${p.font_family_pingo};
|
|
2373
2373
|
font-size: 0.875rem;
|
|
2374
2374
|
font-style: normal;
|