dfh-ui-library 1.13.137 → 1.13.138

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 (46) hide show
  1. package/dist/cjs/index.css +1 -1
  2. package/dist/cjs/index.css.map +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/types/components/Media/LetterFormBuilder/CustomField.d.ts +24 -0
  6. package/dist/cjs/types/components/Media/LetterFormBuilder/FormGenerator.d.ts +4 -0
  7. package/dist/cjs/types/components/Media/LetterFormBuilder/LetterFormBuilder.d.ts +4 -0
  8. package/dist/cjs/types/components/Media/LetterFormBuilder/LetterGenerator.d.ts +4 -0
  9. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/IComponent.d.ts +5 -0
  10. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/IFormGeneratorProps.d.ts +21 -0
  11. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/ILetterGeneratorProps.d.ts +20 -0
  12. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/ILetterProps.d.ts +18 -0
  13. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/ILetterSchema.d.ts +54 -0
  14. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/IQuestionSchema.d.ts +50 -0
  15. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/IQuestionValidationSchema.d.ts +18 -0
  16. package/dist/cjs/types/components/Media/LetterFormBuilder/interfaces/ISchema.d.ts +32 -0
  17. package/dist/cjs/types/components/Media/LetterFormBuilder/useInitialValues.d.ts +3 -0
  18. package/dist/cjs/types/components/Media/LetterFormBuilder/useLetterSchemaAdapter.d.ts +4 -0
  19. package/dist/cjs/types/components/Media/LetterFormBuilder/useOrderSchema.d.ts +3 -0
  20. package/dist/cjs/types/components/Media/LetterFormBuilder/util.d.ts +39 -0
  21. package/dist/cjs/types/components/Media/LetterFormBuilder/validationHelper.d.ts +7 -0
  22. package/dist/cjs/types/components/index.d.ts +1 -1
  23. package/dist/esm/index.css +1 -1
  24. package/dist/esm/index.css.map +1 -1
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/types/components/Media/LetterFormBuilder/CustomField.d.ts +24 -0
  28. package/dist/esm/types/components/Media/LetterFormBuilder/FormGenerator.d.ts +4 -0
  29. package/dist/esm/types/components/Media/LetterFormBuilder/LetterFormBuilder.d.ts +4 -0
  30. package/dist/esm/types/components/Media/LetterFormBuilder/LetterGenerator.d.ts +4 -0
  31. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/IComponent.d.ts +5 -0
  32. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/IFormGeneratorProps.d.ts +21 -0
  33. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/ILetterGeneratorProps.d.ts +20 -0
  34. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/ILetterProps.d.ts +18 -0
  35. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/ILetterSchema.d.ts +54 -0
  36. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/IQuestionSchema.d.ts +50 -0
  37. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/IQuestionValidationSchema.d.ts +18 -0
  38. package/dist/esm/types/components/Media/LetterFormBuilder/interfaces/ISchema.d.ts +32 -0
  39. package/dist/esm/types/components/Media/LetterFormBuilder/useInitialValues.d.ts +3 -0
  40. package/dist/esm/types/components/Media/LetterFormBuilder/useLetterSchemaAdapter.d.ts +4 -0
  41. package/dist/esm/types/components/Media/LetterFormBuilder/useOrderSchema.d.ts +3 -0
  42. package/dist/esm/types/components/Media/LetterFormBuilder/util.d.ts +39 -0
  43. package/dist/esm/types/components/Media/LetterFormBuilder/validationHelper.d.ts +7 -0
  44. package/dist/esm/types/components/index.d.ts +1 -1
  45. package/dist/index.d.ts +3 -1
  46. package/package.json +2 -1
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ interface CustomFieldProps {
3
+ id: string;
4
+ name: string;
5
+ label?: string;
6
+ labelName?: string;
7
+ tooltip?: string;
8
+ component: any;
9
+ error?: string;
10
+ type?: string;
11
+ checked?: boolean;
12
+ options?: any[];
13
+ onChange?: any;
14
+ onBlur?: any;
15
+ onSelect?: any;
16
+ onMultiSelect?: any;
17
+ secondaryComponentsVisible?: boolean;
18
+ inputObjects?: any[];
19
+ selected?: any;
20
+ viewMode?: boolean;
21
+ previousData?: any;
22
+ }
23
+ declare const CustomField: React.FC<CustomFieldProps>;
24
+ export default CustomField;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IFormGeneratorProps } from './interfaces/IFormGeneratorProps';
3
+ declare const FormGenerator: ({ schema, currentStepNumber, components, handleSubmit, SubmitButton, ResetButton, viewMode, isLetterGenerator, ...libProps }: IFormGeneratorProps) => React.JSX.Element;
4
+ export default FormGenerator;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { LetterProps } from './interfaces/ILetterProps';
3
+ declare function LetterFormBuilder(props: LetterProps): React.JSX.Element;
4
+ export default LetterFormBuilder;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ILetterGeneratorProps } from './interfaces/ILetterGeneratorProps';
3
+ declare const LetterGenerator: (props: ILetterGeneratorProps) => React.JSX.Element | null;
4
+ export default LetterGenerator;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface IComponent {
3
+ id: string;
4
+ component: React.FC<any>;
5
+ }
@@ -0,0 +1,21 @@
1
+ import { FormikContextType } from 'formik';
2
+ import { IComponent } from './IComponent';
3
+ import { ISchema } from './ISchema';
4
+ export interface IFormGeneratorProps {
5
+ schema: ISchema;
6
+ currentStepNumber?: number;
7
+ components: IComponent[];
8
+ handleSubmit?: (data: any) => void;
9
+ handleChanges?: (data: any) => void;
10
+ formRef?: React.MutableRefObject<FormikContextType<any> | null>;
11
+ showDefaultSubmitButton?: boolean;
12
+ showDefaultResetButton?: boolean;
13
+ SubmitButton?: React.FC<any>;
14
+ ResetButton?: React.FC<any>;
15
+ defaultBttnClass?: string;
16
+ bttnGroupClass?: string;
17
+ bttnDivClass?: string;
18
+ viewMode?: boolean;
19
+ showPreviousData?: boolean;
20
+ isLetterGenerator?: boolean;
21
+ }
@@ -0,0 +1,20 @@
1
+ import { FormikContextType } from 'formik';
2
+ import { IComponent } from './IComponent';
3
+ import { ILetterSchema } from './ILetterSchema';
4
+ export interface ILetterGeneratorProps {
5
+ schema: ILetterSchema;
6
+ currentStepNumber?: number;
7
+ components: IComponent[];
8
+ handleSubmit?: (data: any) => void;
9
+ handleChanges?: (data: any) => void;
10
+ formRef?: React.MutableRefObject<FormikContextType<any> | null>;
11
+ showDefaultSubmitButton?: boolean;
12
+ showDefaultResetButton?: boolean;
13
+ SubmitButton?: React.FC<any>;
14
+ ResetButton?: React.FC<any>;
15
+ defaultBttnClass?: string;
16
+ bttnGroupClass?: string;
17
+ bttnDivClass?: string;
18
+ viewMode?: boolean;
19
+ showPreviousData?: boolean;
20
+ }
@@ -0,0 +1,18 @@
1
+ import { ILetterSchema } from "./ILetterSchema";
2
+ type LetterBaseProps = {
3
+ schema?: ILetterSchema;
4
+ patientName?: string;
5
+ navigateToView?: (isCancel?: boolean) => void;
6
+ receivedData?: any;
7
+ backToView?: (req: any) => void;
8
+ varientId: string;
9
+ varient: string;
10
+ };
11
+ export type LetterProps = LetterBaseProps & ({
12
+ isReleaseInfo: false;
13
+ letterActionXHR: (req: any, action: 'save' | 'preview') => Promise<any>;
14
+ } | {
15
+ isReleaseInfo: true;
16
+ updateLetterSchemaValuesForRInfo: (req: any) => Promise<any>;
17
+ });
18
+ export {};
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ export interface ILetterSchema {
3
+ _id: string;
4
+ title: string;
5
+ spacing: string;
6
+ formRows: ILetterSchemaRow[];
7
+ jsonSchema: any;
8
+ jsonConfig: any;
9
+ }
10
+ export interface ILetterSchemaRow {
11
+ _id: string;
12
+ rowOrder: number;
13
+ fieldList: ILetterField[];
14
+ rowType?: string;
15
+ subTitle?: string;
16
+ subTitleType?: string;
17
+ rowClass?: string;
18
+ }
19
+ export interface ILetterField {
20
+ _id: string;
21
+ columnOrder: number;
22
+ width: string;
23
+ fieldKey: string;
24
+ fieldType: string;
25
+ preFilledKey: string;
26
+ title: string;
27
+ isValidationEnabled: boolean;
28
+ validation: ILetterFieldValidation[];
29
+ selected: ISelected;
30
+ options: IMultiSelectOption[];
31
+ className?: string;
32
+ }
33
+ export interface IMultiSelectOption {
34
+ id: string;
35
+ value: string;
36
+ displayName?: string;
37
+ isSelected?: boolean;
38
+ }
39
+ export interface IMultiSelectSelectedValues {
40
+ value: IMultiSelectOption[];
41
+ }
42
+ export interface ILetterFieldValidation {
43
+ validationType: string;
44
+ message: string;
45
+ }
46
+ export interface ISelected {
47
+ value: string | Date;
48
+ valueRef?: string;
49
+ isChecked?: boolean;
50
+ }
51
+ export interface IComponent {
52
+ id: string;
53
+ component: React.FC<any>;
54
+ }
@@ -0,0 +1,50 @@
1
+ import { IQuestionValidationSchema } from './IQuestionValidationSchema';
2
+ export interface IQuestionSchema {
3
+ _id: string;
4
+ columnOrder: number;
5
+ columnClass: string;
6
+ visibleIf?: string;
7
+ question: IQuestion;
8
+ }
9
+ export interface IQuestion {
10
+ _id: string;
11
+ filedType?: string | null;
12
+ fieldName?: string;
13
+ component: string;
14
+ title: string;
15
+ placeholder?: string | null;
16
+ selected: ISelectedValue;
17
+ answers?: {
18
+ id: string;
19
+ value: string;
20
+ points?: number;
21
+ }[];
22
+ isValidationEnabled: boolean;
23
+ answerPrevData?: {
24
+ answerLabel: string;
25
+ lastEditedDate: string;
26
+ };
27
+ questionValidation?: IQuestionValidationSchema;
28
+ componentMetaData?: {
29
+ secondaryComponents?: {
30
+ condition?: string;
31
+ inputs?: [
32
+ {
33
+ id?: string;
34
+ name?: string;
35
+ placeholder?: string;
36
+ isRequired?: boolean;
37
+ }
38
+ ];
39
+ };
40
+ };
41
+ tooltip?: string;
42
+ }
43
+ export interface ISelectedValue {
44
+ value?: string | null | Date | boolean;
45
+ additionalValues?: object | null;
46
+ valueRef?: string;
47
+ answerPrevData?: object | null;
48
+ isChecked?: boolean | undefined;
49
+ points?: number;
50
+ }
@@ -0,0 +1,18 @@
1
+ export declare enum ValidationType {
2
+ NONE = "NONE",
3
+ REGEX = "REGEX",
4
+ FUNCTION = "FUNCTION"
5
+ }
6
+ export declare enum ValidationFuncName {
7
+ TEST = "TEST"
8
+ }
9
+ export interface IQuestionValidationSchema {
10
+ validationType: ValidationType;
11
+ isRequired: boolean;
12
+ isRequiredErrorMsg?: string;
13
+ regex?: RegExp;
14
+ regexErrorMsg?: string;
15
+ validationFuncName?: ValidationFuncName;
16
+ functionParamList?: any[];
17
+ functionErrorMsg?: string;
18
+ }
@@ -0,0 +1,32 @@
1
+ import { IQuestionSchema } from './IQuestionSchema';
2
+ export interface ISchema {
3
+ _id: string;
4
+ schemaSteps: ISchemaStep[];
5
+ jsonSchema?: any;
6
+ jsonConfig?: any;
7
+ }
8
+ export interface ISchemaStep {
9
+ _id: string;
10
+ stepNumber: number;
11
+ disclaimer?: string;
12
+ surveryProgress?: SurveryProgressEnum;
13
+ domain: string;
14
+ mainTitle: string;
15
+ contentTitle: string;
16
+ visibleIf?: string;
17
+ formRows: IFormRow[];
18
+ }
19
+ export declare enum SurveryProgressEnum {
20
+ NOTSTARTED = "NOTSTARTED",
21
+ INPROGRESS = "INPROGRESS",
22
+ COMPLETED = "COMPLETED"
23
+ }
24
+ export interface IFormRow {
25
+ _id: string;
26
+ rowOrder: number;
27
+ rowClass: string;
28
+ questionList: IQuestionSchema[];
29
+ component?: string;
30
+ subTitle?: string;
31
+ subTitleType?: string;
32
+ }
@@ -0,0 +1,3 @@
1
+ import { ISchemaStep } from './interfaces/ISchema';
2
+ declare function useInitialValues(): [object, (schemas: ISchemaStep[]) => void];
3
+ export default useInitialValues;
@@ -0,0 +1,4 @@
1
+ import { ISchema } from './interfaces/ISchema';
2
+ import { ILetterSchema } from './interfaces/ILetterSchema';
3
+ declare function useLetterSchemaAdapter(): [ISchema | undefined, (letterSchema: ILetterSchema) => void];
4
+ export default useLetterSchemaAdapter;
@@ -0,0 +1,3 @@
1
+ import { ISchemaStep } from './interfaces/ISchema';
2
+ declare function useOrderSchema(schemaArray: ISchemaStep[]): [ISchemaStep[], (schemaArray: ISchemaStep[]) => void];
3
+ export default useOrderSchema;
@@ -0,0 +1,39 @@
1
+ import * as Yup from 'yup';
2
+ import { ILetterSchema } from './interfaces/ILetterSchema';
3
+ import { IQuestionSchema, ISelectedValue } from './interfaces/IQuestionSchema';
4
+ type NestedFieldShape<T> = {
5
+ value: T;
6
+ };
7
+ export declare const parseString: (inputString: string) => {
8
+ [key: string]: string;
9
+ };
10
+ export declare const isToday: (dateStr: string) => boolean;
11
+ export declare const getTimezoneData: () => {
12
+ hours: number;
13
+ mins: number;
14
+ };
15
+ export declare const castToUTCDate: (date: string | Date | number | null) => Date | null;
16
+ export declare const getLetterSchemaObject: (newSchema: ILetterSchema) => {
17
+ _id: string;
18
+ title: string;
19
+ spacing: string;
20
+ formRows: import("./interfaces/ILetterSchema").ILetterSchemaRow[];
21
+ jsonSchema: any;
22
+ jsonConfig: any;
23
+ } | null;
24
+ export declare function wrapSchemaForNestedValueFields<T extends Yup.AnyObject>(rawSchema: Yup.ObjectSchema<T>): Yup.ObjectSchema<Record<keyof T, Yup.ObjectSchema<NestedFieldShape<any>>>>;
25
+ export declare const getGapClass: (gap: string) => string;
26
+ export declare const decimalToFraction: (value: number) => string;
27
+ export declare const getTailwindWidthClass: (percentStr: string) => string;
28
+ export declare const getType: (type: string) => string;
29
+ export declare const isComponentVisible: (condition: string, values: {
30
+ [key: string]: ISelectedValue;
31
+ }) => boolean;
32
+ export declare const isRowVisible: (questionList: IQuestionSchema[], values: {
33
+ [key: string]: ISelectedValue;
34
+ }) => boolean;
35
+ export declare const letterComponentSchema: {
36
+ fieldId: number;
37
+ component: string;
38
+ }[];
39
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as Yup from 'yup';
2
+ type NestedFieldShape<T> = {
3
+ value: T;
4
+ };
5
+ export declare function wrapSchemaForNestedValueFields<T extends Yup.AnyObject>(rawSchema: Yup.ObjectSchema<T>): Yup.ObjectSchema<Record<keyof T, Yup.ObjectSchema<NestedFieldShape<any>>>>;
6
+ export declare const touchAllFields: (values: any) => any;
7
+ export {};
@@ -16,7 +16,7 @@ export { default as ImagePreview } from './ImagePreview';
16
16
  export { default as DatePicker } from './Datepicker';
17
17
  export * from './InputDatepicker';
18
18
  export { Row } from './core';
19
- export { PhoneNumberInput, PhoneNumberInput2, PhoneNumberInput3, } from './PhoneNumberInput';
19
+ export { PhoneNumberInput, PhoneNumberInput2, PhoneNumberInput3, PhoneNumberInput4, } from './PhoneNumberInput';
20
20
  export { Tooltip } from './Tooltip';
21
21
  export { default as DialogBox } from '../components/core/DialogBox';
22
22
  export { default as Modal } from '../components/Modal';