@mosip/json-form-builder 0.1.0-beta.1 → 0.1.1-beta.0

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.
@@ -1,8 +1,2 @@
1
1
  import { FormState, FormField } from "../types";
2
- /**
3
- * Creates a date input form element.
4
- * @param {FormState} state Current form state containing schema, container, and other properties.
5
- * @param {FormField} field Form field object containing type, id, label, required, and other properties.
6
- * @returns {HTMLDivElement} A div element containing the form field with its label and input.
7
- */
8
2
  export declare const createDateField: (state: FormState, field: FormField) => HTMLDivElement;
@@ -1,8 +1,8 @@
1
- import { FormState, FormField } from "../types";
1
+ import { FormState, SubTypeField } from "../types";
2
2
  /**
3
3
  * Creates a dropdown select form element.
4
4
  * @param {FormState} state Current form state containing schema, container, and other properties.
5
- * @param {FormField} field Form field object containing type, id, label, required, and other properties.
5
+ * @param {SubTypeField} field Form field object containing type, id, label, required, and other properties.
6
6
  * @returns {HTMLDivElement} A div element containing the form field with its label and select dropdown.
7
7
  */
8
- export declare const createDropdownField: (state: FormState, field: FormField) => HTMLDivElement;
8
+ export declare const createDropdownField: (state: FormState, field: SubTypeField, isSubComponent?: boolean) => HTMLDivElement;
@@ -0,0 +1,2 @@
1
+ import { FormState, SubTypeField } from "../types";
2
+ export declare const createFileUploadField: (state: FormState, field: SubTypeField) => HTMLDivElement;
@@ -2,7 +2,5 @@ import { FormState, FormField } from "../types";
2
2
  /**
3
3
  * Creates a password form element.
4
4
  * @param {FormState} state Current form state containing schema, container, and other properties.
5
- * @param {FormField} field Form field object containing type, id, label, required, and other properties.
6
- * @returns {HTMLDivElement} A div element containing the form field with its label and input.
7
5
  */
8
6
  export declare const createPasswordField: (state: FormState, field: FormField) => HTMLDivElement;
@@ -0,0 +1,8 @@
1
+ import { SubTypeField, FormState } from "../types";
2
+ /**
3
+ * Creates a radio-button form element.
4
+ * @param {FormState} state Current form state containing schema, container, and other properties.
5
+ * @param {SubTypeField} field Form field object containing id, labelName, required, and other properties.
6
+ * @returns {HTMLDivElement} A div element containing the radio group with its label and options.
7
+ */
8
+ export declare const createRadioField: (state: FormState, field: SubTypeField) => HTMLDivElement;
@@ -0,0 +1,8 @@
1
+ import { FormState, FormField } from "../types";
2
+ /**
3
+ * Creates a textarea form element.
4
+ * @param {FormState} state Current form state containing schema, container, and other properties.
5
+ * @param {FormField} field Form field object containing type, id, label, required, and other properties.
6
+ * @returns {HTMLDivElement} A div element containing the form field with its label and textarea.
7
+ */
8
+ export declare const createTextareaField: (state: FormState, field: FormField) => HTMLDivElement;
@@ -6,4 +6,7 @@ import { createPasswordField } from "./PasswordComponent";
6
6
  import { createStringField } from "./TextInputComponent";
7
7
  import { createPhoneField } from "./PhoneInputComponent";
8
8
  import { createPhotoField } from "./PhotoComponent";
9
- export { createCheckboxField, createDateField, createDropdownField, createSimpleTextbox, createPasswordField, createStringField, createPhoneField, createPhotoField, };
9
+ import { createTextareaField } from "./TextareaComponent";
10
+ import { createRadioField } from "./RadioComponent";
11
+ import { createFileUploadField } from "./FileUploadComponent";
12
+ export { createCheckboxField, createDateField, createDropdownField, createSimpleTextbox, createPasswordField, createStringField, createPhoneField, createPhotoField, createTextareaField, createRadioField, createFileUploadField };
package/dist/types.d.ts CHANGED
@@ -5,7 +5,7 @@ export interface Label extends KeyValuePair {
5
5
  }
