npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ng-zi/extensions-list

v0.0.2

Published

Angular Material Extensions for list

Downloads

2

Readme

MtxList Component Overview

The mtx-list component provides a flexible way to display lists of items using Angular Material 18 styling and functionality.

Features

  • Item Rendering: Display items in a list format with customizable templates for item content.
  • Selection: Supports single and multiple item selection with visual feedback.
  • Disabled Items: Ability to disable specific items within the list.
  • Custom Templates: Allows users to define custom templates for list item content.
  • Click Events: Emits events when list items are clicked, providing flexibility for interaction handling.
  • Styling: Utilizes Angular Material theming and styling capabilities for consistent design.

Usage

Installation

To use mtx-list in your Angular project, ensure you have Angular Material 18 installed and configured. Import MtxListModule into your feature module where the list will be used.

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MtxListModule } from 'path/to/mtx-list.module';

@NgModule({
  declarations: [YourComponent],
  imports: [
    CommonModule,
    MtxListModule
  ]
})
export class YourModule { }

Basic Example

Use the mtx-list component in your template to render a basic list:

<mtx-list [config]="listConfig" (itemClick)="onItemClick($event)"></mtx-list>

In your component class, define the list configuration (listConfig) and handle the itemClick event:

import { Component } from '@angular/core';
import { MtxListConfig } from 'path/to/list.config';

@Component({
  selector: 'your-component',
  templateUrl: './your-component.html',
  styleUrls: ['./your-component.scss']
})
export class YourComponent {
  listConfig: MtxListConfig = {
    items: [
      { title: 'Item 1', subtitle: 'Subtitle 1' },
      { title: 'Item 2', subtitle: 'Subtitle 2' }
    ]
  };

  onItemClick(item: any) {
    console.log('Item clicked:', item);
    // Handle item click logic here
  }
}

Advanced Usage

Custom Templates

You can provide custom templates for rendering list items:

<mtx-list [config]="listConfig">
  <ng-template let-item>
    <h3>{{ item.title }}</h3>
    <p>{{ item.subtitle }}</p>
    <button mat-icon-button (click)="deleteItem(item)">
      <mat-icon>delete</mat-icon>
    </button>
  </ng-template>
</mtx-list>

Selection

Enable selection mode to allow users to select items:

<mtx-list [config]="listConfig" selectable multiple (itemClick)="onItemClick($event)">
</mtx-list>

API

Inputs

  • config: MtxListConfig - Configuration object for the list component.
    • items: Array<{ title: string, subtitle: string, disabled?: boolean }> - Array of items to display in the list.
    • selectable: boolean - Whether items in the list can be selected.
    • multiple: boolean - Whether multiple items can be selected at once.
    • itemTemplate: TemplateRef<any> - Optional custom template for rendering list items.

Outputs

  • itemClick: EventEmitter<any> - Event emitted when a list item is clicked.