ngx-dynamic-entity-builder 1.2.0 → 1.4.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.
Files changed (35) hide show
  1. package/README.md +3 -2
  2. package/fesm2022/ngx-dynamic-entity-builder.mjs +421 -116
  3. package/fesm2022/ngx-dynamic-entity-builder.mjs.map +1 -1
  4. package/package.json +7 -7
  5. package/types/ngx-dynamic-entity-builder.d.ts +523 -0
  6. package/esm2022/lib/builder-store.service.mjs +0 -1057
  7. package/esm2022/lib/clone.mjs +0 -14
  8. package/esm2022/lib/components/entity-builder-canvas.component.mjs +0 -83
  9. package/esm2022/lib/components/entity-builder-tree-node.component.mjs +0 -191
  10. package/esm2022/lib/components/entity-reference-config.component.mjs +0 -405
  11. package/esm2022/lib/components/field-inspector.component.mjs +0 -139
  12. package/esm2022/lib/components/field-palette.component.mjs +0 -57
  13. package/esm2022/lib/components/field-rules-list.component.mjs +0 -224
  14. package/esm2022/lib/components/referenced-field-config.component.mjs +0 -234
  15. package/esm2022/lib/components/rule-form.component.mjs +0 -201
  16. package/esm2022/lib/components/tab-manager.component.mjs +0 -354
  17. package/esm2022/lib/entity-builder.component.mjs +0 -176
  18. package/esm2022/lib/field-catalog.mjs +0 -6
  19. package/esm2022/ngx-dynamic-entity-builder.mjs +0 -5
  20. package/esm2022/public-api.mjs +0 -16
  21. package/index.d.ts +0 -5
  22. package/lib/builder-store.service.d.ts +0 -206
  23. package/lib/clone.d.ts +0 -9
  24. package/lib/components/entity-builder-canvas.component.d.ts +0 -9
  25. package/lib/components/entity-builder-tree-node.component.d.ts +0 -17
  26. package/lib/components/entity-reference-config.component.d.ts +0 -29
  27. package/lib/components/field-inspector.component.d.ts +0 -33
  28. package/lib/components/field-palette.component.d.ts +0 -13
  29. package/lib/components/field-rules-list.component.d.ts +0 -19
  30. package/lib/components/referenced-field-config.component.d.ts +0 -24
  31. package/lib/components/rule-form.component.d.ts +0 -16
  32. package/lib/components/tab-manager.component.d.ts +0 -28
  33. package/lib/entity-builder.component.d.ts +0 -53
  34. package/lib/field-catalog.d.ts +0 -5
  35. package/public-api.d.ts +0 -12
