Ng-Matero Extensions

repository·main·Indexed 19 days ago

https://github.com/ng-matero/extensions

An extended component library for Angular Material that provides high-level components and directives, including advanced grids, selects, MtxAlert, MtxCheckboxGroup, MtxColorpicker, and MtxDatetimepicker. It supports Material 2 and Material 3 theming and provides pre-built CSS themes.

Tokens
14.3K
Snippets
63
Records
91
Agent score
67%

What's inside ng-matero-extensions

  1. Configure MtxGrid row selection

    main

    The grid supports both row and cell selection.

    Row Selection:

    • multiSelectable: Enable multiple row selection (default: true).
    • rowSelectable: Whether rows are selectable (default: false).
    • rowSelected: Array of currently selected items.
    • rowSelectionFormatter: Use MtxGridRowSelectionFormatter to disable specific rows or hide checkboxes.
    • rowSelectedChange: Event emitted when selection changes.

    Cell Selection:

    • cellSelectable: Whether cells are selectable (default: true).
    • cellSelectedChange: Event emitted when a cell is selected.
  2. Configure MtxGrid pagination and sorting

    main

    The MtxGrid directive provides built-in support for client-side pagination and sorting.

    Pagination Options:

    • pageOnFront: Whether to paginate on the front end (default: true).
    • showPaginator: Whether to show the paginator UI (default: true).
    • pageSize: Number of items per page (default: 10).
    • pageSizeOptions: Available page size options (default: [10, 50, 100]).
    • page: Output event emitted when page size or index changes.

    Sorting Options:

    • sortOnFront: Whether to sort on the front end (default: true).
    • sortActive: The ID of the currently sorted column.
    • sortDirection: The current sort direction ('asc' or 'desc').
    • sortChange: Output event emitted when sort state changes.
  3. Install Ng-Matero Extensions

    main

    Ng-Matero Extensions is an extended component library for Angular Material. Before installing the extensions, ensure you have already installed and set up Angular Material in your project.

    $ npm install @ng-matero/extensions --save
  4. Import Ng-Matero Extension modules

    main

    To use specific components, import their corresponding modules into your Angular @NgModule. For example, to use the data grid and select components, import MtxGridModule and MtxSelectModule from their respective sub-paths.

    import { MtxGridModule } from '@ng-matero/extensions/grid';
    import { MtxSelectModule } from '@ng-matero/extensions/select';
    
    @NgModule({
      ...
      imports: [MtxGridModule, MtxSelectModule, ...],
      ...
    })
    export class YourAppModule {
    }