@genesislcap/foundation-forms 15.50.2 → 15.50.3-holiday-picker.2

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.
Files changed (27) hide show
  1. package/dist/custom-elements.json +416 -0
  2. package/dist/dts/index.d.ts +2 -0
  3. package/dist/dts/index.d.ts.map +1 -1
  4. package/dist/dts/jsonforms/renderers/DatePickerControlRenderer.d.ts +40 -0
  5. package/dist/dts/jsonforms/renderers/DatePickerControlRenderer.d.ts.map +1 -0
  6. package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts +2 -0
  7. package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts.map +1 -1
  8. package/dist/dts/jsonforms/renderers/ValueDateControlRenderer.d.ts +57 -0
  9. package/dist/dts/jsonforms/renderers/ValueDateControlRenderer.d.ts.map +1 -0
  10. package/dist/dts/jsonforms/renderers/date-value-format.d.ts +44 -0
  11. package/dist/dts/jsonforms/renderers/date-value-format.d.ts.map +1 -0
  12. package/dist/dts/jsonforms/renderers/renderer-data.d.ts +17 -0
  13. package/dist/dts/jsonforms/renderers/renderer-data.d.ts.map +1 -0
  14. package/dist/dts/types.d.ts +211 -1
  15. package/dist/dts/types.d.ts.map +1 -1
  16. package/dist/dts/utils/validation.d.ts +32 -0
  17. package/dist/dts/utils/validation.d.ts.map +1 -1
  18. package/dist/esm/index.js +2 -0
  19. package/dist/esm/jsonforms/renderers/DatePickerControlRenderer.js +131 -0
  20. package/dist/esm/jsonforms/renderers/RenderersRanks.js +2 -0
  21. package/dist/esm/jsonforms/renderers/ValueDateControlRenderer.js +275 -0
  22. package/dist/esm/jsonforms/renderers/date-value-format.js +70 -0
  23. package/dist/esm/jsonforms/renderers/renderer-data.js +36 -0
  24. package/dist/esm/utils/validation.js +39 -0
  25. package/dist/foundation-forms.api.json +479 -2
  26. package/dist/foundation-forms.d.ts +307 -1
  27. package/package.json +13 -13
@@ -1,5 +1,7 @@
1
1
  import { Controller } from '@microsoft/fast-element';
2
2
  import { DatasourceOptions } from '@genesislcap/foundation-comms';
3
+ import type { DateConventionsChangedDetail } from '@genesislcap/foundation-ui';
4
+ import type { DayRollConvention } from '@genesislcap/foundation-ui';
3
5
  import { DOMContainer } from '@genesislcap/foundation-utils';
4
6
  import { ElementStyles } from '@microsoft/fast-element';
5
7
  import { ErrorObject } from 'ajv';
@@ -23,6 +25,7 @@ import { OwnPropsOfControl } from '@jsonforms/core';
23
25
  import { RankedTester } from '@jsonforms/core';
24
26
  import { RuleEffect } from '@jsonforms/core';
25
27
  import { SchemaBasedCondition } from '@jsonforms/core';
28
+ import type { SpotLag } from '@genesislcap/foundation-ui';
26
29
  import { StatePropsOfControl } from '@jsonforms/core';
27
30
  import { UISchemaElement } from '@jsonforms/core';
28
31
  import { ViewTemplate } from '@microsoft/fast-element';
@@ -593,6 +596,160 @@ export declare type CsvTemplateErrorEventDetail = {
593
596
  error: string;
594
597
  };
595
598
 
