ngx-dynamic-entity-builder 1.0.0 → 1.2.0
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 +75 -54
- package/esm2022/lib/builder-store.service.mjs +166 -32
- package/esm2022/lib/clone.mjs +1 -1
- package/esm2022/lib/components/entity-builder-tree-node.component.mjs +21 -3
- package/esm2022/lib/components/entity-reference-config.component.mjs +301 -301
- package/esm2022/lib/components/field-inspector.component.mjs +3 -3
- package/esm2022/lib/components/field-palette.component.mjs +33 -33
- package/esm2022/lib/components/field-rules-list.component.mjs +157 -157
- package/esm2022/lib/components/referenced-field-config.component.mjs +8 -2
- package/esm2022/lib/components/rule-form.component.mjs +1 -1
- package/esm2022/lib/components/tab-manager.component.mjs +301 -288
- package/esm2022/lib/entity-builder.component.mjs +27 -4
- package/esm2022/public-api.mjs +1 -2
- package/fesm2022/ngx-dynamic-entity-builder.mjs +999 -926
- package/fesm2022/ngx-dynamic-entity-builder.mjs.map +1 -1
- package/lib/builder-store.service.d.ts +41 -0
- package/lib/components/referenced-field-config.component.d.ts +6 -0
- package/lib/components/tab-manager.component.d.ts +11 -2
- package/lib/entity-builder.component.d.ts +12 -1
- package/package.json +22 -13
- package/public-api.d.ts +0 -1
- package/esm2022/lib/components/connection-source-config.component.mjs +0 -121
- package/lib/components/connection-source-config.component.d.ts +0 -16
package/README.md
CHANGED
|
@@ -1,54 +1,75 @@
|
|
|
1
|
-
# ngx-dynamic-entity-builder
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
# ngx-dynamic-entity-builder
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/ngx-dynamic-entity-builder)
|
|
4
|
+
[](../../LICENSE)
|
|
5
|
+
|
|
6
|
+
Visual Angular builder for authoring `EntityFormConfig` schemas consumed by `ngx-dynamic-entity`. Supports Angular 17 through 22.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 📦 Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install ngx-dynamic-entity-builder ngx-dynamic-entity @dynamic-entity/core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Unlike the renderer, **the builder requires Angular Material and the CDK**, and needs animations enabled:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
// app.config.ts
|
|
20
|
+
import { ApplicationConfig } from '@angular/core';
|
|
21
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
22
|
+
|
|
23
|
+
export const appConfig: ApplicationConfig = {
|
|
24
|
+
providers: [provideAnimations()],
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## ✨ Features
|
|
31
|
+
|
|
32
|
+
- **Palette & canvas** — click a field type in the palette to add it; drag to reorder within the canvas and tree.
|
|
33
|
+
- **Property inspector** — configure validators, options, display flags, `criticalField`, `maskData`, `autoPatch`, and `patchOnTrue`.
|
|
34
|
+
- **Entity reference designer** — registry key mapping, display fields, static filters, and parent→child cascades (`parentField` + `lookupFilter`).
|
|
35
|
+
- **Rules manager** — create, reorder, edit, and toggle reactive rules (`RuleFormComponent`, `FieldRulesListComponent`).
|
|
36
|
+
- **Tab & tree manager** — organize primary tabs, sub-tabs, nested groups, and array field lists. Nesting is recursive; no depth limit is enforced.
|
|
37
|
+
- **Live preview slot** — a projected content slot, so the builder renders a preview without depending on the renderer package.
|
|
38
|
+
- **All 19 field types** from the `@dynamic-entity/core` catalog.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 🚀 Usage
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<ngx-entity-builder
|
|
46
|
+
[config]="initialConfig"
|
|
47
|
+
[languages]="['en', 'de']"
|
|
48
|
+
[availableRoles]="['admin', 'editor']"
|
|
49
|
+
(configChange)="onConfigUpdated($event)"
|
|
50
|
+
(save)="onSave($event)"
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Inputs
|
|
55
|
+
|
|
56
|
+
| Input | Type | Notes |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `config` | `EntityFormConfig \| undefined` | Omit to start from an empty schema. |
|
|
59
|
+
| `languages` | `string[]` | Locales offered for localized labels. Defaults to `['en']`. |
|
|
60
|
+
| `availableRoles` | `string[]` | Roles offered in the permissions editor. |
|
|
61
|
+
| `commonModules` | `readonly CommonModuleEntry[]` | Shared-module options for tabs. |
|
|
62
|
+
|
|
63
|
+
### Outputs
|
|
64
|
+
|
|
65
|
+
| Output | Payload |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `configChange` | `EntityFormConfig` — emitted on every edit. |
|
|
68
|
+
| `save` | `EntityFormConfig` — emitted when the user saves. |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## ⚠️ Known limitations
|
|
73
|
+
|
|
74
|
+
- **Field ids must be unique across the entire schema**, not just within a tab. Rules, `showWhen` conditions, and `autoPatch` mappings all address fields by bare id, so two fields sharing an id in different tabs will interfere with one another.
|
|
75
|
+
- **Structural edits apply to top-level tabs only.** Removing, duplicating, moving, and reordering a field works for fields on a top-level tab; a field inside a sub-tab can be selected and edited but not yet restructured.
|