Delivery notes table
Delivery notes with supplier, DN number, status, received line chips, the received date and an optional column with the purchase order it came against. Debounced search, a supplier filter, cursor pagination, rows that link to the note, and Close and Cancel row actions. Takes columns, rowActions and initial filters.
Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. Pages vs components
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ap-delivery-notes-tableAlso installs: ap-purchase-order-parts, base-data-table, base-entity-cell, base-states, ui-ap-delivery-notes-table.
Usage
import { DeliveryNotesTable } from "@/components/dolfin/ap/delivery-notes-table";
// Place it anywhere inside your <DolfinProvider>.
<DeliveryNotesTable />Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.
API reference
| Prop | Type | Description |
|---|---|---|
filters | OrderListFilters | Initial filters when the table fetches: a supplier, a search. |
pageSize | number | |
hideToolbar | boolean | Hide the search and supplier filter (shown only when the table fetches). |
toolbarActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra controls at the end of the toolbar. |
resolvePurchaseOrderNumbers | boolean | Look up each note's PO number (`purchaseOrderNumber` on the rows, for custom columns). Default: only while the "against" column is shown. |
deliveryNotes | readonly { id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; dnNumber: string; purchaseOrderId?… | The rows to show. Passing them (or `loading` / `error`) fetches nothing; rows still link to the delivery note. |
loading | boolean | |
error | Error | |
onRetry | () => void | |
page | number | 1-based page shown; the pager shows with `onPageChange`. |
hasNextPage | boolean | |
onPageChange | (page: number) => void | |
supplierNames | Readonly<Record<string, string>> | Supplier names by id, for the supplier column. |
supplierId | string | The list is one supplier's: the supplier column gives way to the number. |
filtered | boolean | The list is filtered, so the empty state says nothing matches. |
onClose | (row: DeliveryNote) => void | Shows Close on open rows. Wired for you when the table fetches. |
onCancel | (row: DeliveryNote) => void | Shows Cancel on open rows. Wired for you when the table fetches. |
pendingId | string | The row an action is running on: its menu shows progress. |
columns | DeliveryNoteColumnsProp | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Record<string, boolean>> | |
rowActions | DeliveryNoteRowActionsProp | Replace or extend the row menu (Close, Cancel when their callbacks are given). Pass `[]` for none. |
onRowClick | (row: DeliveryNote) => void | Called when a row is clicked; given, it replaces the row's link. |
getRowRoute | (row: DeliveryNote) => DolfinRoute | null | Where a row links to when there is no `onRowClick`; the delivery note by default (`null` for a plain row). |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
className | string | |
variant | DataTableVariant | |
classNames | DataTableClassNames | |
pager | boolean | Show the built-in previous / next pager when there is more than one page. Default true; pass false when you draw your own pager from the list's pagination (the table still dims while a page loads). |
onRowHover | (row: { id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; dnNumber: string; purchaseOrderId?: n… | Called with the row the pointer moves onto, and with `null` when the pointer leaves the rows (e.g. to highlight the row's point in a chart next to the table). Moving between rows reports the new row without a `null` first. |
Customisation
Without editing the source, you can change:
- Class names
classNameclassNames.frameclassNames.headerclassNames.headerCellclassNames.rowclassNames.cellclassNames.pager- Messages
ap.orders
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Hooks
The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.
useDeliveryNoteActionsuseDeliveryNotesuseDolfinLocaleuseMessagesFiles
Written to your app by the install command:
components/dolfin/ap/delivery-notes-table.tsx350 lines