ngx-dynamic-entity-builder 1.1.0 → 1.3.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 +1 -1
- package/esm2022/lib/builder-store.service.mjs +66 -11
- package/esm2022/lib/components/entity-builder-canvas.component.mjs +4 -3
- package/esm2022/lib/components/entity-builder-tree-node.component.mjs +24 -5
- package/esm2022/lib/components/entity-reference-config.component.mjs +4 -4
- package/esm2022/lib/components/field-palette.component.mjs +4 -4
- package/esm2022/lib/components/field-rules-list.component.mjs +8 -8
- package/esm2022/lib/components/referenced-field-config.component.mjs +4 -3
- package/esm2022/lib/components/rule-form.component.mjs +4 -4
- package/esm2022/lib/components/tab-manager.component.mjs +12 -12
- package/esm2022/lib/entity-builder.component.mjs +19 -24
- package/fesm2022/ngx-dynamic-entity-builder.mjs +133 -61
- package/fesm2022/ngx-dynamic-entity-builder.mjs.map +1 -1
- package/lib/builder-store.service.d.ts +13 -0
- package/lib/entity-builder.component.d.ts +5 -8
- package/package.json +3 -3
|
@@ -186,6 +186,19 @@ export declare class BuilderStore {
|
|
|
186
186
|
moveTab(id: string, direction: -1 | 1): void;
|
|
187
187
|
exportConfig(): EntityFormConfig;
|
|
188
188
|
private mutate;
|
|
189
|
+
/**
|
|
190
|
+
* Replace one field, copying only the objects on the path to it.
|
|
191
|
+
*
|
|
192
|
+
* `mutate` deep-clones the entire config, which is right for a structural edit but wrong
|
|
193
|
+
* for the two setters bound to keystroke events: typing a label allocated a full copy of
|
|
194
|
+
* the config per character. Here every tab and field outside the target's chain is reused
|
|
195
|
+
* by reference, so the cost is proportional to nesting depth rather than config size —
|
|
196
|
+
* while the parts that did change are still fresh objects, so change detection and the
|
|
197
|
+
* signal both see a new identity.
|
|
198
|
+
*
|
|
199
|
+
* Returns without touching anything when the field is not found.
|
|
200
|
+
*/
|
|
201
|
+
private mutateField;
|
|
189
202
|
private uniqueId;
|
|
190
203
|
private validate;
|
|
191
204
|
static ɵfac: i0.ɵɵFactoryDeclaration<BuilderStore, never>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
3
2
|
import { type CommonModuleEntry, type EntityFormConfig, type EntityPermissions } from '@dynamic-entity/core';
|
|
4
3
|
import { BuilderStore } from './builder-store.service';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
@@ -8,6 +7,11 @@ import * as i0 from "@angular/core";
|
|
|
8
7
|
*/
|
|
9
8
|
export declare class EntityBuilderComponent implements OnChanges {
|
|
10
9
|
protected readonly store: BuilderStore;
|
|
10
|
+
/**
|
|
11
|
+
* Optional: only apps that registered a CONFIG_SOURCE have one. Used to drop the cached
|
|
12
|
+
* copy of a config the moment it is edited — see `doSave`.
|
|
13
|
+
*/
|
|
14
|
+
private readonly configSource;
|
|
11
15
|
/** Existing config to edit. When omitted, the builder starts blank. */
|
|
12
16
|
config?: EntityFormConfig;
|
|
13
17
|
/** Languages available for label/placeholder editing. First entry is the default. */
|
|
@@ -29,13 +33,6 @@ export declare class EntityBuilderComponent implements OnChanges {
|
|
|
29
33
|
protected readonly rbacActions: (keyof EntityPermissions)[];
|
|
30
34
|
constructor();
|
|
31
35
|
ngOnChanges(changes: SimpleChanges): void;
|
|
32
|
-
protected onDrop(event: CdkDragDrop<unknown>): void;
|
|
33
|
-
protected fieldTypeLabel(type: string): string;
|
|
34
|
-
protected fieldTypeIcon(type: string): string;
|
|
35
|
-
protected fieldLabel(field: {
|
|
36
|
-
id: string;
|
|
37
|
-
label?: any;
|
|
38
|
-
}): string;
|
|
39
36
|
protected doSave(): void;
|
|
40
37
|
protected get json(): string;
|
|
41
38
|
protected copyJson(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-dynamic-entity-builder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Angular standalone visual builder for authoring dynamic-entity EntityConfig (fields, tabs, validators, RBAC).",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/cdk": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
9
9
|
"@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
10
10
|
"@angular/material": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
11
|
-
"@dynamic-entity/core": "^1.
|
|
12
|
-
"ngx-dynamic-entity": "^1.
|
|
11
|
+
"@dynamic-entity/core": "^1.3.0",
|
|
12
|
+
"ngx-dynamic-entity": "^1.3.0",
|
|
13
13
|
"rxjs": "^7.0.0"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|