@medplum/react 2.0.9 → 2.0.10

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.
@@ -1792,6 +1792,9 @@
1792
1792
  React.createElement(ResourcePropertyDisplay, { arrayElement: true, property: property, propertyType: propertyType, value: v, ignoreMissingValues: props.ignoreMissingValues, link: props.link }))))));
1793
1793
  }
1794
1794
 
1795
+ /**
1796
+ * Low-level component that renders a property from a given resource, given type information
1797
+ */
1795
1798
  function ResourcePropertyDisplay(props) {
1796
1799
  const { property, propertyType, value } = props;
1797
1800
  if (property?.max === '*' && !props.arrayElement) {
@@ -2059,6 +2062,9 @@
2059
2062
  display: input,
2060
2063
  };
2061
2064
  }
2065
+ /**
2066
+ * A low-level component to autocomplete based on a FHIR Valueset.
2067
+ */
2062
2068
  function ValueSetAutocomplete(props) {
2063
2069
  const medplum = useMedplum();
2064
2070
  const { elementDefinition, ...rest } = props;
@@ -2290,7 +2296,7 @@
2290
2296
  }
2291
2297
 
2292
2298
  function ExtensionInput(props) {
2293
- return (React.createElement(core$1.JsonInput, { id: props.name, name: props.name, "data-testid": "extension-input", defaultValue: core.stringify(props.defaultValue), onChange: (newValue) => {
2299
+ return (React.createElement(core$1.JsonInput, { id: props.name, name: props.name, "data-testid": "extension-input", defaultValue: core.stringify(props.defaultValue), deserialize: JSON.parse, onChange: (newValue) => {
2294
2300
  if (props.onChange) {
2295
2301
  props.onChange(JSON.parse(newValue));
2296
2302
  }
@@ -2335,11 +2341,11 @@
2335
2341
  });
2336
2342
  }
2337
2343
  return (React.createElement(core$1.Group, { spacing: "xs", grow: true, noWrap: true },
2338
- React.createElement(core$1.NativeSelect, { defaultValue: value?.use, "data-testid": "use", onChange: (e) => setUse(e.currentTarget.value), data: ['', 'temp', 'old', 'usual', 'official', 'nickname', 'anonymous', 'maiden'] }),
2339
- React.createElement(core$1.TextInput, { placeholder: "Prefix", defaultValue: value?.prefix?.join(' '), onChange: (e) => setPrefix(e.currentTarget.value) }),
2340
- React.createElement(core$1.TextInput, { placeholder: "Given", defaultValue: value?.given?.join(' '), onChange: (e) => setGiven(e.currentTarget.value) }),
2341
- React.createElement(core$1.TextInput, { placeholder: "Family", defaultValue: value?.family, onChange: (e) => setFamily(e.currentTarget.value) }),
2342
- React.createElement(core$1.TextInput, { placeholder: "Suffix", defaultValue: value?.suffix?.join(' '), onChange: (e) => setSuffix(e.currentTarget.value) })));
2344
+ React.createElement(core$1.NativeSelect, { defaultValue: value?.use, name: props.name + '-use', "data-testid": "use", onChange: (e) => setUse(e.currentTarget.value), data: ['', 'temp', 'old', 'usual', 'official', 'nickname', 'anonymous', 'maiden'] }),
2345
+ React.createElement(core$1.TextInput, { placeholder: "Prefix", name: props.name + '-prefix', defaultValue: value?.prefix?.join(' '), onChange: (e) => setPrefix(e.currentTarget.value) }),
2346
+ React.createElement(core$1.TextInput, { placeholder: "Given", name: props.name + '-given', defaultValue: value?.given?.join(' '), onChange: (e) => setGiven(e.currentTarget.value) }),
2347
+ React.createElement(core$1.TextInput, { name: props.name + '-family', placeholder: "Family", defaultValue: value?.family, onChange: (e) => setFamily(e.currentTarget.value) }),
2348
+ React.createElement(core$1.TextInput, { placeholder: "Suffix", name: props.name + '-suffix', defaultValue: value?.suffix?.join(' '), onChange: (e) => setSuffix(e.currentTarget.value) })));
2343
2349
  }
2344
2350
 
2345
2351
  function IdentifierInput(props) {
@@ -3053,6 +3059,11 @@
3053
3059
  return (React.createElement(core$1.Stack, { justify: "flex-start", spacing: "xs" }, value.map((note, index) => note.text && (React.createElement(core$1.Blockquote, { key: `note-${index}`, classNames: { cite: classes.noteCite, body: classes.noteBody, root: classes.noteRoot }, cite: note.authorReference?.display || note.authorString, icon: null }, note.text)))));
3054
3060
  }
3055
3061
 
3062
+ /**
3063
+ * Renders the name of a resource, given either the resource itself or a reference to the resource.
3064
+ * @param props
3065
+ * @returns
3066
+ */
3056
3067
  function ResourceName(props) {
3057
3068
  const { value, link, ...rest } = props;
3058
3069
  const [outcome, setOutcome] = React.useState();