ngx-t-forms-types 0.0.2 → 0.0.4

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.
@@ -646,6 +646,7 @@ export const DefaultInputConfig = {
646
646
  AllFormInputPrimaryKeys.Validators,
647
647
  AllFormInputPrimaryKeys.Required,
648
648
  AllFormInputPrimaryKeys.HintLabel,
649
+ AllFormInputPrimaryKeys.MatOptions,
649
650
  AllFormInputPrimaryKeys.FormInputs,
650
651
  AllFormInputPrimaryKeys.HandleLabel,
651
652
  ],
@@ -1,7 +1,6 @@
1
1
  import { Observable } from "rxjs";
2
- import { IGetTreeResponse, IMultipleInputCal } from "../formInput";
2
+ import { IGetTreeResponse, IMultipleInputCal, IScoaAccount } from "../formInput";
3
3
  import { FormColumnInputs } from "../formInput/BasicFormInputInterface";
4
- import { IMSCOAAccount } from "../formInput/IMscoaAccount";
5
4
  import { CdkDragDrop } from "@angular/cdk/drag-drop";
6
5
  export interface FormBuilderFunctions {
7
6
  multipleInputToggleLabel: (item: FormColumnInputs) => void;
@@ -14,7 +13,7 @@ export interface FormBuilderFunctions {
14
13
  addFunction: (item: IMultipleInputCal, multipleInputId: string | undefined) => void;
15
14
  getLatestAccountTree: () => Observable<IGetTreeResponse>;
16
15
  getSCOAAccount: (SCOAAccount: string) => Observable<{
17
- accounts: IMSCOAAccount[];
16
+ accounts: IScoaAccount[];
18
17
  }>;
19
18
  reorderItems: (event: CdkDragDrop<FormColumnInputs[], any, any>, multipleInputId: string) => void;
20
19
  }
@@ -82,5 +82,6 @@ export declare enum AllFormInputPrimaryKeys {
82
82
  ValueUpdatedAt = "valueUpdatedAt",
83
83
  Status = "status",
84
84
  ViewType = "viewType",
85
- FormIsOpen = "formIsOpen"
85
+ FormIsOpen = "formIsOpen",
86
+ LinkedSegmentId = "linkedSegmentId"
86
87
  }
@@ -87,4 +87,5 @@ export var AllFormInputPrimaryKeys;
87
87
  AllFormInputPrimaryKeys["Status"] = "status";
88
88
  AllFormInputPrimaryKeys["ViewType"] = "viewType";
89
89
  AllFormInputPrimaryKeys["FormIsOpen"] = "formIsOpen";
90
+ AllFormInputPrimaryKeys["LinkedSegmentId"] = "linkedSegmentId";
90
91
  })(AllFormInputPrimaryKeys || (AllFormInputPrimaryKeys = {}));
@@ -23,9 +23,7 @@ export var ElementConfig = {
23
23
  max: 12,
24
24
  step: 1,
25
25
  format: (value) => `${(value / 12) * 100} %`,
26
- hint: `The size determines the width of the input column in the form.
27
- A column size of 12 will take up the full width of the form, while a column size of 4 will take up a third of the form.
28
- `,
26
+ hint: `Controls the input width using a 12-column grid system: 12 = full width, 6 = half width, 4 = one-third width, 3 = one-quarter width`,
29
27
  label: 'Input column size',
30
28
  },
