@lovebowls/leagueelements
Version:
League Elements package for LoveBowls
132 lines • 5.11 kB
TypeScript
export default LeagueElement;
declare class LeagueElement extends HTMLElement {
static get observedAttributes(): string[];
shadow: ShadowRoot;
data: any;
selectedResultDate: any;
activeCalendarFilterDate: any;
leftPanelFlexBasis: any;
minRightPanelPixelWidth: number | null;
activeView: string;
pointsOverTimeChartData: {
dates: never[];
teamSeries: {};
allTeamNames: never[];
} | {
dates: never[];
teamSeries: {};
allTeamNames: never[];
} | {
dates: never[];
teamSeries: {};
allTeamNames: any;
} | {
dates: never[];
teamSeries: {};
allTeamNames: any;
} | {
dates: any[];
teamSeries: {};
allTeamNames: any;
} | null;
selectedTeamsForGraph: Set<any>;
teamColors: {};
activeTrendGraphType: string;
tableFilter: string;
matchModalOpen: boolean;
matchModalData: Object | null;
matchModalTeams: any[];
matchModalMode: string;
lovebowlsTeams: any[];
connectedCallback(): void;
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
loadLeagueData(data: any): Promise<void>;
showError(message: any): void;
_fillTemplate(template: any): any;
render(): void;
tableRows: string | undefined;
_handleRecentMatchClickBound: ((e: any) => void) | undefined;
_handleAttentionMatchClickBound: ((e: any) => void) | undefined;
_handleUpcomingMatchClickBound: ((e: any) => void) | undefined;
setupPaging(): void;
setupResizer(): void;
/**
* Renders the form icons with tooltips for recent matches.
* @param {Array<Object>|string} [matches=[]] - An array of recent match objects or a form string
* Each object should have 'result' (W/D/L)
* and 'description' (the tooltip text).
* @returns {string} HTML string for the form icons.
*/
renderForm(matches?: Array<Object> | string): string;
/**
* Basic HTML escaping function to prevent XSS issues in tooltips.
* @param {string} unsafe - The string to escape.
* @returns {string} The escaped string.
*/
escapeHtml(unsafe?: string): string;
/**
* Formats a list of matches for tooltip display.
* If resultType is provided, only matches of that type are included.
* If not, all matches are included.
* @param {Array<Object>} matches - Array of match objects
* @param {string} [resultType] - Optional: 'W', 'D', or 'L'
* @param {boolean} [displayVerb=true] - Whether to show the verb (Won/Lost/Drew)
* @returns {string} Tooltip string
*/
formatMatchList(matches?: Array<Object>, resultType?: string, displayVerb?: boolean): string;
_getConflictingMatchKeys(): Set<any>;
setupTabs(): void;
_prepareMatrixData(): {
teams: any[];
matrix: {};
} | null;
renderMatrix(): string;
setupMatrixEventListeners(): void;
renderTrendsViewContent(): string;
_preparePointsOverTimeData(): void;
ensureTeamColors(): void;
drawPointsOverTimeSVG(): void;
setupTrendsViewInteractivity(): void;
_getFilteredLeagueData(): any;
setupTableFilterDropdown(): void;
/**
* Renders the rank movement indicator to be placed next to the position.
* @param {number|undefined} movement - The change in rank. Positive for up, negative for down, 0 for no change.
* @returns {string} HTML string for the movement indicator.
*/
renderRankMovementIndicator(movement: number | undefined): string;
/**
* @param {Array<Object>} matchesSubset - Array of match objects to calculate ranks from.
* @param {Array<string>} allTeamIdsInLeague - Array of all team IDs in the league.
* @returns {Object|null} A map of { teamId: rank }, or null if calculation isn't possible.
*/
_calculateRanksFromMatches(matchesSubset: Array<Object>, allTeamIdsInLeague: Array<string>): Object | null;
/**
* Open the match modal dialog.
* @param {Object} matchData
* @param {Array<string>} teams - Array of team IDs
* @param {'edit'|'new'} mode
*/
openMatchModal(matchData: Object, teams: Array<string>, mode?: "edit" | "new"): void;
/**
* Close the match modal dialog.
*/
closeMatchModal(): void;
_handleRecentMatchClick(e: any): void;
_handleAttentionMatchClick(e: any): void;
_handleUpcomingMatchClick(e: any): void;
_handleUpcomingFixtureDateChange(e: any): void;
_handleCalendarDateChange(e: any): void;
parseLovebowlsTeams(teamsData: any): void;
_lovebowlsTeams: any[] | undefined;
_teamNameMap: {} | undefined;
getTeamDisplayName(teamId: any): any;
_getTeamsFromLeagueData(): any;
/**
* Get a shortened version of team name for mobile display
* @param {string} teamName - The full team name
* @return {string} - Shortened team name for mobile display
*/
_getShortTeamName(teamName: string): string;
}
//# sourceMappingURL=leagueElement.d.ts.map