@opencrvs/toolkit 1.8.1-rc.25f3d5c → 1.8.1-rc.38ac682

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.
@@ -4724,13 +4724,164 @@ declare const DataField: z.ZodObject<z.objectUtil.extendShape<{
4724
4724
  uncorrectable?: boolean | undefined;
4725
4725
  }>;
4726
4726
  export type DataField = z.infer<typeof DataField>;
4727
+ declare const PrintButton: z.ZodObject<z.objectUtil.extendShape<{
4728
+ id: z.ZodString;
4729
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
4730
+ id: string;
4731
+ description: string;
4732
+ defaultMessage: string;
4733
+ }>;
4734
+ parent: z.ZodOptional<z.ZodObject<{
4735
+ $$field: z.ZodString;
4736
+ }, "strip", z.ZodTypeAny, {
4737
+ $$field: string;
4738
+ }, {
4739
+ $$field: string;
4740
+ }>>;
4741
+ required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4742
+ conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>;
4743
+ secured: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4744
+ placeholder: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
4745
+ id: string;
4746
+ description: string;
4747
+ defaultMessage: string;
4748
+ }>>;
4749
+ validation: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
4750
+ validator: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
4751
+ message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
4752
+ id: string;
4753
+ description: string;
4754
+ defaultMessage: string;
4755
+ }>;
4756
+ }, "strip", z.ZodTypeAny, {
4757
+ message: TranslationConfig;
4758
+ validator: import(".").JSONSchema;
4759
+ }, {
4760
+ message: {
4761
+ id: string;
4762
+ description: string;
4763
+ defaultMessage: string;
4764
+ };
4765
+ validator: import(".").JSONSchema;
4766
+ }>, "many">>>;
4767
+ helperText: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
4768
+ id: string;
4769
+ description: string;
4770
+ defaultMessage: string;
4771
+ }>>;
4772
+ hideLabel: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4773
+ uncorrectable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4774
+ }, {
4775
+ type: z.ZodLiteral<"PRINT_BUTTON">;
4776
+ configuration: z.ZodObject<{
4777
+ template: z.ZodString;
4778
+ buttonLabel: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
4779
+ id: string;
4780
+ description: string;
4781
+ defaultMessage: string;
4782
+ }>>;
4783
+ }, "strip", z.ZodTypeAny, {
4784
+ template: string;
4785
+ buttonLabel?: TranslationConfig | undefined;
4786
+ }, {
4787
+ template: string;
4788
+ buttonLabel?: {
4789
+ id: string;
4790
+ description: string;
4791
+ defaultMessage: string;
4792
+ } | undefined;
4793
+ }>;
4794
+ }>, "strip", z.ZodTypeAny, {
4795
+ type: "PRINT_BUTTON";
4796
+ id: string;
4797
+ label: TranslationConfig;
4798
+ configuration: {
4799
+ template: string;
4800
+ buttonLabel?: TranslationConfig | undefined;
4801
+ };
4802
+ parent?: {
4803
+ $$field: string;
4804
+ } | undefined;
4805
+ validation?: {
4806
+ message: TranslationConfig;
4807
+ validator: import(".").JSONSchema;
4808
+ }[] | undefined;
4809
+ required?: boolean | undefined;
4810
+ conditionals?: ({
4811
+ type: "SHOW";
4812
+ conditional: import(".").JSONSchema;
4813
+ } | {
4814
+ type: "ENABLE";
4815
+ conditional: import(".").JSONSchema;
4816
+ } | {
4817
+ type: "DISPLAY_ON_REVIEW";
4818
+ conditional: import(".").JSONSchema;
4819
+ })[] | undefined;
4820
+ secured?: boolean | undefined;
4821
+ placeholder?: TranslationConfig | undefined;
4822
+ helperText?: TranslationConfig | undefined;
4823
+ hideLabel?: boolean | undefined;
4824
+ uncorrectable?: boolean | undefined;
4825
+ }, {
4826
+ type: "PRINT_BUTTON";
4827
+ id: string;
4828
+ label: {
4829
+ id: string;
4830
+ description: string;
4831
+ defaultMessage: string;
4832
+ };
4833
+ configuration: {
4834
+ template: string;
4835
+ buttonLabel?: {
4836
+ id: string;
4837
+ description: string;
4838
+ defaultMessage: string;
4839
+ } | undefined;
4840
+ };
4841
+ parent?: {
4842
+ $$field: string;
4843
+ } | undefined;
4844
+ validation?: {
4845
+ message: {
4846
+ id: string;
4847
+ description: string;
4848
+ defaultMessage: string;
4849
+ };
4850
+ validator: import(".").JSONSchema;
4851
+ }[] | undefined;
4852
+ required?: boolean | undefined;
4853
+ conditionals?: ({
4854
+ type: "SHOW";
4855
+ conditional: import(".").JSONSchema;
4856
+ } | {
4857
+ type: "ENABLE";
4858
+ conditional: import(".").JSONSchema;
4859
+ } | {
4860
+ type: "DISPLAY_ON_REVIEW";
4861
+ conditional: import(".").JSONSchema;
4862
+ })[] | undefined;
4863
+ secured?: boolean | undefined;
4864
+ placeholder?: {
4865
+ id: string;
4866
+ description: string;
4867
+ defaultMessage: string;
4868
+ } | undefined;
4869
+ helperText?: {
4870
+ id: string;
4871
+ description: string;
4872
+ defaultMessage: string;
4873
+ } | undefined;
4874
+ hideLabel?: boolean | undefined;
4875
+ uncorrectable?: boolean | undefined;
4876
+ }>;
4877
+ export type PrintButton = z.infer<typeof PrintButton>;
4727
4878
  /** @knipignore */
