@lovebowls/leagueelements
Version:
League Elements package for LoveBowls
177 lines • 5.8 kB
TypeScript
export default LeagueSchedule;
/**
* Custom element to display a complete schedule of matches from a League
* with paging, filtering, and export functionality.
*
* @element league-schedule
* @attr {string} data - JSON stringified League object
* @attr {boolean} [is-mobile] - Whether to use mobile styles
* @attr {boolean} [can-edit] - Whether to show edit buttons for matches
* @attr {string} [filter-date] - Date filter in YYYY-MM-DD format
* @attr {string} [selected-team] - Team ID to filter matches by
*
* Emits 'league-schedule-event' with detail { type: 'matchClick', match }
* Emits 'league-schedule-event' with detail { type: 'matchEdit', match }
* Emits 'league-schedule-event' with detail { type: 'matchSave', match }
* Emits 'league-schedule-event' with detail { type: 'filterClear' }
*/
declare class LeagueSchedule extends HTMLElement {
static get observedAttributes(): string[];
shadow: ShadowRoot;
league: any;
matches: any[];
teams: any[];
currentPage: number;
itemsPerPage: number;
selectedMatchId: any;
selectedTeamId: any;
filterDate: any;
error: string | null;
storageKey: string;
get _canEdit(): boolean;
get _shouldShowRinkColumn(): boolean;
connectedCallback(): void;
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
/**
* Loads and parses the league data.
* @param {string|Object} data - League data as JSON string or object
*/
loadData(data: string | Object): void;
/**
* Returns the filtered list of matches based on current filter settings.
* @returns {Array} Filtered matches
*/
getFilteredMatches(): any[];
/**
* Determines winner styling classes for home and away teams
* @param {Object} match - Match object
* @returns {Object} Object with homeTeamClass and awayTeamClass properties
*/
getWinnerClasses(match: Object): Object;
/**
* Gets comprehensive match information including attention status
* @param {Object} match - Match object
* @returns {Object} Match info with state, attention status, and reason
*/
getMatchInfo(match: Object): Object;
/**
* Finds the next future match and navigates to the page containing it
*/
navigateToNextFutureMatch(): void;
/**
* Gets the team name from the team ID
* @param {string} teamId - Team ID
* @returns {string} Team name
*/
getTeamName(teamId: string): string;
/**
* Formats a match date for display
* @param {string} dateString - Date string
* @returns {string} Formatted date
*/
formatMatchDate(dateString: string): string;
/**
* Formats a match result for display with attention indicators
* @param {Object} match - Match object
* @returns {string} Formatted result string with attention indicators
*/
formatMatchResult(match: Object): string;
/**
* Format the rink for display
* @param {Object} match - Match object
* @returns {string} Formatted rink string
*/
formatMatchRink(match: Object): string;
/**
* Gets the total number of pages
* @returns {number} Total pages
*/
getTotalPages(): number;
/**
* Saves current filter state to sessionStorage
*/
saveFilterState(): void;
/**
* Restores filter state from sessionStorage
*/
restoreFilterState(): void;
/**
* Clears saved filter state
*/
clearFilterState(): void;
/**
* Handles calendar date change events
* @param {Event} e - Calendar event
*/
handleCalendarDateChange: (e: Event) => void;
/**
* Handles team filter change
* @param {Event} e - Change event
*/
handleTeamFilter: (e: Event) => void;
/**
* Clears all filters
*/
clearFilters: () => void;
/**
* Handles page change
* @param {number} page - New page number
*/
handlePageChange: (page: number) => void;
/**
* Handles items per page change
* @param {Event} e - Input event
*/
handleItemsPerPageChange: (e: Event) => void;
/**
* Handles match selection
* @param {Object} match - Selected match
*/
handleMatchSelect: (match: Object) => void;
/**
* Handles edit match button click
* @param {Event} e - Click event
* @param {Object} match - Match to edit
*/
handleEditMatch: (e: Event, match: Object) => void;
/**
* Exports the data in the specified format
* @param {string} format - Export format
*/
exportData: (format: string) => Promise<void>;
showExportMenu: boolean | undefined;
/**
* Renders the component without resetting filter values
*/
renderWithoutReset(): void;
/**
* Renders the component using lit-html
*/
render(): void;
/**
* Internal render method - routes to mobile or desktop renderer
* @param {boolean} resetFilters - Whether to reset filter form values
*/
_render(resetFilters?: boolean): void;
/**
* Mobile-specific render method
* @param {boolean} resetFilters - Whether to reset filter form values
*/
_renderMobile(resetFilters?: boolean): void;
/**
* Desktop-specific render method
* @param {boolean} resetFilters - Whether to reset filter form values
*/
_renderDesktop(resetFilters?: boolean): void;
/**
* Sets up event listeners for the component
*/
setupEventListeners(): void;
/**
* Updates the calendar with appropriate matches based on current team filter
* @param {HTMLElement} calendarElement - The calendar element to update
* @private
*/
private _updateCalendarMatches;
}
//# sourceMappingURL=LeagueSchedule.d.ts.map