@@ -1,33 +0,0 @@
1
- import type { DropdownOption, NestedFieldConfig } from '@dynamic-entity/core';
2
- import { BuilderStore } from '../builder-store.service';
3
- import { type FieldTypeMeta } from '../field-catalog';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * FieldInspectorComponent — edits every property of the currently selected field.
7
- */
8
- export declare class FieldInspectorComponent {
9
- protected readonly store: BuilderStore;
10
- protected readonly field: import("@angular/core").Signal<NestedFieldConfig>;
11
- protected readonly meta: import("@angular/core").Signal<FieldTypeMeta>;
12
- protected lang(): string;
13
- protected toNum(value: unknown): number | null;
14
- protected labelValue(field: NestedFieldConfig): string;
15
- protected placeholderValue(field: NestedFieldConfig): string;
16
- protected optionLabel(option: DropdownOption): string;
17
- protected showWhenEntries(field: NestedFieldConfig): {
18
- key: string;
19
- display: string;
20
- }[];
21
- protected addShowWhen(field: NestedFieldConfig): void;
22
- protected renameShowWhen(field: NestedFieldConfig, oldKey: string, newKey: string): void;
23
- protected setShowWhenValue(field: NestedFieldConfig, key: string, raw: string): void;
24
- protected removeShowWhen(field: NestedFieldConfig, key: string): void;
25
- /**
26
- * `showWhen` compares with `!==`, so the authored type has to survive the round trip:
27
- * "true"/"false" become booleans and numeric text becomes a number.
28
- */
29
- private parseShowWhen;
30
- private stringifyShowWhen;
31
- static ɵfac: i0.ɵɵFactoryDeclaration<FieldInspectorComponent, never>;
32
- static ɵcmp: i0.ɵɵComponentDeclaration<FieldInspectorComponent, "ngx-field-inspector", never, {}, {}, never, never, true, never>;
33
- }
@@ -1,13 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import type { RichFieldType } from '@dynamic-entity/core';
3
- import { type FieldTypeMeta } from '../field-catalog';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * FieldPaletteComponent — the list of buildable field types (Angular Material).
7
- */
8
- export declare class FieldPaletteComponent {
9
- readonly catalog: readonly FieldTypeMeta[];
10
- pick: EventEmitter<RichFieldType>;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<FieldPaletteComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<FieldPaletteComponent, "ngx-field-palette", never, {}, { "pick": "pick"; }, never, never, true, never>;
13
- }
@@ -1,19 +0,0 @@
1
- import type { FormRule } from '@dynamic-entity/core';
2
- import { BuilderStore } from '../builder-store.service';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * FieldRulesListComponent — the rules attached to the selected field: view, reorder,
6
- * enable/disable, edit, delete. `RuleFormComponent` authors one rule; this owns the set.
7
- */
8
- export declare class FieldRulesListComponent {
9
- protected readonly store: BuilderStore;
10
- /** The rule currently open in the editor — a new draft or a copy of an existing rule. */
11
- protected readonly editing: import("@angular/core").WritableSignal<FormRule>;
12
- protected startCreate(): void;
13
- protected startEdit(rule: FormRule): void;
14
- protected commit(rule: FormRule): void;
15
- /** One-line human summary: `status EQUAL "archived" → hide`. */
16
- protected summarize(rule: FormRule): string;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<FieldRulesListComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<FieldRulesListComponent, "ngx-field-rules-list", never, {}, {}, never, never, true, never>;
19
- }
@@ -1,24 +0,0 @@
1
- import { ConfigSourceService } from 'ngx-dynamic-entity';
2
- import type { NestedFieldConfig } from '@dynamic-entity/core';
3
- import { BuilderStore } from '../builder-store.service';
4
- import * as i0 from "@angular/core";
5
- export declare class ReferencedFieldConfigComponent {
6
- protected readonly store: BuilderStore;
7
- protected readonly configSource: ConfigSourceService;
8
- protected readonly field: import("@angular/core").Signal<NestedFieldConfig>;
9
- protected toggleReferenced(field: NestedFieldConfig, enabled: boolean): void;
10
- protected updateEntityKey(field: NestedFieldConfig, key: string): void;
11
- protected updateFieldId(field: NestedFieldConfig, fieldId: string): void;
12
- protected syncWithSource(field: NestedFieldConfig): Promise<void>;
13
- /**
14
- * Both callers pass the id of the field they just edited. This used to ignore that
15
- * argument and read `store.selectedField()` instead, so whenever the edited field was not
16
- * the selected one it checked drift against the wrong field's source entity — or bailed
17
- * out entirely if nothing was selected.
18
- */
19
- private checkDriftForField;
20
- private findField;
21
- private findFieldInList;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<ReferencedFieldConfigComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<ReferencedFieldConfigComponent, "ngx-referenced-field-config", never, {}, {}, never, never, true, never>;
24
- }
@@ -1,16 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import type { FormRule, RuleOperator } from '@dynamic-entity/core';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * RuleFormComponent — dialog/panel form for creating or editing a FormRule.
6
- */
7
- export declare class RuleFormComponent {
8
- rule: FormRule;
9
- save: EventEmitter<FormRule>;
10
- cancel: EventEmitter<void>;
11
- readonly operators: RuleOperator[];
12
- addCondition(): void;
13
- removeCondition(index: number): void;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<RuleFormComponent, never>;
15
- static ɵcmp: i0.ɵɵComponentDeclaration<RuleFormComponent, "ngx-rule-form", never, { "rule": { "alias": "rule"; "required": false; }; }, { "save": "save"; "cancel": "cancel"; }, never, never, true, never>;
16
- }
@@ -1,28 +0,0 @@
1
- import type { NestedTabConfig } from '@dynamic-entity/core';
2
- import { SYSTEM_DEFAULT_CAN_EDIT } from 'ngx-dynamic-entity';
3
- import { BuilderStore } from '../builder-store.service';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Re-exported so existing imports from this package keep working.
7
- *
8
- * This file used to declare its own `new InjectionToken('SYSTEM_DEFAULT_CAN_EDIT')` while
9
- * `ngx-dynamic-entity` exported another under the same name. InjectionToken identity is by
10
- * object reference, so a consumer providing the renderer's — the documented one — was
11
- * providing a token nothing injected, and the predicate silently never ran. One token now,
12
- * defined in the lower-level package that both depend on.
13
- */
14
- export { SYSTEM_DEFAULT_CAN_EDIT };
15
- /**
16
- * TabManagerComponent — add / rename / reorder / remove tabs & sub-tabs with systemDefault protection.
17
- */
18
- export declare class TabManagerComponent {
19
- protected readonly store: BuilderStore;
20
- private readonly canEditSystemDefaultsFn;
21
- protected lang(): string;
22
- protected tabLabel(tab: {
23
- label?: any;
24
- }): string;
25
- protected canEditTab(tab: NestedTabConfig): boolean;
26
- static ɵfac: i0.ɵɵFactoryDeclaration<TabManagerComponent, never>;
27
- static ɵcmp: i0.ɵɵComponentDeclaration<TabManagerComponent, "ngx-tab-manager", never, {}, {}, never, never, true, never>;
28
- }
@@ -1,53 +0,0 @@
1
- import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
- import { CdkDragDrop } from '@angular/cdk/drag-drop';
3
- import { type CommonModuleEntry, type EntityFormConfig, type EntityPermissions } from '@dynamic-entity/core';
4
- import { BuilderStore } from './builder-store.service';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * EntityBuilderComponent — the top-level visual builder for an EntityFormConfig.
8
- */
9
- export declare class EntityBuilderComponent implements OnChanges {
10
- protected readonly store: BuilderStore;
11
- /**
12
- * Optional: only apps that registered a CONFIG_SOURCE have one. Used to drop the cached
13
- * copy of a config the moment it is edited — see `doSave`.
14
- */
15
- private readonly configSource;
16
- /** Existing config to edit. When omitted, the builder starts blank. */
17
- config?: EntityFormConfig;
18
- /** Languages available for label/placeholder editing. First entry is the default. */
19
- languages: string[];
20
- /** Optional role list — enables multi-select role pickers for RBAC instead of free text. */
21
- availableRoles: string[];
22
- /**
23
- * Roles of the person using the builder. Distinct from `availableRoles`, which is the
24
- * vocabulary a schema may reference. Passed to the `SYSTEM_DEFAULT_CAN_EDIT` predicate so
25
- * it can decide whether this user may edit system-default tabs.
26
- */
27
- userRoles: string[];
28
- /** Optional common-module definitions for module tabs; defaults to the built-in list from core. */
29
- commonModules: readonly CommonModuleEntry[];
30
- /** Emitted on every change to the working config. */
31
- configChange: EventEmitter<EntityFormConfig>;
32
- /** Emitted when the user clicks Save. Carries a clean, deep-cloned config. */
33
- save: EventEmitter<EntityFormConfig>;
34
- protected readonly rbacActions: (keyof EntityPermissions)[];
35
- constructor();
36
- ngOnChanges(changes: SimpleChanges): void;
37
- protected onDrop(event: CdkDragDrop<unknown>): void;
38
- protected fieldTypeLabel(type: string): string;
39
- protected fieldTypeIcon(type: string): string;
40
- protected fieldLabel(field: {
41
- id: string;
42
- label?: any;
43
- }): string;
44
- protected doSave(): void;
45
- protected get json(): string;
46
- protected copyJson(): void;
47
- protected rolesFor(action: keyof EntityPermissions): readonly string[];
48
- protected setRoles(action: keyof EntityPermissions, roles: string[]): void;
49
- /** Parse a comma-separated role string into a trimmed, de-duplicated array. */
50
- protected setRolesFromText(action: keyof EntityPermissions, text: string): void;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<EntityBuilderComponent, never>;
52
- static ɵcmp: i0.ɵɵComponentDeclaration<EntityBuilderComponent, "ngx-entity-builder", never, { "config": { "alias": "config"; "required": false; }; "languages": { "alias": "languages"; "required": false; }; "availableRoles": { "alias": "availableRoles"; "required": false; }; "userRoles": { "alias": "userRoles"; "required": false; }; "commonModules": { "alias": "commonModules"; "required": false; }; }, { "configChange": "configChange"; "save": "save"; }, never, ["[ngxBuilderPreview]"], true, never>;
53
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * field-catalog.ts — re-exports shared field catalog from @dynamic-entity/core.
3
- * Single source of truth shared by both visual builder and renderer.
4
- */
5
- export { FIELD_TYPE_CATALOG, getFieldTypeMeta, humanizeId, createFieldConfig, type FieldTypeMeta, type FlagValidator, type ParamValidator, } from '@dynamic-entity/core';
package/public-api.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export * from './lib/entity-builder.component';
2
- export * from './lib/components/field-palette.component';
3
- export * from './lib/components/field-inspector.component';
4
- export * from './lib/components/tab-manager.component';
5
- export * from './lib/components/rule-form.component';
6
- export * from './lib/components/field-rules-list.component';
7
- export * from './lib/components/entity-reference-config.component';
8
- export * from './lib/components/entity-builder-canvas.component';
9
- export * from './lib/components/entity-builder-tree-node.component';
10
- export * from './lib/builder-store.service';
11
- export * from './lib/field-catalog';
12
- export type { EntityFormConfig, NestedTabConfig, NestedFieldConfig, RichFieldType, DropdownOption, EntityPermissions, EntityReferenceConfig, AutoPatchConfig, AutoPatchMapping, PatchOnTrueMapping, FormRule, RuleCondition, RuleAction, RuleOperator, } from '@dynamic-entity/core';