@masterteam/forms 0.0.46 → 0.0.48

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.
@@ -22,7 +22,7 @@ interface Response<T> {
22
22
  type ProcessFormMode = 'Approval' | 'Direct';
23
23
  type ProcessFormSubmitStatus = 'PendingApproval' | 'Executed';
24
24
  type OperationType = 'FormOperation' | 'ActionOperation';
25
- type ProcessFormSource = 'Step' | 'ModuleFallback' | 'LevelFallback' | 'None';
25
+ type ProcessFormSource = 'Step' | 'None';
26
26
  interface ProcessFormLoadRequest {
27
27
  moduleKey: string;
28
28
  operationKey: string;
@@ -66,10 +66,32 @@ interface ProcessFormSubmitValue {
66
66
  }
67
67
  interface ProcessFormSubmitResponse {
68
68
  status: ProcessFormSubmitStatus;
69
- requestSchemaId: number | null;
70
- requestId: number | null;
71
- createdEntityId: number | null;
72
- message: string | null;
69
+ moduleKey: string;
70
+ operation: string;
71
+ recordId: number | null;
72
+ levelId: number | null;
73
+ levelDataId: number | null;
74
+ requestSchemaId?: number | null;
75
+ requestId?: number | null;
76
+ record?: ProcessFormSubmitRecord | null;
77
+ }
78
+ interface ProcessFormSubmitRecord {
79
+ fields: ProcessFormSubmitRecordField[];
80
+ }
81
+ interface ProcessFormSubmitRecordField {
82
+ id: number;
83
+ key: string;
84
+ normalizedKey: string;
85
+ label: string;
86
+ viewType: string;
87
+ configuration: Record<string, unknown> | null;
88
+ source: string;
89
+ order: number;
90
+ isRequired: boolean;
91
+ isSystem: boolean;
92
+ raw: any;
93
+ value: any;
94
+ display?: string | null;
73
95
  }
74
96
  interface ProcessFormValue {
75
97
  propertyKey: string;
@@ -96,8 +118,10 @@ interface ProcessFormContext {
96
118
  preview: boolean;
97
119
  }
98
120
  type ClientFieldWidth = '25' | '50' | '100';
121
+ type ClientFormRenderMode = 'sections' | 'steps' | 'tabs';
99
122
  interface ClientFormConfiguration {
100
123
  isActive?: boolean;
124
+ renderMode?: ClientFormRenderMode;
101
125
  sections: ClientFormSection[];
102
126
  validations?: ClientValidationRule[];
103
127
  }
@@ -114,9 +138,8 @@ interface ClientFormField {
114
138
  id: string;
115
139
  sectionId: string;
116
140
  propertyKey: string;
117
- /** Property info may come as `property` or `propertyMetadata` from API */
118
- property?: ClientPropertyItem;
119
- propertyMetadata?: ClientPropertyItem;
141
+ /** Runtime property metadata returned by the API */
142
+ propertyMetadata: ClientPropertyItem;
120
143
  width: ClientFieldWidth;
121
144
  order: number;
122
145
  hiddenInCreation?: boolean;
@@ -138,7 +161,7 @@ interface ClientPropertyItem {
138
161
  };
139
162
  viewType?: string;
140
163
  source?: string;
141
- configuration?: Record<string, unknown>;
164
+ configuration?: Record<string, unknown> | null;
142
165
  [key: string]: any;
143
166
  }
144
167
  interface ClientValidationRule {
@@ -213,7 +236,6 @@ declare class ClientFormStateService {
213
236
  readonly isApproval: _angular_core.Signal<boolean>;
214
237
  readonly isDirect: _angular_core.Signal<boolean>;
215
238
  readonly formSource: _angular_core.Signal<ProcessFormSource | null>;
216
- readonly isFallbackForm: _angular_core.Signal<boolean>;
217
239
  readonly requiresForm: _angular_core.Signal<boolean>;
218
240
  readonly formConfiguration: _angular_core.Signal<ClientFormConfiguration | null>;
219
241
  readonly values: _angular_core.Signal<ProcessFormValue[]>;
@@ -231,7 +253,6 @@ declare class ClientFormStateService {
231
253
  readonly submitStatus: _angular_core.Signal<_masterteam_forms_client_form.ProcessFormSubmitStatus | null>;
232
254
  readonly isPendingApproval: _angular_core.Signal<boolean>;
233
255
  readonly isExecuted: _angular_core.Signal<boolean>;
234
- readonly createdEntityId: _angular_core.Signal<number | null>;
235
256
  setLoadResponse(response: ProcessFormLoadResponse): void;
236
257
  setSubmitResponse(response: ProcessFormSubmitResponse): void;
237
258
  setError(message: string): void;
@@ -291,7 +312,7 @@ declare class ClientForm implements OnDestroy {
291
312
  readonly readonly: _angular_core.InputSignal<boolean>;
292
313
  readonly autoLoad: _angular_core.InputSignal<boolean>;
293
314
  readonly formMode: _angular_core.InputSignal<"create" | "edit">;
294
- readonly renderMode: _angular_core.InputSignal<"form" | "steps" | "tabs">;
315
+ readonly renderMode: _angular_core.InputSignal<"steps" | "tabs" | "form" | undefined>;
295
316
  readonly showInternalStepActions: _angular_core.InputSignal<boolean>;
296
317
  readonly lang: _angular_core.InputSignal<"en" | "ar">;
297
318
  readonly lookups: _angular_core.InputSignal<ClientLookup[]>;
@@ -310,6 +331,7 @@ declare class ClientForm implements OnDestroy {
310
331
  readonly editableFormConfig: _angular_core.Signal<DynamicFormConfig | null>;
311
332
  readonly stepSections: _angular_core.Signal<_masterteam_components.SectionConfig[]>;
312
333
  readonly hasEditableFormSections: _angular_core.Signal<boolean>;
334
+ readonly effectiveRenderMode: _angular_core.Signal<"steps" | "tabs" | "form">;
313
335
  readonly stepsEnabled: _angular_core.Signal<boolean>;
314
336
  readonly tabsEnabled: _angular_core.Signal<boolean>;
315
337
  readonly sectionNavigationEnabled: _angular_core.Signal<boolean>;
@@ -409,4 +431,4 @@ declare function getPreviewOnlyFieldKeys(config: ClientFormConfiguration, mode?:
409
431
  declare function mapPreviewFieldsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], mode?: 'create' | 'edit'): EntityData[];
410
432
 
411
433
  export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitValues, mapPreviewFieldsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
412
- export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormSection, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };
434
+ export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormRenderMode, ClientFormSection, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };
@@ -5,6 +5,7 @@ import { DynamicFieldConfig } from '@masterteam/components';
5
5
  declare class DynamicField {
6
6
  readonly fieldConfig: _angular_core.InputSignal<DynamicFieldConfig>;
7
7
  readonly transformedFieldConfig: Signal<DynamicFieldConfig>;
8
+ readonly isRequired: Signal<boolean>;
8
9
  private controlContainer;
9
10
  readonly fieldName: _angular_core.InputSignal<string>;
10
11
  constructor();