@medplum/react 3.1.6 → 3.1.8

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,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
 
3
+ import { AccessPolicyResource } from '@medplum/fhirtypes';
3
4
  import { Address } from '@medplum/fhirtypes';
4
5
  import { AnchorProps } from '@mantine/core';
5
6
  import { Annotation } from '@medplum/fhirtypes';
@@ -25,6 +26,7 @@ import { ElementDefinitionBinding } from '@medplum/fhirtypes';
25
26
  import { ElementDefinitionType } from '@medplum/fhirtypes';
26
27
  import { Encounter } from '@medplum/fhirtypes';
27
28
  import { ErrorInfo } from 'react';
29
+ import { ExtendedInternalSchemaElement } from '@medplum/core';
28
30
  import { ExtractResource } from '@medplum/fhirtypes';
29
31
  import { Filter } from '@medplum/core';
30
32
  import { HumanName } from '@medplum/fhirtypes';
@@ -181,10 +183,7 @@ export declare function addYesterdayFilter(definition: SearchRequest, field: str
181
183
 
182
184
  export declare function AnnotationInput(props: AnnotationInputProps): JSX.Element;
183
185
 
184
- export declare interface AnnotationInputProps {
185
- readonly name: string;
186
- readonly defaultValue?: Annotation;
187
- readonly onChange?: (value: Annotation) => void;
186
+ export declare interface AnnotationInputProps extends ComplexTypeInputProps<Annotation> {
188
187
  }
189
188
 
190
189
  export declare function AppShell(props: AppShellProps): JSX.Element;
@@ -246,6 +245,7 @@ export declare interface AttachmentArrayInputProps {
246
245
  readonly defaultValue?: Attachment[];
247
246
  readonly arrayElement?: boolean;
248
247
  readonly onChange?: (value: Attachment[]) => void;
248
+ readonly disabled?: boolean;
249
249
  }
250
250
 
251
251
  export declare function AttachmentButton(props: AttachmentButtonProps): JSX.Element;
@@ -257,8 +257,10 @@ export declare interface AttachmentButtonProps {
257
257
  readonly onUploadProgress?: (e: ProgressEvent) => void;
258
258
  readonly onUploadError?: (outcome: OperationOutcome) => void;
259
259
  children(props: {
260
+ disabled?: boolean;
260
261
  onClick(e: MouseEvent_2): void;
261
262
  }): ReactNode;
263
+ readonly disabled?: boolean;
262
264
  }
263
265
 
264
266
  export declare function AttachmentDisplay(props: AttachmentDisplayProps): JSX.Element | null;
@@ -270,9 +272,7 @@ export declare interface AttachmentDisplayProps {
270
272
 
271
273
  export declare function AttachmentInput(props: AttachmentInputProps): JSX.Element;
272
274
 
273
- export declare interface AttachmentInputProps {
274
- readonly name: string;
275
- readonly defaultValue?: Attachment;
275
+ export declare interface AttachmentInputProps extends ComplexTypeInputProps<Attachment> {
276
276
  readonly arrayElement?: boolean;
277
277
  readonly securityContext?: Reference;
278
278
  readonly onChange?: (value: Attachment | undefined) => void;
@@ -289,6 +289,10 @@ export declare interface BackboneElementDisplayProps {
289
289
  readonly link?: boolean;
290
290
  /** (optional) Profile URL of the structure definition represented by the backbone element */
291
291
  readonly profileUrl?: string;
292
+ /**
293
+ * (optional) If provided, inputs specified in `accessPolicyResource.hiddenFields` are not shown.
294
+ */
295
+ readonly accessPolicyResource?: AccessPolicyResource;
292
296
  }
293
297
 
294
298
  export declare function BackboneElementInput(props: BackboneElementInputProps): JSX.Element;
@@ -302,6 +306,11 @@ export declare interface BackboneElementInputProps extends BaseInputProps {
302
306
  readonly onChange?: (value: any) => void;
303
307
  /** (optional) Profile URL of the structure definition represented by the backbone element */
304
308
  readonly profileUrl?: string;
309
+ /**
310
+ * (optional) If provided, inputs specified in `accessPolicyResource.readonlyFields` are not editable
311
+ * and inputs specified in `accessPolicyResource.hiddenFields` are not shown.
312
+ */
313
+ readonly accessPolicyResource?: AccessPolicyResource;
305
314
  }
306
315
 
307
316
  export declare function BaseChat(props: BaseChatProps): JSX.Element | null;
@@ -361,6 +370,7 @@ export declare interface CheckboxFormSectionProps {
361
370
  readonly children?: ReactNode;
362
371
  readonly testId?: string;
363
372
  readonly fhirPath?: string;
373
+ readonly readonly?: boolean;
364
374
  }
365
375
 
366
376
  /**
@@ -386,8 +396,8 @@ export declare interface CodeableConceptDisplayProps {
386
396
 
387
397
  export declare function CodeableConceptInput(props: CodeableConceptInputProps): JSX.Element;
388
398
 
389
- export declare interface CodeableConceptInputProps extends Omit<ValueSetAutocompleteProps, 'name' | 'defaultValue' | 'onChange'>, ComplexTypeInputProps<CodeableConcept> {
390
- readonly onChange: ((value: CodeableConcept | undefined) => void) | undefined;
399
+ export declare interface CodeableConceptInputProps extends Omit<ValueSetAutocompleteProps, 'name' | 'defaultValue' | 'onChange' | 'disabled'>, ComplexTypeInputProps<CodeableConcept> {
400
+ readonly onChange?: (value: CodeableConcept | undefined) => void;
391
401
  }
392
402
 
393
403
  export declare function CodeInput(props: CodeInputProps): JSX.Element;
@@ -405,15 +415,14 @@ export declare interface CodingDisplayProps {
405
415
 
406
416
  export declare function CodingInput(props: CodingInputProps): JSX.Element;
407
417
 
408
- export declare interface CodingInputProps extends Omit<ValueSetAutocompleteProps, 'defaultValue' | 'onChange'> {
409
- readonly defaultValue?: Coding;
410
- readonly onChange?: (value: Coding | undefined) => void;
418
+ export declare interface CodingInputProps extends Omit<ValueSetAutocompleteProps, 'defaultValue' | 'onChange' | 'disabled' | 'name'>, ComplexTypeInputProps<Coding> {
411
419
  }
412
420
 
413
421
  export declare interface ComplexTypeInputProps<ValueType> extends BaseInputProps {
414
- name: string;
415
- defaultValue?: ValueType;
416
- onChange: ((value: ValueType, propName?: string) => void) | undefined;
422
+ readonly name: string;
423
+ readonly defaultValue?: ValueType;
424
+ readonly onChange?: (value: ValueType, propName?: string) => void;
425
+ readonly disabled?: boolean;
417
426
  }
418
427
 
419
428
  export declare function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null;
@@ -435,7 +444,7 @@ export declare interface ContactPointDisplayProps {
435
444
  export declare function ContactPointInput(props: ContactPointInputProps): JSX.Element;
436
445
 
437
446
  export declare type ContactPointInputProps = ComplexTypeInputProps<ContactPoint> & {
438
- readonly onChange: ((value: ContactPoint | undefined) => void) | undefined;
447
+ readonly onChange?: (value: ContactPoint | undefined) => void;
439
448
  };
440
449
 
441
450
  export declare function Container(props: ContainerProps): JSX.Element;
@@ -471,13 +480,11 @@ export declare function createScriptTag(src: string, onload?: () => void): void;
471
480
  */
472
481
  export declare function DateTimeInput(props: DateTimeInputProps): JSX.Element;
473
482
 
474
- export declare interface DateTimeInputProps {
475
- readonly name?: string;
483
+ export declare interface DateTimeInputProps extends PrimitiveTypeInputProps {
476
484
  readonly label?: string;
477
485
  readonly placeholder?: string;
478
486
  readonly defaultValue?: string;
479
487
  readonly autoFocus?: boolean;
480
- readonly required?: boolean;
481
488
  readonly outcome?: OperationOutcome;
482
489
  readonly onChange?: (value: string) => void;
483
490
  }
@@ -538,6 +545,7 @@ export declare interface ElementDefinitionTypeInputProps extends Pick<ResourcePr
538
545
  readonly min: number;
539
546
  readonly max: number;
540
547
  readonly binding: ElementDefinitionBinding | undefined;
548
+ readonly readOnly?: boolean;
541
549
  }
542
550
 
543
551
  export declare function EncounterTimeline(props: EncounterTimelineProps): JSX.Element;
@@ -615,6 +623,7 @@ export declare interface FormSectionProps {
615
623
  readonly testId?: string;
616
624
  readonly fhirPath?: string;
617
625
  readonly errorExpression?: string;
626
+ readonly readonly?: boolean;
618
627
  }
619
628
 
620
629
  export declare function getErrorsForInput(outcome: OperationOutcome | undefined, expression: string | undefined): string | undefined;
@@ -798,12 +807,9 @@ export declare interface MoneyDisplayProps {
798
807
 
799
808
  export declare function MoneyInput(props: MoneyInputProps): JSX.Element;
800
809
 
801
- export declare interface MoneyInputProps {
802
- readonly name: string;
810
+ export declare interface MoneyInputProps extends ComplexTypeInputProps<Money> {
803
811
  readonly label?: string;
804
812
  readonly placeholder?: string;
805
- readonly defaultValue?: Money;
806
- readonly onChange?: (value: Money) => void;
807
813
  }
808
814
 
809
815
  export declare function Navbar(props: NavbarProps): JSX.Element;
@@ -900,12 +906,13 @@ export declare interface PlanDefinitionBuilderProps {
900
906
  }
901
907
 
902
908
  export declare interface PrimitiveTypeInputProps {
903
- id: string;
904
- name: string;
905
- 'data-testid': string;
906
- defaultValue?: any;
907
- required: boolean;
908
- error: string | undefined;
909
+ readonly id?: string;
910
+ readonly name: string;
911
+ readonly 'data-testid'?: string;
912
+ readonly defaultValue?: any;
913
+ readonly required?: boolean;
914
+ readonly error?: string;
915
+ readonly disabled?: boolean;
909
916
  }
910
917
 
911
918
  export declare function QuantityDisplay(props: QuantityDisplayProps): JSX.Element | null;
@@ -916,12 +923,9 @@ export declare interface QuantityDisplayProps {
916
923
 
917
924
  export declare function QuantityInput(props: QuantityInputProps): JSX.Element;
918
925
 
919
- export declare interface QuantityInputProps {
920
- readonly name: string;
921
- readonly defaultValue?: Quantity;
926
+ export declare interface QuantityInputProps extends ComplexTypeInputProps<Quantity> {
922
927
  readonly autoFocus?: boolean;
923
928
  readonly required?: boolean;
924
- readonly onChange?: (value: Quantity) => void;
925
929
  readonly disableWheel?: boolean;
926
930
  }
927
931
 
@@ -977,10 +981,7 @@ export declare interface RangeDisplayProps {
977
981
  */
978
982
  export declare function RangeInput(props: RangeInputProps): JSX.Element;
979
983
 
980
- export declare interface RangeInputProps {
981
- readonly name: string;
982
- readonly defaultValue?: Range_2;
983
- readonly onChange?: (value: Range_2) => void;
984
+ export declare interface RangeInputProps extends ComplexTypeInputProps<Range_2> {
984
985
  }
985
986
 
986
987
  export declare const reactContext: Context<MedplumContext | undefined>;
@@ -1003,6 +1004,7 @@ export declare interface ReferenceInputProps {
1003
1004
  readonly autoFocus?: boolean;
1004
1005
  readonly required?: boolean;
1005
1006
  readonly onChange?: (value: Reference | undefined) => void;
1007
+ readonly disabled?: boolean;
1006
1008
  }
1007
1009
 
1008
1010
  export declare function ReferenceRangeEditor(props: ReferenceRangeEditorProps): JSX.Element;
@@ -1068,10 +1070,10 @@ export declare interface ResourceArrayDisplayProps {
1068
1070
  readonly includeDescriptionListEntry?: boolean;
1069
1071
  }
1070
1072
 
1071
- export declare function ResourceArrayInput(props: ResourceArrayInputProps): JSX.Element;
1073
+ export declare function ResourceArrayInput(props: ResourceArrayInputProps): JSX.Element | null;
1072
1074
 
1073
1075
  export declare interface ResourceArrayInputProps extends BaseInputProps {
1074
- readonly property: InternalSchemaElement;
1076
+ readonly property: ExtendedInternalSchemaElement;
1075
1077
  readonly name: string;
1076
1078
  readonly defaultValue?: any[];
1077
1079
  readonly indent?: boolean;
@@ -1140,6 +1142,7 @@ export declare interface ResourceInputProps<T extends Resource = Resource> {
1140
1142
  readonly loadOnFocus?: boolean;
1141
1143
  readonly required?: boolean;
1142
1144
  readonly onChange?: (value: T | undefined) => void;
1145
+ readonly disabled?: boolean;
1143
1146
  }
1144
1147
 
1145
1148
  export declare function ResourceName(props: ResourceNameProps): JSX.Element | null;
@@ -1175,12 +1178,12 @@ export declare interface ResourcePropertyDisplayProps {
1175
1178
  export declare function ResourcePropertyInput(props: ResourcePropertyInputProps): JSX.Element;
1176
1179
 
1177
1180
  export declare interface ResourcePropertyInputProps extends BaseInputProps {
1178
- readonly property: InternalSchemaElement;
1181
+ readonly property: ExtendedInternalSchemaElement;
1179
1182
  readonly name: string;
1180
1183
  readonly defaultPropertyType?: string | undefined;
1181
1184
  readonly defaultValue: any;
1182
1185
  readonly arrayElement?: boolean | undefined;
1183
- readonly onChange: ((value: any, propName?: string) => void) | undefined;
1186
+ readonly onChange?: (value: any, propName?: string) => void;
1184
1187
  }
1185
1188
 
1186
1189
  export declare function ResourceTable(props: ResourceTableProps): JSX.Element | null;
@@ -1444,10 +1447,8 @@ export declare interface TimelineProps {
1444
1447
 
1445
1448
  export declare function TimingInput(props: TimingInputProps): JSX.Element;
1446
1449
 
1447
- export declare interface TimingInputProps {
1448
- readonly name: string;
1449
- readonly defaultValue?: Timing;
1450
- readonly onChange?: (newValue: Timing) => void;
1450
+ export declare interface TimingInputProps extends ComplexTypeInputProps<Timing> {
1451
+ readonly defaultModalOpen?: boolean;
1451
1452
  }
1452
1453
 
1453
1454
  /**