ngx-t-forms-types 0.0.23 → 0.0.25
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/dist/interfaces/Form/FormInClassUtils.d.ts +3 -4
- package/dist/interfaces/Form/IFormsInitStateInterface.d.ts +2 -2
- package/dist/interfaces/FormBuilder/FormBuilderCallBackFunctions.d.ts +24 -1
- package/dist/interfaces/FormBuilder/elementEditor.d.ts +3 -1
- package/dist/interfaces/FormBuilder/elementEditor.js +2 -0
- package/dist/interfaces/FormBuilder/inputConfig/ElementEditConfig.js +102 -2
- package/dist/interfaces/Tour/IFormTour.d.ts +15 -1
- package/dist/interfaces/Tour/index.d.ts +1 -1
- package/dist/interfaces/Tower/ITowerFormSteps.d.ts +3 -4
- package/dist/interfaces/environment/IStoreFunctions.d.ts +1 -2
- package/dist/interfaces/formInput/APIDataFetchingConfigurationInterface.d.ts +89 -5
- package/dist/interfaces/formInput/BasicFormInputInterface.d.ts +6 -1
- package/dist/interfaces/formInput/index.d.ts +2 -2
- package/dist/interfaces/formInput/userSignature.d.ts +24 -1
- package/dist/interfaces/pipeline-builder/index.d.ts +2 -2
- package/dist/interfaces/pipeline-builder/pipelineStages.d.ts +7 -1
- package/dist/interfaces/upgradeFunctions/interfaces/init-form.d.ts +2 -1
- package/dist/schemas/MatOptionsSchema.js +10 -1
- package/package.json +3 -26
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import { IUserSignature } from "../formInput/userSignature.js";
|
|
3
|
-
import { PointGroup } from "signature_pad";
|
|
2
|
+
import { IUserSignature, PointGroup } from "../formInput/userSignature.js";
|
|
4
3
|
import { FileUploadFn, NgxTFormsConfig } from "../../interfaces/Form/index.js";
|
|
5
|
-
import { HttpClient } from "@angular/common/http";
|
|
6
4
|
import { FormSubmissionStatus } from "../FormSlide/index.js";
|
|
7
5
|
/**
|
|
8
6
|
* Interface for the utility functions used in the in-class form.
|
|
@@ -33,7 +31,8 @@ export interface InClassFormUtilsInterface {
|
|
|
33
31
|
getUserSignature: () => Observable<IUserSignature>;
|
|
34
32
|
saveUserSignature: (signature: PointGroup[]) => Observable<void>;
|
|
35
33
|
NGX_T_FORMS_CONFIG?: NgxTFormsConfig;
|
|
36
|
-
|
|
34
|
+
/** Angular `HttpClient` instance on the frontend; typed opaque here to avoid an `@angular/common` dependency. */
|
|
35
|
+
httpCall?: unknown;
|
|
37
36
|
setSubmissionStatusValue: (status: FormSubmissionStatus) => void;
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ActivatedRouteSnapshot } from "@angular/router";
|
|
2
1
|
import { DatabaseFormInterface, FormInterface } from "./formInterface.js";
|
|
3
2
|
export interface LocalFormStateSelectorInterface extends FormInterface {
|
|
4
3
|
_id: string;
|
|
@@ -32,7 +31,8 @@ export interface IFormsInitStateInterface {
|
|
|
32
31
|
loadingForms: boolean;
|
|
33
32
|
submittingForm: boolean;
|
|
34
33
|
formId: string | null;
|
|
35
|
-
|
|
34
|
+
/** Angular `ActivatedRouteSnapshot` on the frontend; opaque here to keep these typings Angular-free. */
|
|
35
|
+
routerState: unknown | null;
|
|
36
36
|
loadFormsError: string | null;
|
|
37
37
|
errors: {
|
|
38
38
|
[FormStateErrors.ArchiveForm]: string | undefined;
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { IGetTreeResponse, IMultipleInputCal, IScoaAccount } from "../formInput/index.js";
|
|
3
3
|
import { FormColumnInputs } from "../formInput/BasicFormInputInterface.js";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Structural, Angular-free mirror of `@angular/cdk/drag-drop`'s `CdkDragDrop` event,
|
|
6
|
+
* capturing only the fields a reorder handler reads. Angular's concrete `CdkDragDrop`
|
|
7
|
+
* is assignment-compatible with this shape, so frontend consumers pass it unchanged
|
|
8
|
+
* while this package carries no `@angular/cdk` dependency.
|
|
9
|
+
*/
|
|
10
|
+
export interface CdkDragDrop<T, O = T, I = any> {
|
|
11
|
+
previousIndex: number;
|
|
12
|
+
currentIndex: number;
|
|
13
|
+
item: {
|
|
14
|
+
data: I;
|
|
15
|
+
};
|
|
16
|
+
container: {
|
|
17
|
+
data: T;
|
|
18
|
+
};
|
|
19
|
+
previousContainer: {
|
|
20
|
+
data: O;
|
|
21
|
+
};
|
|
22
|
+
isPointerOverContainer: boolean;
|
|
23
|
+
distance: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
5
28
|
export interface FormBuilderFunctions {
|
|
6
29
|
multipleInputToggleLabel: (item: FormColumnInputs) => void;
|
|
7
30
|
multipleInputToggleForm: (inputId: string, open: boolean) => void;
|
|
@@ -36,7 +36,9 @@ export declare enum ElementEditorTypes {
|
|
|
36
36
|
DecisionGateSettings = "decisionGateSettings",
|
|
37
37
|
RecordListManager = "recordListManager",
|
|
38
38
|
MapMatOptionsKeys = "mapMatOptionsKeys",
|
|
39
|
-
FormPayloadProjection = "formPayloadProjection"
|
|
39
|
+
FormPayloadProjection = "formPayloadProjection",
|
|
40
|
+
/** Opt-in JSON body template ({@link PayloadTemplate}) for a POST value/options fetch. */
|
|
41
|
+
PayloadTemplate = "payloadTemplate"
|
|
40
42
|
}
|
|
41
43
|
export interface ElementEditorConfigInterface {
|
|
42
44
|
editorSections: Array<ElementEditorConfigSectionInterface>;
|
|
@@ -31,6 +31,8 @@ export var ElementEditorTypes;
|
|
|
31
31
|
ElementEditorTypes["RecordListManager"] = "recordListManager";
|
|
32
32
|
ElementEditorTypes["MapMatOptionsKeys"] = "mapMatOptionsKeys";
|
|
33
33
|
ElementEditorTypes["FormPayloadProjection"] = "formPayloadProjection";
|
|
34
|
+
/** Opt-in JSON body template ({@link PayloadTemplate}) for a POST value/options fetch. */
|
|
35
|
+
ElementEditorTypes["PayloadTemplate"] = "payloadTemplate";
|
|
34
36
|
})(ElementEditorTypes || (ElementEditorTypes = {}));
|
|
35
37
|
// interface TStringExpressionValidationTest{
|
|
36
38
|
// expression: string;
|
|
@@ -745,6 +745,34 @@ export var ElementConfig = {
|
|
|
745
745
|
label: 'Configure MongoDB pipeline',
|
|
746
746
|
id: "7b2989ae-2f54-4849-93d0-aff56ac12ef2"
|
|
747
747
|
},
|
|
748
|
+
{
|
|
749
|
+
name: SpecialElementKeys.Default,
|
|
750
|
+
deepBind: ['matOptions', 'fetch', 'value', 'backEndConfig', 'requestBodyMode'],
|
|
751
|
+
additionalTest: [
|
|
752
|
+
{
|
|
753
|
+
// Only once an API endpoint is configured for the value.
|
|
754
|
+
testType: 'exists',
|
|
755
|
+
deepBind: ['matOptions', 'fetch', 'value'],
|
|
756
|
+
},
|
|
757
|
+
],
|
|
758
|
+
editType: ElementEditorTypes.ChipSelect,
|
|
759
|
+
label: 'Request body configuration',
|
|
760
|
+
hint: 'Choose how the POST body is built: map required inputs, or author a JSON payload template. Only one is used.',
|
|
761
|
+
defaultValue: 'mappedInputs',
|
|
762
|
+
// NO clearOnChange. Both configurations are kept side by side —
|
|
763
|
+
// `requestBodyMode` alone decides which one the runtime uses, and the
|
|
764
|
+
// two editors below are shown/hidden by their `additionalTest`. Clearing
|
|
765
|
+
// here destroyed the author's work on every mode toggle, and — because
|
|
766
|
+
// the editor emits `defaultValue` on init when the bound key is absent —
|
|
767
|
+
// wiped `minimumInputRequired` merely on OPENING an existing POST fetch.
|
|
768
|
+
// A fetch left with no `minimumInputRequired` key then crashed
|
|
769
|
+
// `getAllFunctionTypes`, silently disabling the whole input.
|
|
770
|
+
options: [
|
|
771
|
+
{ label: 'Map inputs', value: 'mappedInputs' },
|
|
772
|
+
{ label: 'JSON template', value: 'template' },
|
|
773
|
+
],
|
|
774
|
+
id: "a1d2f3e4-5b6c-4d7e-8f90-1a2b3c4d5e6f"
|
|
775
|
+
},
|
|
748
776
|
{
|
|
749
777
|
name: SpecialElementKeys.Default,
|
|
750
778
|
deepBind: [
|
|
@@ -764,13 +792,39 @@ export var ElementConfig = {
|
|
|
764
792
|
'backEndConfig',
|
|
765
793
|
'minimumInputRequired',
|
|
766
794
|
],
|
|
767
|
-
}
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
// Hidden while the author is using a payload template instead.
|
|
798
|
+
expression: 'requestBodyMode !== template',
|
|
799
|
+
deepBind: ['matOptions', 'fetch', 'value', 'backEndConfig', 'requestBodyMode'],
|
|
800
|
+
},
|
|
768
801
|
],
|
|
769
802
|
hint: `These are payload fields that are required to be filled in order to fetch data from the selected source`,
|
|
770
803
|
editType: ElementEditorTypes.RequiredInputs,
|
|
771
804
|
label: 'Set up required inputs',
|
|
772
805
|
id: "2d0f1e18-897b-4c28-97bc-3078be09f8ee"
|
|
773
806
|
},
|
|
807
|
+
{
|
|
808
|
+
name: SpecialElementKeys.Default,
|
|
809
|
+
deepBind: [
|
|
810
|
+
'matOptions',
|
|
811
|
+
'fetch',
|
|
812
|
+
'value',
|
|
813
|
+
'backEndConfig',
|
|
814
|
+
'payloadTemplate',
|
|
815
|
+
],
|
|
816
|
+
additionalTest: [
|
|
817
|
+
{
|
|
818
|
+
// Shown only when the author has chosen template mode.
|
|
819
|
+
expression: 'requestBodyMode === template',
|
|
820
|
+
deepBind: ['matOptions', 'fetch', 'value', 'backEndConfig', 'requestBodyMode'],
|
|
821
|
+
},
|
|
822
|
+
],
|
|
823
|
+
hint: `Author the POST request body as JSON. Type $ to insert a field as {{inputId}}; every other literal is a fixed default. This supersedes the required-input mapping.`,
|
|
824
|
+
editType: ElementEditorTypes.PayloadTemplate,
|
|
825
|
+
label: 'Payload template',
|
|
826
|
+
id: "b3f6a1c2-7d8e-4a90-8c11-2e5f0a9b7c34"
|
|
827
|
+
},
|
|
774
828
|
{
|
|
775
829
|
name: SpecialElementKeys.Default,
|
|
776
830
|
deepBind: ['matOptions', 'fetch', 'value', 'valueAccessRules'],
|
|
@@ -878,6 +932,28 @@ export var ElementConfig = {
|
|
|
878
932
|
label: 'Select API to fetch data from',
|
|
879
933
|
id: "df9e2a34-7bf5-411e-a265-14ca4f85166d"
|
|
880
934
|
},
|
|
935
|
+
{
|
|
936
|
+
name: SpecialElementKeys.Default,
|
|
937
|
+
deepBind: ['matOptions', 'fetch', 'options', 'backEndConfig', 'requestBodyMode'],
|
|
938
|
+
additionalTest: [
|
|
939
|
+
{
|
|
940
|
+
testType: 'exists',
|
|
941
|
+
deepBind: ['matOptions', 'fetch', 'options'],
|
|
942
|
+
},
|
|
943
|
+
],
|
|
944
|
+
editType: ElementEditorTypes.ChipSelect,
|
|
945
|
+
label: 'Request body configuration',
|
|
946
|
+
hint: 'Choose how the POST body is built: map required inputs, or author a JSON payload template. Only one is used.',
|
|
947
|
+
defaultValue: 'mappedInputs',
|
|
948
|
+
// NO clearOnChange — see the value-slot twin above. This one cleared
|
|
949
|
+
// ['matOptions','fetch','options'], i.e. the ENTIRE options fetch config
|
|
950
|
+
// (endpoint, method, source and all), on the editor's init emit.
|
|
951
|
+
options: [
|
|
952
|
+
{ label: 'Map required inputs', value: 'mappedInputs' },
|
|
953
|
+
{ label: 'Payload template (JSON)', value: 'template' },
|
|
954
|
+
],
|
|
955
|
+
id: "e2c4a6b8-1d3f-4a5b-9c7e-0f1a2b3c4d5e"
|
|
956
|
+
},
|
|
881
957
|
{
|
|
882
958
|
name: SpecialElementKeys.Default,
|
|
883
959
|
deepBind: [
|
|
@@ -897,12 +973,36 @@ export var ElementConfig = {
|
|
|
897
973
|
'backEndConfig',
|
|
898
974
|
'minimumInputRequired',
|
|
899
975
|
],
|
|
900
|
-
}
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
expression: 'requestBodyMode !== template',
|
|
979
|
+
deepBind: ['matOptions', 'fetch', 'options', 'backEndConfig', 'requestBodyMode'],
|
|
980
|
+
},
|
|
901
981
|
],
|
|
902
982
|
editType: ElementEditorTypes.RequiredInputs,
|
|
903
983
|
label: 'Set up required inputs',
|
|
904
984
|
id: "ce8f3b42-340d-4f3e-8d6a-13c93251173f"
|
|
905
985
|
},
|
|
986
|
+
{
|
|
987
|
+
name: SpecialElementKeys.Default,
|
|
988
|
+
deepBind: [
|
|
989
|
+
'matOptions',
|
|
990
|
+
'fetch',
|
|
991
|
+
'options',
|
|
992
|
+
'backEndConfig',
|
|
993
|
+
'payloadTemplate',
|
|
994
|
+
],
|
|
995
|
+
additionalTest: [
|
|
996
|
+
{
|
|
997
|
+
expression: 'requestBodyMode === template',
|
|
998
|
+
deepBind: ['matOptions', 'fetch', 'options', 'backEndConfig', 'requestBodyMode'],
|
|
999
|
+
},
|
|
1000
|
+
],
|
|
1001
|
+
hint: `Author the POST request body as JSON. Type $ to insert a field as {{inputId}}; every other literal is a fixed default. This supersedes the required-input mapping.`,
|
|
1002
|
+
editType: ElementEditorTypes.PayloadTemplate,
|
|
1003
|
+
label: 'Payload template',
|
|
1004
|
+
id: "c7a2e4d1-9b0f-4e63-a5d8-71f3b2c6e089"
|
|
1005
|
+
},
|
|
906
1006
|
{
|
|
907
1007
|
name: SpecialElementKeys.Default,
|
|
908
1008
|
deepBind: ['matOptions', 'fetch', 'options', 'valueAccessRules'],
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Dependency-free structural mirror of `ngx-ui-tour-md-menu`'s `IStepOption`. Only
|
|
3
|
+
* the stable, framework-agnostic fields are named; the index signature keeps the
|
|
4
|
+
* upstream contract open (including Angular-typed members like a `TemplateRef`
|
|
5
|
+
* `content`), so a real `IStepOption` stays assignment-compatible while this package
|
|
6
|
+
* carries no `ngx-ui-tour-md-menu` dependency.
|
|
7
|
+
*/
|
|
8
|
+
export interface IStepOption {
|
|
9
|
+
anchorId?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
content?: unknown;
|
|
12
|
+
route?: unknown;
|
|
13
|
+
placement?: unknown;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* Tour step descriptor used by `ngx-t-forms` when binding form-section guided
|
|
4
18
|
* tours through `ngx-ui-tour-md-menu`. Extends the upstream `IStepOption`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { IFormTour } from './IFormTour.js';
|
|
1
|
+
export { IFormTour, IStepOption } from './IFormTour.js';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { FormGroup } from '@angular/forms';
|
|
2
1
|
import { FormColumnInputs } from '../formInput/BasicFormInputInterface.js';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
3
|
import { FormListSection, FormStateErrors, IFormsInitStateInterface, LocalFormStateSelectorInterface } from '../Form/IFormsInitStateInterface.js';
|
|
5
4
|
import { DatabaseFormInterface } from '../Form/formInterface.js';
|
|
6
|
-
import { ActivatedRouteSnapshot } from '@angular/router';
|
|
7
5
|
export interface ITowerStepColumn extends FormColumnInputs {
|
|
8
6
|
canReload: IInputCanReload;
|
|
9
7
|
inputConfigErrors: {
|
|
@@ -18,7 +16,8 @@ export interface IInputCanReload {
|
|
|
18
16
|
export interface ITowerFormSteps {
|
|
19
17
|
label: string;
|
|
20
18
|
sectionId: string;
|
|
21
|
-
|
|
19
|
+
/** Angular reactive `FormGroup` on the frontend; opaque here to keep these typings Angular-free. */
|
|
20
|
+
sectionForm: unknown | null;
|
|
22
21
|
sectionIsInvalid: boolean | undefined;
|
|
23
22
|
sectionIsSeen: boolean | undefined;
|
|
24
23
|
sectionFormErrorMessage: string;
|
|
@@ -44,7 +43,7 @@ export interface FormsStoreSelectorsInterface {
|
|
|
44
43
|
} | null>;
|
|
45
44
|
selectFormListSection$: Observable<FormListSection>;
|
|
46
45
|
selectFormUpdated$: Observable<string | Date | null>;
|
|
47
|
-
selectRouterState$: Observable<
|
|
46
|
+
selectRouterState$: Observable<unknown | null>;
|
|
48
47
|
selectSubmittingForm$: Observable<boolean>;
|
|
49
48
|
selectFormInitialValues$: Observable<Record<string, any> | null>;
|
|
50
49
|
selectInputInEditId$: Observable<string | null>;
|
|
@@ -3,8 +3,7 @@ import { DatabaseFormInterface, FileUploadFn, FormColumnInputs, FormInterface }
|
|
|
3
3
|
import { IWorkflowOption } from "../FormBuilder/index.js";
|
|
4
4
|
import { AccountingBasis, AdjResponseReviewColumnMapping, IGetTreeResponse, ScoaSegmentValue, WorkflowAdjudicationScoreSheetValue } from "../formInput/index.js";
|
|
5
5
|
import { FormListSection } from "../Form/IFormsInitStateInterface.js";
|
|
6
|
-
import { IUserSignature } from "../formInput/userSignature.js";
|
|
7
|
-
import { PointGroup } from "signature_pad";
|
|
6
|
+
import { IUserSignature, PointGroup } from "../formInput/userSignature.js";
|
|
8
7
|
import { IWorkflowDocListCols } from "../FormBuilder/workflowSelectionConfig.js";
|
|
9
8
|
import { IFinancialCycles } from "./environment.js";
|
|
10
9
|
export interface DialogConfig {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HttpContext, HttpHeaders, HttpParams } from "@angular/common/http";
|
|
2
1
|
import { TreeNode } from "../FormSlide/accessTree.js";
|
|
3
2
|
import { FormInputBasicOptionInterface } from "./FormInputBasicOptionInterface.js";
|
|
4
3
|
import { MinimumInputRequiredInterface } from "./MinimumInputRequiredInterface.js";
|
|
@@ -13,6 +12,59 @@ export interface DataFetchingBaseConfig {
|
|
|
13
12
|
source: DataSources;
|
|
14
13
|
projectFormData?: string;
|
|
15
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A single node in a {@link PayloadTemplate}.
|
|
17
|
+
*
|
|
18
|
+
* - Literals (`string`/`number`/`boolean`/`null`) are sent verbatim — a plain
|
|
19
|
+
* literal is a **typed default**.
|
|
20
|
+
* - A string that is EXACTLY `"{{inputId}}"` is replaced by that input's live,
|
|
21
|
+
* raw (type-preserving) value.
|
|
22
|
+
* - A string that merely CONTAINS `{{inputId}}` token(s) is interpolated to a
|
|
23
|
+
* string (`"prefix-{{x}}"`).
|
|
24
|
+
* - Objects and arrays nest arbitrarily; object keys are literal, so Mongo-style
|
|
25
|
+
* dotted keys such as `"form.contractType"` are preserved as authored.
|
|
26
|
+
*/
|
|
27
|
+
export type PayloadTemplateValue = string | number | boolean | null | PayloadTemplateValue[] | {
|
|
28
|
+
[key: string]: PayloadTemplateValue;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Declarative JSON body for a POST value/options fetch.
|
|
32
|
+
*
|
|
33
|
+
* When present on {@link APIDataFetchingConfigurationInterface.backEndConfig} it
|
|
34
|
+
* SUPERSEDES `minimumInputRequired` for request shaping: the resolved object is
|
|
35
|
+
* sent to the endpoint verbatim (no `data` envelope). `{{inputId}}` string
|
|
36
|
+
* tokens map to live form values; every other literal is a typed default. The
|
|
37
|
+
* fetch stays idle (fires no request) until every referenced input has a
|
|
38
|
+
* non-empty value, then re-fires whenever a mapped value changes.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* payloadTemplate: {
|
|
42
|
+
* workflowId: '65035743e948659eff7f6b5f',
|
|
43
|
+
* valueKey: 'budgetCost',
|
|
44
|
+
* reduce: 'sum',
|
|
45
|
+
* isComplete: true,
|
|
46
|
+
* filter: {
|
|
47
|
+
* archive: false,
|
|
48
|
+
* 'form.contractType': '{{contractType}}',
|
|
49
|
+
* },
|
|
50
|
+
* }
|
|
51
|
+
*/
|
|
52
|
+
export type PayloadTemplate = {
|
|
53
|
+
[key: string]: PayloadTemplateValue;
|
|
54
|
+
} | PayloadTemplateValue[];
|
|
55
|
+
/**
|
|
56
|
+
* Which mechanism shapes a POST fetch's request body.
|
|
57
|
+
*
|
|
58
|
+
* - `'mappedInputs'` — the classic `minimumInputRequired` default/mapTo mapping
|
|
59
|
+
* (also the effective default when unset, for backward compatibility).
|
|
60
|
+
* - `'template'` — the declarative {@link PayloadTemplate}.
|
|
61
|
+
*
|
|
62
|
+
* The two are mutually exclusive in the form builder (one editor at a time) and
|
|
63
|
+
* at runtime: a `payloadTemplate` supersedes the mapping ONLY when the mode is
|
|
64
|
+
* not explicitly `'mappedInputs'`, so switching modes never discards either
|
|
65
|
+
* configuration.
|
|
66
|
+
*/
|
|
67
|
+
export type RequestBodyMode = 'mappedInputs' | 'template';
|
|
16
68
|
export interface APIDataFetchingConfigurationInterface extends DataFetchingBaseConfig {
|
|
17
69
|
_id: string;
|
|
18
70
|
name: string;
|
|
@@ -21,12 +73,13 @@ export interface APIDataFetchingConfigurationInterface extends DataFetchingBaseC
|
|
|
21
73
|
httpMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
22
74
|
postFormData: boolean;
|
|
23
75
|
httpHeaderOptions?: {
|
|
24
|
-
headers?:
|
|
76
|
+
headers?: {
|
|
25
77
|
[header: string]: string | string[];
|
|
26
78
|
};
|
|
27
|
-
context
|
|
79
|
+
/** Opaque request-context bag (Angular's `HttpContext` on the frontend); consumers narrow. */
|
|
80
|
+
context?: unknown;
|
|
28
81
|
observe?: 'body';
|
|
29
|
-
params?:
|
|
82
|
+
params?: {
|
|
30
83
|
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
31
84
|
};
|
|
32
85
|
reportProgress?: boolean;
|
|
@@ -37,7 +90,38 @@ export interface APIDataFetchingConfigurationInterface extends DataFetchingBaseC
|
|
|
37
90
|
} | boolean;
|
|
38
91
|
};
|
|
39
92
|
backEndConfig: {
|
|
40
|
-
|
|
93
|
+
/**
|
|
94
|
+
* The default/mapTo mapping that shapes the POST body in `'mappedInputs'` mode.
|
|
95
|
+
*
|
|
96
|
+
* **Optional**, and genuinely absent in practice: a `'template'`-mode fetch shapes
|
|
97
|
+
* its body from {@link payloadTemplate} and needs no mapping at all, GET fetches
|
|
98
|
+
* never had one, and older persisted configs predate the key. Read it as
|
|
99
|
+
* `backEndConfig?.minimumInputRequired ?? []` — a bare
|
|
100
|
+
* `.minimumInputRequired.every(…)` once threw inside `getAllFunctionTypes`, whose
|
|
101
|
+
* `catch` then erased *every* function type for the input, silently disabling its
|
|
102
|
+
* resource, refresh button, calculation and validators.
|
|
103
|
+
*/
|
|
104
|
+
minimumInputRequired?: MinimumInputRequiredInterface[];
|
|
105
|
+
/**
|
|
106
|
+
* Which request-body mechanism is active (see {@link RequestBodyMode}).
|
|
107
|
+
* Unset is treated as `'mappedInputs'` for backward compatibility. The form
|
|
108
|
+
* builder shows exactly one editor per mode; the runtime uses
|
|
109
|
+
* `payloadTemplate` only when this is not `'mappedInputs'`.
|
|
110
|
+
*/
|
|
111
|
+
requestBodyMode?: RequestBodyMode;
|
|
112
|
+
/**
|
|
113
|
+
* Optional deep JSON template for the POST body (see {@link PayloadTemplate}).
|
|
114
|
+
* When present AND {@link requestBodyMode} is not `'mappedInputs'`, it
|
|
115
|
+
* supersedes `minimumInputRequired` for request shaping. Kept independently of
|
|
116
|
+
* the mapping so toggling {@link requestBodyMode} discards neither.
|
|
117
|
+
*/
|
|
118
|
+
payloadTemplate?: PayloadTemplate;
|
|
119
|
+
/**
|
|
120
|
+
* The raw request body captured from the selected endpoint (e.g. a Postman
|
|
121
|
+
* collection). Persisted only to seed the template editor's default when the
|
|
122
|
+
* author switches to template mode with nothing authored yet; never sent.
|
|
123
|
+
*/
|
|
124
|
+
requestBody?: PayloadTemplate;
|
|
41
125
|
};
|
|
42
126
|
}
|
|
43
127
|
export interface MongoDbPipeLineConfigInterface extends DataFetchingBaseConfig {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Mirrors Angular Material's `MatFormFieldAppearance` (`'fill' | 'outline'`) as a
|
|
3
|
+
* plain string union so these typings carry no `@angular/material` dependency and
|
|
4
|
+
* can be consumed from a backend. Frontend consumers remain assignment-compatible.
|
|
5
|
+
*/
|
|
6
|
+
export type MatFormFieldAppearance = 'fill' | 'outline';
|
|
2
7
|
import { IFileUploadInput, IMatrixInput, IScoaInput, IMultiple, IToggleInput, IWorkflowAdjudicationInput } from ".";
|
|
3
8
|
import { ConditionalInputRule } from "./ConditionalInputRule.js";
|
|
4
9
|
import { IDateRangePickerInput } from "./DateRangePickerInput.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IFolderItem, IPostmanCollection } from "../FormBuilder/postmanCollection.js";
|
|
2
2
|
import { IWorkflowDocListCols } from "../FormBuilder/workflowSelectionConfig.js";
|
|
3
3
|
import { TreeNode } from "../FormSlide/accessTree.js";
|
|
4
|
-
import { APIDataFetchingConfigurationInterface, InputAPIDataId, MongoDbPipeLineConfigInterface } from "./APIDataFetchingConfigurationInterface.js";
|
|
4
|
+
import { APIDataFetchingConfigurationInterface, InputAPIDataId, MongoDbPipeLineConfigInterface, PayloadTemplate, PayloadTemplateValue, RequestBodyMode } from "./APIDataFetchingConfigurationInterface.js";
|
|
5
5
|
import { AutocapitalizeOptions, AutocompleteOptions, ElementTypes, IBasicFormInput, IFormElementTemplate, InputDataTypes, InputPipeTypes, InputTypes, OptionSelectTypes } from "./BasicFormInputInterface.js";
|
|
6
6
|
import { IDateRangePickerInput } from "./DateRangePickerInput.js";
|
|
7
7
|
import { AllDocumentFileExtensions, AllImageFileExtensions, FileUploadInputValueInterface, IFileUploadInput, InputFileType, UploadTypes } from "./FileUploadInputInterface.js";
|
|
@@ -25,4 +25,4 @@ import { CalculationFunctions, calculationVariableInterface } from "./calculatio
|
|
|
25
25
|
import { IRichTextEditor, RichTextEditorType } from "./RichTextEditorInput.js";
|
|
26
26
|
import { ValidationError, ValidationOptions } from "./schema.js";
|
|
27
27
|
import { IUserSignature } from "./userSignature.js";
|
|
28
|
-
export { ElementTypes, InputTypes, InputPipeTypes, AutocapitalizeOptions, AutocompleteOptions, InputDataTypes, MinInputTypes, IFormElementTemplate, IBasicFormInput, IFileUploadInput, IDateRangePickerInput, ITextareaProperties, IToggleInput, IMatrixInput, IMultiple, IMultipleInputCal, IScoaInput, TableConfigurationsInterface, TableColumnConfigInterface, FormControlCustomValidatorsInterface, InputObservedForChange, DraftFormControlCustomValidator, IFormValidationOverride, MinimumInputRequiredInterface, MinInputMapInput, CalculatedFieldRules, calculationVariableInterface, APIDataFetchingConfigurationInterface, IGetTreeResponse, CalculationFunctions, TreeNode, IPostmanCollection, IFolderItem, FileUploadInputValueInterface, AllDocumentFileExtensions, AllImageFileExtensions, UploadTypes, InputFileType, IScoaAccount, IScoaInputConfig, ITableScoaSelectionRow, ScoaSegmentValue, ScoaSegmentValueBag, IIncludedSegmentConfig, AccountingBasis, ScoaAccountTree, IUserSignature, ValidationOptions, ValidationError, MatDataOptionsInterface, MongoDbPipeLineConfigInterface, InputAPIDataId, FormInputBasicOptionInterface, ScoaInterface, ScoaInnerInput, IAccountSegmentTreeKeys, IWorkflowDocumentPicker, IWorkflowDocumentPickerConfig, workflowStepStatus, IWorkflowDocListCols, JsDataTypes, AdjudicationSteps, IWorkflowAdjudicationInput, WorkflowAdjudicationScoreSheetValue, WorkflowAdjudicationMicroFlowReviewValue, WorkflowAdjudicationResponseElectedSupplierSelectionValue, ScoreSheetItem, AdjResponseReviewColumnMapping, OptionSelectTypes, ISelectInputInterface, MultipleInputAvailableOperations, RichTextEditorType, IRichTextEditor, };
|
|
28
|
+
export { ElementTypes, InputTypes, InputPipeTypes, AutocapitalizeOptions, AutocompleteOptions, InputDataTypes, MinInputTypes, IFormElementTemplate, IBasicFormInput, IFileUploadInput, IDateRangePickerInput, ITextareaProperties, IToggleInput, IMatrixInput, IMultiple, IMultipleInputCal, IScoaInput, TableConfigurationsInterface, TableColumnConfigInterface, FormControlCustomValidatorsInterface, InputObservedForChange, DraftFormControlCustomValidator, IFormValidationOverride, MinimumInputRequiredInterface, MinInputMapInput, CalculatedFieldRules, calculationVariableInterface, APIDataFetchingConfigurationInterface, PayloadTemplate, PayloadTemplateValue, RequestBodyMode, IGetTreeResponse, CalculationFunctions, TreeNode, IPostmanCollection, IFolderItem, FileUploadInputValueInterface, AllDocumentFileExtensions, AllImageFileExtensions, UploadTypes, InputFileType, IScoaAccount, IScoaInputConfig, ITableScoaSelectionRow, ScoaSegmentValue, ScoaSegmentValueBag, IIncludedSegmentConfig, AccountingBasis, ScoaAccountTree, IUserSignature, ValidationOptions, ValidationError, MatDataOptionsInterface, MongoDbPipeLineConfigInterface, InputAPIDataId, FormInputBasicOptionInterface, ScoaInterface, ScoaInnerInput, IAccountSegmentTreeKeys, IWorkflowDocumentPicker, IWorkflowDocumentPickerConfig, workflowStepStatus, IWorkflowDocListCols, JsDataTypes, AdjudicationSteps, IWorkflowAdjudicationInput, WorkflowAdjudicationScoreSheetValue, WorkflowAdjudicationMicroFlowReviewValue, WorkflowAdjudicationResponseElectedSupplierSelectionValue, ScoreSheetItem, AdjResponseReviewColumnMapping, OptionSelectTypes, ISelectInputInterface, MultipleInputAvailableOperations, RichTextEditorType, IRichTextEditor, };
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Structural, dependency-free mirror of signature_pad's `PointGroup` (the data
|
|
3
|
+
* captured per pen stroke). signature_pad's own `PointGroup` stays assignment-
|
|
4
|
+
* compatible, so frontend consumers pass captured strokes through unchanged while
|
|
5
|
+
* this package carries no `signature_pad` dependency.
|
|
6
|
+
*/
|
|
7
|
+
export interface PointGroup {
|
|
8
|
+
dotSize: number;
|
|
9
|
+
minWidth: number;
|
|
10
|
+
maxWidth: number;
|
|
11
|
+
penColor: string;
|
|
12
|
+
velocityFilterWeight: number;
|
|
13
|
+
/**
|
|
14
|
+
* The `globalCompositeOperation` for the stroke (mirrors signature_pad).
|
|
15
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
|
|
16
|
+
*/
|
|
17
|
+
compositeOperation: GlobalCompositeOperation;
|
|
18
|
+
points: Array<{
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
pressure: number;
|
|
22
|
+
time: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
2
25
|
export interface IUserSignature {
|
|
3
26
|
dataPoints: PointGroup[];
|
|
4
27
|
signatureDate: Date;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IPipelineGenerationError, IPipelineGenerationResponse, IRunPipelineResponse, PipelineStageEnum } from "./pipelineStages.js";
|
|
2
|
-
export { IPipelineGenerationError, IPipelineGenerationResponse, IRunPipelineResponse, PipelineStageEnum };
|
|
1
|
+
import { IPipelineGenerationError, IPipelineGenerationResponse, IRunPipelineResponse, PipelineStage, PipelineStageEnum } from "./pipelineStages.js";
|
|
2
|
+
export { IPipelineGenerationError, IPipelineGenerationResponse, IRunPipelineResponse, PipelineStage, PipelineStageEnum };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Dependency-free stand-in for mongoose's `PipelineStage` — a single MongoDB
|
|
3
|
+
* aggregation-pipeline stage is just an object keyed by its `$`-operator. mongoose's
|
|
4
|
+
* own `PipelineStage` stays assignment-compatible, so backend callers using mongoose
|
|
5
|
+
* pass real stages through unchanged while this package carries no `mongoose` dependency.
|
|
6
|
+
*/
|
|
7
|
+
export type PipelineStage = Record<string, unknown>;
|
|
2
8
|
export interface IPipelineGenerationError {
|
|
3
9
|
message: string;
|
|
4
10
|
error: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MatFormFieldAppearance } from "@angular/material/form-field";
|
|
2
1
|
import { IIncludedSegmentConfig } from "../../formInput/index.js";
|
|
2
|
+
/** Plain-union mirror of Angular Material's `MatFormFieldAppearance` (no `@angular/material` dependency). */
|
|
3
|
+
type MatFormFieldAppearance = 'fill' | 'outline';
|
|
3
4
|
interface conditionalInputRule {
|
|
4
5
|
formControlName: string;
|
|
5
6
|
label: string;
|
|
@@ -43,7 +43,16 @@ const APIDataFetchingConfigurationSchema = Joi.object({
|
|
|
43
43
|
transferCache: Joi.alternatives().try(Joi.object({ includeHeaders: Joi.array().items(Joi.string()).optional() }), Joi.boolean()).optional()
|
|
44
44
|
}).optional(),
|
|
45
45
|
backEndConfig: Joi.object({
|
|
46
|
-
|
|
46
|
+
// Optional: a 'template'-mode fetch shapes its body from payloadTemplate and
|
|
47
|
+
// carries no mapping; GET fetches never had one. Readers default it to [].
|
|
48
|
+
minimumInputRequired: Joi.array().items(minimumInputRequiredSchema).optional(),
|
|
49
|
+
// Which body mechanism is active; unset ⇒ 'mappedInputs' (backward compatible).
|
|
50
|
+
requestBodyMode: Joi.string().valid('mappedInputs', 'template').optional(),
|
|
51
|
+
// Free-form JSON body template ({{inputId}} tokens + typed default literals).
|
|
52
|
+
// Supersedes minimumInputRequired when set and mode is not 'mappedInputs'.
|
|
53
|
+
payloadTemplate: Joi.alternatives().try(Joi.object(), Joi.array()).optional(),
|
|
54
|
+
// Raw request body captured from the endpoint, used to seed the template editor.
|
|
55
|
+
requestBody: Joi.alternatives().try(Joi.object(), Joi.array()).optional()
|
|
47
56
|
}).optional(),
|
|
48
57
|
valueAccessRules: Joi.alternatives().try(FormInputBasicOptionSchema, Joi.array().items(Joi.object())).optional(),
|
|
49
58
|
source: Joi.string().valid('local', 'api', 'mongoPipeline', 'customOptions').required(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-t-forms-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Typings and interfaces for the ngx-t-forms library for dynamic forms.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typings",
|
|
@@ -38,30 +38,10 @@
|
|
|
38
38
|
"joi": "^18.2.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"@angular/core": "^21.0.0",
|
|
44
|
-
"@angular/forms": "^21.0.0",
|
|
45
|
-
"@angular/material": "^21.0.0",
|
|
46
|
-
"@angular/router": "^21.0.0",
|
|
47
|
-
"mongoose": "^8.23.0",
|
|
48
|
-
"moment": "^2.30.1",
|
|
49
|
-
"ngx-ui-tour-md-menu": "^16.0.0",
|
|
50
|
-
"rxjs": "~7.8.0",
|
|
51
|
-
"signature_pad": "^5.1.3"
|
|
52
|
-
},
|
|
53
|
-
"peerDependenciesMeta": {
|
|
54
|
-
"mongoose": {
|
|
55
|
-
"optional": true
|
|
56
|
-
}
|
|
41
|
+
"moment": ">=2.30.1",
|
|
42
|
+
"rxjs": ">=7.8.0"
|
|
57
43
|
},
|
|
58
44
|
"devDependencies": {
|
|
59
|
-
"@angular/cdk": "^21.2.12",
|
|
60
|
-
"@angular/common": "^21.2.12",
|
|
61
|
-
"@angular/core": "^21.2.12",
|
|
62
|
-
"@angular/forms": "^21.2.12",
|
|
63
|
-
"@angular/material": "^21.2.12",
|
|
64
|
-
"@angular/router": "^21.2.12",
|
|
65
45
|
"@types/jasmine": "^5.1.7",
|
|
66
46
|
"@types/node": "^22.13.9",
|
|
67
47
|
"jasmine-core": "^5.6.0",
|
|
@@ -70,11 +50,8 @@
|
|
|
70
50
|
"karma-jasmine": "^5.1.0",
|
|
71
51
|
"karma-webpack": "^5.0.1",
|
|
72
52
|
"moment": "^2.30.1",
|
|
73
|
-
"mongoose": "^8.23.0",
|
|
74
|
-
"ngx-ui-tour-md-menu": "^16.0.0",
|
|
75
53
|
"rimraf": "^6.0.1",
|
|
76
54
|
"rxjs": "~7.8.0",
|
|
77
|
-
"signature_pad": "^5.1.3",
|
|
78
55
|
"ts-loader": "^9.5.2",
|
|
79
56
|
"typescript": "~5.9.2",
|
|
80
57
|
"webpack": "^5.98.0",
|