formanitor 0.0.22 → 0.0.24
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.
- package/dist/index.cjs +531 -250
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -4
- package/dist/index.d.ts +46 -4
- package/dist/index.mjs +373 -97
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
type FieldType = 'text' | 'number' | 'textarea' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
|
|
3
|
+
type FieldType = 'text' | 'number' | 'textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
|
|
4
4
|
interface ValidationRule {
|
|
5
5
|
min?: number;
|
|
6
6
|
max?: number;
|
|
@@ -69,6 +69,12 @@ interface TextFieldDef extends BaseFieldDef {
|
|
|
69
69
|
/** For textarea: height in pixels. If omitted, uses default min height (80px). */
|
|
70
70
|
height?: number;
|
|
71
71
|
}
|
|
72
|
+
/** Rich text (HTML) field with TipTap toolbar. Value is stored as HTML string. */
|
|
73
|
+
interface RichTextFieldDef extends BaseFieldDef {
|
|
74
|
+
type: 'richtext';
|
|
75
|
+
/** Minimum height of the editor body in pixels. Default: 160. */
|
|
76
|
+
minHeight?: number;
|
|
77
|
+
}
|
|
72
78
|
interface NumberFieldDef extends BaseFieldDef {
|
|
73
79
|
type: 'number';
|
|
74
80
|
}
|
|
@@ -263,7 +269,7 @@ interface DoctorFrequentItems {
|
|
|
263
269
|
investigations?: InvestigationFrequentItem[];
|
|
264
270
|
procedures?: ProcedureFrequentItem[];
|
|
265
271
|
}
|
|
266
|
-
type FieldDef = TextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | BaseFieldDef;
|
|
272
|
+
type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | BaseFieldDef;
|
|
267
273
|
interface Condition {
|
|
268
274
|
field?: string;
|
|
269
275
|
op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
|
|
@@ -619,6 +625,10 @@ interface FieldRendererProps {
|
|
|
619
625
|
}
|
|
620
626
|
declare const FieldRenderer: React.FC<FieldRendererProps>;
|
|
621
627
|
|
|
628
|
+
declare const RichTextWidget: React.FC<{
|
|
629
|
+
fieldId: string;
|
|
630
|
+
}>;
|
|
631
|
+
|
|
622
632
|
interface SubmissionData {
|
|
623
633
|
created_at: string;
|
|
624
634
|
updated_at: string;
|
|
@@ -709,6 +719,38 @@ type AIMedication = {
|
|
|
709
719
|
reason?: string;
|
|
710
720
|
};
|
|
711
721
|
|
|
722
|
+
declare const BEFORE_AFTER_OPTIONS: readonly [{
|
|
723
|
+
readonly label: "Blank";
|
|
724
|
+
readonly value: "";
|
|
725
|
+
}, {
|
|
726
|
+
readonly label: "AFTER FOOD";
|
|
727
|
+
readonly value: "AFTER FOOD";
|
|
728
|
+
}, {
|
|
729
|
+
readonly label: "BEFORE FOOD";
|
|
730
|
+
readonly value: "BEFORE FOOD";
|
|
731
|
+
}, {
|
|
732
|
+
readonly label: "WITH FOOD";
|
|
733
|
+
readonly value: "WITH FOOD";
|
|
734
|
+
}, {
|
|
735
|
+
readonly label: "SINGLE DOSE";
|
|
736
|
+
readonly value: "SINGLE DOSE";
|
|
737
|
+
}, {
|
|
738
|
+
readonly label: "BED TIME";
|
|
739
|
+
readonly value: "BED TIME";
|
|
740
|
+
}, {
|
|
741
|
+
readonly label: "EMPTY STOMACH";
|
|
742
|
+
readonly value: "EMPTY STOMACH";
|
|
743
|
+
}, {
|
|
744
|
+
readonly label: "LOCAL APPLICATION";
|
|
745
|
+
readonly value: "LOCAL APPLICATION";
|
|
746
|
+
}, {
|
|
747
|
+
readonly label: "STAT";
|
|
748
|
+
readonly value: "STAT";
|
|
749
|
+
}, {
|
|
750
|
+
readonly label: "INHALATION";
|
|
751
|
+
readonly value: "INHALATION";
|
|
752
|
+
}];
|
|
753
|
+
type BeforeAfterOption = (typeof BEFORE_AFTER_OPTIONS)[number]['value'];
|
|
712
754
|
type MedicationSearchResult = {
|
|
713
755
|
id: string;
|
|
714
756
|
name: string;
|
|
@@ -724,7 +766,7 @@ type Medication = {
|
|
|
724
766
|
is_custom: boolean;
|
|
725
767
|
duration_value: string;
|
|
726
768
|
duration_unit: 'days' | 'weeks' | 'months';
|
|
727
|
-
before_after:
|
|
769
|
+
before_after: BeforeAfterOption;
|
|
728
770
|
morning: string;
|
|
729
771
|
afternoon: string;
|
|
730
772
|
night: string;
|
|
@@ -818,4 +860,4 @@ declare const SmartTextareaWidget: React.FC<{
|
|
|
818
860
|
fieldId: string;
|
|
819
861
|
}>;
|
|
820
862
|
|
|
821
|
-
export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type MatchedCondition, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SumComputation, type TextFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
|
|
863
|
+
export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type MatchedCondition, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SumComputation, type TextFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
type FieldType = 'text' | 'number' | 'textarea' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
|
|
3
|
+
type FieldType = 'text' | 'number' | 'textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
|
|
4
4
|
interface ValidationRule {
|
|
5
5
|
min?: number;
|
|
6
6
|
max?: number;
|
|
@@ -69,6 +69,12 @@ interface TextFieldDef extends BaseFieldDef {
|
|
|
69
69
|
/** For textarea: height in pixels. If omitted, uses default min height (80px). */
|
|
70
70
|
height?: number;
|
|
71
71
|
}
|
|
72
|
+
/** Rich text (HTML) field with TipTap toolbar. Value is stored as HTML string. */
|
|
73
|
+
interface RichTextFieldDef extends BaseFieldDef {
|
|
74
|
+
type: 'richtext';
|
|
75
|
+
/** Minimum height of the editor body in pixels. Default: 160. */
|
|
76
|
+
minHeight?: number;
|
|
77
|
+
}
|
|
72
78
|
interface NumberFieldDef extends BaseFieldDef {
|
|
73
79
|
type: 'number';
|
|
74
80
|
}
|
|
@@ -263,7 +269,7 @@ interface DoctorFrequentItems {
|
|
|
263
269
|
investigations?: InvestigationFrequentItem[];
|
|
264
270
|
procedures?: ProcedureFrequentItem[];
|
|
265
271
|
}
|
|
266
|
-
type FieldDef = TextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | BaseFieldDef;
|
|
272
|
+
type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | BaseFieldDef;
|
|
267
273
|
interface Condition {
|
|
268
274
|
field?: string;
|
|
269
275
|
op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
|
|
@@ -619,6 +625,10 @@ interface FieldRendererProps {
|
|
|
619
625
|
}
|
|
620
626
|
declare const FieldRenderer: React.FC<FieldRendererProps>;
|
|
621
627
|
|
|
628
|
+
declare const RichTextWidget: React.FC<{
|
|
629
|
+
fieldId: string;
|
|
630
|
+
}>;
|
|
631
|
+
|
|
622
632
|
interface SubmissionData {
|
|
623
633
|
created_at: string;
|
|
624
634
|
updated_at: string;
|
|
@@ -709,6 +719,38 @@ type AIMedication = {
|
|
|
709
719
|
reason?: string;
|
|
710
720
|
};
|
|
711
721
|
|
|
722
|
+
declare const BEFORE_AFTER_OPTIONS: readonly [{
|
|
723
|
+
readonly label: "Blank";
|
|
724
|
+
readonly value: "";
|
|
725
|
+
}, {
|
|
726
|
+
readonly label: "AFTER FOOD";
|
|
727
|
+
readonly value: "AFTER FOOD";
|
|
728
|
+
}, {
|
|
729
|
+
readonly label: "BEFORE FOOD";
|
|
730
|
+
readonly value: "BEFORE FOOD";
|
|
731
|
+
}, {
|
|
732
|
+
readonly label: "WITH FOOD";
|
|
733
|
+
readonly value: "WITH FOOD";
|
|
734
|
+
}, {
|
|
735
|
+
readonly label: "SINGLE DOSE";
|
|
736
|
+
readonly value: "SINGLE DOSE";
|
|
737
|
+
}, {
|
|
738
|
+
readonly label: "BED TIME";
|
|
739
|
+
readonly value: "BED TIME";
|
|
740
|
+
}, {
|
|
741
|
+
readonly label: "EMPTY STOMACH";
|
|
742
|
+
readonly value: "EMPTY STOMACH";
|
|
743
|
+
}, {
|
|
744
|
+
readonly label: "LOCAL APPLICATION";
|
|
745
|
+
readonly value: "LOCAL APPLICATION";
|
|
746
|
+
}, {
|
|
747
|
+
readonly label: "STAT";
|
|
748
|
+
readonly value: "STAT";
|
|
749
|
+
}, {
|
|
750
|
+
readonly label: "INHALATION";
|
|
751
|
+
readonly value: "INHALATION";
|
|
752
|
+
}];
|
|
753
|
+
type BeforeAfterOption = (typeof BEFORE_AFTER_OPTIONS)[number]['value'];
|
|
712
754
|
type MedicationSearchResult = {
|
|
713
755
|
id: string;
|
|
714
756
|
name: string;
|
|
@@ -724,7 +766,7 @@ type Medication = {
|
|
|
724
766
|
is_custom: boolean;
|
|
725
767
|
duration_value: string;
|
|
726
768
|
duration_unit: 'days' | 'weeks' | 'months';
|
|
727
|
-
before_after:
|
|
769
|
+
before_after: BeforeAfterOption;
|
|
728
770
|
morning: string;
|
|
729
771
|
afternoon: string;
|
|
730
772
|
night: string;
|
|
@@ -818,4 +860,4 @@ declare const SmartTextareaWidget: React.FC<{
|
|
|
818
860
|
fieldId: string;
|
|
819
861
|
}>;
|
|
820
862
|
|
|
821
|
-
export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type MatchedCondition, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SumComputation, type TextFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
|
|
863
|
+
export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type MatchedCondition, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SumComputation, type TextFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
|