{"version":3,"sources":["shared/Table/index.module.css","shared/Input/index.module.css","pages/Statistic/FilterForm/index.module.css","pages/Statistic/index.module.css","shared/types.ts","shared/Table/index.tsx","services/api/statistics-type.enum.ts","pages/Statistic/filter.store.ts","pages/Statistic/items.store.ts","shared/Input/index.tsx","pages/Statistic/FilterForm/index.tsx","pages/Statistic/index.tsx"],"names":["module","exports","SortType","Table","props","currentSort","setCurrentSort","useState","columns","data","useEffect","forEach","column","sortType","key","type","onSort","_column$sortType","sort","none","desc","asc","nextSortType","applySortToColumn","_jsxs","className","s","table","children","_jsx","thead","map","cell","style","width","sortButton","onClick","header","arrow","arrowDown","arrowUp","arrowHide","tbody","prepareData","row","i","value","j","renderCell","result","index","accessor","sortColumnIndex","findIndex","col","a","b","_columns$sortColumnIn","sortData","render","_Fragment","StatisticsType","ACTION_SET","ACTION_UPDATE","updateStatisticFilterAction","filters","statisticFilterStore","createStore","state","action","statisticItemsStore","items","Input","section","input","placeholder","ariaLabel","ref","inputRef","onChange","e","onInput","lastInputTimer","FilterForm","t","useTranslation","listMods","setListMods","currentMod","setCurrentMod","textSearch","setTextSearch","currentType","setCurrentType","statTypes","id","Global","label","_2TeamsExceptPvp","PvP","FFA","fillForm","filter","getState","textContains","modFamilyId","length","mod","find","item","statType","statisticsType","undefined","sendSearchText","timeout","clearTimeout","window","setTimeout","_statisticFilterStore","dispatch","skip","ApiService","instance","getModFamilies","then","list","name","form","onSubmit","preventDefault","formSearch","target","formRightBlock","formFilterSelect","formSelectLabel","Select","select","dropDownClasName","selectRaitDropDown","change","handleSelectCurrentType","search","selectModDropDown","handleSelectCurrentMod","withRouter","loading","setLoading","hasMore","setHasMore","useMemo","setFilterSort","sortFilter","scrollTo","handleSort","accountId","nickname","href","rel","sortField","sortOrder","victories","losses","Math","round","floor","rating","additional","updateTable","async","apiService","stats","getStats","setStatisticItemsAction","getFilterFromQuery","params","URLSearchParams","location","includes","Number","Object","values","infiniteRef","useInfiniteScroll","hasNextPage","onLoadMore","handleNext","take","nextPageStatisticFilterAction","init","defaultFilter","unsubFilter","subscribe","Tools","isPreRendering","query","entries","append","String","history","replace","pathname","toString","setFilterToQuery","Helmet","sShared","container","main","title","Trans","i18nKey","infiniteScroll","fullSpinner","Spinner","spinner","notFound"],"mappings":"+EACAA,EAAOC,QAAU,CAAC,MAAQ,qBAAqB,MAAQ,qBAAqB,KAAO,oBAAoB,MAAQ,qBAAqB,UAAY,yBAAyB,QAAU,uBAAuB,UAAY,yBAAyB,WAAa,0B,sBCA5PD,EAAOC,QAAU,CAAC,QAAU,uBAAuB,MAAQ,qB,sBCA3DD,EAAOC,QAAU,CAAC,OAAS,2BAA2B,mBAAqB,uCAAuC,kBAAoB,sCAAsC,eAAiB,mCAAmC,iBAAmB,qCAAqC,gBAAkB,oCAAoC,KAAO,yBAAyB,WAAa,+B,sBCA3XD,EAAOC,QAAU,CAAC,KAAO,wBAAwB,MAAQ,yBAAyB,eAAiB,kCAAkC,cAAgB,iCAAiC,YAAc,+BAA+B,SAAW,4BAA4B,QAAU,2B,sHCD7Q,IAAKC,GAIX,SAJWA,OAAQ,eAARA,EAAQ,UAARA,EAAQ,YAInB,CAJWA,MAAQ,K,sBCsBL,SAASC,EAAMC,GAC1B,MAAOC,EAAaC,GAAkBC,sBAChC,QAACC,EAAO,KAAEC,GAAQL,EAExBM,qBAAU,IACNF,EAAQG,SAAQC,GACZA,EAAOC,UACPP,EAAe,CACXQ,IAAKF,EAAOE,IACZC,KAAMH,EAAOC,cAGvB,CAACL,IAEH,MAAMQ,EAAUJ,IAAoB,IAADK,EAC/B,IAAKL,EAAOM,KAAM,OAElB,MAAMH,EAsFd,SAAsBA,GAClB,OAAQA,GACJ,KAAKb,EAASiB,KACV,OAAOjB,EAASkB,KAEpB,KAAKlB,EAASkB,KACV,OAAOlB,EAASmB,IAEpB,KAAKnB,EAASmB,IACV,OAAOnB,EAASiB,KAE5B,CAjGqBG,CACM,QADML,EACrBL,EAAOC,gBAAQ,IAAAI,IAAIf,EAASi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YvL,SAC1BC,cAACuL,IAAO,CAAC3L,UAAWC,IAAE2L,YAG9BxL,cAAC1B,EAAK,CAACK,QAASA,EAASC,KAAM6D,EAAoBiC,cAE9C0C,GAAqD,IAA1C3E,EAAoBiC,WAAWG,QAC3C7E,cAAA,QAAMJ,UAAWC,IAAE4L,SAAS1L,SAAEwD,EAAE,gCAKpD,G","file":"static/js/3.f15c4a8f.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"table\":\"Table_table__37hOM\",\"thead\":\"Table_thead__zvuz5\",\"cell\":\"Table_cell__3bqgm\",\"arrow\":\"Table_arrow__1bFmb\",\"arrowDown\":\"Table_arrowDown__1oa4r\",\"arrowUp\":\"Table_arrowUp__2A53X\",\"arrowHide\":\"Table_arrowHide__33T8w\",\"sortButton\":\"Table_sortButton__1cWJc\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"section\":\"Input_section__1_LgB\",\"input\":\"Input_input__2R5Ps\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"select\":\"FilterForm_select__1Pbi_\",\"selectRaitDropDown\":\"FilterForm_selectRaitDropDown__u1-J2\",\"selectModDropDown\":\"FilterForm_selectModDropDown__noXbs\",\"formRightBlock\":\"FilterForm_formRightBlock__354xv\",\"formFilterSelect\":\"FilterForm_formFilterSelect__2NufW\",\"formSelectLabel\":\"FilterForm_formSelectLabel__2IXRw\",\"form\":\"FilterForm_form__1AzK4\",\"formSearch\":\"FilterForm_formSearch__26Dk2\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"main\":\"Statistic_main__1FoG0\",\"title\":\"Statistic_title__ocp8Y\",\"infiniteScroll\":\"Statistic_infiniteScroll__zaPYG\",\"smoothSpinner\":\"Statistic_smoothSpinner__ls2S2\",\"fullSpinner\":\"Statistic_fullSpinner__3YxJb\",\"notFound\":\"Statistic_notFound__1zAtp\",\"spinner\":\"Statistic_spinner__1tt9Q\"};","export enum SortType {\r\n none,\r\n asc = 'asc',\r\n desc = 'desc'\r\n}","import React, {useState, useEffect} from 'react';\r\n\r\nimport {SortType} from '../types';\r\n\r\nimport s from './index.module.css';\r\n\r\n\r\nexport interface Column {\r\n header: string;\r\n key: string;\r\n width?: string | number;\r\n sort?: boolean;\r\n sortType?: SortType;\r\n accessor?: (row: any, index: number) => any;\r\n render?: (value: any, index: number) => JSX.Element;\r\n onSort?: (key: string, sortType: SortType) => void;\r\n}\r\n\r\nexport interface Row {\r\n [key: string]: any;\r\n}\r\n\r\nexport default function Table(props: {columns: Column[], data: Row[]}) {\r\n const [currentSort, setCurrentSort] = useState<{key: string, type: SortType}>();\r\n const {columns, data} = props;\r\n\r\n useEffect(() =>\r\n columns.forEach(column =>\r\n column.sortType &&\r\n setCurrentSort({\r\n key: column.key,\r\n type: column.sortType\r\n })\r\n )\r\n , [columns]);\r\n\r\n const onSort = (column: Column) => {\r\n if (!column.sort) return;\r\n\r\n const type = nextSortType(\r\n column.sortType ?? SortType.none\r\n );\r\n\r\n if (column.onSort) {\r\n column.onSort(column.key, type);\r\n }\r\n\r\n setCurrentSort({\r\n key: column.key, type\r\n });\r\n };\r\n\r\n const applySortToColumn = (column: Column) => {\r\n if (column.sortType && !currentSort) {\r\n setCurrentSort({\r\n key: column.key,\r\n type: column.sortType\r\n });\r\n return;\r\n }\r\n\r\n if (column.key !== currentSort?.key) {\r\n column.sortType = SortType.none;\r\n return;\r\n }\r\n\r\n column.sortType = column.sort && currentSort?.type ?\r\n currentSort.type :\r\n SortType.none;\r\n };\r\n\r\n return (\r\n
\r\n {\r\n column.sort ? (\r\n \r\n ) : column.header\r\n }\r\n | \r\n ))\r\n }\r\n
---|
\r\n {renderCell(columns[j], value, i)}\r\n | \r\n ))\r\n }\r\n