ngx-dynamic-entity-builder 1.8.1 → 1.9.1

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": "1.8.1",
3
+ "version": "1.9.1",
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.0.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": "^1.8.1",
14
- "ngx-dynamic-entity": "^1.8.1",
13
+ "@dynamic-entity/core": "^1.9.1",
14
+ "ngx-dynamic-entity": "^1.9.1",
15
15
  "rxjs": "^7.0.0"
16
16
  },
17
17
  "keywords": [
@@ -1,8 +1,9 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
2
+ import { InjectionToken, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
3
3
  import { NestedTabConfig, NestedFieldConfig, EntityFormConfig, FormRule, EntityPermissions, RichFieldType, FlagValidator, ParamValidator, DropdownOption, EntityReferenceConfig, AutoPatchMapping, PatchOnTrueMapping, CommonModuleEntry, FieldTypeMeta, RuleOperator } from '@dynamic-entity/core';
4
4
  export { AutoPatchConfig, AutoPatchMapping, DropdownOption, EntityFormConfig, EntityPermissions, EntityReferenceConfig, FIELD_TYPE_CATALOG, FieldTypeMeta, FlagValidator, FormRule, NestedFieldConfig, NestedTabConfig, ParamValidator, PatchOnTrueMapping, RichFieldType, RuleAction, RuleCondition, RuleOperator, createFieldConfig, getFieldTypeMeta, humanizeId } from '@dynamic-entity/core';
5
5
  import * as ngx_dynamic_entity from 'ngx-dynamic-entity';
6
+ import { UiTextOverridesFor, UiTextParams } from 'ngx-dynamic-entity';
6
7
  export { SYSTEM_DEFAULT_CAN_EDIT } from 'ngx-dynamic-entity';
7
8
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
8
9
 
@@ -362,10 +363,211 @@ declare class BuilderStore {
362
363
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<BuilderStore>;
363
364
  }
364
365
 
366
+ /**
367
+ * Every word the builder puts on screen that is not part of the config being authored.
368
+ *
369
+ * The renderer has its own list (`DEFAULT_UI_TEXT`) and the two are deliberately separate:
370
+ * an application that ships only the renderer should not see a hundred and fifty builder
371
+ * keys in completion, and the two vocabularies share no strings worth deduplicating. What
372
+ * they do share is the resolution rule, which comes from `resolveUiText`.
373
+ *
374
+ * Keys are grouped by panel, because a translator works screen by screen.
375
+ */
376
+ declare const DEFAULT_BUILDER_TEXT: {
377
+ builderTitle: string;
378
+ undo: string;
379
+ undoTooltip: string;
380
+ redo: string;
381
+ redoTooltip: string;
382
+ issuesTooltip: string;
383
+ copyJson: string;
384
+ save: string;
385
+ entityName: string;
386
+ entityNamePlaceholder: string;
387
+ editingLanguage: string;
388
+ maskEntity: string;
389
+ permissions: string;
390
+ actionRoles: string;
391
+ actionRolesPlaceholder: string;
392
+ permissionsHint: string;
393
+ addField: string;
394
+ fieldProperties: string;
395
+ configJson: string;
396
+ fieldsHeading: string;
397
+ canvasEmpty: string;
398
+ selectField: string;
399
+ dragToReorder: string;
400
+ referencedFieldTooltip: string;
401
+ driftDetected: string;
402
+ required: string;
403
+ moveUp: string;
404
+ moveDown: string;
405
+ duplicate: string;
406
+ delete: string;
407
+ moveFieldUp: string;
408
+ moveFieldDown: string;
409
+ duplicateField: string;
410
+ inspectorEmpty: string;
411
+ fieldId: string;
412
+ fieldIdFixedHint: string;
413
+ fieldIdDerivedHint: string;
414
+ tab: string;
415
+ tabMoveHint: string;
416
+ labelInLanguage: string;
417
+ placeholderInLanguage: string;
418
+ defaultValue: string;
419
+ validation: string;
420
+ dataSource: string;
421
+ optionsComeFrom: string;
422
+ optionsSourceNone: string;
423
+ optionsSourceInline: string;
424
+ optionsSourceList: string;
425
+ listName: string;
426
+ listNameHint: string;
427
+ options: string;
428
+ option: string;
429
+ optionInLanguage: string;
430
+ removeOption: string;
431
+ noOptionsYet: string;
432
+ display: string;
433
+ visible: string;
434
+ tableColumn: string;
435
+ readOnly: string;
436
+ disabled: string;
437
+ maskData: string;
438
+ criticalField: string;
439
+ criticalFieldTooltip: string;
440
+ showInSummary: string;
441
+ showInSummaryTooltip: string;
442
+ showWhen: string;
443
+ condition: string;
444
+ watchedField: string;
445
+ equals: string;
446
+ removeCondition: string;
447
+ alwaysVisibleHint: string;
448
+ copyOnTrue: string;
449
+ mapping: string;
450
+ fromField: string;
451
+ toField: string;
452
+ removeMapping: string;
453
+ copyOnTrueHint: string;
454
+ rules: string;
455
+ rule: string;
456
+ noRulesOnField: string;
457
+ rulePriority: string;
458
+ toggleRule: string;
459
+ moveRuleUp: string;
460
+ moveRuleDown: string;
461
+ editRule: string;
462
+ deleteRule: string;
463
+ newRuleTitle: string;
464
+ editRuleTitle: string;
465
+ triggerField: string;
466
+ applyToFields: string;
467
+ conditions: string;
468
+ operator: string;
469
+ value: string;
470
+ conditionValuePlaceholder: string;
471
+ addCondition: string;
472
+ action: string;
473
+ actionType: string;
474
+ actionVisibility: string;
475
+ actionValidationMessage: string;
476
+ actionInfoBanner: string;
477
+ valueOrMessage: string;
478
+ valueOrMessagePlaceholder: string;
479
+ cancel: string;
480
+ saveRule: string;
481
+ tabsManager: string;
482
+ systemTag: string;
483
+ addTab: string;
484
+ noTabs: string;
485
+ flatData: string;
486
+ primaryTab: string;
487
+ maskTabData: string;
488
+ systemDefault: string;
489
+ addSubTab: string;
490
+ consumerModuleName: string;
491
+ consumerModulePlaceholder: string;
492
+ subTabs: string;
493
+ moveTabUp: string;
494
+ moveTabDown: string;
495
+ removeTab: string;
496
+ removeSubTab: string;
497
+ entityReference: string;
498
+ registryKey: string;
499
+ registryKeyHint: string;
500
+ displayFields: string;
501
+ displayFieldsHint: string;
502
+ staticFilters: string;
503
+ staticFiltersHint: string;
504
+ cascade: string;
505
+ parentField: string;
506
+ parentFieldNone: string;
507
+ cascadeHint: string;
508
+ lookupFilterPath: string;
509
+ lookupFilterPathHint: string;
510
+ lookupPath: string;
511
+ lookupPathHint: string;
512
+ autoPatchOnSelect: string;
513
+ targetTab: string;
514
+ sourceLinkedRecord: string;
515
+ targetField: string;
516
+ noAutoPatch: string;
517
+ referencedField: string;
518
+ link: string;
519
+ sourceEntityKey: string;
520
+ sourceEntityKeyPlaceholder: string;
521
+ sourceFieldId: string;
522
+ sourceFieldIdPlaceholder: string;
523
+ driftHeading: string;
524
+ driftBody: string;
525
+ syncWithSource: string;
526
+ };
527
+ /** The keys above, as a union — checked in templates, completed in a host's overrides. */
528
+ type BuilderTextKey = keyof typeof DEFAULT_BUILDER_TEXT;
529
+ /** Same contract as the renderer's `UI_TEXT`, over the builder's vocabulary. */
530
+ type BuilderTextOverrides = UiTextOverridesFor<BuilderTextKey>;
531
+ /**
532
+ * Overrides for the builder's own chrome.
533
+ *
534
+ * Accepts what `UI_TEXT` accepts: a partial map whose values are strings or `LocalizedText`
535
+ * (`{ en, de }`), or a resolver `(key, defaultText, language) => string` for a host with an
536
+ * existing i18n layer. `DEFAULT_BUILDER_TEXT` is the full key list with its English source
537
+ * strings; anything left out keeps its default.
538
+ *
539
+ * @example
540
+ * { provide: BUILDER_TEXT, useValue: { save: { en: 'Save', de: 'Speichern' } } }
541
+ */
542
+ declare const BUILDER_TEXT: InjectionToken<BuilderTextOverrides>;
543
+ /**
544
+ * Resolves the builder's own UI text.
545
+ *
546
+ * The language lives on the service rather than travelling through every template call,
547
+ * because the builder already has a *different* language on screen: `activeLanguage()`
548
+ * selects the `LocalizedText` entry being **authored**. Passing that one to the chrome
549
+ * would flip the builder's own interface every time an author switched the label language
550
+ * they were editing, which is the opposite of what it means.
551
+ *
552
+ * Root-provided and therefore shared: two builders mounted at once show one chrome
553
+ * language. `EntityBuilderComponent`'s `uiLanguage` input is what sets it.
554
+ */
555
+ declare class BuilderTextService {
556
+ private readonly overrides;
557
+ /** The chrome language. Not the authoring language — see the class comment. */
558
+ readonly language: _angular_core.WritableSignal<string>;
559
+ /** One label by key. `params` fill the `{placeholder}` slots. */
560
+ text(key: BuilderTextKey, params?: UiTextParams): string;
561
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BuilderTextService, never>;
562
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<BuilderTextService>;
563
+ }
564
+
365
565
  /**
366
566
  * EntityBuilderComponent — the top-level visual builder for an EntityFormConfig.
367
567
  */
368
568
  declare class EntityBuilderComponent implements OnChanges {
569
+ /** Builder chrome, overridable via BUILDER_TEXT. */
570
+ protected readonly ui: BuilderTextService;
369
571
  protected readonly store: BuilderStore;
370
572
  /**
371
573
  * Optional: only apps that registered a CONFIG_SOURCE have one. Used to drop the cached
@@ -376,6 +578,14 @@ declare class EntityBuilderComponent implements OnChanges {
376
578
  config?: EntityFormConfig;
377
579
  /** Languages available for label/placeholder editing. First entry is the default. */
378
580
  languages: string[];
581
+ /**
582
+ * Language for the builder's **own** chrome, resolved through `BUILDER_TEXT`.
583
+ *
584
+ * Deliberately separate from `languages` and `store.activeLanguage()`, which choose the
585
+ * `LocalizedText` entry being authored: switching the label language you are editing
586
+ * should not translate the interface around it.
587
+ */
588
+ set uiLanguage(value: string);
379
589
  /** Optional role list — enables multi-select role pickers for RBAC instead of free text. */
380
590
  availableRoles: string[];
381
591
  /**
@@ -408,7 +618,7 @@ declare class EntityBuilderComponent implements OnChanges {
408
618
  /** Parse a comma-separated role string into a trimmed, de-duplicated array. */
409
619
  protected setRolesFromText(action: keyof EntityPermissions, text: string): void;
410
620
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityBuilderComponent, never>;
411
- static ɵcmp: _angular_core.ɵɵ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>;
621
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityBuilderComponent, "ngx-entity-builder", never, { "config": { "alias": "config"; "required": false; }; "languages": { "alias": "languages"; "required": false; }; "uiLanguage": { "alias": "uiLanguage"; "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>;
412
622
  }
413
623
 
414
624
  /**
@@ -454,6 +664,8 @@ declare function withExistingOptions(options: readonly FieldPathOption[], curren
454
664
  * FieldInspectorComponent — edits every property of the currently selected field.
455
665
  */
456
666
  declare class FieldInspectorComponent {
667
+ /** Builder chrome, overridable via BUILDER_TEXT. */
668
+ protected readonly ui: BuilderTextService;
457
669
  protected readonly store: BuilderStore;
458
670
  protected readonly field: _angular_core.Signal<NestedFieldConfig>;
459
671
  protected readonly meta: _angular_core.Signal<FieldTypeMeta>;
@@ -519,6 +731,8 @@ declare class FieldInspectorComponent {
519
731
  * TabManagerComponent — add / rename / reorder / remove tabs & sub-tabs with systemDefault protection.
520
732
  */
521
733
  declare class TabManagerComponent {
734
+ /** Builder chrome, overridable via BUILDER_TEXT. */
735
+ protected readonly ui: BuilderTextService;
522
736
  protected readonly store: BuilderStore;
523
737
  private readonly canEditSystemDefaultsFn;
524
738
  protected lang(): string;
@@ -534,6 +748,8 @@ declare class TabManagerComponent {
534
748
  * RuleFormComponent — dialog/panel form for creating or editing a FormRule.
535
749
  */
536
750
  declare class RuleFormComponent {
751
+ /** Builder chrome, overridable via BUILDER_TEXT. */
752
+ protected readonly ui: BuilderTextService;
537
753
  private readonly store;
538
754
  rule: FormRule;
539
755
  save: EventEmitter<FormRule>;
@@ -575,6 +791,8 @@ declare class RuleFormComponent {
575
791
  * enable/disable, edit, delete. `RuleFormComponent` authors one rule; this owns the set.
576
792
  */
577
793
  declare class FieldRulesListComponent {
794
+ /** Builder chrome, overridable via BUILDER_TEXT. */
795
+ protected readonly ui: BuilderTextService;
578
796
  protected readonly store: BuilderStore;
579
797
  /** The rule currently open in the editor — a new draft or a copy of an existing rule. */
580
798
  protected readonly editing: _angular_core.WritableSignal<FormRule>;
@@ -595,6 +813,8 @@ declare class FieldRulesListComponent {
595
813
  * selected reference returns.
596
814
  */
597
815
  declare class EntityReferenceConfigComponent {
816
+ /** Builder chrome, overridable via BUILDER_TEXT. */
817
+ protected readonly ui: BuilderTextService;
598
818
  protected readonly store: BuilderStore;
599
819
  protected readonly field: _angular_core.Signal<NestedFieldConfig>;
600
820
  /** Sibling fields that can drive a cascade — anything but this field itself. */
@@ -626,6 +846,8 @@ declare class EntityReferenceConfigComponent {
626
846
  }
627
847
 
628
848
  declare class EntityBuilderCanvasComponent {
849
+ /** Builder chrome, overridable via BUILDER_TEXT. */
850
+ protected readonly ui: BuilderTextService;
629
851
  protected readonly store: BuilderStore;
630
852
  /**
631
853
  * Headings only earn their space once the fields are actually split across tabs. A
@@ -639,6 +861,8 @@ declare class EntityBuilderCanvasComponent {
639
861
  }
640
862
 
641
863
  declare class EntityBuilderTreeNodeComponent {
864
+ /** Builder chrome, overridable via BUILDER_TEXT. */
865
+ protected readonly ui: BuilderTextService;
642
866
  protected readonly store: BuilderStore;
643
867
  field: NestedFieldConfig;
644
868
  index: number;
@@ -653,5 +877,5 @@ declare class EntityBuilderTreeNodeComponent {
653
877
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityBuilderTreeNodeComponent, "ngx-entity-builder-tree-node", never, { "field": { "alias": "field"; "required": true; }; "index": { "alias": "index"; "required": true; }; "totalCount": { "alias": "totalCount"; "required": true; }; }, {}, never, never, true, never>;
654
878
  }
655
879
 
656
- export { BuilderStore, EntityBuilderCanvasComponent, EntityBuilderComponent, EntityBuilderTreeNodeComponent, EntityReferenceConfigComponent, FieldInspectorComponent, FieldPaletteComponent, FieldRulesListComponent, RuleFormComponent, TabManagerComponent, fieldPathOptions, withExistingOptions };
657
- export type { BuilderFieldGroup, BuilderProblem, FieldPathOption };
880
+ export { BUILDER_TEXT, BuilderStore, BuilderTextService, DEFAULT_BUILDER_TEXT, EntityBuilderCanvasComponent, EntityBuilderComponent, EntityBuilderTreeNodeComponent, EntityReferenceConfigComponent, FieldInspectorComponent, FieldPaletteComponent, FieldRulesListComponent, RuleFormComponent, TabManagerComponent, fieldPathOptions, withExistingOptions };
881
+ export type { BuilderFieldGroup, BuilderProblem, BuilderTextKey, BuilderTextOverrides, FieldPathOption };