Giter Site home page Giter Site logo

angular-material-genric-table's Introduction

Generic Component - Angular Material Table

Demo

Demo ⚡️

Features

  • Fully Type Safe
  • Custom Filtration
  • Custom Sorting
  • Disable Specific Column's Sorting
  • Configurable Columns
  • Columns Data Transfomation
  • Custom Columns styling
  • Responsive Table
  • Action Buttons
  • Action Button styling and position
  • Pagination and Page Size
  • Row Click handler
  • Theme Support
  • Action buttons permissoin supports
  • Sticky Action Button
  • Scroll the table on page change
  • Default column Sorting option

API Reference

<lib-mat-table-list
  class="lib-mat-table-black-header"
  [data]="data"
  [filterValue]="filterValue"
  [columns]="columns"
  [filterFn]="inputFilterFn"
  [sortFn]="inputSortFn"
  [actionBtns]="actionBtns"
  [pageSize]="10"
  [containerClasses]="['py-5']"
  [tableContainerClasses]="['pt-2']"
  [rowClickListner]="onRowClick"
  [sortActive]="'creationDate'"
  [sortDirection]="'desc'"
  [paginationClasses] = "['bg-transparent','mt-3']"
></lib-mat-table-list>
Parameter Description
data Required An array of generic type T representing the data to be displayed in the table
class optional lib-mat-table-black-header is the theme name of black header
columns Required An array of IColumn objects representing the columns configuration of the table.
filterValue A string representing the filter value for filtering the data in the table
sortFn Custom Sorting Function
rowClickListner Row Click Handler Function
actionBtns Action Columns Setting and function definition
pageSize A number representing the number of items to be displayed per page.
tableContainerClasses An array of strings representing the CSS classes to be applied to the table container.
containerClasses An array of strings representing the CSS classes to be applied to the outer container of the table.
paginationClasses An array of strings representing the CSS classes to be applied to the pagination section.
limitSizes An array of numbers representing the options for page size selection.
scrollOffset A number representing the offset used for scrolling to the table after pagination.
rowClickListner A function that handles row click events.
filterFn A function used for custom data filtering.
sortFn A function used for custom data sorting.
sortActive A string representing the active sorting column.
sortDirection A string representing the sorting direction ('asc' or 'desc').
actionBtns An object of type IActionBtnConfiguration representing the configuration for action buttons in the table.

All available Interfaces

IColumn

Key Description
name string - The name of the column.
disableSorting boolean (optional) - Indicates whether sorting is disabled for this column.
displayName string - The display name of the column.
headerStyle Style (optional) - CSS styles for the column header.
dataStyle Style (optional) - CSS styles for the column data.
transForm (value: any) => any (optional) - A transformation function for the column data.
headerClasses string[] (optional) - CSS classes for the column header.
dataClasses string[] (optional) - CSS classes for the column data.

IActionBtn

Key Description
name string - The name of the action button.
onClick (data: T) => void - Function to be executed when the action button is clicked.
icon string (optional) - The icon name for the action button.
access (data: T) => boolean (optional) - Function to determine whether the action button is accessible for a specific row.

IActionBtnConfiguration

Key Description
positions 'start'
headerStyle Style (optional) - CSS styles for the action button header.
dataStyle Style (optional) - CSS styles for the action button data.
headerClasses string[] (optional) - CSS classes for the action button header.
dataClasses string[] (optional) - CSS classes for the action button data.
classes string[] (optional) - CSS classes for the action buttons.
buttons IActionBtn[] - Array of action button configurations.
sticky boolean (optional) - Indicates whether the action buttons are sticky.

Made By Aamir Khan

Thank You!!

angular-material-genric-table's People

Contributors

aamir12 avatar

Watchers

 avatar

Forkers

aamirk16

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.