fansunited-management-components 1.54.1-RC4 → 1.54.1
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/index.es.js +1 -0
- package/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/Inputs/NumberInput/NumberInput.d.ts +2 -0
- package/src/components/Inputs/NumberInput/NumberInput.d.ts.map +1 -1
- package/src/constants/components.d.ts +1 -0
- package/src/constants/components.d.ts.map +1 -1
- package/src/context/ComponentContext.d.ts +1 -0
- package/src/context/ComponentContext.d.ts.map +1 -1
package/index.es.js
CHANGED
|
@@ -31533,6 +31533,7 @@ const NB = H.forwardRef(function(t, n) {
|
|
|
31533
31533
|
sx: e.sx,
|
|
31534
31534
|
value: e.defaultValue,
|
|
31535
31535
|
onChange: t,
|
|
31536
|
+
disabled: e.disabled || !1,
|
|
31536
31537
|
slotProps: {
|
|
31537
31538
|
input: {
|
|
31538
31539
|
component: NB,
|
package/index.umd.js
CHANGED
|
@@ -2468,7 +2468,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2468
2468
|
Prefix can't start with '-' when allowNegative is true.
|
|
2469
2469
|
prefix: `+i+`
|
|
2470
2470
|
allowNegative: `+o+`
|
|
2471
|
-
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function GB(e){e=WB(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=or);var o=e.onBlur;o===void 0&&(o=or);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,c=e.prefix;c===void 0&&(c="");var d=e.defaultValue,f=e.value,h=e.valueIsNumericString,p=e.onValueChange,m=ov(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=hs(e),v=g.decimalSeparator,w=g.allowedDecimalSeparators,S=function($){return gv($,e)},x=function($,B){return VB($,B,e)},I=di(f)?d:f,y=h!=null?h:UB(I,c,t);di(f)?di(d)||(y=y||typeof d=="number"):y=y||typeof f=="number";var A=function($){return av($)?$:(typeof $=="number"&&($=uv($)),y&&typeof s=="number"?dv($,s,!!l):$)},E=pv(A(f),A(d),!!y,S,x,p),k=E[0],z=k.numAsString,Y=k.formattedValue,D=E[1],T=function($){var B=$.target,H=$.key,Q=B.selectionStart,te=B.selectionEnd,R=B.value;if(R===void 0&&(R=""),(H==="Backspace"||H==="Delete")&&te<c.length){$.preventDefault();return}if(Q!==te){i($);return}H==="Backspace"&&R[0]==="-"&&Q===c.length+1&&n&&Ar(B,1),s&&l&&(H==="Backspace"&&R[Q-1]===v?(Ar(B,Q-1),$.preventDefault()):H==="Delete"&&R[Q]===v&&$.preventDefault()),w!=null&&w.includes(H)&&R[Q]===v&&Ar(B,Q+1);var M=a===!0?",":a;H==="Backspace"&&R[Q-1]===M&&Ar(B,Q-1),H==="Delete"&&R[Q]===M&&Ar(B,Q+1),i($)},F=function($){var B=z;if(B.match(/\d/g)||(B=""),r||(B=_B(B)),l&&s&&(B=dv(B,s,l)),B!==z){var H=gv(B,e);D({formattedValue:H,value:B,floatValue:parseFloat(B)},{event:$,source:uo.event})}o($)},V=function($){return $===v?!0:fo($)},j=function($){var B=$.currentValue,H=$.lastValue,Q=$.formattedValue,te=$.currentValueIndex,R=$.formattedValueIndex,M=B[te],U=Q[R],G=fv(H,B),ne=G.to,se=function(ae){return x(ae).indexOf(".")+c.length};return f===0&&l&&s&&B[ne.start]===v&&se(B)<te&&se(Q)>R?!1:te>=ne.start&&te<ne.end&&w&&w.includes(M)&&U===v?!0:M===U};return Object.assign(Object.assign({},m),{value:Y,valueIsNumericString:!1,isValidInputCharacter:V,isCharacterSame:j,onValueChange:D,format:S,removeFormatting:x,getCaretBoundary:function($){return HB($,e)},onKeyDown:T,onBlur:F})}function YB(e){var t=GB(e);return C.createElement(FB,Object.assign({},t))}const KB=W.forwardRef(function(t,n){const a=t,{onChange:r,isAllowed:i}=a,o=Ge(a,["onChange","isAllowed"]);return u.jsx(YB,q(N({},o),{getInputRef:n,onValueChange:s=>{r({target:{name:t.name,value:s.value}})},thousandSeparator:!0,valueIsNumericString:!0,isAllowed:i}))}),xu=e=>{const t=n=>{e.onChange(Number(n.target.value))};return u.jsxs(fu,{size:e.size||"sm",children:[u.jsx(hu,{children:e.label}),u.jsx(Wa,{sx:e.sx,value:e.defaultValue,onChange:t,slotProps:{input:{component:KB,isAllowed:e.isAllowed?e.isAllowed:()=>!0}}}),e.description?u.jsx(b.FormHelperText,{children:e.description}):u.jsx(u.Fragment,{})]})},QB=e=>e.startsWith("fb:c:")?"competition":e.startsWith("fb:t:")?"team":"player",qB=(e,t,n,r)=>{const i=e.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),o=e.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),a=e.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),s=[],l=[];if(i.length>0){const c=t.football.getCompetitions({competitionIds:i}).then(d=>{l.push(d)}).catch(d=>{console.error(d),r()});s.push(c)}if(o.length>0){const c=t.football.getTeams({teamIds:o}).then(d=>{l.push(d.data)}).catch(d=>{console.error(d),r()});s.push(c)}if(a.length>0){const c=t.football.getPlayers({playerIds:a}).then(d=>{l.push(d.data)}).catch(d=>{console.error(d),r()});s.push(c)}Promise.all(s).then(()=>{const d=Array.prototype.concat.apply([],l).map(f=>JB(f));n(d)})},JB=e=>{const t=new rv;return t.label=e.name,t.value=e.name,t.id=e.id,t.group=QB(e.id),e.birthDate?t.logo=e.assets&&e.assets.headshot&&e.assets.headshot:t.logo=e.assets&&e.assets.logo&&e.assets.logo,t.countryName=e.country.name,t.countryFlag=e.country.assets&&e.country.assets.flag?e.country.assets.flag:ze.country,t},XB=10,ZB=e=>{const[t,n]=C.useState([]),[r,i]=C.useState([]),[o,a]=C.useState(!1),[s,l]=C.useState(""),[c,d]=C.useState(!1),{sdk:f}=lt(),h=()=>d(!c),p=(v,w)=>{n(w),e.onChangeTags(w)};C.useEffect(()=>{qB(e.tags,f,n,h)},[e.tags]);const m=C.useMemo(()=>ir(v=>{if(!v){i([]),a(!1);return}a(!0),f.football.search({query:v}).then(w=>{i([...iv(w)]),a(!1)}).catch(w=>{console.error(w),i([]),a(!1)})},300),[]);C.useEffect(()=>(m(s),()=>m.cancel()),[s,m]);const g=(v,w)=>v.map((S,x)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:I=>w({index:x}).onClick(I),children:u.jsx(De.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:S},`option_${S.id}`)},S.id));return u.jsxs(b.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{color:"primary",children:e.labels.contextEntityTag}),u.jsx(b.Autocomplete,{getOptionDisabled:()=>t.length===XB,forcePopupIcon:!1,multiple:!0,loading:o,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(v,w)=>v.id===w.id,endDecorator:o?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:t.length>0?"":e.labels.typeContextTagNamePlaceholder,options:r,filterOptions:v=>v.filter(w=>!t.some(S=>S.value===w.value)),onInputChange:(v,w)=>{l(w)},onChange:p,getOptionKey:v=>v.id,groupBy:v=>v.group+"s",value:t!=null?t:[],renderTags:g,renderOption:(v,w)=>u.jsx(b.AutocompleteOption,q(N({},v),{children:u.jsx(wn,{option:w})}))}),u.jsx(nt,{showToast:c,message:e.labels.getFootballEntitiesErrorMessage,color:"danger",hideToast:h})]})},e$=e=>new Map().set("id",e.id).set("type",e.type).set("label",e.label),t$=e=>{const t=JSON.parse(JSON.stringify(e.context)),n=e.context.content,r=e.context.campaign,i=e$(e.labels),o=(l,c)=>{const d=l.target.value;t.content[c]=d,e.onChange(t)},a=(l,c)=>{const d=l.target.value;t.campaign[c]=d,e.onChange(t)},s=l=>{l.length?t.tags=l.map(c=>({id:c.id,type:c.group,source:"football"})):t.tags=[],e.onChange(t)};return u.jsx(u.Fragment,{children:u.jsxs(Hh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[u.jsxs(Wh,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${hc.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[u.jsx(Hr,{children:e.labels.tags}),u.jsx(Hr,{children:e.labels.content}),u.jsx(Hr,{children:e.labels.campaign})]}),u.jsx(Zr,{value:0,sx:{px:0},children:u.jsx(ZB,{labels:e.labels,tags:e.context.tags,onChangeTags:s})}),u.jsx(Zr,{value:1,sx:{px:0},children:Object.keys(n).map(l=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{label:i.get(l),placeholder:"",defaultValue:n[l],required:!1,size:"sm",onChange:c=>o(c,l)})},`context-content-${l}`))}),u.jsx(Zr,{value:2,sx:{px:0},children:Object.keys(r).map(l=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{label:i.get(l),placeholder:"",defaultValue:r[l],required:!1,size:"sm",onChange:c=>a(c,l)})},`context-campaign-${l}`))})]})})},n$=e=>e?N({},e):{main:"",mobile:""},r$=e=>{const[t,n]=C.useState(!1),r=n$(e.defaultValue),i=(a,s)=>{r[s]=a,e.onChange(r)},o=a=>{r[a]="",e.onChange(r)};return u.jsxs(b.Box,{sx:{marginBottom:"10px"},children:[u.jsx(lo,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:a=>i(a,"main"),clearImage:()=>o("main")}),u.jsx(b.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?u.jsx(lo,{labels:e.labels,title:e.labels.mobileImage,image:r.mobile,onChangeImages:a=>i(a,"mobile"),clearImage:()=>o("mobile")}):u.jsx(u.Fragment,{})]})},i$=({defaultValue:e,isClearable:t=!0,labels:n,onChange:r})=>{const i=C.useRef(null),o=[{id:"FREE",label:n.free},{id:"LEAD",label:n.lead},{id:"REGISTERED",label:n.registered},{id:"PAID",label:n.paid}];return u.jsxs(b.FormControl,{size:"sm",sx:{mb:2},children:[u.jsx(b.FormLabel,{children:n.authRequirement}),u.jsx(b.Select,q(N({value:e,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,s)=>r(s),sx:{minHeight:"37px"}},e&&t&&{endDecorator:u.jsx(b.IconButton,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;r(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:u.jsx(bm,{})}),indicator:null}),{children:o.map(a=>u.jsx(b.Option,{value:a.id,children:a.label},a.id))})),u.jsx(b.FormHelperText,{children:n.authRequirementDescription})]})};function o$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const ps=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function fi(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Cu(e){return"nodeType"in e}function Rt(e){var t,n;return e?fi(e)?e:Cu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function wu(e){const{Document:t}=Rt(e);return e instanceof t}function ho(e){return fi(e)?!1:e instanceof Rt(e).HTMLElement}function mv(e){return e instanceof Rt(e).SVGElement}function hi(e){return e?fi(e)?e.document:Cu(e)?wu(e)?e:ho(e)||mv(e)?e.ownerDocument:document:document:document}const ln=ps?C.useLayoutEffect:C.useEffect;function gs(e){const t=C.useRef(e);return ln(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function a$(){const e=C.useRef(null),t=C.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function po(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return ln(()=>{n.current!==e&&(n.current=e)},t),n}function go(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ms(e){const t=gs(e),n=C.useRef(null),r=C.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function vs(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Iu={};function mo(e,t){return C.useMemo(()=>{if(t)return t;const n=Iu[e]==null?0:Iu[e]+1;return Iu[e]=n,e+"-"+n},[e,t])}function vv(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const s=Object.entries(a);for(const[l,c]of s){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},N({},t))}}const pi=vv(1),vo=vv(-1);function s$(e){return"clientX"in e&&"clientY"in e}function bs(e){if(!e)return!1;const{KeyboardEvent:t}=Rt(e.target);return t&&e instanceof t}function l$(e){if(!e)return!1;const{TouchEvent:t}=Rt(e.target);return t&&e instanceof t}function ys(e){if(l$(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return s$(e)?{x:e.clientX,y:e.clientY}:null}const Hn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Hn.Translate.toString(e),Hn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),bv="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function c$(e){return e.matches(bv)?e:e.querySelector(bv)}const u$={display:"none"};function d$(e){let{id:t,value:n}=e;return C.createElement("div",{id:t,style:u$},n)}function f$(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function h$(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const yv=C.createContext(null);function p$(e){const t=C.useContext(yv);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function g$(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const m$={draggable:`
|
|
2471
|
+
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function GB(e){e=WB(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=or);var o=e.onBlur;o===void 0&&(o=or);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,c=e.prefix;c===void 0&&(c="");var d=e.defaultValue,f=e.value,h=e.valueIsNumericString,p=e.onValueChange,m=ov(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=hs(e),v=g.decimalSeparator,w=g.allowedDecimalSeparators,S=function($){return gv($,e)},x=function($,B){return VB($,B,e)},I=di(f)?d:f,y=h!=null?h:UB(I,c,t);di(f)?di(d)||(y=y||typeof d=="number"):y=y||typeof f=="number";var A=function($){return av($)?$:(typeof $=="number"&&($=uv($)),y&&typeof s=="number"?dv($,s,!!l):$)},E=pv(A(f),A(d),!!y,S,x,p),k=E[0],z=k.numAsString,Y=k.formattedValue,D=E[1],T=function($){var B=$.target,H=$.key,Q=B.selectionStart,te=B.selectionEnd,R=B.value;if(R===void 0&&(R=""),(H==="Backspace"||H==="Delete")&&te<c.length){$.preventDefault();return}if(Q!==te){i($);return}H==="Backspace"&&R[0]==="-"&&Q===c.length+1&&n&&Ar(B,1),s&&l&&(H==="Backspace"&&R[Q-1]===v?(Ar(B,Q-1),$.preventDefault()):H==="Delete"&&R[Q]===v&&$.preventDefault()),w!=null&&w.includes(H)&&R[Q]===v&&Ar(B,Q+1);var M=a===!0?",":a;H==="Backspace"&&R[Q-1]===M&&Ar(B,Q-1),H==="Delete"&&R[Q]===M&&Ar(B,Q+1),i($)},F=function($){var B=z;if(B.match(/\d/g)||(B=""),r||(B=_B(B)),l&&s&&(B=dv(B,s,l)),B!==z){var H=gv(B,e);D({formattedValue:H,value:B,floatValue:parseFloat(B)},{event:$,source:uo.event})}o($)},V=function($){return $===v?!0:fo($)},j=function($){var B=$.currentValue,H=$.lastValue,Q=$.formattedValue,te=$.currentValueIndex,R=$.formattedValueIndex,M=B[te],U=Q[R],G=fv(H,B),ne=G.to,se=function(ae){return x(ae).indexOf(".")+c.length};return f===0&&l&&s&&B[ne.start]===v&&se(B)<te&&se(Q)>R?!1:te>=ne.start&&te<ne.end&&w&&w.includes(M)&&U===v?!0:M===U};return Object.assign(Object.assign({},m),{value:Y,valueIsNumericString:!1,isValidInputCharacter:V,isCharacterSame:j,onValueChange:D,format:S,removeFormatting:x,getCaretBoundary:function($){return HB($,e)},onKeyDown:T,onBlur:F})}function YB(e){var t=GB(e);return C.createElement(FB,Object.assign({},t))}const KB=W.forwardRef(function(t,n){const a=t,{onChange:r,isAllowed:i}=a,o=Ge(a,["onChange","isAllowed"]);return u.jsx(YB,q(N({},o),{getInputRef:n,onValueChange:s=>{r({target:{name:t.name,value:s.value}})},thousandSeparator:!0,valueIsNumericString:!0,isAllowed:i}))}),xu=e=>{const t=n=>{e.onChange(Number(n.target.value))};return u.jsxs(fu,{size:e.size||"sm",children:[u.jsx(hu,{children:e.label}),u.jsx(Wa,{sx:e.sx,value:e.defaultValue,onChange:t,disabled:e.disabled||!1,slotProps:{input:{component:KB,isAllowed:e.isAllowed?e.isAllowed:()=>!0}}}),e.description?u.jsx(b.FormHelperText,{children:e.description}):u.jsx(u.Fragment,{})]})},QB=e=>e.startsWith("fb:c:")?"competition":e.startsWith("fb:t:")?"team":"player",qB=(e,t,n,r)=>{const i=e.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),o=e.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),a=e.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),s=[],l=[];if(i.length>0){const c=t.football.getCompetitions({competitionIds:i}).then(d=>{l.push(d)}).catch(d=>{console.error(d),r()});s.push(c)}if(o.length>0){const c=t.football.getTeams({teamIds:o}).then(d=>{l.push(d.data)}).catch(d=>{console.error(d),r()});s.push(c)}if(a.length>0){const c=t.football.getPlayers({playerIds:a}).then(d=>{l.push(d.data)}).catch(d=>{console.error(d),r()});s.push(c)}Promise.all(s).then(()=>{const d=Array.prototype.concat.apply([],l).map(f=>JB(f));n(d)})},JB=e=>{const t=new rv;return t.label=e.name,t.value=e.name,t.id=e.id,t.group=QB(e.id),e.birthDate?t.logo=e.assets&&e.assets.headshot&&e.assets.headshot:t.logo=e.assets&&e.assets.logo&&e.assets.logo,t.countryName=e.country.name,t.countryFlag=e.country.assets&&e.country.assets.flag?e.country.assets.flag:ze.country,t},XB=10,ZB=e=>{const[t,n]=C.useState([]),[r,i]=C.useState([]),[o,a]=C.useState(!1),[s,l]=C.useState(""),[c,d]=C.useState(!1),{sdk:f}=lt(),h=()=>d(!c),p=(v,w)=>{n(w),e.onChangeTags(w)};C.useEffect(()=>{qB(e.tags,f,n,h)},[e.tags]);const m=C.useMemo(()=>ir(v=>{if(!v){i([]),a(!1);return}a(!0),f.football.search({query:v}).then(w=>{i([...iv(w)]),a(!1)}).catch(w=>{console.error(w),i([]),a(!1)})},300),[]);C.useEffect(()=>(m(s),()=>m.cancel()),[s,m]);const g=(v,w)=>v.map((S,x)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:I=>w({index:x}).onClick(I),children:u.jsx(De.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:S},`option_${S.id}`)},S.id));return u.jsxs(b.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{color:"primary",children:e.labels.contextEntityTag}),u.jsx(b.Autocomplete,{getOptionDisabled:()=>t.length===XB,forcePopupIcon:!1,multiple:!0,loading:o,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(v,w)=>v.id===w.id,endDecorator:o?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:t.length>0?"":e.labels.typeContextTagNamePlaceholder,options:r,filterOptions:v=>v.filter(w=>!t.some(S=>S.value===w.value)),onInputChange:(v,w)=>{l(w)},onChange:p,getOptionKey:v=>v.id,groupBy:v=>v.group+"s",value:t!=null?t:[],renderTags:g,renderOption:(v,w)=>u.jsx(b.AutocompleteOption,q(N({},v),{children:u.jsx(wn,{option:w})}))}),u.jsx(nt,{showToast:c,message:e.labels.getFootballEntitiesErrorMessage,color:"danger",hideToast:h})]})},e$=e=>new Map().set("id",e.id).set("type",e.type).set("label",e.label),t$=e=>{const t=JSON.parse(JSON.stringify(e.context)),n=e.context.content,r=e.context.campaign,i=e$(e.labels),o=(l,c)=>{const d=l.target.value;t.content[c]=d,e.onChange(t)},a=(l,c)=>{const d=l.target.value;t.campaign[c]=d,e.onChange(t)},s=l=>{l.length?t.tags=l.map(c=>({id:c.id,type:c.group,source:"football"})):t.tags=[],e.onChange(t)};return u.jsx(u.Fragment,{children:u.jsxs(Hh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[u.jsxs(Wh,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${hc.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[u.jsx(Hr,{children:e.labels.tags}),u.jsx(Hr,{children:e.labels.content}),u.jsx(Hr,{children:e.labels.campaign})]}),u.jsx(Zr,{value:0,sx:{px:0},children:u.jsx(ZB,{labels:e.labels,tags:e.context.tags,onChangeTags:s})}),u.jsx(Zr,{value:1,sx:{px:0},children:Object.keys(n).map(l=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{label:i.get(l),placeholder:"",defaultValue:n[l],required:!1,size:"sm",onChange:c=>o(c,l)})},`context-content-${l}`))}),u.jsx(Zr,{value:2,sx:{px:0},children:Object.keys(r).map(l=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{label:i.get(l),placeholder:"",defaultValue:r[l],required:!1,size:"sm",onChange:c=>a(c,l)})},`context-campaign-${l}`))})]})})},n$=e=>e?N({},e):{main:"",mobile:""},r$=e=>{const[t,n]=C.useState(!1),r=n$(e.defaultValue),i=(a,s)=>{r[s]=a,e.onChange(r)},o=a=>{r[a]="",e.onChange(r)};return u.jsxs(b.Box,{sx:{marginBottom:"10px"},children:[u.jsx(lo,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:a=>i(a,"main"),clearImage:()=>o("main")}),u.jsx(b.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?u.jsx(lo,{labels:e.labels,title:e.labels.mobileImage,image:r.mobile,onChangeImages:a=>i(a,"mobile"),clearImage:()=>o("mobile")}):u.jsx(u.Fragment,{})]})},i$=({defaultValue:e,isClearable:t=!0,labels:n,onChange:r})=>{const i=C.useRef(null),o=[{id:"FREE",label:n.free},{id:"LEAD",label:n.lead},{id:"REGISTERED",label:n.registered},{id:"PAID",label:n.paid}];return u.jsxs(b.FormControl,{size:"sm",sx:{mb:2},children:[u.jsx(b.FormLabel,{children:n.authRequirement}),u.jsx(b.Select,q(N({value:e,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,s)=>r(s),sx:{minHeight:"37px"}},e&&t&&{endDecorator:u.jsx(b.IconButton,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;r(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:u.jsx(bm,{})}),indicator:null}),{children:o.map(a=>u.jsx(b.Option,{value:a.id,children:a.label},a.id))})),u.jsx(b.FormHelperText,{children:n.authRequirementDescription})]})};function o$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const ps=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function fi(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Cu(e){return"nodeType"in e}function Rt(e){var t,n;return e?fi(e)?e:Cu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function wu(e){const{Document:t}=Rt(e);return e instanceof t}function ho(e){return fi(e)?!1:e instanceof Rt(e).HTMLElement}function mv(e){return e instanceof Rt(e).SVGElement}function hi(e){return e?fi(e)?e.document:Cu(e)?wu(e)?e:ho(e)||mv(e)?e.ownerDocument:document:document:document}const ln=ps?C.useLayoutEffect:C.useEffect;function gs(e){const t=C.useRef(e);return ln(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function a$(){const e=C.useRef(null),t=C.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function po(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return ln(()=>{n.current!==e&&(n.current=e)},t),n}function go(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ms(e){const t=gs(e),n=C.useRef(null),r=C.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function vs(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Iu={};function mo(e,t){return C.useMemo(()=>{if(t)return t;const n=Iu[e]==null?0:Iu[e]+1;return Iu[e]=n,e+"-"+n},[e,t])}function vv(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const s=Object.entries(a);for(const[l,c]of s){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},N({},t))}}const pi=vv(1),vo=vv(-1);function s$(e){return"clientX"in e&&"clientY"in e}function bs(e){if(!e)return!1;const{KeyboardEvent:t}=Rt(e.target);return t&&e instanceof t}function l$(e){if(!e)return!1;const{TouchEvent:t}=Rt(e.target);return t&&e instanceof t}function ys(e){if(l$(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return s$(e)?{x:e.clientX,y:e.clientY}:null}const Hn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Hn.Translate.toString(e),Hn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),bv="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function c$(e){return e.matches(bv)?e:e.querySelector(bv)}const u$={display:"none"};function d$(e){let{id:t,value:n}=e;return C.createElement("div",{id:t,style:u$},n)}function f$(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function h$(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const yv=C.createContext(null);function p$(e){const t=C.useContext(yv);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function g$(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const m$={draggable:`
|
|
2472
2472
|
To pick up a draggable item, press the space bar.
|
|
2473
2473
|
While dragging, use the arrow keys to move the item.
|
|
2474
2474
|
Press space again to drop the item in its new position, or press escape to cancel.
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ type NumberInputProps = {
|
|
|
9
9
|
isAllowed?: (values: NumberFormatValues) => boolean;
|
|
10
10
|
sx?: SxProps;
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
disabled?: boolean;
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
15
|
* Numeric input with thousand separator formatting.
|
|
@@ -22,6 +23,7 @@ type NumberInputProps = {
|
|
|
22
23
|
* @property {(values: NumberFormatValues) => boolean} [isAllowed] - Optional additional constraints.
|
|
23
24
|
* @property {import('@mui/material').SxProps} [sx] - Styles applied to Input.
|
|
24
25
|
* @property {'sm'|'md'|'lg'} [size='sm'] - Control size.
|
|
26
|
+
* @property {boolean} [disabled=false] - Disable control.
|
|
25
27
|
*/
|
|
26
28
|
declare const NumberInput: React.FC<NumberInputProps>;
|
|
27
29
|
export default NumberInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAqC,MAAM,qBAAqB,CAAC;AAK5F,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA8BxC,KAAK,gBAAgB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC;IACpD,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAqC,MAAM,qBAAqB,CAAC;AAK5F,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA8BxC,KAAK,gBAAgB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC;IACpD,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuB3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -302,6 +302,7 @@ export declare const components: {
|
|
|
302
302
|
isAllowed?: (values: import('react-number-format').NumberFormatValues) => boolean;
|
|
303
303
|
sx?: import('@mui/material').SxProps;
|
|
304
304
|
size?: "sm" | "md" | "lg";
|
|
305
|
+
disabled?: boolean;
|
|
305
306
|
}>;
|
|
306
307
|
/**
|
|
307
308
|
* Tabs to manage entity context: tags, content, and campaign metadata.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/constants/components.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,UAAU;IACtB;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;kBA9DwF,CAAC;qBAC/E,CAAC;iBAAiB,CAAA;;;;IA+D/B;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;;;OAIG
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/constants/components.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,UAAU;IACtB;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;kBA9DwF,CAAC;qBAC/E,CAAC;iBAAiB,CAAA;;;;IA+D/B;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;;;;;;;OAQG;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;;;IAEH;;OAEG;;;;;IAEH;;;;;OAKG;;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;;;;OAKG;;;oCA9O8B,CAAC;;;;;;;;;;;;;;;;;;CAgPzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,UAAU,CAAC"}
|
|
@@ -210,6 +210,7 @@ declare const ComponentContext: React.Context<{
|
|
|
210
210
|
isAllowed?: (values: import('react-number-format').NumberFormatValues) => boolean;
|
|
211
211
|
sx?: import('@mui/material').SxProps;
|
|
212
212
|
size?: "sm" | "md" | "lg";
|
|
213
|
+
disabled?: boolean;
|
|
213
214
|
}>;
|
|
214
215
|
readonly EntityContext: React.FC<{
|
|
215
216
|
labels: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentContext.d.ts","sourceRoot":"","sources":["../../../src/context/ComponentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3E,KAAK,sBAAsB,GAAG;IAC7B,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAamzB,CAAC;qBAAoB,CAAC;iBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"ComponentContext.d.ts","sourceRoot":"","sources":["../../../src/context/ComponentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3E,KAAK,sBAAsB,GAAG;IAC7B,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAamzB,CAAC;qBAAoB,CAAC;iBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAAztB,CAAC;;;;;;;;;;;;;;;;;;SAblF,CAAC;AAEvE;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,GAAG,iBAAiB,CAE3E,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC"}
|