@masterteam/forms 0.0.51 → 0.0.52
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/assets/forms.css +1 -1
- package/fesm2022/masterteam-forms-client-form.mjs +61 -14
- 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 +2 -2
- package/fesm2022/masterteam-forms-dynamic-form.mjs.map +1 -1
- package/package.json +2 -2
- package/types/masterteam-forms-client-form.d.ts +37 -17
|
@@ -26,10 +26,10 @@ type ProcessFormSource = 'Step' | 'None';
|
|
|
26
26
|
interface ProcessFormLoadRequest {
|
|
27
27
|
moduleKey: string;
|
|
28
28
|
operationKey: string;
|
|
29
|
-
moduleId?: number;
|
|
30
|
-
levelId?: number;
|
|
31
|
-
levelDataId?: number;
|
|
32
|
-
moduleDataId?: number;
|
|
29
|
+
moduleId?: number | string;
|
|
30
|
+
levelId?: number | string;
|
|
31
|
+
levelDataId?: number | string;
|
|
32
|
+
moduleDataId?: number | string;
|
|
33
33
|
requestSchemaId?: number;
|
|
34
34
|
draftProcessId?: number;
|
|
35
35
|
preview?: boolean;
|
|
@@ -50,15 +50,20 @@ interface ProcessFormLoadResponse {
|
|
|
50
50
|
interface ProcessFormSubmitRequest {
|
|
51
51
|
moduleKey: string;
|
|
52
52
|
operationKey: string;
|
|
53
|
-
moduleId?: number;
|
|
54
|
-
levelId?: number;
|
|
55
|
-
levelDataId?: number;
|
|
56
|
-
moduleDataId?: number;
|
|
57
|
-
recordId?: number;
|
|
53
|
+
moduleId?: number | string;
|
|
54
|
+
levelId?: number | string;
|
|
55
|
+
levelDataId?: number | string;
|
|
56
|
+
moduleDataId?: number | string;
|
|
57
|
+
recordId?: number | string;
|
|
58
58
|
requestSchemaId?: number;
|
|
59
59
|
returnUrl?: string;
|
|
60
60
|
fields: ProcessFormSubmitField[];
|
|
61
61
|
}
|
|
62
|
+
interface ClientFormSubmitRequestMapperContext {
|
|
63
|
+
formValue: Record<string, any>;
|
|
64
|
+
loadResponse: ProcessFormLoadResponse;
|
|
65
|
+
}
|
|
66
|
+
type ClientFormSubmitRequestMapper = (request: ProcessFormSubmitRequest, context: ClientFormSubmitRequestMapperContext) => ProcessFormSubmitRequest;
|
|
62
67
|
interface ProcessFormSubmitField {
|
|
63
68
|
requestPropertyId?: number;
|
|
64
69
|
propertyKey: string;
|
|
@@ -266,6 +271,16 @@ declare class ClientFormStateService {
|
|
|
266
271
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientFormStateService>;
|
|
267
272
|
}
|
|
268
273
|
|
|
274
|
+
type StepTimelineState = 'completed' | 'current' | 'upcoming';
|
|
275
|
+
interface StepTimelineItem {
|
|
276
|
+
key: string;
|
|
277
|
+
label: string;
|
|
278
|
+
value: number;
|
|
279
|
+
state: StepTimelineState;
|
|
280
|
+
selected: boolean;
|
|
281
|
+
beforeLineActive: boolean;
|
|
282
|
+
afterLineActive: boolean;
|
|
283
|
+
}
|
|
269
284
|
/**
|
|
270
285
|
* Client Form — Runtime process form component.
|
|
271
286
|
*
|
|
@@ -293,6 +308,7 @@ declare class ClientForm implements OnDestroy {
|
|
|
293
308
|
private loadSub?;
|
|
294
309
|
private submitSub?;
|
|
295
310
|
readonly runtimeMessages: _angular_core.WritableSignal<FormulaRuntimeMessage[]>;
|
|
311
|
+
private readonly translocoService;
|
|
296
312
|
readonly submitting: _angular_core.Signal<boolean>;
|
|
297
313
|
readonly submitError: _angular_core.Signal<string | null>;
|
|
298
314
|
readonly isSubmitted: _angular_core.Signal<boolean>;
|
|
@@ -305,22 +321,24 @@ declare class ClientForm implements OnDestroy {
|
|
|
305
321
|
readonly currentStep: _angular_core.WritableSignal<number>;
|
|
306
322
|
readonly moduleKey: _angular_core.InputSignal<string>;
|
|
307
323
|
readonly operationKey: _angular_core.InputSignal<string>;
|
|
308
|
-
readonly moduleId: _angular_core.InputSignal<number | undefined>;
|
|
309
|
-
readonly levelId: _angular_core.InputSignal<number | undefined>;
|
|
310
|
-
readonly levelDataId: _angular_core.InputSignal<number | undefined>;
|
|
311
|
-
readonly moduleDataId: _angular_core.InputSignal<number | undefined>;
|
|
324
|
+
readonly moduleId: _angular_core.InputSignal<string | number | undefined>;
|
|
325
|
+
readonly levelId: _angular_core.InputSignal<string | number | undefined>;
|
|
326
|
+
readonly levelDataId: _angular_core.InputSignal<string | number | undefined>;
|
|
327
|
+
readonly moduleDataId: _angular_core.InputSignal<string | number | undefined>;
|
|
312
328
|
readonly requestSchemaId: _angular_core.InputSignal<number | undefined>;
|
|
313
329
|
readonly draftProcessId: _angular_core.InputSignal<number | undefined>;
|
|
314
330
|
readonly preview: _angular_core.InputSignal<boolean>;
|
|
315
331
|
readonly returnUrl: _angular_core.InputSignal<string | undefined>;
|
|
332
|
+
readonly submitRequestMapper: _angular_core.InputSignal<ClientFormSubmitRequestMapper | null>;
|
|
316
333
|
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
317
334
|
readonly autoLoad: _angular_core.InputSignal<boolean>;
|
|
318
335
|
readonly formMode: _angular_core.InputSignal<"create" | "edit">;
|
|
319
336
|
readonly renderMode: _angular_core.InputSignal<"steps" | "tabs" | "form" | undefined>;
|
|
320
337
|
readonly showInternalStepActions: _angular_core.InputSignal<boolean>;
|
|
321
|
-
readonly lang: _angular_core.
|
|
338
|
+
readonly lang: _angular_core.WritableSignal<"en" | "ar">;
|
|
322
339
|
readonly lookups: _angular_core.InputSignal<ClientLookup[]>;
|
|
323
340
|
readonly ignoredFieldKeys: _angular_core.InputSignal<string[]>;
|
|
341
|
+
readonly rtl: _angular_core.Signal<boolean>;
|
|
324
342
|
readonly loaded: _angular_core.OutputEmitterRef<ProcessFormLoadResponse>;
|
|
325
343
|
readonly submitted: _angular_core.OutputEmitterRef<ProcessFormSubmitResponse>;
|
|
326
344
|
readonly errored: _angular_core.OutputEmitterRef<string>;
|
|
@@ -341,6 +359,7 @@ declare class ClientForm implements OnDestroy {
|
|
|
341
359
|
readonly tabsEnabled: _angular_core.Signal<boolean>;
|
|
342
360
|
readonly sectionNavigationEnabled: _angular_core.Signal<boolean>;
|
|
343
361
|
readonly tabOptions: _angular_core.Signal<OptionItem[]>;
|
|
362
|
+
readonly stepTimeline: _angular_core.Signal<StepTimelineItem[]>;
|
|
344
363
|
readonly visibleSectionKeys: _angular_core.Signal<string[] | null>;
|
|
345
364
|
readonly forcedHiddenFieldKeys: _angular_core.Signal<string[]>;
|
|
346
365
|
readonly effectiveForcedHiddenFieldKeys: _angular_core.Signal<string[]>;
|
|
@@ -387,8 +406,9 @@ declare class ClientForm implements OnDestroy {
|
|
|
387
406
|
ngOnDestroy(): void;
|
|
388
407
|
private buildLoadRequest;
|
|
389
408
|
private buildSubmitRequest;
|
|
409
|
+
private resolveStepTimelineState;
|
|
390
410
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientForm, never>;
|
|
391
|
-
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; }; "
|
|
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>;
|
|
392
412
|
}
|
|
393
413
|
|
|
394
414
|
/**
|
|
@@ -421,7 +441,7 @@ declare class ClientFormApiService {
|
|
|
421
441
|
* @param mode 'create' or 'edit' — filters hidden fields accordingly
|
|
422
442
|
* @param lookups Available lookup definitions for resolving Lookup/LookupMultiSelect options
|
|
423
443
|
*/
|
|
424
|
-
declare function mapToDynamicFormConfig(config: ClientFormConfiguration, lang?: 'en' | 'ar', mode?: 'create' | 'edit', lookups?: ClientLookup[]): DynamicFormConfig;
|
|
444
|
+
declare function mapToDynamicFormConfig(config: ClientFormConfiguration, lang?: 'en' | 'ar', mode?: 'create' | 'edit', lookups?: ClientLookup[], context?: ProcessFormContext | null): DynamicFormConfig;
|
|
425
445
|
/**
|
|
426
446
|
* Convert API property values into a flat key-value object
|
|
427
447
|
* suitable for `formControl.patchValue()`.
|
|
@@ -440,4 +460,4 @@ declare function getPreviewOnlyFieldKeys(config: ClientFormConfiguration, mode?:
|
|
|
440
460
|
declare function mapPreviewFieldsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], mode?: 'create' | 'edit'): EntityData[];
|
|
441
461
|
|
|
442
462
|
export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
|
|
443
|
-
export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormRenderMode, ClientFormSection, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitField, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };
|
|
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 };
|