@maro-tech/form
v0.1.20
Published
Reusable Angular form controls and a schema-driven form engine for Maro Tech applications.
Readme
@maro-tech/form
Reusable Angular form controls and a schema-driven form engine for Maro Tech applications.
Installation
npm install @maro-tech/form @maro-tech/coreThe package uses the application API through relative /api endpoints. The consuming application must provide Angular HttpClient and the Tailwind content path for both packages.
Available exports
- Input controls: text, number, date, datetime, email, password, textarea, select, checkbox, color, slug, file, photo, barcode, and range.
DynamicFormComponentfor rendering a form from a field schema.UiFormModalComponentfor loading, editing, and submitting a form through/api/crud/form/....
Basic usage
import { DynamicFormComponent, UiDynamicFormField } from '@maro-tech/form';
readonly fields: UiDynamicFormField[] = [
{ id: 'name', type: 'text', label: 'Name', required: true },
{ id: 'status', type: 'select', label: 'Status', options: [
{ label: 'Active', value: 'active' },
] },
];The library posts and reads data through relative paths such as /api/suggest/... and /api/crud/form/..., so the frontend and backend can share the same origin and proxy configuration.
Local checks
npm run build
npm run test:ci