4728
- export type Inferred = z.infer<typeof Address> | z.infer<typeof TextField> | z.infer<typeof NumberField> | z.infer<typeof TextAreaField> | z.infer<typeof DateField> | z.infer<typeof TimeField> | z.infer<typeof DateRangeField> | z.infer<typeof SelectDateRangeField> | z.infer<typeof Paragraph> | z.infer<typeof RadioGroup> | z.infer<typeof BulletList> | z.infer<typeof PageHeader> | z.infer<typeof Select> | z.infer<typeof NameField> | z.infer<typeof PhoneField> | z.infer<typeof IdField> | z.infer<typeof Checkbox> | z.infer<typeof File> | z.infer<typeof FileUploadWithOptions> | z.infer<typeof Country> | z.infer<typeof AdministrativeArea> | z.infer<typeof Divider> | z.infer<typeof Location> | z.infer<typeof Facility> | z.infer<typeof Office> | z.infer<typeof SignatureField> | z.infer<typeof EmailField> | z.infer<typeof DataField>;
4879
+ export type Inferred = z.infer<typeof Address> | z.infer<typeof TextField> | z.infer<typeof NumberField> | z.infer<typeof TextAreaField> | z.infer<typeof DateField> | z.infer<typeof TimeField> | z.infer<typeof DateRangeField> | z.infer<typeof SelectDateRangeField> | z.infer<typeof Paragraph> | z.infer<typeof RadioGroup> | z.infer<typeof BulletList> | z.infer<typeof PageHeader> | z.infer<typeof Select> | z.infer<typeof NameField> | z.infer<typeof PhoneField> | z.infer<typeof IdField> | z.infer<typeof Checkbox> | z.infer<typeof File> | z.infer<typeof FileUploadWithOptions> | z.infer<typeof Country> | z.infer<typeof AdministrativeArea> | z.infer<typeof Divider> | z.infer<typeof Location> | z.infer<typeof Facility> | z.infer<typeof Office> | z.infer<typeof SignatureField> | z.infer<typeof EmailField> | z.infer<typeof DataField> | z.infer<typeof PrintButton>;
4729
4880
  /** @knipignore */
4730
4881
  /**
4731
4882
  * This is the type that should be used for the input of the FieldConfig. Useful when config uses zod defaults.
4732
4883
  */
