@angularai/smart-datatable
v0.0.3
Published
<div align="center"> <h1>@angularai/smart-datatable</h1> <p>π AI-powered data table components for Angular applications</p>
Readme
Overview
@angularai/smart-datatable provides AI-enhanced data table components for Angular. Features intelligent sorting, filtering, natural language queries, and smart data insights.
β¨ Features
- π§ AI-Powered Search: Natural language queries for data filtering
- π Smart Sorting: Intelligent column sorting with AI ranking
- π Advanced Filtering: Context-aware filtering suggestions
- π Data Insights: AI-generated insights from your data
- π± Responsive: Mobile-friendly table layouts
- π§ Fully Typed: Complete TypeScript support
- β‘ Virtual Scrolling: Handle large datasets efficiently
π¦ Installation
npm install @angularai/smart-datatable @angularai/coreπ Quick Start
1. Import the Component
import { Component } from '@angular/core';
import { SmartDatatableComponent } from '@angularai/smart-datatable';
@Component({
selector: 'app-data-table',
standalone: true,
imports: [SmartDatatableComponent],
template: `
<smart-datatable
[data]="users"
[columns]="columns"
[provider]="'openai'"
[apiKey]="apiKey"
[enableAISearch]="true"
/>
`
})
export class DataTableComponent {
apiKey = 'your-openai-api-key';
columns = [
{ field: 'name', header: 'Name' },
{ field: 'email', header: 'Email' },
{ field: 'role', header: 'Role' }
];
users = [
{ name: 'John Doe', email: '[email protected]', role: 'Admin' },
{ name: 'Jane Smith', email: '[email protected]', role: 'User' }
];
}π Component API
SmartDatatableComponent
Inputs
| Input | Type | Default | Description |
|-------|------|---------|-------------|
| data | any[] | [] | Data array to display |
| columns | Column[] | [] | Column definitions |
| provider | string | 'openai' | AI provider |
| apiKey | string | '' | API key |
| enableAISearch | boolean | true | Enable AI-powered search |
| pageSize | number | 10 | Rows per page |
| sortable | boolean | true | Enable sorting |
| filterable | boolean | true | Enable filtering |
Outputs
| Output | Type | Description |
|--------|------|-------------|
| rowSelected | EventEmitter<any> | Emitted when row is selected |
| dataFiltered | EventEmitter<any[]> | Emitted when data is filtered |
| insightGenerated | EventEmitter<string> | Emitted when AI generates insight |
π§ Advanced Usage
Natural Language Queries
<smart-datatable
[data]="salesData"
[columns]="columns"
[provider]="'openai'"
[apiKey]="apiKey"
[enableAISearch]="true"
searchPlaceholder="Ask about your data..."
/>Users can type queries like:
- "Show me sales over $1000"
- "Find customers from California"
- "Sort by highest revenue"
π¦ Related Packages
| Package | Description | |---------|-------------| | @angularai/core | Core AI functionality | | @angularai/analytics | AI analytics |
π Related Projects
| Framework | Repository | Status | |-----------|-----------|--------| | Vue.js | @aivue | β Available | | React | @anthropic-ai/react | β Available | | Angular | @angularai | β Available | | Svelte | @svelteai | π‘ Planned |
π License
MIT Β© AngularAI
