@medplum/react 5.1.7 → 5.1.9
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/cjs/index.cjs +6 -6
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/index.d.ts +42 -0
- package/dist/esm/index.d.ts +42 -0
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +22 -27
package/dist/cjs/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type { ErrorInfo } from 'react';
|
|
|
36
36
|
import type { ExtendedInternalSchemaElement } from '@medplum/core';
|
|
37
37
|
import type { ExtractResource } from '@medplum/fhirtypes';
|
|
38
38
|
import type { Filter } from '@medplum/core';
|
|
39
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
39
40
|
import { getPreferredPharmaciesFromPatient } from '@medplum/core';
|
|
40
41
|
import type { HumanName } from '@medplum/fhirtypes';
|
|
41
42
|
import type { HumanNameFormatOptions } from '@medplum/core';
|
|
@@ -83,6 +84,7 @@ import type { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
|
|
|
83
84
|
import type { Range as Range_2 } from '@medplum/fhirtypes';
|
|
84
85
|
import type { Ratio } from '@medplum/fhirtypes';
|
|
85
86
|
import type { ReactNode } from 'react';
|
|
87
|
+
import { RefAttributes } from 'react';
|
|
86
88
|
import type { Reference } from '@medplum/fhirtypes';
|
|
87
89
|
import { removePreferredPharmacyFromPatient } from '@medplum/core';
|
|
88
90
|
import type { RequestGroup } from '@medplum/fhirtypes';
|
|
@@ -523,6 +525,8 @@ export declare interface CodingInputProps extends Omit<ValueSetAutocompleteProps
|
|
|
523
525
|
readonly response?: QuestionnaireResponseItem;
|
|
524
526
|
}
|
|
525
527
|
|
|
528
|
+
export declare function codingToValueSetElement(coding: Coding): ValueSetExpansionContains;
|
|
529
|
+
|
|
526
530
|
export declare type Command<T = string> = {
|
|
527
531
|
command: string;
|
|
528
532
|
value?: T;
|
|
@@ -618,6 +622,12 @@ export declare interface DateTimeInputProps extends PrimitiveTypeInputProps {
|
|
|
618
622
|
readonly onChange?: (value: string) => void;
|
|
619
623
|
}
|
|
620
624
|
|
|
625
|
+
/**
|
|
626
|
+
* Default item component for resource autocomplete inputs.
|
|
627
|
+
* Displays the resource avatar, display name, and birth date or ID.
|
|
628
|
+
*/
|
|
629
|
+
export declare const DefaultResourceItemComponent: ForwardRefExoticComponent<AsyncAutocompleteOption<Resource> & RefAttributes<HTMLDivElement>>;
|
|
630
|
+
|
|
621
631
|
export declare function DefaultResourceTimeline(props: DefaultResourceTimelineProps): JSX.Element;
|
|
622
632
|
|
|
623
633
|
export declare interface DefaultResourceTimelineProps extends Pick<ResourceTimelineProps<Resource>, 'getMenu'> {
|
|
@@ -1094,6 +1104,29 @@ export declare interface MoneyInputProps extends ComplexTypeInputProps<Money> {
|
|
|
1094
1104
|
readonly placeholder?: string;
|
|
1095
1105
|
}
|
|
1096
1106
|
|
|
1107
|
+
export declare function MultiResourceInput<T extends Resource = Resource>(props: MultiResourceInputProps<T>): JSX.Element | null;
|
|
1108
|
+
|
|
1109
|
+
export declare interface MultiResourceInputProps<T extends Resource = Resource> {
|
|
1110
|
+
readonly resourceType: T['resourceType'];
|
|
1111
|
+
readonly name: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* Initial selected values. Each entry may be a full resource or a reference that will be
|
|
1114
|
+
* resolved on mount. Treated as uncontrolled — changes after mount are ignored.
|
|
1115
|
+
*/
|
|
1116
|
+
readonly defaultValue?: (T | Reference<T>)[];
|
|
1117
|
+
readonly searchCriteria?: Record<string, string>;
|
|
1118
|
+
readonly placeholder?: string;
|
|
1119
|
+
readonly required?: boolean;
|
|
1120
|
+
readonly itemComponent?: (props: AsyncAutocompleteOption<T>) => JSX.Element | ReactNode;
|
|
1121
|
+
/** Called whenever the selection changes. Receives the full array of selected resources. */
|
|
1122
|
+
readonly onChange?: (value: T[]) => void;
|
|
1123
|
+
readonly disabled?: boolean;
|
|
1124
|
+
readonly label?: AsyncAutocompleteProps<T>['label'];
|
|
1125
|
+
readonly error?: AsyncAutocompleteProps<T>['error'];
|
|
1126
|
+
/** Maximum number of resources that can be selected. Defaults to uncapped. */
|
|
1127
|
+
readonly maxValues?: number;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1097
1130
|
export declare function Navbar(props: NavbarProps): JSX.Element;
|
|
1098
1131
|
|
|
1099
1132
|
export declare interface NavbarLink {
|
|
@@ -1683,8 +1716,15 @@ export declare interface ResourceHistoryTableProps {
|
|
|
1683
1716
|
readonly id?: string;
|
|
1684
1717
|
}
|
|
1685
1718
|
|
|
1719
|
+
/**
|
|
1720
|
+
* @param props - The props for the ResourceInput component.
|
|
1721
|
+
* @returns The ResourceInput component.
|
|
1722
|
+
*/
|
|
1686
1723
|
export declare function ResourceInput<T extends Resource = Resource>(props: ResourceInputProps<T>): JSX.Element | null;
|
|
1687
1724
|
|
|
1725
|
+
/**
|
|
1726
|
+
* @deprecated Use MultiResourceInput instead, which supports multiple default and selected values.
|
|
1727
|
+
*/
|
|
1688
1728
|
export declare interface ResourceInputProps<T extends Resource = Resource> {
|
|
1689
1729
|
readonly resourceType: T['resourceType'];
|
|
1690
1730
|
readonly name: string;
|
|
@@ -2401,6 +2441,8 @@ export declare interface ValueSetAutocompleteProps extends Omit<AsyncAutocomplet
|
|
|
2401
2441
|
readonly withHelpText?: boolean;
|
|
2402
2442
|
}
|
|
2403
2443
|
|
|
2444
|
+
export declare function valueSetElementToCoding(element: ValueSetExpansionContains): Coding;
|
|
2445
|
+
|
|
2404
2446
|
/** Vitals section — searches for Observation resources with category vital-signs. */
|
|
2405
2447
|
export declare const VitalsSection: PatientSummarySectionConfig;
|
|
2406
2448
|
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type { ErrorInfo } from 'react';
|
|
|
36
36
|
import type { ExtendedInternalSchemaElement } from '@medplum/core';
|
|
37
37
|
import type { ExtractResource } from '@medplum/fhirtypes';
|
|
38
38
|
import type { Filter } from '@medplum/core';
|
|
39
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
39
40
|
import { getPreferredPharmaciesFromPatient } from '@medplum/core';
|
|
40
41
|
import type { HumanName } from '@medplum/fhirtypes';
|
|
41
42
|
import type { HumanNameFormatOptions } from '@medplum/core';
|
|
@@ -83,6 +84,7 @@ import type { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
|
|
|
83
84
|
import type { Range as Range_2 } from '@medplum/fhirtypes';
|
|
84
85
|
import type { Ratio } from '@medplum/fhirtypes';
|
|
85
86
|
import type { ReactNode } from 'react';
|
|
87
|
+
import { RefAttributes } from 'react';
|
|
86
88
|
import type { Reference } from '@medplum/fhirtypes';
|
|
87
89
|
import { removePreferredPharmacyFromPatient } from '@medplum/core';
|
|
88
90
|
import type { RequestGroup } from '@medplum/fhirtypes';
|
|
@@ -523,6 +525,8 @@ export declare interface CodingInputProps extends Omit<ValueSetAutocompleteProps
|
|
|
523
525
|
readonly response?: QuestionnaireResponseItem;
|
|
524
526
|
}
|
|
525
527
|
|
|
528
|
+
export declare function codingToValueSetElement(coding: Coding): ValueSetExpansionContains;
|
|
529
|
+
|
|
526
530
|
export declare type Command<T = string> = {
|
|
527
531
|
command: string;
|
|
528
532
|
value?: T;
|
|
@@ -618,6 +622,12 @@ export declare interface DateTimeInputProps extends PrimitiveTypeInputProps {
|
|
|
618
622
|
readonly onChange?: (value: string) => void;
|
|
619
623
|
}
|
|
620
624
|
|
|
625
|
+
/**
|
|
626
|
+
* Default item component for resource autocomplete inputs.
|
|
627
|
+
* Displays the resource avatar, display name, and birth date or ID.
|
|
628
|
+
*/
|
|
629
|
+
export declare const DefaultResourceItemComponent: ForwardRefExoticComponent<AsyncAutocompleteOption<Resource> & RefAttributes<HTMLDivElement>>;
|
|
630
|
+
|
|
621
631
|
export declare function DefaultResourceTimeline(props: DefaultResourceTimelineProps): JSX.Element;
|
|
622
632
|
|
|
623
633
|
export declare interface DefaultResourceTimelineProps extends Pick<ResourceTimelineProps<Resource>, 'getMenu'> {
|
|
@@ -1094,6 +1104,29 @@ export declare interface MoneyInputProps extends ComplexTypeInputProps<Money> {
|
|
|
1094
1104
|
readonly placeholder?: string;
|
|
1095
1105
|
}
|
|
1096
1106
|
|
|
1107
|
+
export declare function MultiResourceInput<T extends Resource = Resource>(props: MultiResourceInputProps<T>): JSX.Element | null;
|
|
1108
|
+
|
|
1109
|
+
export declare interface MultiResourceInputProps<T extends Resource = Resource> {
|
|
1110
|
+
readonly resourceType: T['resourceType'];
|
|
1111
|
+
readonly name: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* Initial selected values. Each entry may be a full resource or a reference that will be
|
|
1114
|
+
* resolved on mount. Treated as uncontrolled — changes after mount are ignored.
|
|
1115
|
+
*/
|
|
1116
|
+
readonly defaultValue?: (T | Reference<T>)[];
|
|
1117
|
+
readonly searchCriteria?: Record<string, string>;
|
|
1118
|
+
readonly placeholder?: string;
|
|
1119
|
+
readonly required?: boolean;
|
|
1120
|
+
readonly itemComponent?: (props: AsyncAutocompleteOption<T>) => JSX.Element | ReactNode;
|
|
1121
|
+
/** Called whenever the selection changes. Receives the full array of selected resources. */
|
|
1122
|
+
readonly onChange?: (value: T[]) => void;
|
|
1123
|
+
readonly disabled?: boolean;
|
|
1124
|
+
readonly label?: AsyncAutocompleteProps<T>['label'];
|
|
1125
|
+
readonly error?: AsyncAutocompleteProps<T>['error'];
|
|
1126
|
+
/** Maximum number of resources that can be selected. Defaults to uncapped. */
|
|
1127
|
+
readonly maxValues?: number;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1097
1130
|
export declare function Navbar(props: NavbarProps): JSX.Element;
|
|
1098
1131
|
|
|
1099
1132
|
export declare interface NavbarLink {
|
|
@@ -1683,8 +1716,15 @@ export declare interface ResourceHistoryTableProps {
|
|
|
1683
1716
|
readonly id?: string;
|
|
1684
1717
|
}
|
|
1685
1718
|
|
|
1719
|
+
/**
|
|
1720
|
+
* @param props - The props for the ResourceInput component.
|
|
1721
|
+
* @returns The ResourceInput component.
|
|
1722
|
+
*/
|
|
1686
1723
|
export declare function ResourceInput<T extends Resource = Resource>(props: ResourceInputProps<T>): JSX.Element | null;
|
|
1687
1724
|
|
|
1725
|
+
/**
|
|
1726
|
+
* @deprecated Use MultiResourceInput instead, which supports multiple default and selected values.
|
|
1727
|
+
*/
|
|
1688
1728
|
export declare interface ResourceInputProps<T extends Resource = Resource> {
|
|
1689
1729
|
readonly resourceType: T['resourceType'];
|
|
1690
1730
|
readonly name: string;
|
|
@@ -2401,6 +2441,8 @@ export declare interface ValueSetAutocompleteProps extends Omit<AsyncAutocomplet
|
|
|
2401
2441
|
readonly withHelpText?: boolean;
|
|
2402
2442
|
}
|
|
2403
2443
|
|
|
2444
|
+
export declare function valueSetElementToCoding(element: ValueSetExpansionContains): Coding;
|
|
2445
|
+
|
|
2404
2446
|
/** Vitals section — searches for Observation resources with category vital-signs. */
|
|
2405
2447
|
export declare const VitalsSection: PatientSummarySectionConfig;
|
|
2406
2448
|
|