fansunited-management-components 1.50.0 → 1.50.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.
- package/index.es.js +2 -5
- package/index.umd.js +2 -2
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -35948,7 +35948,7 @@ const Iy = Qe(/* @__PURE__ */ u.jsx("path", {
|
|
|
35948
35948
|
data-poll-url="${s}"` : "", x = d ? Math.min(50, Math.max(1, d)) : 1, b = h ? Math.min(5, Math.max(1, h)) : 1, I = `
|
|
35949
35949
|
data-items-count="${x}"`, A = `
|
|
35950
35950
|
data-items-per-row="${b}"`, E = `
|
|
35951
|
-
data-widget-
|
|
35951
|
+
data-widget-mode="${m}"`, _ = `<div
|
|
35952
35952
|
data-component="fu-widget"
|
|
35953
35953
|
data-content-type="list"${v}${w}${C}${y}${I}${A}${E}
|
|
35954
35954
|
></div>`, H = ({ title: N }) => /* @__PURE__ */ u.jsx(Oe, { title: N, sx: { maxWidth: 300 }, children: /* @__PURE__ */ u.jsx(vi, { color: "primary" }) }), $ = () => /* @__PURE__ */ u.jsxs(pn, { sx: { pb: 1, mb: 3 }, children: [
|
|
@@ -36018,10 +36018,7 @@ const Iy = Qe(/* @__PURE__ */ u.jsx("path", {
|
|
|
36018
36018
|
children: [
|
|
36019
36019
|
/* @__PURE__ */ u.jsx(Ye, { color: "primary", children: t.mode }),
|
|
36020
36020
|
/* @__PURE__ */ u.jsx(Ut, { defaultValue: m, onChange: (N, W) => g(W), children: oz.map((N, W) => /* @__PURE__ */ u.jsx(Et, { value: N, children: az[N] }, `basic-select-${N}-${W}`)) }),
|
|
36021
|
-
/* @__PURE__ */ u.
|
|
36022
|
-
t.modeDescription,
|
|
36023
|
-
'Choose how items load in a list. "Load more" shows pages with a Load more button. "Limited" shows only the first "Items per page" items and no option to load more content.'
|
|
36024
|
-
] })
|
|
36021
|
+
/* @__PURE__ */ u.jsx(Ri, { children: t.modeDescription })
|
|
36025
36022
|
]
|
|
36026
36023
|
}
|
|
36027
36024
|
)
|
package/index.umd.js
CHANGED
|
@@ -2487,7 +2487,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2487
2487
|
data-poll-url="${l}"`:"",w=d?Math.min(50,Math.max(1,d)):1,y=h?Math.min(5,Math.max(1,h)):1,A=`
|
|
2488
2488
|
data-items-count="${w}"`,E=`
|
|
2489
2489
|
data-items-per-row="${y}"`,_=`
|
|
2490
|
-
data-widget-
|
|
2490
|
+
data-widget-mode="${m}"`,D=`<div
|
|
2491
2491
|
data-component="fu-widget"
|
|
2492
2492
|
data-content-type="list"${v}${S}${I}${x}${A}${E}${_}
|
|
2493
|
-
></div>`,G=({title:j})=>u.jsx(b.Tooltip,{title:j,sx:{maxWidth:300},children:u.jsx(ni,{color:"primary"})}),F=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xn,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.quizzesInfoMessage}),onChange:j=>o(j.target.value)}),u.jsx(xn,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:j=>s(j.target.value)}),u.jsx(xn,{label:t.pollURL,placeholder:"",defaultValue:l,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.pollsInfoMessage}),onChange:j=>c(j.target.value)})]}),T=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xu,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:d,onChange:j=>f(j||null),size:"md"}),u.jsx(xu,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:h,onChange:j=>p(j||null),size:"md"}),u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:t.mode}),u.jsx(b.Select,{defaultValue:m,onChange:(j,Y)=>g(Y),children:hF.map((j,Y)=>u.jsx(b.Option,{value:j,children:pF[j]},`basic-select-${j}-${Y}`))}),u.
|
|
2493
|
+
></div>`,G=({title:j})=>u.jsx(b.Tooltip,{title:j,sx:{maxWidth:300},children:u.jsx(ni,{color:"primary"})}),F=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xn,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.quizzesInfoMessage}),onChange:j=>o(j.target.value)}),u.jsx(xn,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:j=>s(j.target.value)}),u.jsx(xn,{label:t.pollURL,placeholder:"",defaultValue:l,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.pollsInfoMessage}),onChange:j=>c(j.target.value)})]}),T=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xu,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:d,onChange:j=>f(j||null),size:"md"}),u.jsx(xu,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:h,onChange:j=>p(j||null),size:"md"}),u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:t.mode}),u.jsx(b.Select,{defaultValue:m,onChange:(j,Y)=>g(Y),children:hF.map((j,Y)=>u.jsx(b.Option,{value:j,children:pF[j]},`basic-select-${j}-${Y}`))}),u.jsx(b.FormHelperText,{children:t.modeDescription})]})]});return u.jsxs(b.Box,{mt:1,children:[T(),u.jsx(fs,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:j=>{j===!1&&(o(""),s(""),c("")),r(j)}}),n&&F(),u.jsxs(b.Box,{position:"relative",mb:1,children:[u.jsx(b.Textarea,{value:D,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:j=>j.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),u.jsx(b.Tooltip,{title:t.copyToClipboard,children:u.jsx(b.Button,{onClick:()=>{navigator.clipboard.writeText(D)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:u.jsx(Oe.ContentCopy,{})})})]}),u.jsx(b.Alert,{variant:"outlined",color:"primary",startDecorator:u.jsx(ni,{}),sx:{mb:1,width:"fit-content"},children:u.jsxs(b.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,u.jsx(b.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},db=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],mF={Login:qR,InformationInput:xn,RichText:dc,HeaderButtons:SP,MarketSelection:uL,Accordion:fT,DynamicFields:jP,BasicSelect:pT,BooleanSwitch:fs,Branding:IP,ProfileSearchSelect:DM,RangeCalendar:FP,CompetitionSearchSelect:_M,Related:pL,Images:AR,Duration:NP,DatePickerComponent:no,Flags:CR,Spinner:ds,Tags:Rm,Toast:at,AdContent:hT,Match:dL,Winners:xB,CompetitionsSearchSelect:PM,TeamsSearchSelect:OM,CustomSelect:PL,Schedule:IL,NoPermissionCard:zP,CustomFlatpickrCalendar:qc,ContextSelectFilter:wB,NumberInput:xu,EntityContext:e$,MiniGamesImages:n$,AuthRequirement:r$,SortableList:YN,ItemsPerPageFilter:KN,ImageCard:lo,RelatedRelationship:lF,ExportUsersLeads:cF,SignOutButton:sg,BasicSortableList:dF,WidgetEmbedCode:fF,WidgetListEmbedCode:gF,AdvancedProfileSearchSelect:({labels:e,ids:t,onChange:n})=>{const[r,i]=C.useState([]),[o,a]=C.useState([]),[s,l]=C.useState(""),[c,d]=C.useState("name"),[f,h]=C.useState(!1),[p,m]=C.useState(!1),{sdk:g}=ft(),v=!0,S=()=>m(!p),I=(A,E)=>{i(E);const _=E.map(D=>D.id);n(_&&_.length?_:null)},x=3;C.useEffect(()=>{!s&&t&&t.length&&g.profile.getByIds(t,void 0,v).then(A=>{i(db(A))}).catch(A=>{S(),console.error(A),i([])})},[]);const w=C.useMemo(()=>Sr((A,E)=>{h(!0),g.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,v).then(_=>{a([...db(_)]),h(!1)}).catch(_=>{console.error(_),S(),a([]),h(!1)})},300),[]);C.useEffect(()=>{if(!s||s.length<x){a([]);return}return w(s,c),()=>w.cancel()},[s,w,c]);const y=(A,E)=>A.map((_,D)=>{var G;return u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:F=>E({index:D}).onClick(F),children:u.jsx(Oe.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=_.avatar)!=null?G:st.avatar}),u.jsx(b.Typography,{children:_.label})]})},_.id)});return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{marginBottom:"16px"},children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:f,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:u.jsxs(u.Fragment,{children:[f&&u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),u.jsx(b.Divider,{orientation:"vertical"}),u.jsxs(b.Select,{variant:"plain",value:c,onChange:(A,E)=>d(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[u.jsx(b.Option,{value:"name",children:e.searchByName}),u.jsx(b.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(_=>_.value===E.value)),onInputChange:(A,E)=>{l(E)},onChange:I,getOptionKey:A=>A.id,value:r,renderTags:y,renderOption:(A,E)=>{var _;return u.jsx(b.AutocompleteOption,Q(N({},A),{children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(_=E.avatar)!=null?_:st.avatar}),u.jsx(b.Typography,{children:E.label})]})}))}})}),u.jsx(at,{showToast:p,message:e.searchProfilesErrorMessage,color:"danger",hideToast:S})]})},FormatNumber:({value:e,sx:t,tooltipPlacement:n})=>{const r=l=>{const c=Math.abs(l);return c>=1e9?(l/1e9).toFixed(1)+"b":c>=1e6?(l/1e6).toFixed(1)+"m":c>=1e3?(l/1e3).toFixed(1)+"k":l.toString()},i=l=>new Intl.NumberFormat("en-US").format(l),o=Math.abs(e)>=1e3,a=r(e),s=i(e);return o?u.jsx(b.Tooltip,{title:s,placement:n,arrow:!0,children:u.jsx(b.Typography,{sx:t,children:a})}):u.jsx(b.Typography,{sx:t,children:a})}},fb=C.createContext(null),vF=({children:e})=>u.jsx(fb.Provider,{value:mF,children:e}),bF=()=>{const e=C.useContext(fb);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},hb=425,pb=1024;return{APIProvider:AI,AuthProvider:TI,AuthContext:jf,ComponentProvider:vF,useComponentContext:bF,useAPIContext:ft,useIsMobile:()=>{const[e,t]=C.useState(window.innerWidth<=pb),[n,r]=C.useState(window.innerWidth<=hb);return C.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=pb),r(window.innerWidth<=hb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}}}});
|