@nice2dev/ui-forms 1.3.10 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -8
- package/dist/index.cjs +6 -3
- package/dist/index.d.ts +808 -158
- package/dist/index.mjs +4905 -1928
- package/dist/studio.cjs +10 -0
- package/dist/studio.d.ts +796 -0
- package/dist/studio.mjs +1233 -0
- package/dist/ui-forms.css +1 -1
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -1,25 +1,58 @@
|
|
|
1
1
|
# @nice2dev/ui-forms
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Schema-driven forms and the module editors of the NiceToDev ecosystem.
|
|
4
4
|
|
|
5
5
|
## Components
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
- **NiceDevelopmentStudio** — design complete modules in one place. Its tree shows projects
|
|
8
|
+
(workspaces) → packages → modules → their entities, views, workflows, translations and other
|
|
9
|
+
parts, and templates → modules; a picked row gets a small preview, and **Edit** opens it in its
|
|
10
|
+
form on the whole studio (settings, entities, views, workflows, permissions, data sources, seed
|
|
11
|
+
data, hooks, scripts). Saving reviews the changed files and writes back only them, keeping each
|
|
12
|
+
file's formatting.
|
|
13
|
+
- **NiceEntityForm** — one entity in forms: its metadata, its fields (a grid, each field in its
|
|
14
|
+
own form) and its validation; the edit screen of NiceEntityEditor on its own.
|
|
15
|
+
- **NiceSchemaForm** — an editable form generated from a Draft-07 JSON Schema or field
|
|
16
|
+
definitions, with live validation and a raw JSON view.
|
|
17
|
+
- **NiceEntityEditor** — an entity / field designer (`*.entities.json`).
|
|
18
|
+
- **NiceI18nEditor** — translations as a keys × languages grid.
|
|
19
|
+
- **NiceArrayField** — an array of objects in a grid, edited through a form built from the item
|
|
20
|
+
schema.
|
|
21
|
+
|
|
22
|
+
Helpers: `formSchemaToJsonSchema`, `jsonSchemaToFormItems`, `validateAgainstJsonSchema`, and
|
|
23
|
+
`aiFormConfigToFormFields`. The last one turns the fields generated by `NiceFormBuilderAI` /
|
|
24
|
+
`useFormBuilderAI` from `@nice2dev/ui-ai` into NiceSchemaForm fields.
|
|
25
|
+
|
|
26
|
+
## The studio without React: `@nice2dev/ui-forms/studio`
|
|
27
|
+
|
|
28
|
+
The studio's core works in Node too (validators, generators, CI):
|
|
29
|
+
|
|
30
|
+
- the provider contract and an in-memory provider;
|
|
31
|
+
- file kinds;
|
|
32
|
+
- format-keeping JSON (`patchJsonText`);
|
|
33
|
+
- the studio's own module format.
|
|
34
|
+
|
|
35
|
+
The preset for OmniVerk seed modules is in `@nice2dev/erp-adapter/omniverk`.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { NiceDevelopmentStudio, createMemoryStudioProvider } from '@nice2dev/ui-forms';
|
|
39
|
+
|
|
40
|
+
const provider = createMemoryStudioProvider({ workspaces, templates });
|
|
41
|
+
|
|
42
|
+
<NiceDevelopmentStudio provider={provider} tutorial />;
|
|
43
|
+
```
|
|
10
44
|
|
|
11
45
|
## Install
|
|
12
46
|
|
|
13
47
|
```bash
|
|
14
|
-
npm install @nice2dev/ui-forms @nice2dev/ui
|
|
48
|
+
npm install @nice2dev/ui-forms @nice2dev/ui @nice2dev/ui-core @nice2dev/i18n
|
|
15
49
|
```
|
|
16
50
|
|
|
17
|
-
Requires `@nice2dev/ui` as a peer dependency (uses `NiceForm`, `NiceBaseProps`, AI hooks).
|
|
18
|
-
|
|
19
51
|
## Styling
|
|
20
52
|
|
|
21
|
-
|
|
53
|
+
Import the CSS once at your app's entry point:
|
|
22
54
|
|
|
23
55
|
```tsx
|
|
24
56
|
import '@nice2dev/ui/style.css';
|
|
57
|
+
import '@nice2dev/ui-forms/style.css';
|
|
25
58
|
```
|