ngx-t-forms-types 0.0.16 → 0.0.18
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/formInterface.d.ts +5 -3
- package/dist/interfaces/Form/index.d.ts +2 -2
- package/dist/interfaces/FormBuilder/DefaultEelement.js +46 -1
- package/dist/interfaces/FormBuilder/DefaultInputConfigInterface.d.ts +9 -1
- package/dist/interfaces/FormBuilder/FormInputKeys.d.ts +2 -1
- package/dist/interfaces/FormBuilder/FormInputKeys.js +1 -0
- package/dist/interfaces/FormBuilder/elementEditor.d.ts +2 -1
- package/dist/interfaces/FormBuilder/elementEditor.js +1 -0
- package/dist/interfaces/FormBuilder/inputConfig/ElementEditConfig.js +42 -0
- package/dist/interfaces/environment/IStoreFunctions.d.ts +10 -0
- package/dist/interfaces/environment/environment.d.ts +7 -0
- package/dist/interfaces/environment/index.d.ts +2 -1
- package/dist/interfaces/formInput/BasicFormInputInterface.d.ts +5 -3
- package/dist/interfaces/formInput/BasicFormInputInterface.js +1 -0
- package/dist/interfaces/formInput/ISelectInputInterface.d.ts +13 -0
- package/dist/interfaces/formInput/WorkflowDocumentPicker.d.ts +7 -2
- package/dist/interfaces/formInput/WorkflowDocumentPicker.js +1 -0
- package/dist/schemas/DocmentPickerInputSchema.js +4 -2
- package/dist/schemas/FormInputSchema.d.ts +1 -0
- package/dist/schemas/FormInputSchema.js +11 -1
- package/package.json +5 -1
|
@@ -7,13 +7,15 @@ export interface FormInterface {
|
|
|
7
7
|
formTitle: string;
|
|
8
8
|
submissionMessage?: string;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
11
|
-
|
|
10
|
+
export interface MainFormInterface {
|
|
11
|
+
form: FormInterface;
|
|
12
12
|
systemDefault: boolean;
|
|
13
13
|
archive: boolean;
|
|
14
14
|
userId: string;
|
|
15
15
|
defaultDepartment: string;
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
export interface DatabaseFormInterface extends MainFormInterface {
|
|
18
|
+
_id: string;
|
|
17
19
|
createdAt: Date;
|
|
18
20
|
updatedAt: Date;
|
|
19
21
|
__v: number;
|
|
@@ -6,7 +6,7 @@ import { CustomConfigInterface } from "./CustomeConfigInter";
|
|
|
6
6
|
import { FileData, FileUploadFn } from "./FileUploadFn";
|
|
7
7
|
import { IFormChangeHistory } from "./formChangeHistory";
|
|
8
8
|
import { IFormActions, InClassFormUtilsInterface, InClassFormUtilsWithSectionsInterface } from "./FormInClassUtils";
|
|
9
|
-
import { FormInterface, DatabaseFormInterface } from "./formInterface";
|
|
9
|
+
import { FormInterface, DatabaseFormInterface, MainFormInterface } from "./formInterface";
|
|
10
10
|
import { FormSubmissionHandleInterface, IReportDataSources } from "./formSubmissionHandleInterface";
|
|
11
11
|
import { FormListSection, FormStateErrors, IFormsInitStateInterface, LocalFormStateSelectorInterface } from "./IFormsInitStateInterface";
|
|
12
|
-
export { CustomConfigInterface, InClassFormUtilsInterface, InClassFormUtilsWithSectionsInterface, FormInterface, DatabaseFormInterface, FormSubmissionHandleInterface, FormColumnInputs, IFormActions, NgxTFormsConfig, FileUploadFn, FileData, FormListSection, LocalFormStateSelectorInterface, IFormsInitStateInterface, FormStateErrors, IArrayFunction, OLD_FormInterface, IAllInputs, IFormChangeHistory, IReportDataSources };
|
|
12
|
+
export { CustomConfigInterface, InClassFormUtilsInterface, InClassFormUtilsWithSectionsInterface, FormInterface, MainFormInterface, DatabaseFormInterface, FormSubmissionHandleInterface, FormColumnInputs, IFormActions, NgxTFormsConfig, FileUploadFn, FileData, FormListSection, LocalFormStateSelectorInterface, IFormsInitStateInterface, FormStateErrors, IArrayFunction, OLD_FormInterface, IAllInputs, IFormChangeHistory, IReportDataSources };
|
|
@@ -175,7 +175,7 @@ export const DefaultInputConfig = {
|
|
|
175
175
|
AllFormInputPrimaryKeys.DataType,
|
|
176
176
|
SpecialElementKeys.MatOptionsApiCall,
|
|
177
177
|
AllFormInputPrimaryKeys.OptionSelectType,
|
|
178
|
-
AllFormInputPrimaryKeys.AllowMultipleSelection
|
|
178
|
+
AllFormInputPrimaryKeys.AllowMultipleSelection,
|
|
179
179
|
],
|
|
180
180
|
elementTemplate: {
|
|
181
181
|
element: ElementTypes.Select,
|
|
@@ -190,6 +190,50 @@ export const DefaultInputConfig = {
|
|
|
190
190
|
allowMultipleSelection: false,
|
|
191
191
|
},
|
|
192
192
|
},
|
|
193
|
+
[ElementTypes.PaginatedSelectionTable]: {
|
|
194
|
+
label: 'Paginated Selection Table',
|
|
195
|
+
illustration: '/assets/select.svg',
|
|
196
|
+
disabled: false,
|
|
197
|
+
requiredProperties: [
|
|
198
|
+
AllFormInputPrimaryKeys.Label,
|
|
199
|
+
AllFormInputPrimaryKeys.Appearance,
|
|
200
|
+
AllFormInputPrimaryKeys.DataType,
|
|
201
|
+
AllFormInputPrimaryKeys.FormControlName,
|
|
202
|
+
AllFormInputPrimaryKeys.MatOptions,
|
|
203
|
+
AllFormInputPrimaryKeys.PaginationSelectionConfig
|
|
204
|
+
],
|
|
205
|
+
properties: [
|
|
206
|
+
AllFormInputPrimaryKeys.Label,
|
|
207
|
+
AllFormInputPrimaryKeys.Appearance,
|
|
208
|
+
AllFormInputPrimaryKeys.FormControlName,
|
|
209
|
+
AllFormInputPrimaryKeys.Validators,
|
|
210
|
+
AllFormInputPrimaryKeys.Required,
|
|
211
|
+
AllFormInputPrimaryKeys.ColSize,
|
|
212
|
+
AllFormInputPrimaryKeys.Value,
|
|
213
|
+
AllFormInputPrimaryKeys.MatOptions,
|
|
214
|
+
AllFormInputPrimaryKeys.HintLabel,
|
|
215
|
+
FormInputKeys.SuffixIcon,
|
|
216
|
+
FormInputKeys.PrefixIcon,
|
|
217
|
+
FormInputKeys.PrefixText,
|
|
218
|
+
FormInputKeys.SuffixText,
|
|
219
|
+
AllFormInputPrimaryKeys.DataType,
|
|
220
|
+
SpecialElementKeys.MatOptionsApiCall,
|
|
221
|
+
AllFormInputPrimaryKeys.AllowMultipleSelection,
|
|
222
|
+
AllFormInputPrimaryKeys.PaginationSelectionConfig
|
|
223
|
+
],
|
|
224
|
+
elementTemplate: {
|
|
225
|
+
element: ElementTypes.PaginatedSelectionTable,
|
|
226
|
+
required: true,
|
|
227
|
+
onlySetTempErrorOnTouch: false,
|
|
228
|
+
colSize: 12,
|
|
229
|
+
validators: [],
|
|
230
|
+
appearance: 'outline',
|
|
231
|
+
isCalculatedField: false,
|
|
232
|
+
dataType: InputDataTypes.String,
|
|
233
|
+
optionSelectType: OptionSelectTypes.DropDown, // Default to dropdown,
|
|
234
|
+
allowMultipleSelection: false,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
193
237
|
[ElementTypes.IconSelect]: {
|
|
194
238
|
label: 'iconSelect',
|
|
195
239
|
illustration: '/assets/iconselection.svg',
|
|
@@ -584,6 +628,7 @@ export const DefaultInputConfig = {
|
|
|
584
628
|
AllFormInputPrimaryKeys.Value,
|
|
585
629
|
AllFormInputPrimaryKeys.HintLabel,
|
|
586
630
|
AllFormInputPrimaryKeys.WorkflowPickerConfig,
|
|
631
|
+
AllFormInputPrimaryKeys.AllowMultipleSelection,
|
|
587
632
|
],
|
|
588
633
|
elementTemplate: {
|
|
589
634
|
element: ElementTypes.WorkflowDocumentPicker,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementTypes, IToggleInput, ITextareaProperties, IDateRangePickerInput, IFileUploadInput, IMultiple, IWorkflowAdjudicationInput, IScoaInput } from "../formInput";
|
|
2
2
|
import { IFormElementTemplate } from "../formInput/BasicFormInputInterface";
|
|
3
|
-
import { ISelectInputInterface } from "../formInput/ISelectInputInterface";
|
|
3
|
+
import { IPaginatedSelectionTableInputInterface, ISelectInputInterface } from "../formInput/ISelectInputInterface";
|
|
4
4
|
import { IRichTextEditor } from "../formInput/RichTextEditorInput";
|
|
5
5
|
import { IWorkflowDocumentPicker } from "../formInput/WorkflowDocumentPicker";
|
|
6
6
|
import { AllFormInputPrimaryKeys, FormInputKeys, SpecialElementKeys } from "./FormInputKeys";
|
|
@@ -45,6 +45,14 @@ export interface DefaultInputConfigInterface {
|
|
|
45
45
|
elementTemplate: ISelectInputInterface;
|
|
46
46
|
requiredProperties: Array<FormInputKeys | AllFormInputPrimaryKeys>;
|
|
47
47
|
};
|
|
48
|
+
[ElementTypes.PaginatedSelectionTable]: {
|
|
49
|
+
label: string;
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
illustration: string;
|
|
52
|
+
properties: Array<FormInputKeys | SpecialElementKeys | AllFormInputPrimaryKeys>;
|
|
53
|
+
elementTemplate: IPaginatedSelectionTableInputInterface;
|
|
54
|
+
requiredProperties: Array<FormInputKeys | AllFormInputPrimaryKeys>;
|
|
55
|
+
};
|
|
48
56
|
[ElementTypes.IconSelect]: {
|
|
49
57
|
label: string;
|
|
50
58
|
illustration: string;
|
|
@@ -96,5 +96,6 @@ export declare enum AllFormInputPrimaryKeys {
|
|
|
96
96
|
OptionSelectType = "optionSelectType",
|
|
97
97
|
AllowMultipleSelection = "allowMultipleSelection",
|
|
98
98
|
GroupBy = "groupBy",
|
|
99
|
-
ConditionalInputConfig = "conditionalInputConfig"
|
|
99
|
+
ConditionalInputConfig = "conditionalInputConfig",
|
|
100
|
+
PaginationSelectionConfig = "paginationSelectionConfig"
|
|
100
101
|
}
|
|
@@ -101,4 +101,5 @@ export var AllFormInputPrimaryKeys;
|
|
|
101
101
|
AllFormInputPrimaryKeys["AllowMultipleSelection"] = "allowMultipleSelection";
|
|
102
102
|
AllFormInputPrimaryKeys["GroupBy"] = "groupBy";
|
|
103
103
|
AllFormInputPrimaryKeys["ConditionalInputConfig"] = "conditionalInputConfig";
|
|
104
|
+
AllFormInputPrimaryKeys["PaginationSelectionConfig"] = "paginationSelectionConfig";
|
|
104
105
|
})(AllFormInputPrimaryKeys || (AllFormInputPrimaryKeys = {}));
|
|
@@ -34,7 +34,8 @@ export declare enum ElementEditorTypes {
|
|
|
34
34
|
DataSourcePicker = "dataSourcePicker",
|
|
35
35
|
ListLabelConfigEditor = "listLabelConfigEditor",
|
|
36
36
|
DecisionGateSettings = "decisionGateSettings",
|
|
37
|
-
RecordListManager = "recordListManager"
|
|
37
|
+
RecordListManager = "recordListManager",
|
|
38
|
+
MapMatOptionsKeys = "mapMatOptionsKeys"
|
|
38
39
|
}
|
|
39
40
|
export interface ElementEditorConfigInterface {
|
|
40
41
|
editorSections: Array<ElementEditorConfigSectionInterface>;
|
|
@@ -29,6 +29,7 @@ export var ElementEditorTypes;
|
|
|
29
29
|
ElementEditorTypes["ListLabelConfigEditor"] = "listLabelConfigEditor";
|
|
30
30
|
ElementEditorTypes["DecisionGateSettings"] = "decisionGateSettings";
|
|
31
31
|
ElementEditorTypes["RecordListManager"] = "recordListManager";
|
|
32
|
+
ElementEditorTypes["MapMatOptionsKeys"] = "mapMatOptionsKeys";
|
|
32
33
|
})(ElementEditorTypes || (ElementEditorTypes = {}));
|
|
33
34
|
// interface TStringExpressionValidationTest{
|
|
34
35
|
// expression: string;
|
|
@@ -398,16 +398,39 @@ export var ElementConfig = {
|
|
|
398
398
|
hint: 'Select a workflow to manage document options for this input.',
|
|
399
399
|
id: "ed16ad54-3a6c-407d-8b67-779ff23786db",
|
|
400
400
|
},
|
|
401
|
+
{
|
|
402
|
+
name: AllFormInputPrimaryKeys.WorkflowPickerConfig,
|
|
403
|
+
deepBind: [AllFormInputPrimaryKeys.WorkflowPickerConfig, 'primaryIdentifierKey'],
|
|
404
|
+
label: "Select primary identifier key",
|
|
405
|
+
hint: "Choose a key other than _id to serve as the primary identifier for workflow documents. Note: existing mappings will be cleared when reconfigured. After updating, reselect the workflow above.",
|
|
406
|
+
editType: ElementEditorTypes.MapMatOptionsKeys,
|
|
407
|
+
fetchOptions: [AllFormInputPrimaryKeys.WorkflowPickerConfig, 'sampleDocument'],
|
|
408
|
+
additionalTest: [
|
|
409
|
+
{
|
|
410
|
+
deepBind: [AllFormInputPrimaryKeys.WorkflowPickerConfig, 'workflowId'],
|
|
411
|
+
testType: 'exists',
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
clearOnChange: [
|
|
415
|
+
[AllFormInputPrimaryKeys.WorkflowPickerConfig, 'sampleDocument'],
|
|
416
|
+
],
|
|
417
|
+
id: "c9396a58-1d72-4ef9-8eff-5a28e8f738a1"
|
|
418
|
+
},
|
|
401
419
|
{
|
|
402
420
|
name: AllFormInputPrimaryKeys.WorkflowPickerConfig,
|
|
403
421
|
deepBind: [AllFormInputPrimaryKeys.WorkflowPickerConfig, 'documentSourceType'],
|
|
404
422
|
hint: `Choose the source type for document options: 'Postman API' fetches from an external API, 'Data Pipeline' pulls from MongoDB.`,
|
|
405
423
|
editType: ElementEditorTypes.ChipSelect,
|
|
406
424
|
label: 'Document options source type',
|
|
425
|
+
defaultValue: 'default',
|
|
407
426
|
clearOnChange: [
|
|
408
427
|
[AllFormInputPrimaryKeys.WorkflowPickerConfig, 'documentsSource'],
|
|
409
428
|
],
|
|
410
429
|
options: [
|
|
430
|
+
{
|
|
431
|
+
label: 'Default',
|
|
432
|
+
value: 'default'
|
|
433
|
+
},
|
|
411
434
|
{ label: 'Postman API', value: DataSources.Api },
|
|
412
435
|
{ label: 'Data Pipeline', value: DataSources.MongoDb },
|
|
413
436
|
],
|
|
@@ -481,6 +504,25 @@ export var ElementConfig = {
|
|
|
481
504
|
hint: `Create a MongoDB aggregation pipeline to fetch document options from your database.`,
|
|
482
505
|
id: "1b826f36-08ad-46b5-86ea-c1c48fd90f51"
|
|
483
506
|
},
|
|
507
|
+
//********************** */
|
|
508
|
+
{
|
|
509
|
+
name: AllFormInputPrimaryKeys.PaginationSelectionConfig,
|
|
510
|
+
editType: ElementEditorTypes.Toggle,
|
|
511
|
+
deepBind: [AllFormInputPrimaryKeys.PaginationSelectionConfig, 'useLocalPagination'],
|
|
512
|
+
id: "fea889f3-5da4-4a68-9593-8f3ada6d697b",
|
|
513
|
+
label: 'Use local pagination',
|
|
514
|
+
hint: `When enabled, pagination is handled on the client side, suitable for data sources that do not support pagination.`,
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
name: AllFormInputPrimaryKeys.PaginationSelectionConfig,
|
|
518
|
+
editType: ElementEditorTypes.MapMatOptionsKeys,
|
|
519
|
+
deepBind: [AllFormInputPrimaryKeys.PaginationSelectionConfig, 'primaryIdentifierKey'],
|
|
520
|
+
label: 'Map option primary identifier, this is what will be used as the value of the input',
|
|
521
|
+
fetchOptions: [AllFormInputPrimaryKeys.MatOptions, 'options', '0'],
|
|
522
|
+
hint: "This configuration maps the key to be used as the input's value when a user selects an option. When an option is selected, the value of this key will be assigned to the form control.",
|
|
523
|
+
id: "fb684ce4-28d0-4cc6-ac1a-1d3e82f2f287"
|
|
524
|
+
},
|
|
525
|
+
//********************** */
|
|
484
526
|
{
|
|
485
527
|
name: AllFormInputPrimaryKeys.AdjudicationStep,
|
|
486
528
|
label: 'Adjudication step type',
|
|
@@ -6,6 +6,7 @@ import { FormListSection } from "../Form/IFormsInitStateInterface";
|
|
|
6
6
|
import { IUserSignature } from "../formInput/userSignature";
|
|
7
7
|
import { PointGroup } from "signature_pad";
|
|
8
8
|
import { IWorkflowDocListCols } from "../FormBuilder/workflowSelectionConfig";
|
|
9
|
+
import { IFinancialCycles } from "./environment";
|
|
9
10
|
export interface DialogConfig {
|
|
10
11
|
title: string;
|
|
11
12
|
message: string;
|
|
@@ -48,6 +49,7 @@ export interface IStoreFunctions {
|
|
|
48
49
|
toastError: (message: string) => void;
|
|
49
50
|
workflows: () => Observable<IWorkflowOption[]>;
|
|
50
51
|
getWorkflowCols: (workflowId: string) => Observable<IWorkflowDocListCols[]>;
|
|
52
|
+
getFinacialCycles: () => Observable<IFinancialCycles>;
|
|
51
53
|
getCurrentFormAvailableInputOptions: () => Observable<Array<FormColumnInputs>>;
|
|
52
54
|
getSelectedDocument: (documentId: string) => Observable<any>;
|
|
53
55
|
getScoaTree: () => Observable<IGetTreeResponse>;
|
|
@@ -66,6 +68,14 @@ export interface IStoreFunctions {
|
|
|
66
68
|
results: any;
|
|
67
69
|
message: string;
|
|
68
70
|
}>;
|
|
71
|
+
getWorkflowDocuments: (workflowId: string, page: number, itemsPerPage: number, sort: Record<string, -1 | 1>, searchKey: string | undefined, filter?: Record<string, any>) => Observable<{
|
|
72
|
+
footerConfig: {
|
|
73
|
+
totalPages: number;
|
|
74
|
+
totalItems: number;
|
|
75
|
+
itemsPerPage: number;
|
|
76
|
+
};
|
|
77
|
+
formValues: Record<string, unknown>[];
|
|
78
|
+
}>;
|
|
69
79
|
fileUpload: FileUploadFn;
|
|
70
80
|
formSubmittedSuccessfully: (formId: string) => void;
|
|
71
81
|
getUserSignature: () => Observable<IUserSignature>;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { IStoreFunctions } from "./IStoreFunctions";
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
export interface IFinancialCycles {
|
|
4
|
+
CURRENT_FINANCIAL_CYCLE_END_DATE: Moment;
|
|
5
|
+
CURRENT_FINANCIAL_CYCLE_START_DATE: Moment;
|
|
6
|
+
CURRENT_SPRINT_END_DATE: Moment;
|
|
7
|
+
CURRENT_SPRINT_START_DATE: Moment;
|
|
8
|
+
}
|
|
2
9
|
export interface NgxTFormsConfig {
|
|
3
10
|
base_url?: string;
|
|
4
11
|
formBuilder: IStoreFunctions;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ActionButton, BasisValidationError, DialogConfig, IStoreFunctions, MscoaValuetValidationErrors } from "./IStoreFunctions";
|
|
2
|
-
|
|
2
|
+
import { IFinancialCycles } from "./environment";
|
|
3
|
+
export { IStoreFunctions, ActionButton, DialogConfig, IFinancialCycles, MscoaValuetValidationErrors, BasisValidationError, };
|
|
@@ -8,8 +8,8 @@ import { ITextareaProperties } from "./TextAreaInput";
|
|
|
8
8
|
import { CalculatedFieldRules } from "./calculatedFieldRules";
|
|
9
9
|
import { IRichTextEditor } from "./RichTextEditorInput";
|
|
10
10
|
import { IWorkflowDocumentPicker } from "./WorkflowDocumentPicker";
|
|
11
|
-
import { ISelectInputInterface } from "./ISelectInputInterface";
|
|
12
|
-
export type FormColumnInputs = IBasicFormInput & ISelectInputInterface & IWorkflowDocumentPicker & IFileUploadInput & IDateRangePickerInput & ITextareaProperties & IToggleInput & IMatrixInput & IMultiple & IScoaInput & IRichTextEditor & IWorkflowAdjudicationInput;
|
|
11
|
+
import { IPaginatedSelectionTableInputInterface, ISelectInputInterface } from "./ISelectInputInterface";
|
|
12
|
+
export type FormColumnInputs = IBasicFormInput & ISelectInputInterface & IPaginatedSelectionTableInputInterface & IWorkflowDocumentPicker & IFileUploadInput & IDateRangePickerInput & ITextareaProperties & IToggleInput & IMatrixInput & IMultiple & IScoaInput & IRichTextEditor & IWorkflowAdjudicationInput;
|
|
13
13
|
export declare enum ElementTypes {
|
|
14
14
|
Input = "input",
|
|
15
15
|
Location = "location",
|
|
@@ -28,7 +28,8 @@ export declare enum ElementTypes {
|
|
|
28
28
|
Editor = "editor",
|
|
29
29
|
MscoaSelection = "mscoaSelection",
|
|
30
30
|
WorkflowDocumentPicker = "workflowDocumentPicker",
|
|
31
|
-
WorkflowAdjudication = "workflowAdjudication"
|
|
31
|
+
WorkflowAdjudication = "workflowAdjudication",
|
|
32
|
+
PaginatedSelectionTable = "paginatedSelectionTable"
|
|
32
33
|
}
|
|
33
34
|
export declare enum InputTypes {
|
|
34
35
|
Text = "text",
|
|
@@ -147,4 +148,5 @@ export interface IBasicFormInput extends IFormElementTemplate {
|
|
|
147
148
|
} | Array<{
|
|
148
149
|
[key: string]: any;
|
|
149
150
|
}>;
|
|
151
|
+
multiSelect?: boolean;
|
|
150
152
|
}
|
|
@@ -22,6 +22,7 @@ export var ElementTypes;
|
|
|
22
22
|
ElementTypes["MscoaSelection"] = "mscoaSelection";
|
|
23
23
|
ElementTypes["WorkflowDocumentPicker"] = "workflowDocumentPicker";
|
|
24
24
|
ElementTypes["WorkflowAdjudication"] = "workflowAdjudication";
|
|
25
|
+
ElementTypes["PaginatedSelectionTable"] = "paginatedSelectionTable";
|
|
25
26
|
// Add other types as needed
|
|
26
27
|
})(ElementTypes || (ElementTypes = {}));
|
|
27
28
|
export var InputTypes;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { AllFormInputPrimaryKeys } from "../FormBuilder/FormInputKeys";
|
|
2
|
+
import { TreeNode } from "../FormSlide/accessTree";
|
|
2
3
|
import { IBasicFormInput, OptionSelectTypes } from "./BasicFormInputInterface";
|
|
3
4
|
export interface ISelectInputInterface extends IBasicFormInput {
|
|
4
5
|
[AllFormInputPrimaryKeys.OptionSelectType]: OptionSelectTypes;
|
|
5
6
|
[AllFormInputPrimaryKeys.AllowMultipleSelection]: boolean;
|
|
6
7
|
}
|
|
8
|
+
export interface IPaginatedSelectionTableInputInterface extends IBasicFormInput {
|
|
9
|
+
[AllFormInputPrimaryKeys.AllowMultipleSelection]: boolean;
|
|
10
|
+
[AllFormInputPrimaryKeys.PaginationSelectionConfig]: {
|
|
11
|
+
useLocalPagination: boolean;
|
|
12
|
+
primaryIdentifierKey?: TreeNode[];
|
|
13
|
+
columns: Array<{
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
id: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { AllFormInputPrimaryKeys } from "../FormBuilder/FormInputKeys";
|
|
2
|
+
import { TreeNode } from "../FormSlide/accessTree";
|
|
1
3
|
import { APIDataFetchingConfigurationInterface, DataSources, MongoDbPipeLineConfigInterface } from "./APIDataFetchingConfigurationInterface";
|
|
2
4
|
import { IBasicFormInput } from "./BasicFormInputInterface";
|
|
3
5
|
export interface IWorkflowDocumentPicker extends IBasicFormInput {
|
|
4
6
|
workflowPickerConfig: IWorkflowDocumentPickerConfig;
|
|
7
|
+
[AllFormInputPrimaryKeys.AllowMultipleSelection]: boolean;
|
|
5
8
|
}
|
|
6
9
|
export interface IWorkflowDocumentPickerConfig {
|
|
7
10
|
workflowId: string;
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
primaryIdentifierKey?: TreeNode[];
|
|
12
|
+
sampleDocument?: Record<string, unknown>;
|
|
13
|
+
documentSourceType: DataSources | 'default';
|
|
14
|
+
documentsSource?: APIDataFetchingConfigurationInterface | MongoDbPipeLineConfigInterface;
|
|
10
15
|
}
|
|
11
16
|
export declare enum workflowStepStatus {
|
|
12
17
|
PENDING = "pending",
|
|
@@ -4,7 +4,9 @@ import { DataSources } from '../interfaces/FormBuilder';
|
|
|
4
4
|
// Schema for IWorkflowDocumentPickerConfig
|
|
5
5
|
const workflowDocumentPickerConfigSchema = Joi.object({
|
|
6
6
|
workflowId: Joi.string().required(),
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
primaryIdentifierKey: Joi.array().items(Joi.object()).optional(),
|
|
8
|
+
sampleDocument: Joi.object().optional(), // Optional field for sample document structure
|
|
9
|
+
documentSourceType: Joi.string().valid(...Object.values(DataSources), 'default').required(),
|
|
10
|
+
documentsSource: Joi.alternatives().try(APIDataFetchingConfigurationSchema, MongoDbPipeLineConfigSchema, Joi.object()).optional(),
|
|
9
11
|
});
|
|
10
12
|
export { workflowDocumentPickerConfigSchema };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { FormColumnInputs } from '../interfaces/Form';
|
|
3
3
|
import { ValidationError, ValidationOptions } from '../interfaces/formInput/schema';
|
|
4
|
+
export declare const paginationSelectionConfigSchema: Joi.ObjectSchema<any>;
|
|
4
5
|
export declare const baseFormColumnInputsSchema: Joi.ObjectSchema<any>;
|
|
5
6
|
declare const formColumnInputsSchema: Joi.ObjectSchema<any>;
|
|
6
7
|
declare function validateFormColumnInputs(data: FormColumnInputs): {
|
|
@@ -16,6 +16,15 @@ import { CalculationFunctions } from '../interfaces/formInput/calculationVariabl
|
|
|
16
16
|
import { RichTextEditorType } from '../interfaces/formInput/RichTextEditorInput';
|
|
17
17
|
import { InputViewTypes, OptionSelectTypes } from '../interfaces/formInput/BasicFormInputInterface';
|
|
18
18
|
import { workflowDocumentPickerConfigSchema } from './DocmentPickerInputSchema';
|
|
19
|
+
export const paginationSelectionConfigSchema = Joi.object({
|
|
20
|
+
useLocalPagination: Joi.boolean().optional(),
|
|
21
|
+
primaryIdentifierKey: Joi.array().items(Joi.object()).optional(),
|
|
22
|
+
columns: Joi.array().items(Joi.object({
|
|
23
|
+
key: Joi.string().required(),
|
|
24
|
+
label: Joi.string().required(),
|
|
25
|
+
id: Joi.string().required()
|
|
26
|
+
})).optional()
|
|
27
|
+
});
|
|
19
28
|
export const baseFormColumnInputsSchema = Joi.object({
|
|
20
29
|
[AllFormInputPrimaryKeys.Id]: Joi.string().optional(),
|
|
21
30
|
[AllFormInputPrimaryKeys.SectionId]: Joi.string().optional(),
|
|
@@ -88,7 +97,8 @@ export const baseFormColumnInputsSchema = Joi.object({
|
|
|
88
97
|
canReload: Joi.boolean().required()
|
|
89
98
|
}).optional(),
|
|
90
99
|
[AllFormInputPrimaryKeys.GroupBy]: Joi.array().items(Joi.string()),
|
|
91
|
-
[AllFormInputPrimaryKeys.ConditionalInputConfig]: Joi.any().optional()
|
|
100
|
+
[AllFormInputPrimaryKeys.ConditionalInputConfig]: Joi.any().optional(),
|
|
101
|
+
[AllFormInputPrimaryKeys.PaginationSelectionConfig]: paginationSelectionConfigSchema.optional()
|
|
92
102
|
}).id('formColumnInputs');
|
|
93
103
|
const formColumnInputsSchema = baseFormColumnInputsSchema.append({
|
|
94
104
|
[AllFormInputPrimaryKeys.FormInputs]: Joi.array().items(Joi.link('#formColumnInputs')).optional()
|
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.18",
|
|
4
4
|
"description": "Typings and interfaces for the ngx-t-forms library for dynamic forms.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typings",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "karma start",
|
|
30
30
|
"clean": "rimraf dist",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
31
32
|
"build": "npm run clean && tsc",
|
|
32
33
|
"build:prod": "npm run build --mode production",
|
|
33
34
|
"prepublishOnly": "npm run build",
|
|
@@ -55,5 +56,8 @@
|
|
|
55
56
|
"typescript": "^5.8.2",
|
|
56
57
|
"webpack": "^5.98.0",
|
|
57
58
|
"webpack-dev-server": "^5.2.0"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"moment": "^2.30.1"
|
|
58
62
|
}
|
|
59
63
|
}
|