npm.io
2.5.0 • Published 5d ago

@codella-software/utils

Licence
MIT
Version
2.5.0
Deps
2
Size
2.1 MB
Vulns
0
Weekly
157

@codella-software/utils

Framework-agnostic core services for building dynamic forms, tables, and more with TypeScript and RxJS.

Features

  • FormBuilder - Comprehensive form state management with validation, masks, and middleware
  • TableBuilder - Dynamic table management with filtering, sorting, and pagination
  • FiltersAndSort - Flexible filtering and sorting logic for data operations
  • TabsService - Tab state management and navigation
  • APIService - RESTful API client with authentication, error handling, request/response interceptors, and middleware hooks
  • LiveUpdatesService - Real-time updates via WebSocket or Server-Sent Events

Installation

npm install @codella-software/utils

Quick Start

FormBuilder
import { FormBuilder } from '@codella-software/utils';

const form = new FormBuilder({
  fields: [
    { name: 'email', type: 'text', validators: ['required', 'email'] },
    { name: 'password', type: 'password', validators: ['required'] }
  ]
});

form.values$.subscribe(values => console.log(values));
TableBuilder
import { TableBuilder } from '@codella-software/utils';

const table = new TableBuilder({
  data: [{ id: 1, name: 'John' }],
  columns: [
    { key: 'id', label: 'ID' },
    { key: 'name', label: 'Name' }
  ]
});

table.filteredData$.subscribe(data => console.log(data));
APIService
import { createAPIClient } from '@codella-software/utils';

const api = createAPIClient({
  baseURL: 'https://api.example.com',
  authProvider: customAuthProvider
});

api.get('/users').then(data => console.log(data));

Documentation

For full API documentation, visit https://CodellaSoftware.github.io/codella-utils/

License

MIT

Keywords