4733
- export type InferredInput = z.input<typeof Address> | z.input<typeof TextField> | z.input<typeof NumberField> | z.input<typeof TextAreaField> | z.input<typeof DateField> | z.input<typeof TimeField> | z.input<typeof DateRangeField> | z.input<typeof Paragraph> | z.input<typeof RadioGroup> | z.input<typeof BulletList> | z.input<typeof PageHeader> | z.input<typeof Select> | z.input<typeof NameField> | z.input<typeof PhoneField> | z.input<typeof IdField> | z.input<typeof Checkbox> | z.input<typeof File> | z.input<typeof FileUploadWithOptions> | z.input<typeof Country> | z.input<typeof AdministrativeArea> | z.input<typeof Divider> | z.input<typeof Location> | z.input<typeof Facility> | z.input<typeof Office> | z.input<typeof SignatureField> | z.input<typeof EmailField> | z.input<typeof DataField>;
4884
+ export type InferredInput = z.input<typeof Address> | z.input<typeof TextField> | z.input<typeof NumberField> | z.input<typeof TextAreaField> | z.input<typeof DateField> | z.input<typeof TimeField> | z.input<typeof DateRangeField> | z.input<typeof Paragraph> | z.input<typeof RadioGroup> | z.input<typeof BulletList> | z.input<typeof PageHeader> | z.input<typeof Select> | z.input<typeof NameField> | z.input<typeof PhoneField> | z.input<typeof IdField> | z.input<typeof Checkbox> | z.input<typeof File> | z.input<typeof FileUploadWithOptions> | z.input<typeof Country> | z.input<typeof AdministrativeArea> | z.input<typeof Divider> | z.input<typeof Location> | z.input<typeof Facility> | z.input<typeof Office> | z.input<typeof SignatureField> | z.input<typeof EmailField> | z.input<typeof DataField> | z.input<typeof PrintButton>;
4734
4885
  export declare const FieldConfig: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
4735
4886
  id: z.ZodString;
4736
4887
  label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
@@ -9139,6 +9290,155 @@ export declare const FieldConfig: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z
9139
9290
  } | undefined;
9140
9291
  hideLabel?: boolean | undefined;
9141
9292
  uncorrectable?: boolean | undefined;
