ngx-t-forms-types 0.0.21 → 0.0.22

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.
@@ -369,12 +369,16 @@ export var ElementConfig = {
369
369
  fetchOptions: ['mscoaConfig', 'showAllSegments'],
370
370
  additionalTest: [
371
371
  {
372
- expression: `accountingBasis !== ${AccountingBasis.Accrual}`,
372
+ // Show the cash-segments editor ONLY for an explicit Cash/Dual basis.
373
+ // A positive whitelist (not `!== Accrual`) also hides it for the
374
+ // unset/`undefined` default of a freshly-added input — `!== Accrual`
375
+ // is true for `undefined`, which left it always visible.
376
+ expression: `accountingBasis === ${AccountingBasis.Cash} || accountingBasis === ${AccountingBasis.Dual}`,
373
377
  deepBind: ['mscoaConfig', 'accountingBasis'],
374
378
  },
375
379
  ],
376
380
  hint: "Configure SCOA segments to be When mapping the Cash accounts",
377
- id: "d9ea60b9-653f-4d9c-88bd-f603a589cce0"
381
+ id: "f1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b"
378
382
  },
379
383
  {
380
384
  name: AllFormInputPrimaryKeys.MscoaConfig,
@@ -76,6 +76,15 @@ export interface ScoaSegmentValueBag {
76
76
  debit?: IScoaAccount | undefined;
77
77
  credit?: IScoaAccount | undefined;
78
78
  vatApplicableTo?: string;
79
+ /**
80
+ * Segment-scoped custom-input values, written as siblings of `debit`/`credit`
81
+ * (e.g. `budgetValue`, `department`) and keyed by the custom input's
82
+ * `formControlName`. Typed `unknown` because a custom input may carry any
83
+ * dynamic-input value (number, string, boolean, date, object); narrow at the
84
+ * read site. The reserved keys above (`debit`/`credit`/`vatApplicableTo`, plus
85
+ * the runtime-derived `vat`) retain their precise types.
86
+ */
87
+ [customKey: string]: unknown;
79
88
  }
80
89
  export interface ScoaSegmentValue {
81
90
  [key: string]: ScoaSegmentValueBag;
@@ -11,6 +11,13 @@ export interface IMscoaFormInput extends IBasicFormInput {
11
11
  };
12
12
  }
13
13
  export interface ScoaInnerInput extends FormColumnInputs {
14
+ /**
15
+ * Id of the `IIncludedSegmentConfig` this custom input is attached to
16
+ * (i.e. `IIncludedSegmentConfig.id`). When set, the input renders inside that
17
+ * segment's row and its value is projected into
18
+ * `segmentValues[basis][SEGMENT][formControlName]` as a sibling of
19
+ * debit/credit. Empty/absent means the input is a standalone segment row.
20
+ */
14
21
  linkedSegmentId: string;
15
22
  }
16
23
  export interface ScoreSheetItem {
@@ -9,6 +9,7 @@ const FormInputBasicOptionSchema = Joi.object({
9
9
  const MinInputMapInputSchema = Joi.object({
10
10
  formControlName: Joi.string().required(),
11
11
  dataType: Joi.string().valid(...Object.values(InputDataTypes)).required(),
12
+ inputId: Joi.string().required(),
12
13
  element: Joi.string().valid(...Object.values(ElementTypes)).required()
13
14
  });
14
15
  const minimumInputRequiredSchema = Joi.object({
@@ -28,6 +29,19 @@ const APIDataFetchingConfigurationSchema = Joi.object({
28
29
  inputSourceId: Joi.string().optional(),
29
30
  httpMethod: Joi.string().valid('GET', 'POST', 'PUT', 'DELETE').required(),
30
31
  postFormData: Joi.boolean().required(),
32
+ // httpHeaderOptions mirrors Angular's HttpClient options. Live Angular code may pass
33
+ // HttpHeaders/HttpContext/HttpParams class instances, but anything persisted/transmitted (and
34
+ // thus what this schema validates) is a plain object, so we validate the serializable shape.
35
+ httpHeaderOptions: Joi.object({
36
+ headers: Joi.object().pattern(Joi.string(), Joi.alternatives().try(Joi.string(), Joi.array().items(Joi.string()))).optional(),
37
+ context: Joi.object().optional(),
38
+ observe: Joi.string().valid('body').optional(),
39
+ params: Joi.object().pattern(Joi.string(), Joi.alternatives().try(Joi.string(), Joi.number(), Joi.boolean(), Joi.array().items(Joi.alternatives().try(Joi.string(), Joi.number(), Joi.boolean())))).optional(),
40
+ reportProgress: Joi.boolean().optional(),
41
+ responseType: Joi.string().valid('json').optional(),
42
+ withCredentials: Joi.boolean().optional(),
43
+ transferCache: Joi.alternatives().try(Joi.object({ includeHeaders: Joi.array().items(Joi.string()).optional() }), Joi.boolean()).optional()
44
+ }).optional(),
31
45
  backEndConfig: Joi.object({
32
46
  minimumInputRequired: Joi.array().items(minimumInputRequiredSchema).required()
33
47
  }).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-t-forms-types",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Typings and interfaces for the ngx-t-forms library for dynamic forms.",
5
5
  "keywords": [
6
6
  "typings",