Purchase order form parts
Pieces shared by the purchase order and delivery note dialogs: labelled fields with required marks and inline errors, form sections, line cards, a server-searched supplier picker and a calendar date picker.
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-purchase-order-form-partsAlso installs: button, calendar, command, field, popover, base-theme, ui-ap-purchase-order-form-parts.
Usage
import { OrderFormSection } from "@/components/dolfin/ap/order-form-parts";
// Place it anywhere inside your <DolfinProvider>.
<OrderFormSection title={title} children={children} />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 |
|---|---|---|
title required | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
children required | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
description | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
actions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… |
Customisation
Without editing the source, you can change:
- Messages
ap.orders.formbase.states.retry
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.
useDolfinLocaleuseMessagesuseSupplierOptionsFiles
Written to your app by the install command:
components/dolfin/ap/order-form-parts.tsx273 lines