@nestjs-dash/core
v1.4.0
Published
Panel, Resource, Table/Form/Action/Schema builders for NestJS Dash (the NestJS host module lives in @nestjs-dash/nestjs; ORM adapters in @nestjs-dash/{typeorm,mikroorm,prisma,in-memory})
Readme
@nestjs-dash/core
Panel, Resource, Table/Form/Action/Schema builders for NestJS Dash — the Filament-style domain model that ORM adapters and the NestJS host module build on. Re-exports @nestjs-dash/adapter's ResourceAdapter/DatabaseAdapter SPI and @nestjs-dash/support's shared types, so most consumers only need to import from this one package.
Install
pnpm add @nestjs-dash/coreUsage
import { Resource, Table, TextColumn, Schema, TextInput } from '@nestjs-dash/core';
export class AuthorResource extends Resource {
static override slug = 'authors';
static override table(table: Table) {
return table.columns([TextColumn.make('id'), TextColumn.make('name').sortable().searchable()]);
}
static override form(form: Schema) {
return form.components([TextInput.make('name').required()]);
}
}import { Panel } from '@nestjs-dash/core';
const panel = Panel.make().path('/admin').resources([AuthorResource]);An ORM adapter package (@nestjs-dash/typeorm, @nestjs-dash/mikroorm, @nestjs-dash/prisma, @nestjs-dash/in-memory) supplies AuthorResource.adapter; @nestjs-dash/nestjs wires the Panel into a NestJS module.
What's here
Resource/Page/Panel/RelationManager/NavigationLink— the domain modelTableplus columns (TextColumn,IconColumn,ImageColumn,BadgeColumn,BooleanColumn,DateColumn) and filters (SelectFilter,TextFilter,DateFilter)Schema/Section/Grid/Tabs/Htmlplus form fields (TextInput,Textarea,Select,Checkbox,Toggle,Radio,DatePicker,DateTimePicker,ColorPicker,CodeEditor,TagsInput,RichEditor,RichBox,ImageUpload,FileUpload,Repeater)translatableInput()/translatableColumn()— locale-tabbed form field and fixed-locale list column for any{ en, nl, fr, ... }-shaped JSON column (e.g.@nestjs-dash/translation's@TranslatableColumn())Actionand its subclasses (EditAction,DeleteAction,CreateAction,ViewAction,AssociateAction,AttachAction, bulk variants, …) plusDialogBarChart/LineChart/PieChart/StatCarddashboard widgets
Docs: https://nestjs-dash.zakout.tech.
License
MIT