599
+ /**
600
+ * Renderer entry for a date-picker control. Opt in per form via `additionalRenderers`:
601
+ * ```ts
602
+ * import { DatePickerControlRendererEntry } from '@genesislcap/foundation-forms';
603
+ * form.additionalRenderers = [DatePickerControlRendererEntry];
604
+ * ```
605
+ * It then matches every `format: "date"` string field, plus fields with `options.datePicker`.
606
+ * @public
607
+ */
608
+ export declare const DatePickerControlRendererEntry: RendererEntry;
609
+
610
+ /**
611
+ * Renders a `<prefix-date-picker>` for a date control, storing an ISO `YYYY-MM-DD` string by
612
+ * default or UTC-midnight epoch milliseconds with `options.valueFormat: 'epoch'`.
613
+ *
614
+ * `allow-empty` keeps an unset field empty rather than defaulting to today, and
615
+ * `strict-free-text` reverts typed dates the calendar couldn't pick. The picker has no
616
+ * `disabled` state, so a disabled control blocks pointer events on its wrapper.
617
+ * @public
618
+ */
619
+ export declare const DatePickerControlRendererTemplate: (prefix?: string) => ViewTemplate<DispatchRenderer, any>;
620
+
621
+ /**
622
+ * Configuration options for the date-picker control renderer (`DatePickerControlRendererEntry`).
623
+ * @public
624
+ */
625
+ export declare type DatePickerRendererOptions = StandardRendererOptions & {
626
+ /**
627
+ * Opts a plain `type: "string"` field (no `format: "date"`), or a `number` epoch field, into
628
+ * the date-picker renderer.
629
+ * @public
630
+ */
631
+ datePicker?: true;
632
+ /**
633
+ * How the selected date is stored in the form data; either format is read.
634
+ * @defaultValue `'iso'`
635
+ * @public
636
+ */
637
+ valueFormat?: DateValueFormat;
638
+ /**
639
+ * BCP-47 locale for this control, e.g. `'en-GB'`: sets the default `displayFormat` and the
640
+ * calendar's month/weekday names.
641
+ * @defaultValue the runtime's `Intl` locale
642
+ * @public
643
+ */
644
+ locale?: string;
645
+ /**
646
+ * dayjs format used to display and read typed dates, e.g. `'DD MMM YYYY'`. Does not affect the
647
+ * stored value.
648
+ * @defaultValue the numeric date pattern of `locale` (en-GB → `DD/MM/YYYY`, en-US → `MM/DD/YYYY`)
649
+ * @public
650
+ */
651
+ displayFormat?: string;
652
+ /**
653
+ * Hides Saturday/Sunday columns in the calendar.
654
+ * @public
655
+ */
656
+ hideWeekends?: boolean;
657
+ /**
658
+ * Fetches holiday/closure days from the server and disables them: those of the business
659
+ * centres, exchanges and currencies named below, merged (a day any of them closes is
660
+ * disabled), or every calendar's when none is named.
661
+ * @defaultValue `false`
662
+ * @public
663
+ */
664
+ holidayCalendars?: boolean;
665
+ /**
666
+ * FpML business centre codes (`businessCenterScheme`, e.g. `GBLO`, `USNY`, `EUTA`) whose
667
+ * holidays `holidayCalendars` disables, combined with `businessCentersField`.
668
+ * @public
669
+ */
670
+ businessCenters?: string[];
671
+ /**
672
+ * Name of a top-level sibling field holding business centre codes: an array, or a string
673
+ * separated by `;` (e.g. a `PAY_CALENDAR` of `GBLO;USNY`), commas or spaces.
674
+ * @public
675
+ */
676
+ businessCentersField?: string;
677
+ /**
678
+ * Exchange MICs (e.g. `XNYS`) whose closures `holidayCalendars` disables, combined with
679
+ * `exchangeCodesField`.
680
+ * @public
681
+ */
682
+ exchangeCodes?: string[];
683
+ /**
684
+ * Name of a top-level sibling field holding exchange MICs, as `businessCentersField`.
685
+ * @public
686
+ */
687
+ exchangeCodesField?: string;
688
+ /**
689
+ * ISO 4217 currencies whose holidays `holidayCalendars` disables, combined with `currencyField`.
690
+ * @public
691
+ */
692
+ currencyCodes?: string[];
693
+ /**
694
+ * Name of a top-level sibling field holding an ISO 4217 currency code (or several, as
695
+ * `businessCentersField`) whose holidays `holidayCalendars` disables.
696
+ * @public
697
+ */
698
+ currencyField?: string;
699
+ /**
700
+ * Earliest selectable date, ISO `YYYY-MM-DD` (inclusive); with `minDateField` the later applies.
701
+ * @public
702
+ */
703
+ minDate?: string;
704
+ /**
705
+ * Latest selectable date, ISO `YYYY-MM-DD` (inclusive); with `maxDateField` the earlier applies.
706
+ * @public
707
+ */
708
+ maxDate?: string;
709
+ /**
710
+ * Name of a top-level sibling field whose date is the earliest selectable one, e.g.
711
+ * `'START_DATE'` on an end date. Ignored while empty.
712
+ * @public
713
+ */
714
+ minDateField?: string;
715
+ /**
716
+ * Name of a top-level sibling field whose date is the latest selectable one, e.g. `'END_DATE'`
717
+ * on a start date. Ignored while empty.
718
+ * @public
719
+ */
720
+ maxDateField?: string;
721
+ /**
722
+ * Picks a date range: this control holds the start and the named sibling field the end. Leave
723
+ * the end field out of the uiSchema, since this control edits it.
724
+ * @public
725
+ */
726
+ rangeEndField?: string;
727
+ /**
728
+ * Lets the user type the date in `displayFormat` as well as pick it. A typed date the calendar
729
+ * wouldn't allow reverts on blur/Enter.
730
+ * @public
731
+ */
732
+ allowFreeText?: boolean;
733
+ };
734
+
735
+ /**
736
+ * Storage format for a date written by the date-picker and value-date control renderers:
737
+ * - `'iso'` — an ISO 8601 calendar date string, `YYYY-MM-DD` (e.g. `2026-09-25`). Matches JSON
738
+ * Schema `format: "date"` and the FpML/CDM convention, sorts correctly as a string, and parses
739
+ * natively everywhere.
740
+ * - `'epoch'` — UTC-midnight epoch milliseconds, the genesis `DATE` wire format.
741
+ * @public
742
+ */
743
+ export declare type DateValueFormat = 'iso' | 'epoch';
744
+
745
+ /**
746
+ * Default settlement convention per overnight benchmark index, applied when the control's
747
+ * `options.indexField` sibling carries one of these codes: a short name (`SOFR`) or its FpML
748
+ * `floatingRateIndexScheme` code (`USD-SOFR`, checked against scheme 3-14).
749
+ * @public
750
+ */
751
+ export declare const DEFAULT_INDEX_CONVENTIONS: Record<string, IndexConvention>;
752
+
596
753
  declare class DispatchRenderer extends FASTElement {
597
754
  jsonforms: any;
598
755
  jsonformsChanged(): void;
@@ -2156,6 +2313,10 @@ export declare function getVerticalCategorizationHeight(layout: CategorizationLa
2156
2313
  */
2157
2314
  export declare type GroupRendererOptions = CategorizationRendererOptions;
2158
2315
 
2316
+ declare interface IndexConvention extends DateConventionsChangedDetail {
2317
+ currency: string;
2318
+ }
2319
+
2159
2320
  /**
2160
2321
  * Converts a JsonForms/Ajv instance path to a JSON Forms scope string.
2161
2322
  * @example `/items/0/CCY` → `#/properties/items/items/0/properties/CCY`
@@ -2339,6 +2500,40 @@ export declare type MulticolumnDropdownRendererOptions = Pick<ConnectedRenderers
2339
2500
  dropdownWidth?: number;
2340
2501
  };
2341
2502
 
2503
+ /**
2504
+ * Ensures the date in the current field (the one the validator is on) is on or after the date in
2505
+ * the target field, e.g. an end date that can't be before its start date. Either field may hold
2506
+ * an ISO `YYYY-MM-DD` string or epoch milliseconds; no error while either is empty.
2507
+ * @param target - the other date field, e.g. `'START_DATE'`
2508
+ * @param message - the error shown on the current field; defaults to `Must not be before <target>`
2509
+ * @returns a validator function that will be run by the smart form during the client-side validation stage
2510
+ * @public
2511
+ */
2512
+ export declare const mustBeOnOrAfter: (target: string, message?: string) => (data: any, path: any) => {
2513
+ instancePath: string;
2514
+ message: string;
2515
+ schemaPath: string;
2516
+ keyword: string;
2517
+ params: {};
2518
+ }[];
2519
+
2520
+ /**
2521
+ * Ensures the date in the current field (the one the validator is on) is on or before the date
2522
+ * in the target field, e.g. a start date that can't be after its end date. Either field may hold
2523
+ * an ISO `YYYY-MM-DD` string or epoch milliseconds; no error while either is empty.
2524
+ * @param target - the other date field, e.g. `'END_DATE'`
2525
+ * @param message - the error shown on the current field; defaults to `Must not be after <target>`
2526
+ * @returns a validator function that will be run by the smart form during the client-side validation stage
2527
+ * @public
2528
+ */
2529
+ export declare const mustBeOnOrBefore: (target: string, message?: string) => (data: any, path: any) => {
2530
+ instancePath: string;
2531
+ message: string;
2532
+ schemaPath: string;
2533
+ keyword: string;
2534
+ params: {};
2535
+ }[];
2536
+
2342
2537
  /**
2343
2538
  * Ensures the value of the current field (the one the validator is on) matches the one of the target field.
2344
2539
  * @param target - any other field
@@ -2925,7 +3120,7 @@ export declare type UiSchemaElementOptions = StandardRendererOptions & {
2925
3120
  * @public
2926
3121
  */
2927
3122
  data?: any[];
2928
- } & Partial<Omit<ConnectedRenderersOptions, 'data'>> & Partial<NumberRendererOptions> & Partial<ArrayRendererOptions> & Partial<CategorizationRendererOptions> & Partial<CategorizationLayoutOptions> & Partial<GroupRendererOptions> & Partial<StepperRendererOptions> & Partial<StringRendererOptions> & Partial<Omit<RadioGroupRendererOptions, 'data'>> & Partial<Omit<SegmentedRendererOptions, 'data'>>;
3123
+ } & Partial<Omit<ConnectedRenderersOptions, 'data'>> & Partial<NumberRendererOptions> & Partial<ArrayRendererOptions> & Partial<CategorizationRendererOptions> & Partial<CategorizationLayoutOptions> & Partial<GroupRendererOptions> & Partial<StepperRendererOptions> & Partial<StringRendererOptions> & Partial<Omit<RadioGroupRendererOptions, 'data'>> & Partial<Omit<SegmentedRendererOptions, 'data'>> & Partial<ValueDateRendererOptions> & Partial<DatePickerRendererOptions>;
2929
3124
 