9293
+ }>, z.ZodObject<z.objectUtil.extendShape<{
9294
+ id: z.ZodString;
9295
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
9296
+ id: string;
9297
+ description: string;
9298
+ defaultMessage: string;
9299
+ }>;
9300
+ parent: z.ZodOptional<z.ZodObject<{
9301
+ $$field: z.ZodString;
9302
+ }, "strip", z.ZodTypeAny, {
9303
+ $$field: string;
9304
+ }, {
9305
+ $$field: string;
9306
+ }>>;
9307
+ required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
9308
+ conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>;
9309
+ secured: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
9310
+ placeholder: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
9311
+ id: string;
9312
+ description: string;
9313
+ defaultMessage: string;
9314
+ }>>;
9315
+ validation: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
9316
+ validator: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
9317
+ message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
9318
+ id: string;
9319
+ description: string;
9320
+ defaultMessage: string;
9321
+ }>;
9322
+ }, "strip", z.ZodTypeAny, {
9323
+ message: TranslationConfig;
9324
+ validator: import(".").JSONSchema;
9325
+ }, {
9326
+ message: {
9327
+ id: string;
9328
+ description: string;
9329
+ defaultMessage: string;
9330
+ };
9331
+ validator: import(".").JSONSchema;
9332
+ }>, "many">>>;
9333
+ helperText: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
9334
+ id: string;
9335
+ description: string;
9336
+ defaultMessage: string;
9337
+ }>>;
9338
+ hideLabel: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
9339
+ uncorrectable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
9340
+ }, {
9341
+ type: z.ZodLiteral<"PRINT_BUTTON">;
9342
+ configuration: z.ZodObject<{
9343
+ template: z.ZodString;
9344
+ buttonLabel: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
9345
+ id: string;
9346
+ description: string;
9347
+ defaultMessage: string;
9348
+ }>>;
9349
+ }, "strip", z.ZodTypeAny, {
9350
+ template: string;
9351
+ buttonLabel?: TranslationConfig | undefined;
9352
+ }, {
9353
+ template: string;
9354
+ buttonLabel?: {
9355
+ id: string;
9356
+ description: string;
9357
+ defaultMessage: string;
9358
+ } | undefined;
9359
+ }>;
9360
+ }>, "strip", z.ZodTypeAny, {
9361
+ type: "PRINT_BUTTON";
9362
+ id: string;
9363
+ label: TranslationConfig;
9364
+ configuration: {
9365
+ template: string;
9366
+ buttonLabel?: TranslationConfig | undefined;
9367
+ };
9368
+ parent?: {
9369
+ $$field: string;
9370
+ } | undefined;
9371
+ validation?: {
9372
+ message: TranslationConfig;
9373
+ validator: import(".").JSONSchema;
9374
+ }[] | undefined;
9375
+ required?: boolean | undefined;
9376
+ conditionals?: ({
9377
+ type: "SHOW";
9378
+ conditional: import(".").JSONSchema;
9379
+ } | {
9380
+ type: "ENABLE";
9381
+ conditional: import(".").JSONSchema;
9382
+ } | {
9383
+ type: "DISPLAY_ON_REVIEW";
9384
+ conditional: import(".").JSONSchema;
9385
+ })[] | undefined;
9386
+ secured?: boolean | undefined;
9387
+ placeholder?: TranslationConfig | undefined;
9388
+ helperText?: TranslationConfig | undefined;
9389
+ hideLabel?: boolean | undefined;
9390
+ uncorrectable?: boolean | undefined;
9391
+ }, {
9392
+ type: "PRINT_BUTTON";
9393
+ id: string;
9394
+ label: {
9395
+ id: string;
9396
+ description: string;
9397
+ defaultMessage: string;
9398
+ };
9399
+ configuration: {
9400
+ template: string;
9401
+ buttonLabel?: {
9402
+ id: string;
9403
+ description: string;
9404
+ defaultMessage: string;
9405
+ } | undefined;
9406
+ };
9407
+ parent?: {
9408
+ $$field: string;
9409
+ } | undefined;
9410
+ validation?: {
9411
+ message: {
9412
+ id: string;
9413
+ description: string;
9414
+ defaultMessage: string;
9415
+ };
9416
+ validator: import(".").JSONSchema;
9417
+ }[] | undefined;
9418
+ required?: boolean | undefined;
9419
+ conditionals?: ({
9420
+ type: "SHOW";
9421
+ conditional: import(".").JSONSchema;
9422
+ } | {
9423
+ type: "ENABLE";
9424
+ conditional: import(".").JSONSchema;
9425
+ } | {
9426
+ type: "DISPLAY_ON_REVIEW";
9427
+ conditional: import(".").JSONSchema;
9428
+ })[] | undefined;
9429
+ secured?: boolean | undefined;
9430
+ placeholder?: {
9431
+ id: string;
9432
+ description: string;
9433
+ defaultMessage: string;
9434
+ } | undefined;
9435
+ helperText?: {
9436
+ id: string;
9437
+ description: string;
9438
+ defaultMessage: string;
9439
+ } | undefined;
9440
+ hideLabel?: boolean | undefined;
9441
+ uncorrectable?: boolean | undefined;
9142
9442
  }>]>;
9143
9443
  export type SelectField = z.infer<typeof Select>;
9144
9444
  export type NameField = z.infer<typeof NameField>;
@@ -27,8 +27,9 @@ export declare const FieldType: {
27
27
  readonly OFFICE: "OFFICE";
28
28
  readonly SIGNATURE: "SIGNATURE";
29
29
  readonly DATA: "DATA";
30
+ readonly PRINT_BUTTON: "PRINT_BUTTON";
30
31
  };
31
- export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
32
+ export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "PRINT_BUTTON")[];
32
33
  export type FieldType = (typeof fieldTypes)[number];
33
34
  /**
34
35
  * Composite field types are field types that consist of multiple field values.
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField } from './FieldConfig';
2
+ import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField, PrintButton } from './FieldConfig';
3
3
  import { FieldType } from './FieldType';
4
4
  import { FieldValue, FieldUpdateValueSchema, DateRangeFieldValue, SelectDateRangeValue } from './FieldValue';
5
5
  import { FullDocumentPath } from '../documents';
@@ -641,7 +641,14 @@ export declare const isDataFieldType: (field: {
641
641
  value: undefined;
642
642
  config: DataField;
643
643
  };
644
- export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
644
+ export declare const isPrintButtonFieldType: (field: {
645
+ config: FieldConfig;
646
+ value: FieldValue;
647
+ }) => field is {
648
+ value: undefined;
649
+ config: PrintButton;
650
+ };
651
+ export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField | PrintButton;
645
652
  export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
646
653
  export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
647
654
  export {};