@masterteam/forms 0.0.52 → 0.0.54
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/fesm2022/masterteam-forms-client-form.mjs +150 -20
- package/fesm2022/masterteam-forms-client-form.mjs.map +1 -1
- package/fesm2022/masterteam-forms-dynamic-field.mjs +8 -4
- package/fesm2022/masterteam-forms-dynamic-field.mjs.map +1 -1
- package/fesm2022/masterteam-forms-dynamic-form.mjs +6 -3
- package/fesm2022/masterteam-forms-dynamic-form.mjs.map +1 -1
- package/package.json +2 -2
- package/types/masterteam-forms-client-form.d.ts +34 -5
- package/types/masterteam-forms-dynamic-form.d.ts +1 -0
|
@@ -23,6 +23,23 @@ 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';
|
|
27
|
+
type ClientFormFooterActionMode = 'loading' | 'steps' | 'submit';
|
|
28
|
+
interface ClientFormFooterState {
|
|
29
|
+
loading: boolean;
|
|
30
|
+
isLoaded: boolean;
|
|
31
|
+
renderMode: ClientFormResolvedRenderMode;
|
|
32
|
+
actionMode: ClientFormFooterActionMode;
|
|
33
|
+
stepNavigationEnabled: boolean;
|
|
34
|
+
sectionNavigationEnabled: boolean;
|
|
35
|
+
currentStep: number;
|
|
36
|
+
stepCount: number;
|
|
37
|
+
canGoToPreviousStep: boolean;
|
|
38
|
+
canGoToNextStep: boolean;
|
|
39
|
+
showPreviousStep: boolean;
|
|
40
|
+
showNextStep: boolean;
|
|
41
|
+
showSubmit: boolean;
|
|
42
|
+
}
|
|
26
43
|
interface ProcessFormLoadRequest {
|
|
27
44
|
moduleKey: string;
|
|
28
45
|
operationKey: string;
|
|
@@ -162,6 +179,7 @@ interface ClientFormField {
|
|
|
162
179
|
interface ClientPropertyItem {
|
|
163
180
|
key: string;
|
|
164
181
|
propertyId?: number;
|
|
182
|
+
isCalculated?: boolean;
|
|
165
183
|
name: string | {
|
|
166
184
|
display?: string;
|
|
167
185
|
en?: string;
|
|
@@ -287,7 +305,10 @@ interface StepTimelineItem {
|
|
|
287
305
|
* Self-contained, signal-based (no NGXS). Each instance manages its own state
|
|
288
306
|
* via a component-scoped `ClientFormStateService`.
|
|
289
307
|
*
|
|
290
|
-
*
|
|
308
|
+
* Submit and reset actions stay external. Step navigation buttons are optional
|
|
309
|
+
* and can be hidden with `showInternalStepActions`.
|
|
310
|
+
*
|
|
311
|
+
* Parent can control actions via `viewChild()`:
|
|
291
312
|
*
|
|
292
313
|
* ```html
|
|
293
314
|
* <mt-client-form #processForm [moduleKey]="'Risk'" [operationKey]="'CloseRisk'" />
|
|
@@ -307,6 +328,7 @@ declare class ClientForm implements OnDestroy {
|
|
|
307
328
|
protected readonly state: ClientFormStateService;
|
|
308
329
|
private loadSub?;
|
|
309
330
|
private submitSub?;
|
|
331
|
+
private readonly hasStartedLoad;
|
|
310
332
|
readonly runtimeMessages: _angular_core.WritableSignal<FormulaRuntimeMessage[]>;
|
|
311
333
|
private readonly translocoService;
|
|
312
334
|
readonly submitting: _angular_core.Signal<boolean>;
|
|
@@ -333,7 +355,7 @@ declare class ClientForm implements OnDestroy {
|
|
|
333
355
|
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
334
356
|
readonly autoLoad: _angular_core.InputSignal<boolean>;
|
|
335
357
|
readonly formMode: _angular_core.InputSignal<"create" | "edit">;
|
|
336
|
-
readonly renderMode: _angular_core.InputSignal<"
|
|
358
|
+
readonly renderMode: _angular_core.InputSignal<"form" | "steps" | "tabs" | undefined>;
|
|
337
359
|
readonly showInternalStepActions: _angular_core.InputSignal<boolean>;
|
|
338
360
|
readonly lang: _angular_core.WritableSignal<"en" | "ar">;
|
|
339
361
|
readonly lookups: _angular_core.InputSignal<ClientLookup[]>;
|
|
@@ -344,6 +366,7 @@ declare class ClientForm implements OnDestroy {
|
|
|
344
366
|
readonly errored: _angular_core.OutputEmitterRef<string>;
|
|
345
367
|
readonly modeDetected: _angular_core.OutputEmitterRef<ProcessFormMode>;
|
|
346
368
|
readonly formSourceDetected: _angular_core.OutputEmitterRef<ProcessFormSource>;
|
|
369
|
+
readonly footerStateChanged: _angular_core.OutputEmitterRef<ClientFormFooterState>;
|
|
347
370
|
readonly formControl: FormControl<Record<string, any> | null>;
|
|
348
371
|
readonly formConfig: _angular_core.Signal<DynamicFormConfig | null>;
|
|
349
372
|
readonly initialValues: _angular_core.Signal<Record<string, any>>;
|
|
@@ -354,7 +377,7 @@ declare class ClientForm implements OnDestroy {
|
|
|
354
377
|
readonly editableFormConfig: _angular_core.Signal<DynamicFormConfig | null>;
|
|
355
378
|
readonly stepSections: _angular_core.Signal<_masterteam_components.SectionConfig[]>;
|
|
356
379
|
readonly hasEditableFormSections: _angular_core.Signal<boolean>;
|
|
357
|
-
readonly effectiveRenderMode: _angular_core.Signal<"
|
|
380
|
+
readonly effectiveRenderMode: _angular_core.Signal<"form" | "steps" | "tabs">;
|
|
358
381
|
readonly stepsEnabled: _angular_core.Signal<boolean>;
|
|
359
382
|
readonly tabsEnabled: _angular_core.Signal<boolean>;
|
|
360
383
|
readonly sectionNavigationEnabled: _angular_core.Signal<boolean>;
|
|
@@ -363,6 +386,8 @@ declare class ClientForm implements OnDestroy {
|
|
|
363
386
|
readonly visibleSectionKeys: _angular_core.Signal<string[] | null>;
|
|
364
387
|
readonly forcedHiddenFieldKeys: _angular_core.Signal<string[]>;
|
|
365
388
|
readonly effectiveForcedHiddenFieldKeys: _angular_core.Signal<string[]>;
|
|
389
|
+
readonly footerLoading: _angular_core.Signal<boolean>;
|
|
390
|
+
readonly footerState: _angular_core.Signal<ClientFormFooterState>;
|
|
366
391
|
constructor();
|
|
367
392
|
/**
|
|
368
393
|
* Load form configuration from the API.
|
|
@@ -403,12 +428,16 @@ declare class ClientForm implements OnDestroy {
|
|
|
403
428
|
getCurrentStep(): number;
|
|
404
429
|
getStepCount(): number;
|
|
405
430
|
isStepNavigationEnabled(): boolean;
|
|
431
|
+
isSectionNavigationEnabled(): boolean;
|
|
432
|
+
isFooterLoading(): boolean;
|
|
433
|
+
getResolvedRenderMode(): ClientFormResolvedRenderMode;
|
|
434
|
+
getFooterState(): ClientFormFooterState;
|
|
406
435
|
ngOnDestroy(): void;
|
|
407
436
|
private buildLoadRequest;
|
|
408
437
|
private buildSubmitRequest;
|
|
409
438
|
private resolveStepTimelineState;
|
|
410
439
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientForm, never>;
|
|
411
|
-
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"; }, never, never, true, never>;
|
|
440
|
+
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>;
|
|
412
441
|
}
|
|
413
442
|
|
|
414
443
|
/**
|
|
@@ -460,4 +489,4 @@ declare function getPreviewOnlyFieldKeys(config: ClientFormConfiguration, mode?:
|
|
|
460
489
|
declare function mapPreviewFieldsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], mode?: 'create' | 'edit'): EntityData[];
|
|
461
490
|
|
|
462
491
|
export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
|
|
463
|
-
export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormRenderMode, ClientFormSection, ClientFormSubmitRequestMapper, ClientFormSubmitRequestMapperContext, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitField, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };
|
|
492
|
+
export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormFooterActionMode, ClientFormFooterState, 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 };
|
|
@@ -36,6 +36,7 @@ declare class DynamicForm implements OnDestroy, ControlValueAccessor, Validator
|
|
|
36
36
|
registerOnChange(fn: (value: any) => void): void;
|
|
37
37
|
registerOnTouched(fn: () => void): void;
|
|
38
38
|
private buildForm;
|
|
39
|
+
private shouldCreateControl;
|
|
39
40
|
writeValue(value: any): void;
|
|
40
41
|
validate(_control: AbstractControl): ValidationErrors | null;
|
|
41
42
|
/**
|