2930
3125
  /**
2931
3126
  * The layouts and control types, which allow you to customize the arrangement of forms.
@@ -2939,4 +3134,115 @@ export declare type UiSchemaElementType = 'Control' | 'VerticalLayout' | 'Layout
2939
3134
  */
2940
3135
  export declare type UiSchemaOptions = StepperOrientationOptions | LabelPlacementOptions | CategorizationLayoutOptions;
2941
3136
 
3137
+ /**
3138
+ * Renderer entry for a value-date control. Opt in per form via `additionalRenderers`:
3139
+ * ```ts
3140
+ * import { ValueDateControlRendererEntry } from '@genesislcap/foundation-forms';
3141
+ * form.additionalRenderers = [ValueDateControlRendererEntry];
3142
+ * ```
3143
+ * and mark the field with `options: { valueDate: true, baseCurrencyField: 'BASE_CCY', ... }`.
3144
+ * @public
3145
+ */
3146
+ export declare const ValueDateControlRendererEntry: RendererEntry;
3147
+
3148
+ /**
3149
+ * Renders a `<foundation-value-date>` bound to sibling fields (currency pair, index, trade date)
3150
+ * via `options`, and writes the resolved delivery date back as this control's value - plus,
3151
+ * optionally, the unadjusted date (`unadjustedDateScope`) and the spot lag in days
3152
+ * (`spotLagDaysScope`). A read-only control shows the date with its conventions locked.
3153
+ *
3154
+ * Every binding re-pushes on each form-wide re-render, so values the user can change in the
3155
+ * widget are cached per renderer and echoed back instead of being reset.
3156
+ * @public
3157
+ */
3158
+ export declare const ValueDateControlRendererTemplate: (prefix?: string) => ViewTemplate<DispatchRenderer, any>;
3159
+
3160
+ /**
3161
+ * Configuration options for the value-date control renderer.
3162
+ * Activated by `valueDate: true`; reads its currencies, index and trade date from sibling fields.
3163
+ * @public
3164
+ */
3165
+ export declare type ValueDateRendererOptions = StandardRendererOptions & {
3166
+ /**
3167
+ * Enables the value-date control renderer for this element.
3168
+ * @public
3169
+ */
3170
+ valueDate: true;
3171
+ /**
3172
+ * Name of the sibling top-level field holding the base currency code (e.g. `EUR`).
3173
+ * @defaultValue `'BASE_CURRENCY'`
3174
+ * @public
3175
+ */
3176
+ baseCurrencyField?: string;
3177
+ /**
3178
+ * Name of the sibling top-level field holding the quote currency code (e.g. `USD`).
3179
+ * @defaultValue `'QUOTE_CURRENCY'`
3180
+ * @public
3181
+ */
3182
+ quoteCurrencyField?: string;
3183
+ /**
3184
+ * Fixed base currency code, used when the `baseCurrencyField` sibling is empty - e.g. the
3185
+ * settlement currency of an instrument whose form has no currency field.
3186
+ * @public
3187
+ */
3188
+ baseCurrency?: string;
3189
+ /**
3190
+ * Fixed quote currency code, used when the `quoteCurrencyField` sibling is empty.
3191
+ * @public
3192
+ */
3193
+ quoteCurrency?: string;
3194
+ /**
3195
+ * Name of the sibling top-level field holding a benchmark index code (e.g. `SOFR`, `SONIA`).
3196
+ * A recognised index's spot lag and day-roll convention are applied automatically.
3197
+ * @public
3198
+ */
3199
+ indexField?: string;
3200
+ /**
3201
+ * Name of a sibling top-level field holding the trade date (ISO or epoch) that spot and tenor
3202
+ * targets count from instead of today.
3203
+ * @public
3204
+ */
3205
+ tradeDateField?: string;
3206
+ /**
3207
+ * Fixed spot lag for this control, e.g. `'T+0'` for a trade date. A recognised `indexField`
3208
+ * takes precedence; when either fixed convention is set, the conventions popover is hidden.
3209
+ * @public
3210
+ */
3211
+ spotLag?: SpotLag;
3212
+ /**
3213
+ * Fixed day-roll convention for this control, e.g. `'following'`. A recognised `indexField`
3214
+ * convention takes precedence.
3215
+ * @public
3216
+ */
3217
+ dayRollConvention?: DayRollConvention;
3218
+ /**
3219
+ * How the resolved delivery date is stored in the form data.
3220
+ * @defaultValue `'iso'`
3221
+ * @public
3222
+ */
3223
+ valueFormat?: DateValueFormat;
3224
+ /**
3225
+ * Scope (e.g. `#/properties/UNADJUSTED_SETTLEMENT_DATE`) to also store the unadjusted target
3226
+ * date in - the date before the day-roll convention moved it off a holiday or weekend - so a
3227
+ * record keeps both the adjusted and unadjusted dates. Stored in `valueFormat`.
3228
+ * @public
3229
+ */
3230
+ unadjustedDateScope?: string;
3231
+ /**
3232
+ * Scope of an integer field holding the spot lag in business days (`T+N` is `N`), e.g. an
3233
+ * instrument's settlement offset. Its value seeds the spot lag (offsets above 2 show as `T+2`,
3234
+ * the widest lag the widget offers), and the user's spot-lag choice is written back to it; an
3235
+ * empty field is filled with the lag in use. A recognised `indexField` or fixed `spotLag` takes
3236
+ * precedence.
3237
+ * @public
3238
+ */
3239
+ spotLagDaysScope?: string;
3240
+ /**
3241
+ * Whether the widget fetches its holiday calendars from the server (`holiday-calendars`).
3242
+ * @defaultValue `false`
3243
+ * @public
3244
+ */
3245
+ holidayCalendars?: boolean;
3246
+ };
3247
+
2942
3248
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-forms",
3
3
  "description": "Genesis Foundation Forms",
