UNPKG

@claromentis/design-system

Version:

Claromentis Design System Component Library

108 lines (107 loc) 1.98 kB
/** * Likes Modal * * Used to retrieve the likes for an object and display the likes using pagination */ export declare class ClaLikesModal { /** * The host element. */ element: HTMLElement; /** * Modal Element */ private modalElement; /** * Boostrap Modal instance */ private modalInstance; /** * Items to display per page. */ private ITEMS_PER_PAGE; /** * Items per column. */ private ITEMS_PER_COLUMN; /** * Maximum pagination items to show. */ private MAX_PAGES_TO_SHOW; /** * Current page. */ currentPage: number; /** * Total pages. */ totalPages: number; /** * Total likes. */ totalLikes: number; /** * List of people who liked. */ likers: any[]; /** * The type of object that the component should retrieve likes for. */ objectType: string; /** * The ID of the object that the component should retrieve likes for. */ objectId: string; /** * This is used to update the `totalLikes` state. */ total: number; /** * Update `totalLikes` when component is loaded. * Pass the prop to the state */ componentWillLoad(): void; /** * Set the bootstrap modal instance */ componentDidLoad(): void; /** * Watch the `total` being changed * Update `totalLikes` when `total` changes to keep in sync * * @param {number} newValue New value */ protected onTotalChange(newValue: number): void; /** * Fetch the likers data * * @param offset The offset (or current position) */ private fetchData; /** * Handle page pagination click * * @param event Event * @param page Page */ private handlePageClick; /** * Open the modal * * @param event */ private openModal; /** * Get the likers per column * * @param {Number} index * @returns {Array} */ private getLikersByColumn; /** * Render the markup * * @returns {JSX} */ render(): any; }