ngx-dynamic-entity-builder 2.1.0 → 2.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-dynamic-entity-builder",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Angular standalone visual builder for authoring dynamic-entity EntityConfig (fields, tabs, validators, RBAC).",
|
|
5
5
|
"//typings": "Local workspace resolution only: ng-packagr 21 writes types/ngx-dynamic-entity-builder.d.ts into dist/package.json. Do NOT add a 'main' field here — ng-packagr does not generate one, so it would be copied verbatim and resolve wrongly in the published package.",
|
|
6
6
|
"typings": "types/ngx-dynamic-entity-builder.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"@angular/core": "^17.2.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
11
11
|
"@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
12
12
|
"@angular/material": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
13
|
-
"@dynamic-entity/core": "^2.
|
|
14
|
-
"ngx-dynamic-entity": "^2.
|
|
13
|
+
"@dynamic-entity/core": "^2.2.0",
|
|
14
|
+
"ngx-dynamic-entity": "^2.2.0",
|
|
15
15
|
"rxjs": "^7.0.0"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
@@ -44,45 +44,18 @@ declare class BuilderStore {
|
|
|
44
44
|
/**
|
|
45
45
|
* Roles of the person using the builder — distinct from `availableRoles`, which is the
|
|
46
46
|
* vocabulary a schema may reference. Needed so the SYSTEM_DEFAULT_CAN_EDIT predicate can
|
|
47
|
-
* be asked a real question
|
|
48
|
-
* made any role-checking predicate answer false for everyone.
|
|
47
|
+
* be asked a real question rather than answering for an empty role list.
|
|
49
48
|
*/
|
|
50
49
|
private readonly _userRoles;
|
|
51
50
|
private readonly history;
|
|
52
|
-
private readonly cursor;
|
|
53
|
-
private readonly historyLength;
|
|
54
|
-
private lastEditAt;
|
|
55
|
-
/** Consecutive edits closer together than this fold into one undo step. */
|
|
56
|
-
private static readonly COALESCE_MS;
|
|
57
51
|
readonly canUndo: _angular_core.Signal<boolean>;
|
|
58
52
|
readonly canRedo: _angular_core.Signal<boolean>;
|
|
59
|
-
/**
|
|
60
|
-
* Fold the current state into history.
|
|
61
|
-
*
|
|
62
|
-
* Called explicitly by the write paths rather than from an `effect`. An effect would have
|
|
63
|
-
* been fewer call sites, but it requires an injection context: `BuilderStore` had no
|
|
64
|
-
* constructor, so `new BuilderStore()` was legal, and adding one broke every caller that
|
|
65
|
-
* did it with NG0203. Explicit calls also make the timing deterministic — a test can
|
|
66
|
-
* assert straight after an edit instead of flushing effects first.
|
|
67
|
-
*
|
|
68
|
-
* Calling it twice for one operation is harmless: the second call sees the same signal
|
|
69
|
-
* references already at the cursor and returns.
|
|
70
|
-
*
|
|
71
|
-
* `setFieldLabel` is bound to a keystroke, so recording every emission would make undo
|
|
72
|
-
* walk back one character at a time. Two consecutive edits merge when they land inside
|
|
73
|
-
* `COALESCE_MS` *and* the structure is unchanged — a rename coalesces, while adding,
|
|
74
|
-
* removing or moving anything always earns its own step however fast it is clicked.
|
|
75
|
-
*/
|
|
76
53
|
private record;
|
|
77
|
-
/** How many undo steps are kept. */
|
|
78
|
-
private static readonly MAX_HISTORY;
|
|
79
|
-
/** Counts that distinguish a structural edit from a value edit. */
|
|
80
|
-
private shapeOf;
|
|
81
54
|
/** Start history again from the state just loaded. Nothing before it is undoable. */
|
|
82
55
|
private resetHistory;
|
|
83
56
|
undo(): void;
|
|
84
57
|
redo(): void;
|
|
85
|
-
private
|
|
58
|
+
private restore;
|
|
86
59
|
readonly config: _angular_core.Signal<EntityFormConfig>;
|
|
87
60
|
readonly selectedFieldId: _angular_core.Signal<string>;
|
|
88
61
|
readonly activeLanguage: _angular_core.Signal<string>;
|
|
@@ -93,11 +66,8 @@ declare class BuilderStore {
|
|
|
93
66
|
/**
|
|
94
67
|
* Every field the config declares, sub-tabs included.
|
|
95
68
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* picker could not offer a nested field as a source, and the drift check looked a nested
|
|
99
|
-
* field up here, got nothing, and returned without checking. The store's structural
|
|
100
|
-
* operations already walked the whole tree — only this view did not.
|
|
69
|
+
* The canvas, the entity-reference source picker and the drift check all read this, so it
|
|
70
|
+
* has to reach nested tabs just as the store's structural operations do.
|
|
101
71
|
*
|
|
102
72
|
* It deliberately does not descend into a field's own `children`: `group` and `array`
|
|
103
73
|
* children are rendered by the row that owns them, not as rows of their own.
|
|
@@ -131,10 +101,9 @@ declare class BuilderStore {
|
|
|
131
101
|
/**
|
|
132
102
|
* Every tab in the tree, flattened.
|
|
133
103
|
*
|
|
134
|
-
* The structural operations below
|
|
135
|
-
* the top level
|
|
136
|
-
* duplicated, moved or reordered
|
|
137
|
-
* unable to restructure, which is the worst possible state for an authoring tool.
|
|
104
|
+
* The structural operations below go through this rather than `draft.tabs`, which is only
|
|
105
|
+
* the top level — otherwise a field on a sub-tab could be edited but never removed,
|
|
106
|
+
* duplicated, moved or reordered.
|
|
138
107
|
*/
|
|
139
108
|
private flattenTabs;
|
|
140
109
|
/**
|
|
@@ -192,14 +161,11 @@ declare class BuilderStore {
|
|
|
192
161
|
*
|
|
193
162
|
* Ids are the wiring between fields — rules, cascades, patches and `showWhen` all address
|
|
194
163
|
* fields by id — so a rename that only touches `field.id` silently breaks that wiring.
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*/
|
|
198
|
-
/**
|
|
164
|
+
* Label-derived ids make renaming routine, so the references move with it.
|
|
165
|
+
*
|
|
199
166
|
* `key` addresses the field to rename; `oldId` is the bare id every *reference* to it
|
|
200
|
-
* carries. They
|
|
201
|
-
*
|
|
202
|
-
* and rules are all keyed by bare id and never match a path.
|
|
167
|
+
* carries. They are separate because resolving needs the path, while `showWhen`,
|
|
168
|
+
* `parentField`, `autoPatch` targets and rules are all keyed by bare id.
|
|
203
169
|
*/
|
|
204
170
|
private applyRename;
|
|
205
171
|
removeField(key: string): void;
|
|
@@ -269,7 +235,7 @@ declare class BuilderStore {
|
|
|
269
235
|
setFieldDataSource(fieldId: string, source: 'none' | 'manual' | 'lookup'): void;
|
|
270
236
|
/** Set the named list a choice field reads its options from. */
|
|
271
237
|
setListName(fieldId: string, listName: string): void;
|
|
272
|
-
/** Link a field to a field defined in another entity configuration
|
|
238
|
+
/** Link a field to a field defined in another entity configuration */
|
|
273
239
|
linkReferencedField(fieldId: string, sourceEntityKey: string, sourceField: NestedFieldConfig): void;
|
|
274
240
|
/** Unlink a referenced field back to an independent field. */
|
|
275
241
|
unlinkReferencedField(fieldId: string): void;
|
|
@@ -485,6 +451,8 @@ declare const DEFAULT_BUILDER_TEXT: {
|
|
|
485
451
|
hintInLanguage: string;
|
|
486
452
|
hintHint: string;
|
|
487
453
|
defaultValue: string;
|
|
454
|
+
sliderStep: string;
|
|
455
|
+
sliderStepHint: string;
|
|
488
456
|
sectionBasics: string;
|
|
489
457
|
sectionLayout: string;
|
|
490
458
|
sectionValidation: string;
|
|
@@ -809,11 +777,8 @@ interface PaletteSection {
|
|
|
809
777
|
/**
|
|
810
778
|
* FieldPaletteComponent — the list of buildable field types.
|
|
811
779
|
*
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
* grid forced two equal columns and the button refused to wrap, so a third of the palette
|
|
815
|
-
* could not be read. And with no order to them, finding "Month & Year" meant scanning the
|
|
816
|
-
* whole list: the grouping and the filter are what make a palette this size navigable.
|
|
780
|
+
* Grouped and filterable, because a flat list of twenty-two types is not navigable, and
|
|
781
|
+
* tiles wrap their labels so names like "Entity Reference" are never clipped.
|
|
817
782
|
*/
|
|
818
783
|
declare class FieldPaletteComponent {
|
|
819
784
|
/** Builder chrome, overridable via BUILDER_TEXT. */
|
|
@@ -940,6 +905,8 @@ declare class FieldInspectorComponent {
|
|
|
940
905
|
* put a 1 on every field in the config and tell the author nothing.
|
|
941
906
|
*/
|
|
942
907
|
protected displayFlagCount(field: NestedFieldConfig): number;
|
|
908
|
+
/** A step must be above zero; anything else clears it, and the slider uses 1. */
|
|
909
|
+
protected positiveOrUnset(value: unknown): number | undefined;
|
|
943
910
|
protected toNum(value: unknown): number | null;
|
|
944
911
|
protected labelValue(field: NestedFieldConfig): string;
|
|
945
912
|
protected placeholderValue(field: NestedFieldConfig): string;
|
|
@@ -980,9 +947,7 @@ declare class FieldInspectorComponent {
|
|
|
980
947
|
}[];
|
|
981
948
|
/**
|
|
982
949
|
* Seeds a new condition with the first field not already watched.
|
|
983
|
-
*
|
|
984
|
-
* It used to seed the literal string `field`, which is not a field id at all — so a new
|
|
985
|
-
* condition started out referencing nothing and silently hid the field until it was edited.
|
|
950
|
+
* A seed that names no real field would silently hide this one until edited.
|
|
986
951
|
*/
|
|
987
952
|
protected addShowWhen(field: NestedFieldConfig): void;
|
|
988
953
|
protected renameShowWhen(field: NestedFieldConfig, oldKey: string, newKey: string): void;
|