@nice2dev/ui-forms
v1.4.64
Published
Nice2Dev UI Forms - schema-driven forms and module editors: NiceDevelopmentStudio, NiceSchemaForm, NiceEntityEditor, NiceI18nEditor
Maintainers
Readme
@nice2dev/ui-forms
Schema-driven forms and the module editors of the NiceToDev ecosystem.
Components
- NiceDevelopmentStudio — design complete modules in one place. Its tree shows projects (workspaces) → packages → modules → their entities, views, workflows, translations and other parts, and templates → modules; a picked row gets a small preview, and Edit opens it in its form on the whole studio (settings, entities, views, workflows, permissions, data sources, seed data, hooks, scripts). Saving reviews the changed files and writes back only them, keeping each file's formatting.
- NiceEntityForm — one entity in forms: its metadata, its fields (a grid, each field in its own form) and its validation; the edit screen of NiceEntityEditor on its own.
- NiceSchemaForm — an editable form generated from a Draft-07 JSON Schema or field definitions, with live validation and a raw JSON view.
- NiceEntityEditor — an entity / field designer (
*.entities.json). - NiceI18nEditor — translations as a keys × languages grid.
- NiceArrayField — an array of objects in a grid, edited through a form built from the item schema.
Helpers: formSchemaToJsonSchema, jsonSchemaToFormItems, validateAgainstJsonSchema, and
aiFormConfigToFormFields. The last one turns the fields generated by NiceFormBuilderAI /
useFormBuilderAI from @nice2dev/ui-ai into NiceSchemaForm fields.
The studio without React: @nice2dev/ui-forms/studio
The studio's core works in Node too (validators, generators, CI):
- the provider contract and an in-memory provider;
- file kinds;
- format-keeping JSON (
patchJsonText); - the studio's own module format.
The preset for OmniVerk seed modules is in @nice2dev/erp-adapter/omniverk.
import { NiceDevelopmentStudio, createMemoryStudioProvider } from '@nice2dev/ui-forms';
const provider = createMemoryStudioProvider({ workspaces, templates });
<NiceDevelopmentStudio provider={provider} tutorial />;Install
npm install @nice2dev/ui-forms @nice2dev/ui @nice2dev/ui-core @nice2dev/i18nStyling
Import the CSS once at your app's entry point:
import '@nice2dev/ui/style.css';
import '@nice2dev/ui-forms/style.css';