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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@arp0d3v/lds-angular

v2.1.0

Published

Angular components and directives for @arp0d3v/lds-core data sources

Readme

@arp0d3v/lds-angular

Angular components and directives for @arp0d3v/lds-core

npm version License: MIT

Angular 17+ components that provide a beautiful UI layer for @arp0d3v/lds-core data sources.


Features

  • Standalone Components - Modern Angular architecture
  • lds-th - Sortable table headers with auto-title display
  • lds-td - Visibility-controlled table cells
  • ldsTable - Directive for dependency injection
  • lds-grid-pager - Beautiful pagination component with routing support
  • lds-grid-sorter - Column sorting UI
  • Routing Integration - URL-based state management with Angular Router
  • OnPush Compatible - Optimized change detection
  • TypeScript - Full type safety
  • 55% Less Code - Compared to traditional directives

Installation

npm install @arp0d3v/lds-core @arp0d3v/lds-angular

Or with yarn:

yarn add @arp0d3v/lds-core @arp0d3v/lds-angular

⚠️ Breaking Changes in v2.1.0

If you're upgrading from v2.0.0 or earlier:

  • Field Properties: orderablesortable
  • State Properties: order1Name/order1Dirsort1Name/sort1Dir
  • Requires: @arp0d3v/lds-core ^2.1.0

Migration:

// Old (v2.0.0)
new LdsField('name', 'Name', 'string', true, true)  // orderable
dataSource.state.order1Name

// New (v2.1.0)
new LdsField('name', 'Name', 'string', true, true)  // sortable
dataSource.state.sort1Name

Quick Start

1. Import Module

// app.module.ts or shared.module.ts
import { NgModule } from '@angular/core';
import { ListDataSourceModule, ListDataSourceProvider } from '@arp0d3v/lds-angular';
import { AppListDataSourceProvider } from './services/datasource.provider';

@NgModule({
  imports: [
    ListDataSourceModule.forRoot(
      [{ provide: ListDataSourceProvider, useClass: AppListDataSourceProvider }],
      {
        pagination: {
          enabled: true,
          pageSize: 20,
          buttonCount: 7
        },
        sort: {
          defaultDir: 'desc'
        },
        saveState: true,
        cacheType: 'local'
      }
    )
  ],
  exports: [ListDataSourceModule]
})
export class SharedModule { }

2. Create Component

import { Component, OnInit, OnDestroy } from '@angular/core';
import { ListDataSource, LdsField } from '@arp0d3v/lds-core';
import { ListDataSourceProvider } from '@arp0d3v/lds-angular';

@Component({
  selector: 'app-user-list',
  templateUrl: './user-list.component.html'
})
export class UserListComponent implements OnInit, OnDestroy {
  dataSource: ListDataSource<User>;

  constructor(private ldsProvider: ListDataSourceProvider) {
    this.dataSource = this.ldsProvider.getRemoteDataSource(
      'api/users',
      'UserListGrid'
    );
    
    this.dataSource.setPageSize(20);
    this.dataSource.setFields([
      new LdsField('id', 'ID', 'number'),
      new LdsField('name', 'Name', 'string'),
      new LdsField('email', 'Email', 'string'),
      new LdsField('createdAt', 'Created', 'datetime')
    ]);
  }

  ngOnInit() {
    this.dataSource.reload();
  }

  ngOnDestroy() {
    this.dataSource.dispose();
  }

  trackByFn(index: number, user: User): number {
    return user.id || index;
  }
}

interface User {
  id: number;
  name: string;
  email: string;
  createdAt: string;
}

3. Create Template

<table class="table table-bordered" [ldsTable]="dataSource">
  <thead>
    <tr>
      <th lds-th="id"></th>
      <th lds-th="name"></th>
      <th lds-th="email"></th>
      <th lds-th="createdAt"></th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let user of dataSource.items; trackBy: trackByFn">
      <td lds-td="id">{{ user.id }}</td>
      <td lds-td="name">{{ user.name }}</td>
      <td lds-td="email">{{ user.email }}</td>
      <td lds-td="createdAt">{{ user.createdAt | date }}</td>
    </tr>
  </tbody>
</table>

<lds-grid-pager [dataSource]="dataSource"></lds-grid-pager>

Components

lds-th (Table Header)

Sortable table header component with auto-title display.

<th lds-th="fieldName"></th>
<!-- Automatically displays field title and handles sorting -->

lds-td (Table Cell)

Visibility-controlled table cell component.

<td lds-td="fieldName">{{ item.fieldName }}</td>
<!-- Automatically hidden when field is not visible -->

ldsTable (Directive)

Provides dataSource to all child lds-th and lds-td components via DI.

<table [ldsTable]="dataSource">
  <!-- No need to pass dataSource to each component -->
</table>

lds-grid-pager (Component)

Pagination UI component.

<lds-grid-pager [dataSource]="dataSource"></lds-grid-pager>

lds-grid-sorter (Component)

Sort configuration UI component.

<lds-grid-sorter [dataSource]="dataSource"></lds-grid-sorter>

Documentation


Routing Support

Enable URL-based state management for shareable links and browser back/forward support:

// In your component
this.dataSource = this.ldsProvider.getRemoteDataSource('api/users', 'UserList', {
    useRouting: true,  // Enable routing
    pagination: {
        enabled: true,
        pageSize: 20
    }
});

// Apply query params from route
this.route.queryParams.subscribe(params => {
    this.dataSource.applyQueryParams(params);
    this.dataSource.reload();
});

The lds-grid-pager component automatically uses routerLink when useRouting is enabled.


Requirements

  • Angular 17.0.0 or higher
  • @arp0d3v/lds-core 2.1.0 or higher
  • @angular/router (for routing support)

License

MIT © Arash Pouya


Author

Arash Pouya (@arp0d3v)

C# ASP.NET developer with expertise in Angular, TypeScript, and web development.


Related Packages


Support