4
- "version": "15.50.2",
4
+ "version": "15.50.3-holiday-picker.2",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -56,12 +56,12 @@
56
56
  }
57
57
  },
58
58
  "devDependencies": {
59
- "@genesislcap/foundation-testing": "15.50.2",
60
- "@genesislcap/genx": "15.50.2",
61
- "@genesislcap/ts-builder": "15.50.2",
62
- "@genesislcap/uvu-playwright-builder": "15.50.2",
63
- "@genesislcap/vite-builder": "15.50.2",
64
- "@genesislcap/webpack-builder": "15.50.2",
59
+ "@genesislcap/foundation-testing": "15.50.3-holiday-picker.2",
60
+ "@genesislcap/genx": "15.50.3-holiday-picker.2",
61
+ "@genesislcap/ts-builder": "15.50.3-holiday-picker.2",
62
+ "@genesislcap/uvu-playwright-builder": "15.50.3-holiday-picker.2",
63
+ "@genesislcap/vite-builder": "15.50.3-holiday-picker.2",
64
+ "@genesislcap/webpack-builder": "15.50.3-holiday-picker.2",
65
65
  "@types/json-schema": "^7.0.11",
66
66
  "@types/papaparse": "^5.3.14"
67
67
  },
@@ -78,12 +78,12 @@
78
78
  }
79
79
  },
80
80
  "dependencies": {
81
- "@genesislcap/foundation-comms": "15.50.2",
82
- "@genesislcap/foundation-criteria": "15.50.2",
83
- "@genesislcap/foundation-logger": "15.50.2",
84
- "@genesislcap/foundation-notifications": "15.50.2",
85
- "@genesislcap/foundation-ui": "15.50.2",
86
- "@genesislcap/foundation-utils": "15.50.2",
81
+ "@genesislcap/foundation-comms": "15.50.3-holiday-picker.2",
82
+ "@genesislcap/foundation-criteria": "15.50.3-holiday-picker.2",
83
+ "@genesislcap/foundation-logger": "15.50.3-holiday-picker.2",
84
+ "@genesislcap/foundation-notifications": "15.50.3-holiday-picker.2",
85
+ "@genesislcap/foundation-ui": "15.50.3-holiday-picker.2",
86
+ "@genesislcap/foundation-utils": "15.50.3-holiday-picker.2",
87
87
  "@json-schema-tools/dereferencer": "^1.6.1",
88
88
  "@jsonforms/core": "^3.2.1",
89
89
  "@microsoft/fast-components": "2.30.6",