6
6
  export interface FormField {
7
7
  id: string;
8
- controlType: "textbox" | "password" | "date" | "dropdown" | "checkbox" | "phone" | "photo";
8
+ controlType: "textbox" | "password" | "date" | "dropdown" | "checkbox" | "phone" | "photo" | "radio" | "textarea" | "fileupload";
9
9
  type?: "string" | "simpleType";
10
10
  labelName: Label;
11
11
  required?: boolean;
@@ -19,6 +19,14 @@ export interface FormField {
19
19
  prefix?: string[];
20
20
  acceptedFileTypes?: string[];
21
21
  format?: string;
22
+ minAge?: number;
23
+ maxAge?: number;
24
+ rows?: number;
25
+ maxFileSizeMB?: number;
26
+ }
27
+ export interface SubTypeField extends FormField {
28
+ controlType: "dropdown" | "radio" | "fileupload";
29
+ subType: string;
22
30
  }
23
31
  export interface AllowedValues {
24
32
  [key: string]: {
@@ -62,7 +70,7 @@ export interface FormConfig {
62
70
  language: LanguageSettings;
63
71
  allowedValues?: AllowedValues;
64
72
  errors?: Errors;
65
- maxUploadFileSize?: number;
73
+ maxFileSizeMB?: number;
66
74
  i18nValues?: {
67
75
  errors?: Errors;
68
76
  labels?: {
@@ -94,7 +102,7 @@ export interface Validator {
94
102
  langCode?: string;
95
103
  }
96
104
  export interface FormState {
97
- schema: FormField[];
105
+ schema: FormField[] | SubTypeField[];
98
106
  allowedValues: AllowedValues;
99
107
  mandatoryLanguages: string[];
100
108
  optionalLanguages: string[];
@@ -120,11 +128,12 @@ export interface FormState {
120
128
  languageMap: KeyValuePair;
121
129
  additionalSchema?: AdditionalSchema;
122
130
  isSubmitting: boolean;
123
- maxUploadFileSize: number;
131
+ maxFileSizeMB?: number;
124
132
  labels: {
125
133
  [id: string]: Label;
126
134
  };
127
135
  placeholders: {
128
136
  [id: string]: Label;
129
137
  };
138
+ isFormInitialized: boolean;
130
139
  }
@@ -1,9 +1,11 @@
1
1
  declare const ControlType: {
2
2
  TEXTBOX: string;
3
+ TEXTAREA: string;
3
4
  PASSWORD: string;
4
5
  DATE: string;
5
6
  DROPDOWN: string;
6
7
  CHECKBOX: string;
8
+ RADIO: string;
7
9
  PHONE: string;
8
10
  PHOTO: string;
9
11
  FILE: string;
@@ -0,0 +1,8 @@
1
+ export declare const uploadIconSvg = "\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6.66675 13.3333L10.0001 10M10.0001 10L13.3334 13.3333M10.0001 10V17.5M16.6667 13.9524C17.6847 13.1117 18.3334 11.8399 18.3334 10.4167C18.3334 7.88536 16.2814 5.83333 13.7501 5.83333C13.568 5.83333 13.3976 5.73833 13.3052 5.58145C12.2185 3.73736 10.2121 2.5 7.91675 2.5C4.46497 2.5 1.66675 5.29822 1.66675 8.75C1.66675 10.4718 2.36295 12.0309 3.48921 13.1613\" stroke=\"#344054\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n";
2
+ export declare const trashIconSvg = "<svg width=\"17\" height=\"19\" viewBox=\"0 0 17 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M11.6666 4.16659V3.49992C11.6666 2.5665 11.6666 2.09979 11.4849 1.74327C11.3251 1.42966 11.0702 1.1747 10.7566 1.01491C10.4 0.833252 9.93334 0.833252 8.99992 0.833252H7.66658C6.73316 0.833252 6.26645 0.833252 5.90993 1.01491C5.59633 1.1747 5.34136 1.42966 5.18157 1.74327C4.99992 2.09979 4.99992 2.5665 4.99992 3.49992V4.16659M6.66659 8.74992V12.9166M9.99992 8.74992V12.9166M0.833252 4.16659H15.8333M14.1666 4.16659V13.4999C14.1666 14.9001 14.1666 15.6001 13.8941 16.1349C13.6544 16.6053 13.272 16.9878 12.8016 17.2274C12.2668 17.4999 11.5667 17.4999 10.1666 17.4999H6.49992C5.09979 17.4999 4.39972 17.4999 3.86494 17.2274C3.39454 16.9878 3.01209 16.6053 2.7724 16.1349C2.49992 15.6001 2.49992 14.9001 2.49992 13.4999V4.16659\" stroke=\"#475467\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
3
+ export declare const fileIconSvg = "<svg width=\"15\" height=\"19\" viewBox=\"0 0 15 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M9.16659 1.05805V4.50016C9.16659 4.96687 9.16659 5.20023 9.25741 5.37849C9.33731 5.53529 9.46479 5.66277 9.62159 5.74267C9.79985 5.8335 10.0332 5.8335 10.4999 5.8335H13.942M14.1666 7.49035V13.5002C14.1666 14.9003 14.1666 15.6004 13.8941 16.1351C13.6544 16.6055 13.272 16.988 12.8016 17.2277C12.2668 17.5002 11.5667 17.5002 10.1666 17.5002H4.83325C3.43312 17.5002 2.73306 17.5002 2.19828 17.2277C1.72787 16.988 1.34542 16.6055 1.10574 16.1351C0.833252 15.6004 0.833252 14.9003 0.833252 13.5002V4.8335C0.833252 3.43336 0.833252 2.7333 1.10574 2.19852C1.34542 1.72811 1.72787 1.34566 2.19828 1.10598C2.73306 0.833496 3.43312 0.833496 4.83325 0.833496H7.50973C8.12121 0.833496 8.42695 0.833496 8.71466 0.902571C8.96975 0.963813 9.21362 1.06482 9.4373 1.2019C9.68959 1.3565 9.90578 1.57269 10.3382 2.00507L12.995 4.66192C13.4274 5.0943 13.6436 5.31049 13.7982 5.56278C13.9353 5.78646 14.0363 6.03033 14.0975 6.28542C14.1666 6.57314 14.1666 6.87887 14.1666 7.49035Z\" stroke=\"#98A2B3\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n";
4
+ export declare const calendarIconSvg = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 13 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1.38059 13.6401C1.02276 13.6401 0.719889 13.5161 0.471973 13.2682C0.224056 13.0203 0.100098 12.7174 0.100098 12.3596V2.87889C0.100098 2.52106 0.224056 2.21819 0.471973 1.97027C0.719889 1.72236 1.02276 1.5984 1.38059 1.5984H2.36127V0.100098H3.45105V1.5984H8.81809V0.100098H9.88059V1.5984H10.8613C11.2191 1.5984 11.522 1.72236 11.7699 1.97027C12.0178 2.21819 12.1418 2.52106 12.1418 2.87889V12.3596C12.1418 12.7174 12.0178 13.0203 11.7699 13.2682C11.522 13.5161 11.2191 13.6401 10.8613 13.6401H1.38059ZM1.38059 12.5776H10.8613C10.9158 12.5776 10.9658 12.5548 11.0111 12.5094C11.0565 12.4641 11.0793 12.4141 11.0793 12.3596V5.71222H1.1626V12.3596C1.1626 12.4141 1.18532 12.4641 1.23077 12.5094C1.27611 12.5548 1.32605 12.5776 1.38059 12.5776ZM1.1626 4.64972H11.0793V2.87889C11.0793 2.82435 11.0565 2.77441 11.0111 2.72908C10.9658 2.68362 10.9158 2.6609 10.8613 2.6609H1.38059C1.32605 2.6609 1.27611 2.68362 1.23077 2.72908C1.18532 2.77441 1.1626 2.82435 1.1626 2.87889V4.64972Z\" fill=\"#A0A8AC\"/>\n<path d=\"M1.1626 4.64972H11.0793V2.87889C11.0793 2.82435 11.0565 2.77441 11.0111 2.72908C10.9658 2.68362 10.9158 2.6609 10.8613 2.6609H1.38059C1.32605 2.6609 1.27611 2.68362 1.23077 2.72908C1.18532 2.77441 1.1626 2.82435 1.1626 2.87889V4.64972ZM1.1626 4.64972V2.6609M1.38059 13.6401C1.02276 13.6401 0.719889 13.5161 0.471973 13.2682C0.224056 13.0203 0.100098 12.7174 0.100098 12.3596V2.87889C0.100098 2.52106 0.224056 2.21819 0.471973 1.97027C0.719889 1.72236 1.02276 1.5984 1.38059 1.5984H2.36127V0.100098H3.45105V1.5984H8.81809V0.100098H9.88059V1.5984H10.8613C11.2191 1.5984 11.522 1.72236 11.7699 1.97027C12.0178 2.21819 12.1418 2.52106 12.1418 2.87889V12.3596C12.1418 12.7174 12.0178 13.0203 11.7699 13.2682C11.522 13.5161 11.2191 13.6401 10.8613 13.6401H1.38059ZM1.38059 12.5776H10.8613C10.9158 12.5776 10.9658 12.5548 11.0111 12.5094C11.0565 12.4641 11.0793 12.4141 11.0793 12.3596V5.71222H1.1626V12.3596C1.1626 12.4141 1.18532 12.4641 1.23077 12.5094C1.27611 12.5548 1.32605 12.5776 1.38059 12.5776Z\" stroke=\"#A0A8AC\" stroke-width=\"0.2\"/>\n</svg>\n";
5
+ export declare const errorIconSvg = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5 1C3.93913 1 2.92172 1.42143 2.17157 2.17157C1.42143 2.92172 1 3.93913 1 5C1 6.06087 1.42143 7.07828 2.17157 7.82843C2.92172 8.57857 3.93913 9 5 9C6.06087 9 7.07828 8.57857 7.82843 7.82843C8.57857 7.07828 9 6.06087 9 5C9 3.93913 8.57857 2.92172 7.82843 2.17157C7.07828 1.42143 6.06087 1 5 1ZM0 5C0 2.2385 2.2385 0 5 0C7.7615 0 10 2.2385 10 5C10 7.7615 7.7615 10 5 10C2.2385 10 0 7.7615 0 5ZM2.8965 2.8965C2.99026 2.80276 3.11742 2.75011 3.25 2.75011C3.38258 2.75011 3.50974 2.80276 3.6035 2.8965L5 4.293L6.3965 2.8965C6.44262 2.84875 6.4978 2.81065 6.5588 2.78445C6.6198 2.75824 6.68541 2.74445 6.7518 2.74387C6.81819 2.7433 6.88403 2.75595 6.94548 2.78109C7.00693 2.80623 7.06275 2.84336 7.1097 2.8903C7.15664 2.93725 7.19377 2.99307 7.21891 3.05452C7.24405 3.11597 7.2567 3.18181 7.25613 3.2482C7.25555 3.31459 7.24176 3.3802 7.21555 3.4412C7.18935 3.5022 7.15126 3.55738 7.1035 3.6035L5.707 5L7.1035 6.3965C7.19458 6.4908 7.24498 6.6171 7.24384 6.7482C7.2427 6.8793 7.19011 7.00471 7.09741 7.09741C7.00471 7.19011 6.8793 7.2427 6.7482 7.24384C6.6171 7.24498 6.4908 7.19458 6.3965 7.1035L5 5.707L3.6035 7.1035C3.5092 7.19458 3.3829 7.24498 3.2518 7.24384C3.1207 7.2427 2.99529 7.19011 2.90259 7.09741C2.80989 7.00471 2.7573 6.8793 2.75616 6.7482C2.75502 6.6171 2.80542 6.4908 2.8965 6.3965L4.293 5L2.8965 3.6035C2.80276 3.50974 2.75011 3.38258 2.75011 3.25C2.75011 3.11742 2.80276 2.99026 2.8965 2.8965Z\" fill=\"#FE6B6B\"/>\n</svg>\n";
6
+ export declare const eyeIconSvg = "<svg width=\"22\" height=\"17\" viewBox=\"0 0 14 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M8.66626 4.66663C8.66626 5.19706 8.45555 5.70577 8.08047 6.08084C7.7054 6.45591 7.19669 6.66663 6.66626 6.66663C6.13583 6.66663 5.62712 6.45591 5.25205 6.08084C4.87697 5.70577 4.66626 5.19706 4.66626 4.66663C4.66626 4.13619 4.87697 3.62748 5.25205 3.25241C5.62712 2.87734 6.13583 2.66663 6.66626 2.66663C7.19669 2.66663 7.7054 2.87734 8.08047 3.25241C8.45555 3.62748 8.66626 4.13619 8.66626 4.66663Z\" fill=\"#A0A8AC\"/>\n<path d=\"M13.2623 4.36867C11.8236 1.49067 9.26898 0 6.66631 0C4.06364 0 1.50898 1.49067 0.0703106 4.36867C0.0240716 4.4612 0 4.56322 0 4.66667C0 4.77011 0.0240716 4.87213 0.0703106 4.96467C1.50898 7.84267 4.06364 9.33333 6.66631 9.33333C9.26898 9.33333 11.8236 7.84267 13.2623 4.96467C13.3085 4.87213 13.3326 4.77011 13.3326 4.66667C13.3326 4.56322 13.3085 4.4612 13.2623 4.36867ZM6.66631 8C4.68698 8 2.66498 6.92 1.41964 4.66667C2.66498 2.41333 4.68631 1.33333 6.66631 1.33333C8.64631 1.33333 10.6676 2.41333 11.913 4.66667C10.6676 6.92 8.64564 8 6.66631 8Z\" fill=\"#A0A8AC\"/>\n</svg>\n";
7
+ export declare const eyeCrossedIconSvg = "<svg width=\"22\" height=\"17\" viewBox=\"0 0 14 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1.80431 0.187141C1.67858 0.0657025 1.51017 -0.00149374 1.33538 2.52018e-05C1.16058 0.00154415 0.99337 0.0716568 0.869765 0.195262C0.74616 0.318868 0.676047 0.486076 0.674528 0.660874C0.673009 0.835672 0.740205 1.00407 0.861644 1.12981L2.47764 2.74581C1.52431 3.46314 0.692311 4.44847 0.0703106 5.69381C0.0240716 5.78634 0 5.88837 0 5.99181C0 6.09525 0.0240716 6.19727 0.0703106 6.28981C1.50898 9.16781 4.06364 10.6585 6.66631 10.6585C7.70298 10.6585 8.73298 10.4218 9.68631 9.95514L11.5283 11.7965C11.654 11.9179 11.8224 11.9851 11.9972 11.9836C12.172 11.9821 12.3393 11.912 12.4629 11.7884C12.5865 11.6647 12.6566 11.4975 12.6581 11.3227C12.6596 11.1479 12.5924 10.9795 12.471 10.8538L1.80431 0.187141ZM8.67564 8.94381C8.02231 9.19914 7.34231 9.32514 6.66631 9.32514C4.68698 9.32514 2.66498 8.24514 1.41964 5.99181C1.96431 5.00581 2.65831 4.24514 3.43164 3.70047L4.86098 5.12981C4.68237 5.50311 4.62395 5.92262 4.69379 6.33052C4.76362 6.73842 4.95827 7.11461 5.25089 7.40723C5.54351 7.69985 5.9197 7.8945 6.3276 7.96433C6.73549 8.03417 7.15501 7.97575 7.52831 7.79714L8.67564 8.94381ZM11.0343 7.25581C11.3563 6.88514 11.6516 6.46447 11.913 5.99181C10.6676 3.73847 8.64631 2.65847 6.66631 2.65847C6.59164 2.65847 6.51698 2.66003 6.44231 2.66314L5.25231 1.47381C5.71715 1.37498 6.19108 1.32515 6.66631 1.32514C9.26831 1.32514 11.8236 2.81581 13.2623 5.69381C13.3085 5.78634 13.3326 5.88837 13.3326 5.99181C13.3326 6.09525 13.3085 6.19727 13.2623 6.28981C12.9213 6.98069 12.4898 7.62301 11.979 8.19981L11.0343 7.25581Z\" fill=\"#A0A8AC\"/>\n</svg>\n";
8
+ export declare const infoIconSvg = "<svg width=\"15\" height=\"15\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5 1C3.93913 1 2.92172 1.42143 2.17157 2.17157C1.42143 2.92172 1 3.93913 1 5C1 6.06087 1.42143 7.07828 2.17157 7.82843C2.92172 8.57857 3.93913 9 5 9C6.06087 9 7.07828 8.57857 7.82843 7.82843C8.57857 7.07828 9 6.06087 9 5C9 3.93913 8.57857 2.92172 7.82843 2.17157C7.07828 1.42143 6.06087 1 5 1ZM0 5C0 2.2385 2.2385 0 5 0C7.7615 0 10 2.2385 10 5C10 7.7615 7.7615 10 5 10C2.2385 10 0 7.7615 0 5Z\" fill=\"#2D86BA\"/>\n<path d=\"M5 4C5.13261 4 5.25979 4.05268 5.35355 4.14645C5.44732 4.24021 5.5 4.36739 5.5 4.5V7.5C5.5 7.63261 5.44732 7.75979 5.35355 7.85355C5.25979 7.94732 5.13261 8 5 8C4.86739 8 4.74021 7.94732 4.64645 7.85355C4.55268 7.75979 4.5 7.63261 4.5 7.5V4.5C4.5 4.36739 4.55268 4.24021 4.64645 4.14645C4.74021 4.05268 4.86739 4 5 4ZM5.75 2.75C5.75 2.94891 5.67098 3.13968 5.53033 3.28033C5.38968 3.42098 5.19891 3.5 5 3.5C4.80109 3.5 4.61032 3.42098 4.46967 3.28033C4.32902 3.13968 4.25 2.94891 4.25 2.75C4.25 2.55109 4.32902 2.36032 4.46967 2.21967C4.61032 2.07902 4.80109 2 5 2C5.19891 2 5.38968 2.07902 5.53033 2.21967C5.67098 2.36032 5.75 2.55109 5.75 2.75Z\" fill=\"#2D86BA\"/>\n</svg>\n";
@@ -1,4 +1,4 @@
1
- import { FormField, FormState, Label } from "../types";
1
+ import { FormField, FormState, Label, SubTypeField } from "../types";
2
2
  type LabelObject = Record<string, string>;
3
3
  /**
4
4
  * Helps to get the label text for a form field, including a required indicator if the field is marked as required.
@@ -57,12 +57,6 @@ declare const handleRegexValidation: (state: FormState, errorContainer: HTMLDivE
57
57
  lastError: null;
58
58
  isValid: boolean;
59
59
  };
60
- /**
61
- * Creates an SVG element representing an info icon.
62
- * @param {number | string} size size of the info icon in px
63
- * @returns {SVGSVGElement} returns an SVG element with the info icon.
64
- */
65
- declare const createInfoIconSvg: (size?: number | string) => SVGSVGElement;
66
60
  /**
67
61
  * Create Info icon for a form field
68
62
  * @param {string} infoMessage The message to display in the info icon tooltip.
@@ -88,7 +82,7 @@ declare const checkCapsLock: (event: KeyboardEvent | MouseEvent, capsLockSpan: H
88
82
  * @param {HTMLDivElement} wrapper Wrapper HTMLDivElement that contains the form field.
89
83
  * @param {HTMLInputElement} input Input HTMLInputElement that will have the caps lock check enabled.
90
84
  */
91
- declare const enableCapsLockCheck: (field: FormField, wrapper: HTMLDivElement, input: HTMLInputElement) => void;
85
+ declare const enableCapsLockCheck: (field: FormField, wrapper: HTMLDivElement, input: HTMLInputElement | HTMLTextAreaElement) => void;
92
86
  /**
93
87
  * Prevents the default action of an event.
94
88
  * @param {Event} e Event to prevent default action for.
@@ -98,7 +92,7 @@ declare const preventDefaultFn: (e: Event) => void;
98
92
  * Disables a form field by preventing user input and interaction.
99
93
  * @param {HTMLInputElement | HTMLSelectElement} field HTMLInputElement or HTMLSelectElement to disable.
100
94
  */
101
- declare const disableField: (field: HTMLInputElement | HTMLSelectElement) => void;
95
+ declare const disableField: (field: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement) => void;
102
96
  /**
103
97
  * Creates a new div element to be used as an error container.
104
98
  * @returns {HTMLDivElement} A new div element to be used as an error container.
@@ -118,5 +112,8 @@ declare const dataUrlToBlob: (dataUrl: string) => Blob;
118
112
  * @returns {boolean} Returns true if the form is valid, false otherwise.
119
113
  */
120
114
  declare const validateForm: (state: FormState) => boolean;
121
- declare const emptyInvalidFn: (input: HTMLInputElement | HTMLSelectElement) => (() => void);
122
- export { getLabelText, getMultiLangText, appendError, handleRequiredValidation, handleRegexValidation, createInfoIconSvg, createInfoIcon, getCapsLockSpan, checkCapsLock, disableField, preventDefaultFn, createErrorContainer, buildBidirectionalLanguageMap, enableCapsLockCheck, dataUrlToBlob, validateForm, emptyInvalidFn, };
115
+ declare const emptyInvalidFn: (input: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement) => (() => void);
116
+ declare const getAcceptString: (allowedTypes: string[]) => string;
117
+ declare const mimeToLabel: (mime: string) => string;
118
+ declare const isSubTypeField: (field: FormField) => field is SubTypeField;
119
+ export { getLabelText, getMultiLangText, appendError, handleRequiredValidation, handleRegexValidation, createInfoIcon, getCapsLockSpan, checkCapsLock, disableField, preventDefaultFn, createErrorContainer, buildBidirectionalLanguageMap, enableCapsLockCheck, dataUrlToBlob, validateForm, emptyInvalidFn, getAcceptString, mimeToLabel, isSubTypeField };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mosip/json-form-builder",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.1-beta.0",
4
4
  "description": "A dynamic JSON form builder with multi-language support, validation, and responsive design",
5
5
  "main": "dist/JsonFormBuilder.umd.js",
6
6
  "module": "dist/JsonFormBuilder.esm.js",