@medplum/react 3.2.4 → 3.2.5

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.
@@ -797,7 +797,20 @@ export declare interface MedplumProviderProps {
797
797
 
798
798
  export declare const MemoizedFhirPathTable: MemoExoticComponent<typeof FhirPathTable>;
799
799
 
800
- export declare const MemoizedSearchControl: MemoExoticComponent<typeof SearchControl>;
800
+ /**
801
+ * @deprecated
802
+ *
803
+ * The memoization `MemoizedSearchControl` provides has been merged into `SearchControl`. Previously the memoization was done via HOC but
804
+ * it was proven that this wasn't effective for a large number of use cases, especially when:
805
+ * 1. `search` was an inline static object, which would trigger the memo to recompute on every re-render of the parent component
806
+ * 2. Any of the callbacks, such as `onClick` were not memoized via `useCallback`, which would result in the recomputation as well
807
+ *
808
+ * Scenario 1 also retriggered the effect that runs `loadResults` on change of the `search`, which was less than desirable.
809
+ *
810
+ * The memoization is now accomplished via checking deep equality of the incoming `search` prop in the body of the component, and setting a memoized
811
+ * state whenever the incoming and current memoized value are not deeply equal. See: https://github.com/medplum/medplum/pull/5023
812
+ */
813
+ export declare const MemoizedSearchControl: typeof SearchControl;
801
814
 
802
815
  export declare function MoneyDisplay(props: MoneyDisplayProps): JSX.Element | null;
803
816
 
@@ -948,8 +961,11 @@ export declare interface QuestionnaireFormProps {
948
961
  readonly questionnaire: Questionnaire | Reference<Questionnaire>;
949
962
  readonly subject?: Reference;
950
963
  readonly encounter?: Reference<Encounter>;
964
+ readonly disablePagination?: boolean;
965
+ readonly excludeButtons?: boolean;
951
966
  readonly submitButtonText?: string;
952
- readonly onSubmit: (response: QuestionnaireResponse) => void;
967
+ readonly onChange?: (response: QuestionnaireResponse) => void;
968
+ readonly onSubmit?: (response: QuestionnaireResponse) => void;
953
969
  }
954
970
 
955
971
  export declare enum QuestionnaireItemType {
@@ -1147,6 +1163,7 @@ export declare interface ResourceInputProps<T extends Resource = Resource> {
1147
1163
  readonly placeholder?: string;
1148
1164
  readonly loadOnFocus?: boolean;
1149
1165
  readonly required?: boolean;
1166
+ readonly itemComponent?: (props: AsyncAutocompleteOption<T>) => JSX.Element | ReactNode;
1150
1167
  readonly onChange?: (value: T | undefined) => void;
1151
1168
  readonly disabled?: boolean;
1152
1169
  }
@@ -797,7 +797,20 @@ export declare interface MedplumProviderProps {
797
797
 
798
798
  export declare const MemoizedFhirPathTable: MemoExoticComponent<typeof FhirPathTable>;
799
799
 
800
- export declare const MemoizedSearchControl: MemoExoticComponent<typeof SearchControl>;
800
+ /**
801
+ * @deprecated
802
+ *
803
+ * The memoization `MemoizedSearchControl` provides has been merged into `SearchControl`. Previously the memoization was done via HOC but
804
+ * it was proven that this wasn't effective for a large number of use cases, especially when:
805
+ * 1. `search` was an inline static object, which would trigger the memo to recompute on every re-render of the parent component
806
+ * 2. Any of the callbacks, such as `onClick` were not memoized via `useCallback`, which would result in the recomputation as well
807
+ *
808
+ * Scenario 1 also retriggered the effect that runs `loadResults` on change of the `search`, which was less than desirable.
809
+ *
810
+ * The memoization is now accomplished via checking deep equality of the incoming `search` prop in the body of the component, and setting a memoized
811
+ * state whenever the incoming and current memoized value are not deeply equal. See: https://github.com/medplum/medplum/pull/5023
812
+ */
813
+ export declare const MemoizedSearchControl: typeof SearchControl;
801
814
 
802
815
  export declare function MoneyDisplay(props: MoneyDisplayProps): JSX.Element | null;
803
816
 
@@ -948,8 +961,11 @@ export declare interface QuestionnaireFormProps {
948
961
  readonly questionnaire: Questionnaire | Reference<Questionnaire>;
949
962
  readonly subject?: Reference;
950
963
  readonly encounter?: Reference<Encounter>;
964
+ readonly disablePagination?: boolean;
965
+ readonly excludeButtons?: boolean;
951
966
  readonly submitButtonText?: string;
952
- readonly onSubmit: (response: QuestionnaireResponse) => void;
967
+ readonly onChange?: (response: QuestionnaireResponse) => void;
968
+ readonly onSubmit?: (response: QuestionnaireResponse) => void;
953
969
  }
954
970
 
955
971
  export declare enum QuestionnaireItemType {
@@ -1147,6 +1163,7 @@ export declare interface ResourceInputProps<T extends Resource = Resource> {
1147
1163
  readonly placeholder?: string;
1148
1164
  readonly loadOnFocus?: boolean;
1149
1165
  readonly required?: boolean;
1166
+ readonly itemComponent?: (props: AsyncAutocompleteOption<T>) => JSX.Element | ReactNode;
1150
1167
  readonly onChange?: (value: T | undefined) => void;
1151
1168
  readonly disabled?: boolean;
1152
1169
  }