@masterteam/forms 0.0.58 → 0.0.60

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.
@@ -23,7 +23,7 @@ type ProcessFormMode = 'Approval' | 'Direct';
23
23
  type ProcessFormSubmitStatus = 'PendingApproval' | 'Executed';
24
24
  type OperationType = 'FormOperation' | 'ActionOperation';
25
25
  type ProcessFormSource = 'Step' | 'None';
26
- type ClientFormResolvedRenderMode = 'form' | 'steps' | 'tabs';
26
+ type ClientFormResolvedRenderMode = 'form' | 'steps' | 'tabs' | 'wizard';
27
27
  type ClientFormFooterActionMode = 'loading' | 'steps' | 'submit';
28
28
  interface ClientFormFooterState {
29
29
  loading: boolean;
@@ -76,6 +76,20 @@ interface ProcessFormSubmitRequest {
76
76
  returnUrl?: string;
77
77
  fields: ProcessFormSubmitField[];
78
78
  }
79
+ interface ProcessFormValidationRuntimeResult {
80
+ isValid: boolean;
81
+ hasBlockingFailures: boolean;
82
+ results: ProcessFormValidationRuleResult[];
83
+ }
84
+ interface ProcessFormValidationRuleResult {
85
+ ruleId: string | number;
86
+ message?: ClientFormTranslatableValue | string | null;
87
+ severity: 'error' | 'warning';
88
+ passed: boolean;
89
+ isBlocking: boolean;
90
+ isEvaluationError: boolean;
91
+ errorMessage?: string | null;
92
+ }
79
93
  interface ClientFormSubmitRequestMapperContext {
80
94
  formValue: Record<string, any>;
81
95
  loadResponse: ProcessFormLoadResponse;
@@ -144,7 +158,7 @@ interface ProcessFormContext {
144
158
  preview: boolean;
145
159
  }
146
160
  type ClientFieldWidth = '25' | '50' | '100';
147
- type ClientFormRenderMode = 'sections' | 'steps' | 'tabs';
161
+ type ClientFormRenderMode = 'sections' | 'steps' | 'tabs' | 'wizard' | undefined;
148
162
  interface ClientFormConfiguration {
149
163
  isActive?: boolean;
150
164
  renderMode?: ClientFormRenderMode;
@@ -191,6 +205,12 @@ interface ClientPropertyItem {
191
205
  configuration?: Record<string, unknown> | null;
192
206
  [key: string]: any;
193
207
  }
208
+ interface ClientFormTranslatableValue {
209
+ display?: string;
210
+ en?: string;
211
+ ar?: string;
212
+ [key: string]: string | undefined;
213
+ }
194
214
  interface ClientValidationRule {
195
215
  id: string | number;
196
216
  formulaTokens: string;
@@ -328,8 +348,11 @@ declare class ClientForm implements OnDestroy {
328
348
  protected readonly state: ClientFormStateService;
329
349
  private loadSub?;
330
350
  private submitSub?;
351
+ private formValueSub?;
331
352
  private readonly hasStartedLoad;
332
- readonly runtimeMessages: _angular_core.WritableSignal<FormulaRuntimeMessage[]>;
353
+ private readonly formRuntimeMessages;
354
+ private readonly submitValidationMessages;
355
+ readonly runtimeMessages: _angular_core.Signal<FormulaRuntimeMessage[]>;
333
356
  private readonly translocoService;
334
357
  readonly submitting: _angular_core.Signal<boolean>;
335
358
  readonly submitError: _angular_core.Signal<string | null>;
@@ -355,7 +378,7 @@ declare class ClientForm implements OnDestroy {
355
378
  readonly readonly: _angular_core.InputSignal<boolean>;
356
379
  readonly autoLoad: _angular_core.InputSignal<boolean>;
357
380
  readonly formMode: _angular_core.InputSignal<"create" | "edit">;
358
- readonly renderMode: _angular_core.InputSignal<"form" | "steps" | "tabs" | undefined>;
381
+ readonly renderMode: _angular_core.InputSignal<"form" | "steps" | "tabs" | "wizard" | undefined>;
359
382
  readonly showInternalStepActions: _angular_core.InputSignal<boolean>;
360
383
  readonly lang: _angular_core.WritableSignal<"en" | "ar">;
361
384
  readonly lookups: _angular_core.InputSignal<ClientLookup[]>;
@@ -382,9 +405,11 @@ declare class ClientForm implements OnDestroy {
382
405
  readonly editableFormConfig: _angular_core.Signal<DynamicFormConfig | null>;
383
406
  readonly stepSections: _angular_core.Signal<_masterteam_components.SectionConfig[]>;
384
407
  readonly hasEditableFormSections: _angular_core.Signal<boolean>;
385
- readonly effectiveRenderMode: _angular_core.Signal<"form" | "steps" | "tabs">;
408
+ readonly effectiveRenderMode: _angular_core.Signal<"form" | "steps" | "tabs" | "wizard">;
386
409
  readonly stepsEnabled: _angular_core.Signal<boolean>;
387
410
  readonly tabsEnabled: _angular_core.Signal<boolean>;
411
+ readonly wizardEnabled: _angular_core.Signal<boolean>;
412
+ readonly wizardFormConfig: _angular_core.Signal<DynamicFormConfig | null>;
388
413
  readonly sectionNavigationEnabled: _angular_core.Signal<boolean>;
389
414
  readonly tabOptions: _angular_core.Signal<OptionItem[]>;
390
415
  readonly stepTimeline: _angular_core.Signal<StepTimelineItem[]>;
@@ -440,6 +465,9 @@ declare class ClientForm implements OnDestroy {
440
465
  ngOnDestroy(): void;
441
466
  private buildLoadRequest;
442
467
  private buildSubmitRequest;
468
+ private mapSubmitValidationMessages;
469
+ private resolveSubmitValidationMessage;
470
+ private resolveTranslatableValue;
443
471
  private resolveStepTimelineState;
444
472
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientForm, never>;
445
473
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientForm, "mt-client-form", never, { "moduleKey": { "alias": "moduleKey"; "required": true; "isSignal": true; }; "operationKey": { "alias": "operationKey"; "required": true; "isSignal": true; }; "moduleId": { "alias": "moduleId"; "required": false; "isSignal": true; }; "levelId": { "alias": "levelId"; "required": false; "isSignal": true; }; "levelDataId": { "alias": "levelDataId"; "required": false; "isSignal": true; }; "moduleDataId": { "alias": "moduleDataId"; "required": false; "isSignal": true; }; "requestSchemaId": { "alias": "requestSchemaId"; "required": false; "isSignal": true; }; "draftProcessId": { "alias": "draftProcessId"; "required": false; "isSignal": true; }; "preview": { "alias": "preview"; "required": false; "isSignal": true; }; "returnUrl": { "alias": "returnUrl"; "required": false; "isSignal": true; }; "submitRequestMapper": { "alias": "submitRequestMapper"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "autoLoad": { "alias": "autoLoad"; "required": false; "isSignal": true; }; "formMode": { "alias": "formMode"; "required": false; "isSignal": true; }; "renderMode": { "alias": "renderMode"; "required": false; "isSignal": true; }; "showInternalStepActions": { "alias": "showInternalStepActions"; "required": false; "isSignal": true; }; "lookups": { "alias": "lookups"; "required": false; "isSignal": true; }; "ignoredFieldKeys": { "alias": "ignoredFieldKeys"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "submitted": "submitted"; "errored": "errored"; "modeDetected": "modeDetected"; "formSourceDetected": "formSourceDetected"; "footerStateChanged": "footerStateChanged"; }, never, never, true, never>;
@@ -462,6 +490,11 @@ declare class ClientFormApiService {
462
490
  * - Direct → status: 'Executed'
463
491
  */
464
492
  submit(request: ProcessFormSubmitRequest): Observable<Response<ProcessFormSubmitResponse>>;
493
+ /**
494
+ * Validate the exact submit payload against backend-owned form rules
495
+ * before the real submit call.
496
+ */
497
+ validate(request: ProcessFormSubmitRequest): Observable<Response<ProcessFormValidationRuntimeResult>>;
465
498
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientFormApiService, never>;
466
499
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientFormApiService>;
467
500
  }
@@ -501,4 +534,4 @@ declare function mapPreviewFieldsToEntities(config: ClientFormConfiguration, val
501
534
  declare function mapPreviewSectionsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], lang?: 'en' | 'ar', mode?: 'create' | 'edit', readonly?: boolean): ClientFormPreviewSection[];
502
535
 
503
536
  export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapPreviewSectionsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
504
- export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormFooterActionMode, ClientFormFooterState, ClientFormPreviewSection, ClientFormRenderMode, ClientFormResolvedRenderMode, ClientFormSection, ClientFormSubmitRequestMapper, ClientFormSubmitRequestMapperContext, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitField, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };
537
+ export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormFooterActionMode, ClientFormFooterState, ClientFormPreviewSection, ClientFormRenderMode, ClientFormResolvedRenderMode, ClientFormSection, ClientFormSubmitRequestMapper, ClientFormSubmitRequestMapperContext, ClientFormTranslatableValue, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitField, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValidationRuleResult, ProcessFormValidationRuntimeResult, ProcessFormValue, ProcessFormValueMetadata, Response };