@praxisui/dynamic-form 1.0.0-beta.66 → 1.0.0-beta.68
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 +90 -1
- package/fesm2022/praxisui-dynamic-form.mjs +993 -44
- package/fesm2022/praxisui-dynamic-form.mjs.map +1 -1
- package/index.d.ts +71 -3
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
|
|
5
5
|
import { MatDialog } from '@angular/material/dialog';
|
|
6
6
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
7
7
|
import { CdkDragStart, CdkDragMove, CdkDragEnd, CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
8
|
-
import { AsyncConfigStorage, FormLayout, FieldMetadata, FormLayoutRule, FormRuleTargetType as FormRuleTargetType$1, FormSection, FormRow, FormColumn, FormConfig, FormActionButton, BackConfig, FormHooksLayout, EndpointConfig, FormSubmitEvent, FormReadyEvent, FormValueChangeEvent, SyncResult, FormInitializationError, LoadingState, FormCustomActionEvent, FormActionConfirmationEvent, WidgetDefinition, GenericCrudService, ConnectionStorage, DynamicFormService, ErrorMessageService, SchemaNormalizerService, ComponentMetadataRegistry, GlobalConfigService, ComponentKeyService, LoadingOrchestrator, PraxisLoadingRenderer, FormHooksRegistry, FormHookPreset, LoggerService, FormConfigState, FieldDefinition, Breakpoint, ComponentDocMeta, IconPickerService, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
|
|
8
|
+
import { AsyncConfigStorage, FormLayout, FieldMetadata, FormLayoutRule, FormRuleTargetType as FormRuleTargetType$1, FormSection, FormRow, FormColumn, FormConfig, FormActionButton, BackConfig, FormHooksLayout, EndpointConfig, FormSubmitEvent, FormReadyEvent, FormValueChangeEvent, SyncResult, FormInitializationError, LoadingState, FormCustomActionEvent, FormActionConfirmationEvent, WidgetDefinition, GenericCrudService, ConnectionStorage, DynamicFormService, ErrorMessageService, SchemaNormalizerService, ComponentMetadataRegistry, GlobalConfigService, ComponentKeyService, LoadingOrchestrator, PraxisLoadingRenderer, FormHooksRegistry, FormHookPreset, LoggerService, FormConfigState, FieldDefinition, Breakpoint, ComponentDocMeta, IconPickerService, PraxisI18nService, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
|
|
9
9
|
import * as rxjs from 'rxjs';
|
|
10
10
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
11
11
|
import { SettingsPanelService, SettingsValueProvider } from '@praxisui/settings-panel';
|
|
@@ -61,6 +61,8 @@ declare class FormRulesService {
|
|
|
61
61
|
* @returns A RuleEvaluationResult object containing the visibility and required states for the fields.
|
|
62
62
|
*/
|
|
63
63
|
applyRules(formGroup: FormGroup, formRules: FormLayoutRule[]): RuleApplicationResult;
|
|
64
|
+
private setPath;
|
|
65
|
+
private deletePath;
|
|
64
66
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormRulesService, never>;
|
|
65
67
|
static ɵprov: i0.ɵɵInjectableDeclaration<FormRulesService>;
|
|
66
68
|
}
|
|
@@ -443,6 +445,25 @@ interface DynamicFieldRenderErrorEvent {
|
|
|
443
445
|
error: unknown;
|
|
444
446
|
fatal: boolean;
|
|
445
447
|
}
|
|
448
|
+
type ResolvedSectionHeaderVisual = {
|
|
449
|
+
kind: 'none';
|
|
450
|
+
} | {
|
|
451
|
+
kind: 'icon';
|
|
452
|
+
icon: string;
|
|
453
|
+
} | {
|
|
454
|
+
kind: 'image';
|
|
455
|
+
src: string;
|
|
456
|
+
alt: string;
|
|
457
|
+
} | {
|
|
458
|
+
kind: 'initials';
|
|
459
|
+
text: string;
|
|
460
|
+
ariaLabel: string;
|
|
461
|
+
} | {
|
|
462
|
+
kind: 'placeholder';
|
|
463
|
+
icon?: string;
|
|
464
|
+
text?: string;
|
|
465
|
+
ariaLabel: string;
|
|
466
|
+
};
|
|
446
467
|
declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
|
|
447
468
|
private crud;
|
|
448
469
|
private fb;
|
|
@@ -586,11 +607,14 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
|
|
|
586
607
|
private columnRuleProps;
|
|
587
608
|
private pendingEntityId;
|
|
588
609
|
private loadedEntityId;
|
|
610
|
+
private hydratedEntityId;
|
|
589
611
|
private loadedEntityData;
|
|
590
612
|
private schemaCache;
|
|
591
613
|
private lastSchemaMeta?;
|
|
592
614
|
private schemaRootHooks?;
|
|
593
615
|
private destroy$;
|
|
616
|
+
private readonly sectionHeaderBlobUrlCache;
|
|
617
|
+
private readonly sectionHeaderObjectUrls;
|
|
594
618
|
private lastCorrelationId?;
|
|
595
619
|
private currentDnD?;
|
|
596
620
|
private columnFieldsCache;
|
|
@@ -689,6 +713,11 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
|
|
|
689
713
|
private syncWithServer;
|
|
690
714
|
private loadEntity;
|
|
691
715
|
private buildFormFromConfig;
|
|
716
|
+
private captureFormRuntimeState;
|
|
717
|
+
private buildCurrentFormRuntimeContext;
|
|
718
|
+
private buildRestoreTargetContext;
|
|
719
|
+
private isCompatibleRuntimeStateContext;
|
|
720
|
+
private restoreFormRuntimeState;
|
|
692
721
|
/**
|
|
693
722
|
* Backward-compatible required validation for DATE_RANGE controls.
|
|
694
723
|
* Some core builds do not enforce required start/end for dateRange fields.
|
|
@@ -729,6 +758,17 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
|
|
|
729
758
|
getRowClasses(row: FormRow): string[];
|
|
730
759
|
getRowStyles(row: FormRow): Record<string, any> | null;
|
|
731
760
|
getSectionIcon(section: FormSection): string | undefined;
|
|
761
|
+
getSectionHeaderVisual(section: FormSection): ResolvedSectionHeaderVisual;
|
|
762
|
+
private getSectionHeaderConfig;
|
|
763
|
+
private getSectionHeaderFieldValue;
|
|
764
|
+
private getSectionHeaderInitialsSourceValue;
|
|
765
|
+
private getSectionHeaderFallbackIcon;
|
|
766
|
+
private getSectionHeaderEmptyVisual;
|
|
767
|
+
private getSectionHeaderAltText;
|
|
768
|
+
private deriveSectionHeaderInitials;
|
|
769
|
+
private resolveSectionHeaderImageSrc;
|
|
770
|
+
private bytesToDataUrl;
|
|
771
|
+
private firstNonEmptyString;
|
|
732
772
|
getSectionClasses(section: FormSection): string[];
|
|
733
773
|
getSectionStyles(section: FormSection): Record<string, any> | null;
|
|
734
774
|
private sanitizeSectionStylesForEditorialContext;
|
|
@@ -1402,7 +1442,20 @@ declare class CanvasToolbarComponent {
|
|
|
1402
1442
|
static ɵcmp: i0.ɵɵComponentDeclaration<CanvasToolbarComponent, "praxis-canvas-toolbar", never, { "selectedElement": { "alias": "selectedElement"; "required": false; }; }, { "editMetadata": "editMetadata"; "delete": "delete"; "moveUp": "moveUp"; "moveDown": "moveDown"; "selectPath": "selectPath"; "requestClose": "requestClose"; "toggleReadonly": "toggleReadonly"; "toggleRequired": "toggleRequired"; "toggleHidden": "toggleHidden"; "toggleDisabled": "toggleDisabled"; }, never, never, true, never>;
|
|
1403
1443
|
}
|
|
1404
1444
|
|
|
1445
|
+
type FormSectionHeaderMode = 'icon' | 'avatar-image' | 'avatar-initials' | 'auto';
|
|
1446
|
+
type FormSectionHeaderEmptyState = 'fallback-icon' | 'placeholder-avatar' | 'none';
|
|
1447
|
+
interface FormSectionHeaderConfig {
|
|
1448
|
+
mode?: FormSectionHeaderMode;
|
|
1449
|
+
sourceField?: string;
|
|
1450
|
+
initialsSourceField?: string;
|
|
1451
|
+
altField?: string;
|
|
1452
|
+
fallbackIcon?: string;
|
|
1453
|
+
emptyState?: FormSectionHeaderEmptyState;
|
|
1454
|
+
initialsMaxLength?: number;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1405
1457
|
interface EditableFormSection extends FormSection {
|
|
1458
|
+
sectionHeader?: FormSectionHeaderConfig;
|
|
1406
1459
|
appearance?: 'card' | 'plain' | 'step';
|
|
1407
1460
|
stepLabel?: string;
|
|
1408
1461
|
collapsible?: boolean;
|
|
@@ -1431,7 +1484,9 @@ declare class SectionEditorComponent implements OnInit, AfterViewInit, OnDestroy
|
|
|
1431
1484
|
private fb;
|
|
1432
1485
|
private data;
|
|
1433
1486
|
private iconPicker;
|
|
1487
|
+
private i18n;
|
|
1434
1488
|
focusTarget?: 'title' | 'description';
|
|
1489
|
+
fieldMetadata: FieldMetadata[];
|
|
1435
1490
|
section: EditableFormSection;
|
|
1436
1491
|
form: FormGroup;
|
|
1437
1492
|
breakpoints: Breakpoint[];
|
|
@@ -1443,19 +1498,32 @@ declare class SectionEditorComponent implements OnInit, AfterViewInit, OnDestroy
|
|
|
1443
1498
|
descriptionInput?: ElementRef<HTMLTextAreaElement>;
|
|
1444
1499
|
constructor(fb: FormBuilder, data: {
|
|
1445
1500
|
section: EditableFormSection;
|
|
1446
|
-
|
|
1501
|
+
fieldMetadata?: FieldMetadata[];
|
|
1502
|
+
}, iconPicker: IconPickerService, i18n: PraxisI18nService);
|
|
1447
1503
|
ngOnInit(): void;
|
|
1448
1504
|
ngAfterViewInit(): void;
|
|
1449
1505
|
ngOnDestroy(): void;
|
|
1450
1506
|
getSettingsValue(): any;
|
|
1451
1507
|
pickIcon(): Promise<void>;
|
|
1452
1508
|
clearIcon(): void;
|
|
1509
|
+
pickFallbackIcon(): Promise<void>;
|
|
1510
|
+
clearFallbackIcon(): void;
|
|
1453
1511
|
applyPreset(key: 'default' | 'simple' | 'collapsible' | 'denseGrid'): void;
|
|
1454
1512
|
setCustomColors(value: string): void;
|
|
1455
1513
|
onTitleStyleChange(style: string): void;
|
|
1456
1514
|
onDescriptionStyleChange(style: string): void;
|
|
1515
|
+
get fieldOptions(): Array<{
|
|
1516
|
+
value: string;
|
|
1517
|
+
label: string;
|
|
1518
|
+
}>;
|
|
1519
|
+
tx(key: string, fallback: string): string;
|
|
1520
|
+
private applyNormalizedFormValue;
|
|
1521
|
+
private normalizeSectionFormValue;
|
|
1522
|
+
private normalizeSectionHeader;
|
|
1523
|
+
private normalizeOptionalString;
|
|
1524
|
+
private normalizeOptionalNumber;
|
|
1457
1525
|
static ɵfac: i0.ɵɵFactoryDeclaration<SectionEditorComponent, never>;
|
|
1458
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SectionEditorComponent, "praxis-section-editor", never, { "focusTarget": { "alias": "focusTarget"; "required": false; }; }, {}, never, never, true, never>;
|
|
1526
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SectionEditorComponent, "praxis-section-editor", never, { "focusTarget": { "alias": "focusTarget"; "required": false; }; "fieldMetadata": { "alias": "fieldMetadata"; "required": false; }; }, {}, never, never, true, never>;
|
|
1459
1527
|
}
|
|
1460
1528
|
|
|
1461
1529
|
interface EditableFormRow extends FormRow {
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/dynamic-form",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.68",
|
|
4
4
|
"description": "Angular dynamic form engine for Praxis UI: metadata-driven forms, hooks, and services integrating @praxisui/* packages.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^20.0.0",
|
|
7
7
|
"@angular/core": "^20.0.0",
|
|
8
8
|
"@angular/cdk": "^20.0.0",
|
|
9
|
-
"@praxisui/settings-panel": "^1.0.0-beta.
|
|
10
|
-
"@praxisui/visual-builder": "^1.0.0-beta.
|
|
11
|
-
"@praxisui/specification-core": "^1.0.0-beta.
|
|
12
|
-
"@praxisui/specification": "^1.0.0-beta.
|
|
13
|
-
"@praxisui/core": "^1.0.0-beta.
|
|
14
|
-
"@praxisui/cron-builder": "^1.0.0-beta.
|
|
9
|
+
"@praxisui/settings-panel": "^1.0.0-beta.68",
|
|
10
|
+
"@praxisui/visual-builder": "^1.0.0-beta.68",
|
|
11
|
+
"@praxisui/specification-core": "^1.0.0-beta.68",
|
|
12
|
+
"@praxisui/specification": "^1.0.0-beta.68",
|
|
13
|
+
"@praxisui/core": "^1.0.0-beta.68",
|
|
14
|
+
"@praxisui/cron-builder": "^1.0.0-beta.68"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"tslib": "^2.3.0",
|