npm package: @hirehq/ngx-smart-table
Description: A modern, feature-rich smart table component for Angular applications built with PrimeNG.
Latest version: 1.0.6
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @hirehq/ngx-smart-table

A modern, feature-rich smart table component for Angular applications built with PrimeNG.

## Features

- 🚀 Built with Angular 19 and PrimeNG
- 📊 Advanced data table with sorting, filtering, and pagination
- 🎨 Modern UI with Tailwind CSS and PrimeUI themes
- 🔧 Highly customizable and extensible
- 📱 Responsive design
- ⚡ Optimized for performance
- 🆕 Standalone component support (recommended)

## Installation

```bash
npm install @hirehq/ngx-smart-table
```

## Peer Dependencies

This library requires the following peer dependencies:

```json
{
  "@angular/common": "^19.2.0",
  "@angular/core": "^19.2.0",
  "primeng": "^19.0.0",
  "primeicons": "^7.0.0"
}
```

## Quick Start

> **💡 Recommended**: Use the standalone component approach for modern Angular applications.

### 1. Import the Component (Standalone)

```typescript
import { Component } from '@angular/core';
import { HqSmartTableComponent } from '@hirehq/ngx-smart-table';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [HqSmartTableComponent],
  template: `
    <hq-smart-table
      [data]="tableData"
      [columns]="tableColumns"
      [config]="tableConfig">
    </hq-smart-table>
  `
})
export class ExampleComponent {
  // ... component logic
}
```

### 2. Alternative: NgModule Approach

```typescript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HqSmartTableModule } from '@hirehq/ngx-smart-table';

@NgModule({
  imports: [
    BrowserModule,
    HqSmartTableModule
  ],
  // ...
})
export class AppModule { }
```

### 3. Use the Component

```html
<hq-smart-table
  [data]="tableData"
  [columns]="tableColumns"
  [config]="tableConfig">
</hq-smart-table>
```

```typescript
import { Component } from '@angular/core';
import { HqSmartTableComponent } from '@hirehq/ngx-smart-table';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [HqSmartTableComponent],
  template: `
    <hq-smart-table
      [data]="tableData"
      [columns]="tableColumns"
      [config]="tableConfig">
    </hq-smart-table>
  `
})
export class ExampleComponent {
  tableData = [
    { id: 1, name: 'John Doe', email: 'john@example.com' },
    { id: 2, name: 'Jane Smith', email: 'jane@example.com' }
  ];

  tableColumns = [
    { field: 'id', header: 'ID' },
    { field: 'name', header: 'Name' },
    { field: 'email', header: 'Email' }
  ];

  tableConfig = {
    pagination: true,
    sorting: true,
    filtering: true,
    pageSize: 10
  };
}
```

## Configuration

### Quick Config Example

```typescript
// Simple configuration
const config = {
  pagination: true,
  sorting: true,
  filtering: true,
  pageSize: 10
};

// Column definition
const columns = [
  { field: 'id', header: 'ID', sortable: true },
  { field: 'name', header: 'Name', filterable: true },
  { field: 'email', header: 'Email' }
];
```

### Available Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `pagination` | `boolean` | `false` | Enable pagination |
| `sorting` | `boolean` | `false` | Enable column sorting |
| `filtering` | `boolean` | `false` | Enable global filtering |
| `pageSize` | `number` | `10` | Items per page |
| `pageSizeOptions` | `number[]` | `[5,10,25,50]` | Page size dropdown options |

## Styling

The component uses Tailwind CSS and PrimeUI themes. Make sure to include the required CSS files in your application:

```typescript
// In your angular.json or styles.css
@import "tailwindcss";
@import "primeng/resources/themes/lara-light-blue/theme.css";
@import "primeng/resources/primeng.css";
@import "primeicons/primeicons.css";
```

## Development

### Building the Library

```bash
# Standard build
npm run build

# Build with auto version bump
npm run build:patch    # Patch version (1.0.0 → 1.0.1)
npm run build:minor    # Minor version (1.0.0 → 1.1.0)
npm run build:major    # Major version (1.0.0 → 2.0.0)
npm run build:prod     # Production build (patch version)
```

### Running Tests

```bash
npm run test
```

### Publishing

```bash
# Quick release (build + publish patch version)
npm run release

# Build and publish with specific version bump
npm run publish:patch  # Build patch + publish
npm run publish:minor  # Build minor + publish
npm run publish:major  # Build major + publish

# Manual publish (after building)
npm run build:patch
npm publish
```

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Submit a pull request

## License

This project is licensed under the MIT License.

## Support

For support and questions, please open an issue on GitHub.