31
29
  {
@@ -40,9 +38,9 @@ export var ElementConfig = {
40
38
  name: SpecialElementKeys.Default,
41
39
  deepBind: [AllFormInputPrimaryKeys.FormControlName],
42
40
  id: "8db68cde-52ca-4be6-9db9-e0d53217f00a",
43
- hint: 'The form control is an inputs unique identifier in the form group, and should be in CamelCase',
41
+ hint: `A unique identifier for the input in the form value. Use camelCase format (e.g., 'firstName', 'phoneNumber').`,
44
42
  editType: ElementEditorTypes.Input,
45
- label: 'Control name ',
43
+ label: 'Control name',
46
44
  blurHandle: BlurHandleTypes.CleanFormControl,
47
45
  },
48
46
  {
@@ -67,13 +65,6 @@ export var ElementConfig = {
67
65
  editType: ElementEditorTypes.Input,
68
66
  deepBind: [AllFormInputPrimaryKeys.StartDateControl],
69
67
  blurHandle: BlurHandleTypes.CleanFormControl,
70
- disabled: [
71
- //Don't allow editing if the form control name is already set
72
- {
73
- deepBind: [AllFormInputPrimaryKeys.Id],
74
- testType: 'exists'
75
- },
76
- ],
77
68
  hint: "Because a date range has two values representing the start end end value, you need to assign a form control name to the start date input.",
78
69
  label: 'Start Date Control name',
79
70
  },
@@ -81,13 +72,6 @@ export var ElementConfig = {
81
72
  name: AllFormInputPrimaryKeys.EndDateControl,
82
73
  deepBind: [AllFormInputPrimaryKeys.EndDateControl],
83
74
  id: "a50917da-9129-434a-b2db-316dea2ff0a7",
84
- disabled: [
85
- //Don't allow editing if the form control name is already set
86
- {
87
- deepBind: [AllFormInputPrimaryKeys.Id],
88
- testType: 'exists'
89
- },
90
- ],
91
75
  editType: ElementEditorTypes.Input,
92
76
  blurHandle: BlurHandleTypes.CleanFormControl,
93
77
  label: 'End Date Control name',
@@ -172,12 +156,12 @@ export var ElementConfig = {
172
156
  {
173
157
  name: AllFormInputPrimaryKeys.MscoaConfig,
174
158
  editType: ElementEditorTypes.Toggle,
175
- label: 'Allow selection of all mscoa segments',
159
+ label: 'Allow selection of all SCOA segments',
176
160
  deepBind: ['mscoaConfig', 'showAllSegments'],
177
161
  clearOnChange: [
178
162
  [AllFormInputPrimaryKeys.MscoaConfig, 'segments'],
179
163
  ],
180
- hint: 'If enabled, the user can select any segment from the MScoa configuration',
164
+ hint: 'When enabled, allows selection from all Standard Chart of Accounts (SCOA) segments. Disable to limit available segments.',
181
165
  id: "0f78efcc-5477-4202-916a-8a7cf459c017"
182
166
  },
183
167
  {
@@ -186,8 +170,18 @@ export var ElementConfig = {
186
170
  editType: ElementEditorTypes.ConfigMscoaSegments,
187
171
  label: 'Configure MScoa segments',
188
172
  fetchOptions: ['mscoaConfig', 'showAllSegments'],
173
+ hint: "Configure SCOA segments to be used in the input",
189
174
  id: "ba1a5b79-b071-44a6-b39a-bf1c2fafcda5"
190
175
  },
176
+ {
177
+ name: AllFormInputPrimaryKeys.MscoaConfig,
178
+ deepBind: ['mscoaConfig', 'inputs'],
179
+ editType: ElementEditorTypes.ConfigMscoaAdditionalInputs,
180
+ label: 'Configure additional inputs',
181
+ hint: 'Configure supplementary inputs that extend SCOA segments with additional dimensions. These inputs will be linked to the selected SCOA segments.',
182
+ fetchOptions: [],
183
+ id: "21cc22c6-efb6-4e7d-b772-56443c82bd11"
184
+ },
191
185
  {
192
186
  name: AllFormInputPrimaryKeys.RichTextEditorLibrary,
193
187
  editType: ElementEditorTypes.ChipSelect,
@@ -220,7 +214,7 @@ export var ElementConfig = {
220
214
  name: AllFormInputPrimaryKeys.DataType,
221
215
  deepBind: [AllFormInputPrimaryKeys.DataType],
222
216
  editType: ElementEditorTypes.ChipSelect,
223
- hint: 'The data type is the type of data that the input will hold.Data types are used to validate the input data',
217
+ hint: 'Specifies the data type this input will store (string, number, date, etc.). This affects validation and input processing.',
224
218
  label: 'Data value type',
225
219
  id: "07e33ac0-ba36-48b9-989f-a33293f93051",
226
220
  options: Object.values(InputDataTypes).map((type) => ({ label: type, value: type })),
@@ -250,7 +244,8 @@ export var ElementConfig = {
250
244
  deepBind: ['type'],
251
245
  },
252
246
  ],
253
- label: 'Is calculated field',
247
+ hint: "When enabled, this numeric field's value will be calculated automatically based on formula rules you define below.",
248
+ label: 'Set as calculated field',
254
249
  clearOnChange: [
255
250
  ['calculatedFieldRules'],
256
251
  ],
@@ -279,7 +274,7 @@ export var ElementConfig = {
279
274
  {
280
275
  name: AllFormInputPrimaryKeys.MatOptions,
281
276
  deepBind: ['matOptions', 'fetch', 'value', 'source'],
282
- hint: `Choose data source for input values - affects how values are populated and which configuration options become available`,
277
+ hint: `Choose where input values come from: 'Form Input' links to another field, 'Postman API' fetches from an external API, 'Data Pipeline' pulls from MongoDB.`,
283
278
  editType: ElementEditorTypes.ChipSelect,
284
279
  label: 'Select value source',
285
280
  clearOnChange: [
@@ -296,14 +291,14 @@ export var ElementConfig = {
296
291
  name: SpecialElementKeys.Default,
297
292
  deepBind: ['matOptions', 'fetch', 'value', 'inputSourceId'],
298
293
  editType: ElementEditorTypes.FormInputSelector,
299
- hint: `Links this field to a source input: when the source input's value changes, this field will automatically update to match.This creates a dynamic connection between fields.`,
294
+ hint: `Links this field to another input field. When the source field changes, this field automatically updates to match, creating a dynamic connection.`,
300
295
  additionalTest: [
301
296
  {
302
297
  expression: `source === ${DataSources.Local}`,
303
298
  deepBind: ['matOptions', 'fetch', 'value', 'source'],
304
299
  },
305
300
  ],
306
- label: 'Select Input To fetch Data from',
301
+ label: 'Select source input field',
307
302
  id: "865658d5-6ba4-4402-952f-731cfaeefb76"
308
303
  },
309
304
  {
@@ -319,23 +314,22 @@ export var ElementConfig = {
319
314
  clearOnChange: [
320
315
  ['matOptions', 'fetch', 'value'],
321
316
  ],
322
- hint: `APIs are loaded from Postman collection. Configure required headers, payload format, and response mapping before use. Ensure API is documented in Postman.`,
323
- label: 'Select API to fetch data from',
317
+ hint: `Select an API endpoint from your Postman collection to fetch values. Configure headers, payload format, and response mapping as needed.`,
318
+ label: 'Select API endpoint',
324
319
  id: "95724e64-9d5b-4260-866c-4ada95670b46"
325
320
  },
326
321
  {
327
322
  name: SpecialElementKeys.Default,
328
323
  deepBind: ['matOptions', 'fetch', 'value'],
329
324
  editType: ElementEditorTypes.MongoPipelineBuilder,
330
- hint: `MongoDb pipelines are used to fetch data from a MongoDb database.
331
- Configure the pipeline to fetch the required data before use.`,
325
+ hint: `Create a MongoDB aggregation pipeline to fetch and transform data from your database for this input.`,
332
326
  additionalTest: [
333
327
  {
334
328
  expression: `source === ${DataSources.MongoDb}`,
335
329
  deepBind: ['matOptions', 'fetch', 'value', 'source'],
336
330
  },
337
331
  ],
338
- label: 'Configure a MongoDb data pipeline',
332
+ label: 'Configure MongoDB pipeline',
339
333
  id: "7b2989ae-2f54-4849-93d0-aff56ac12ef2"
340
334
  },
341
335
  {
@@ -520,8 +514,8 @@ export var ElementConfig = {
520
514
  name: SpecialElementKeys.Default,
521
515
  editType: ElementEditorTypes.Toggle,
522
516
  deepBind: [AllFormInputPrimaryKeys.OnlySetTempErrorOnTouch],
523
- label: 'Set temporary errors only on touch',
524
- hint: 'If enabled, the input will only show errors when the user interacts with the input',
517
+ label: 'Show errors only after interaction',
518
+ hint: 'When enabled, validation errors appear only after user interaction with the field. When disabled, errors show immediately on form load.',
525
519
  id: "264bf529-c0f1-4393-b6fd-1d5eb48fce91"
526
520
  },
527
521
  {
@@ -548,7 +542,8 @@ export var ElementConfig = {
548
542
  {
549
543
  name: SpecialElementKeys.DefaultValuePipe,
550
544
  editType: ElementEditorTypes.ChipSelect,
551
- label: 'Add a value pipe',
545
+ label: 'Format displayed value',
546
+ hint: "Apply formatting to the displayed value (e.g., currency symbols, date formatting, decimal places) without changing the stored value.",
552
547
  deepBind: ['pipe', 'pipeType'],
553
548
  additionalTest: [
554
549
  {
@@ -1,5 +1,5 @@
1
1
  import { MatFormFieldAppearance } from "@angular/material/form-field";
2
- import { IFileUploadInput, IMatrixInput, IMscoaInput, IMultiple, ITableSelectionInput, IToggleInput } from ".";
2
+ import { IFileUploadInput, IMatrixInput, IScoaInput, IMultiple, ITableSelectionInput, IToggleInput } from ".";
3
3
  import { ConditionalInputRule } from "./ConditionalInputRule";
4
4
  import { IDateRangePickerInput } from "./DateRangePickerInput";
5
5
  import { FormControlCustomValidatorsInterface } from "./FormControlCustomValidatorsInterface";
@@ -7,7 +7,7 @@ import { MatDataOptionsInterface } from "./MatDataOptionsInterface";
7
7
  import { ITextareaProperties } from "./TextAreaInput";
8
8
  import { CalculatedFieldRules } from "./calculatedFieldRules";
9
9
  import { IRichTextEditor } from "./RichTextEditorInput";
10
- export type FormColumnInputs = IBasicFormInput & ITableSelectionInput & IFileUploadInput & IDateRangePickerInput & ITextareaProperties & IToggleInput & IMatrixInput & IMultiple & IMscoaInput & IRichTextEditor;
10
+ export type FormColumnInputs = IBasicFormInput & ITableSelectionInput & IFileUploadInput & IDateRangePickerInput & ITextareaProperties & IToggleInput & IMatrixInput & IMultiple & IScoaInput & IRichTextEditor;
11
11
  export declare enum ElementTypes {
12
12
  Input = "input",
13
13
  Location = "location",
@@ -111,7 +111,7 @@ export interface IBasicFormInput extends IFormElementTemplate {
111
111
  };
112
112
  hintLabel?: string;
113
113
  temporaryHint?: string;
114
- valueUpdatedAt?: Date;
114
+ valueUpdatedAt?: Date | undefined;
115
115
  status?: Record<string, string>;
116
116
  min?: number | string | Date | MaxMinCustomScripts;
117
117
  max?: number | string | Date | MaxMinCustomScripts;
@@ -1,5 +1,6 @@
1
- import { FormColumnInputs, IBasicFormInput } from "./BasicFormInputInterface";
2
- export interface IMSCOAAccount {
1
+ import { IBasicFormInput } from "./BasicFormInputInterface";
2
+ import { ScoaInnerInput } from "./MscoaInput";
3
+ export interface IScoaAccount {
3
4
  _id: {
4
5
  $oid: string;
5
6
  };
@@ -36,49 +37,58 @@ export interface IMSCOAAccount {
36
37
  $date: string;
37
38
  };
38
39
  }
39
- export interface MscoaInterface extends IMscoaInputConfig {
40
- accountTree: MscoaAccountTree;
40
+ export interface ScoaInterface extends IScoaInputConfig {
41
+ inputId: string;
42
+ accountTree: ScoaAccountTree;
41
43
  loadingTree: boolean;
42
44
  initiated: boolean;
43
45
  accountTreeKeys: string[] | undefined;
44
- segmentValues: MscoaSegmentValue | undefined;
46
+ segmentValues: ScoaSegmentValue | undefined;
45
47
  getTreeResponse: IGetTreeResponse | null;
46
48
  }
47
- export interface MscoaSegmentValue {
49
+ export interface ScoaSegmentValue {
48
50
  [key: string]: {
49
- debit: IMSCOAAccount | undefined;
50
- credit: IMSCOAAccount | undefined;
51
+ debit: IScoaAccount | undefined;
52
+ credit: IScoaAccount | undefined;
51
53
  };
52
54
  }
53
- export type MscoaAccountTree = {
54
- [key: string]: MscoaAccountTree;
55
+ export type ScoaAccountTree = {
56
+ [key: string]: ScoaAccountTree;
55
57
  };
56
- export interface ITableScoaSelectionRow {
57
- segment: string;
58
- segmentTree: MscoaAccountTree;
59
- segmentValue: IMSCOAAccount | undefined;
58
+ export interface ITableScoaSelectionRow extends IIncludedSegmentConfig {
59
+ segmentTree: ScoaAccountTree;
60
+ segmentValue: IScoaAccount | undefined;
60
61
  debit: string;
61
62
  credit: string;
62
63
  }
63
64
  export interface IIncludedSegmentConfig {
64
65
  segment: string | undefined;
66
+ customSegment?: string | undefined;
65
67
  label: string;
66
68
  readOnly: boolean;
67
69
  singleSelect: boolean;
70
+ segmentExtension: boolean;
71
+ id: string;
68
72
  }
69
- export interface IMscoaInputConfig {
70
- inputs: MscoaInnerInput[];
73
+ export interface IScoaInputConfig {
74
+ inputs: ScoaInnerInput[];
71
75
  segments: IIncludedSegmentConfig[] | undefined;
72
76
  showAllSegments: boolean;
73
77
  }
74
- export interface MscoaInnerInput extends FormColumnInputs {
75
- segment: string;
76
- }
77
78
  export interface IGetTreeResponse {
78
79
  message: string;
79
- accountTree: MscoaAccountTree | {};
80
+ accountTree: ScoaAccountTree | {};
80
81
  accountTreeKeys: string[] | undefined;
81
82
  }
82
- export interface IMscoaInput extends IBasicFormInput {
83
- mscoaConfig: IMscoaInputConfig;
83
+ export interface IScoaInput extends IBasicFormInput {
84
+ mscoaConfig: IScoaInputConfig;
85
+ }
86
+ export interface IAccountSegmentTreeKeys extends IIncludedSegmentConfig {
87
+ segment: string;
88
+ innerInput: ScoaInnerInput;
89
+ label: string;
90
+ formInput: boolean;
91
+ segmentTree: ScoaAccountTree;
92
+ inputs: ScoaInnerInput[];
93
+ segmentValue: Record<string, any>;
84
94
  }
@@ -7,10 +7,10 @@ export interface IMscoaFormInput extends IBasicFormInput {
7
7
  segment: string;
8
8
  label: string;
9
9
  }[];
10
- inputs: MscoaInnerInput[];
10
+ inputs: ScoaInnerInput[];
11
11
  };
12
12
  }
13
- export interface MscoaInnerInput extends FormColumnInputs {
14
- segment: string;
13
+ export interface ScoaInnerInput extends FormColumnInputs {
14
+ linkedSegmentId: string;
15
15
  }
16
16
  export declare var MSCOA_INPUT_DEFAULT_MAT_OPTIONS: MatDataOptionsInterface;
@@ -6,10 +6,11 @@ import { IDateRangePickerInput } from "./DateRangePickerInput";
6
6
  import { AllDocumentFileExtensions, AllImageFileExtensions, FileUploadInputValueInterface, IFileUploadInput, InputFileType, UploadTypes } from "./FileUploadInputInterface";
7
7
  import { FormControlCustomValidatorsInterface } from "./FormControlCustomValidatorsInterface";
8
8
  import { FormInputBasicOptionInterface } from "./FormInputBasicOptionInterface";
9
- import { IGetTreeResponse, IIncludedSegmentConfig, IMSCOAAccount, IMscoaInput, IMscoaInputConfig, ITableScoaSelectionRow, MscoaAccountTree, MscoaInterface, MscoaSegmentValue } from "./IMscoaAccount";
9
+ import { IAccountSegmentTreeKeys, IGetTreeResponse, IIncludedSegmentConfig, IScoaAccount, IScoaInput, IScoaInputConfig, ITableScoaSelectionRow, ScoaAccountTree, ScoaInterface, ScoaSegmentValue } from "./IMscoaAccount";
10
10
  import { MatDataOptionsInterface } from "./MatDataOptionsInterface";
11
11
  import { IMatrixInput } from "./MatrixInputInterface";
12
12
  import { MinInputMapInput, MinInputTypes, MinimumInputRequiredInterface } from "./MinimumInputRequiredInterface";
13
+ import { ScoaInnerInput } from "./MscoaInput";
13
14
  import { IMultiple, IMultipleInputCal } from "./MultipleInterface";
14
15
  import { TableColumnConfigInterface, TableConfigurationsInterface } from "./TableConfigurationsInterface";
15
16
  import { ITableSelectionInput } from "./TableSelectionInput";
@@ -19,4 +20,4 @@ import { CalculatedFieldRules } from "./calculatedFieldRules";
19
20
  import { CalculationFunctions, calculationVariableInterface } from "./calculationVariableInterface";
20
21
  import { ValidationError, ValidationOptions } from "./schema";
21
22
  import { IUserSignature } from "./userSignature";
22
- export { ElementTypes, InputTypes, InputPipeTypes, AutocapitalizeOptions, AutocompleteOptions, InputDataTypes, MinInputTypes, ITableSelectionInput, IBasicFormInput, IFileUploadInput, IDateRangePickerInput, ITextareaProperties, IToggleInput, IMatrixInput, IMultiple, IMultipleInputCal, IMscoaInput, TableConfigurationsInterface, TableColumnConfigInterface, FormControlCustomValidatorsInterface, MinimumInputRequiredInterface, MinInputMapInput, CalculatedFieldRules, calculationVariableInterface, APIDataFetchingConfigurationInterface, IGetTreeResponse, CalculationFunctions, TreeNode, IPostmanCollection, IFolderItem, FileUploadInputValueInterface, AllDocumentFileExtensions, AllImageFileExtensions, UploadTypes, InputFileType, IMSCOAAccount, IMscoaInputConfig, ITableScoaSelectionRow, MscoaSegmentValue, IIncludedSegmentConfig, MscoaAccountTree, IUserSignature, ValidationOptions, ValidationError, MatDataOptionsInterface, MongoDbPipeLineConfigInterface, InputAPIDataId, FormInputBasicOptionInterface, MscoaInterface, };
23
+ export { ElementTypes, InputTypes, InputPipeTypes, AutocapitalizeOptions, AutocompleteOptions, InputDataTypes, MinInputTypes, ITableSelectionInput, IBasicFormInput, IFileUploadInput, IDateRangePickerInput, ITextareaProperties, IToggleInput, IMatrixInput, IMultiple, IMultipleInputCal, IScoaInput, TableConfigurationsInterface, TableColumnConfigInterface, FormControlCustomValidatorsInterface, MinimumInputRequiredInterface, MinInputMapInput, CalculatedFieldRules, calculationVariableInterface, APIDataFetchingConfigurationInterface, IGetTreeResponse, CalculationFunctions, TreeNode, IPostmanCollection, IFolderItem, FileUploadInputValueInterface, AllDocumentFileExtensions, AllImageFileExtensions, UploadTypes, InputFileType, IScoaAccount, IScoaInputConfig, ITableScoaSelectionRow, ScoaSegmentValue, IIncludedSegmentConfig, ScoaAccountTree, IUserSignature, ValidationOptions, ValidationError, MatDataOptionsInterface, MongoDbPipeLineConfigInterface, InputAPIDataId, FormInputBasicOptionInterface, ScoaInterface, ScoaInnerInput, IAccountSegmentTreeKeys };
@@ -4,4 +4,4 @@ import { MinInputTypes } from "./MinimumInputRequiredInterface";
4
4
  import { CalculationFunctions } from "./calculationVariableInterface";
5
5
  export {
6
6
  ///ENUMS
7
- ElementTypes, InputTypes, InputPipeTypes, AutocapitalizeOptions, AutocompleteOptions, InputDataTypes, MinInputTypes, CalculationFunctions, AllDocumentFileExtensions, AllImageFileExtensions, UploadTypes, InputFileType, };
7
+ ElementTypes, InputTypes, InputPipeTypes, AutocapitalizeOptions, AutocompleteOptions, InputDataTypes, MinInputTypes, CalculationFunctions, AllDocumentFileExtensions, AllImageFileExtensions, UploadTypes, InputFileType };
@@ -1,4 +1,5 @@
1
1
  import { MatFormFieldAppearance } from "@angular/material/form-field";
2
+ import { IIncludedSegmentConfig } from "../../formInput";
2
3
  interface conditionalInputRule {
3
4
  formControlName: string;
4
5
  label: string;
@@ -159,12 +160,7 @@ interface multipleInterface extends BasicFormInputInterface {
159
160
  showTotalsOf: Array<string>;
160
161
  groupBy: Array<string>;
161
162
  }
162
- interface IIncludedSegmentConfig {
163
- segment: string;
164
- label: string;
165
- readOnly: boolean;
166
- }
167
- interface IMscoaInputConfig {
163
+ interface IScoaInputConfig {
168
164
  inputs: IAllInputs[];
169
165
  segments: IIncludedSegmentConfig[];
170
166
  showAllSegments: boolean;
@@ -176,7 +172,7 @@ interface matrixInputInterface extends BasicFormInputInterface {
176
172
  tableConfig: TableConfigurationsInterface;
177
173
  }
178
174
  interface MscoaInput extends BasicFormInputInterface {
179
- mscoaConfig: IMscoaInputConfig;
175
+ mscoaConfig: IScoaInputConfig;
180
176
  }
181
177
  interface TableSelectionInput extends BasicFormInputInterface {
182
178
  selectUpto: number | undefined;
@@ -1,6 +1,11 @@
1
1
  import * as Joi from 'joi';
2
2
  export declare const calculatedFieldRulesSchema: Joi.ObjectSchema<any>;
3
3
  export declare function validateCalculatedFieldRules(value: any): {
4
+ error: {
5
+ message: string;
6
+ };
7
+ value: any;
8
+ } | {
4
9
  error: Joi.ValidationError | undefined;
5
10
  value: any;
6
11
  };
@@ -21,7 +21,8 @@ export const calculatedFieldRulesSchema = Joi.object({
21
21
  formControlWithFormula: Joi.string().optional()
22
22
  });
23
23
  export function validateCalculatedFieldRules(value) {
24
+ if (!value)
25
+ return { error: { message: 'value is required' }, value };
24
26
  const { error, value: validatedValue } = calculatedFieldRulesSchema.validate(value);
25
27
  return { error, value: validatedValue };
26
28
  }
27
- console.error("ffffffffffffff");
@@ -34,6 +34,7 @@ const baseFormColumnInputsSchema = Joi.object({
34
34
  [AllFormInputPrimaryKeys.Max]: Joi.alternatives().try(Joi.number(), Joi.string(), Joi.date()).optional(),
35
35
  [AllFormInputPrimaryKeys.MinLength]: Joi.number().integer().optional(),
36
36
  [AllFormInputPrimaryKeys.MaxLength]: Joi.number().integer().optional(),
37
+ [AllFormInputPrimaryKeys.LinkedSegmentId]: Joi.string().optional(),
37
38
  [AllFormInputPrimaryKeys.MscoaConfig]: MscoaInputConfigSchema.optional(),
38
39
  [AllFormInputPrimaryKeys.Value]: Joi.alternatives().try(Joi.number(), Joi.string().allow(''), Joi.boolean(), Joi.date(), Joi.object(), Joi.array().items(Joi.object())).optional(),
39
40
  [AllFormInputPrimaryKeys.DataType]: Joi.string().valid(...Object.values(InputDataTypes)).required(),
@@ -65,7 +66,7 @@ const baseFormColumnInputsSchema = Joi.object({
65
66
  [AllFormInputPrimaryKeys.OnlySetTempErrorOnTouch]: Joi.boolean().optional(),
66
67
  [AllFormInputPrimaryKeys.IsCalculatedField]: Joi.boolean().optional(),
67
68
  [AllFormInputPrimaryKeys.TemporaryHint]: Joi.string().optional(),
68
- [AllFormInputPrimaryKeys.ValueUpdatedAt]: Joi.date().optional(),
69
+ [AllFormInputPrimaryKeys.ValueUpdatedAt]: Joi.any().optional(),
69
70
  [AllFormInputPrimaryKeys.Status]: Joi.object().pattern(Joi.string(), Joi.string()).optional(),
70
71
  [AllFormInputPrimaryKeys.ViewType]: Joi.string().valid(...Object.values(InputViewTypes)).optional(),
71
72
  [AllFormInputPrimaryKeys.FormIsOpen]: Joi.boolean().optional(),
@@ -1,6 +1,6 @@
1
1
  import Joi from 'joi';
2
2
  export declare const IncludedSegmentConfigSchema: Joi.ObjectSchema<any>;
3
- export declare const MscoaInnerInputSchema: Joi.ObjectSchema<any>;
3
+ export declare const ScoaInnerInputSchema: Joi.ObjectSchema<any>;
4
4
  export declare const MscoaInputConfigSchema: Joi.ObjectSchema<any>;
5
5
  export declare function validateMscoaInputConfig(value: any): {
6
6
  error: Joi.ValidationError | undefined;
@@ -1,18 +1,21 @@
1
1
  import Joi from 'joi';
2
2
  export const IncludedSegmentConfigSchema = Joi.object({
3
- segment: Joi.string().required(),
3
+ segment: Joi.string(),
4
+ customSegment: Joi.string().optional(),
4
5
  label: Joi.string().required(),
5
6
  readOnly: Joi.boolean().required(),
6
- singleSelect: Joi.boolean().required()
7
+ singleSelect: Joi.boolean().required(),
8
+ segmentExtension: Joi.boolean().required(),
9
+ id: Joi.string().required()
7
10
  });
8
- export const MscoaInnerInputSchema = Joi.object({
11
+ export const ScoaInnerInputSchema = Joi.object({
9
12
  segment: Joi.string().required(),
10
13
  id: Joi.string().required(),
11
14
  label: Joi.string().required(),
12
15
  formControlName: Joi.string().required(),
13
16
  });
14
17
  export const MscoaInputConfigSchema = Joi.object({
15
- inputs: Joi.array().items(MscoaInnerInputSchema).required(),
18
+ inputs: Joi.array().items(ScoaInnerInputSchema).required(),
16
19
  segments: Joi.array().items(IncludedSegmentConfigSchema).min(1).required(),
17
20
  showAllSegments: Joi.boolean().required()
18
21
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-t-forms-types",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Typings and interfaces for the ngx-t-forms library for dynamic forms.",
5
5
  "keywords": [
6
6
  "typings",