@medplum/react 0.9.15 → 0.9.18

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 (35) hide show
  1. package/dist/cjs/index.js +2620 -2351
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/index.min.js +1 -1
  4. package/dist/cjs/index.min.js.map +1 -1
  5. package/dist/cjs/styles.css +335 -242
  6. package/dist/esm/index.js +2620 -2355
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/esm/index.min.js +1 -1
  9. package/dist/esm/index.min.js.map +1 -1
  10. package/dist/esm/styles.css +335 -242
  11. package/dist/types/BackboneElementDisplay.d.ts +2 -4
  12. package/dist/types/BackboneElementInput.d.ts +0 -2
  13. package/dist/types/FhirPathDisplay.d.ts +1 -1
  14. package/dist/types/MedplumLink.d.ts +1 -0
  15. package/dist/types/PlanDefinitionBuilder.d.ts +7 -0
  16. package/dist/types/QuestionnaireForm.d.ts +0 -2
  17. package/dist/types/RequestGroupDisplay.d.ts +9 -0
  18. package/dist/types/ResourceArrayDisplay.d.ts +0 -2
  19. package/dist/types/ResourceArrayInput.d.ts +0 -2
  20. package/dist/types/ResourcePropertyDisplay.d.ts +2 -3
  21. package/dist/types/ResourcePropertyInput.d.ts +1 -2
  22. package/dist/types/SearchControl.d.ts +2 -0
  23. package/dist/types/SearchControlField.d.ts +1 -1
  24. package/dist/types/SearchFilterEditor.d.ts +1 -0
  25. package/dist/types/SearchPopupMenu.d.ts +2 -2
  26. package/dist/types/SearchUtils.d.ts +5 -8
  27. package/dist/types/StatusBadge.d.ts +6 -0
  28. package/dist/types/UploadButton.d.ts +2 -1
  29. package/dist/types/index.d.ts +5 -1
  30. package/dist/types/stories/PlanDefinitionBuilder.stories.d.ts +5 -0
  31. package/dist/types/stories/RequestGroupDisplay.stories.d.ts +5 -0
  32. package/dist/types/stories/SearchControl.stories.d.ts +4 -0
  33. package/dist/types/stories/StatusBadge.stories.d.ts +5 -0
  34. package/dist/types/stories/UploadButton.stories.d.ts +6 -0
  35. package/package.json +19 -19
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { IndexedStructureDefinition } from '@medplum/core';
3
2
  import { ElementDefinition } from '@medplum/fhirtypes';
4
3
  interface ResourceArrayDisplayProps {
5
- schema: IndexedStructureDefinition;
6
4
  property: ElementDefinition;
7
5
  values: any[];
8
6
  arrayElement?: boolean;
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { IndexedStructureDefinition } from '@medplum/core';
3
2
  import { ElementDefinition } from '@medplum/fhirtypes';
4
3
  interface ResourceArrayInputProps {
5
- schema: IndexedStructureDefinition;
6
4
  property: ElementDefinition;
7
5
  name: string;
8
6
  defaultValue?: any[];
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { IndexedStructureDefinition, PropertyType } from '@medplum/core';
2
+ import { PropertyType, TypedValue } from '@medplum/core';
3
3
  import { ElementDefinition } from '@medplum/fhirtypes';
4
4
  export interface ResourcePropertyDisplayProps {
5
- schema?: IndexedStructureDefinition;
6
5
  property?: ElementDefinition;
7
6
  propertyType: PropertyType;
8
7
  value: any;
@@ -22,4 +21,4 @@ export declare function ResourcePropertyDisplay(props: ResourcePropertyDisplayPr
22
21
  * @param property The property definition.
23
22
  * @returns The value of the property and the property type.
24
23
  */
25
- export declare function getValueAndType(context: any, property: ElementDefinition): [any, PropertyType];
24
+ export declare function getValueAndType(context: TypedValue, path: string): [any, PropertyType];
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { IndexedStructureDefinition, PropertyType } from '@medplum/core';
2
+ import { PropertyType } from '@medplum/core';
3
3
  import { ElementDefinition, ElementDefinitionType, OperationOutcome } from '@medplum/fhirtypes';
4
4
  export interface ResourcePropertyInputProps {
5
- schema: IndexedStructureDefinition;
6
5
  property: ElementDefinition;
7
6
  name: string;
8
7
  defaultPropertyType?: PropertyType;
@@ -19,6 +19,8 @@ export interface SearchControlProps {
19
19
  search: SearchRequest;
20
20
  userConfig?: UserConfiguration;
21
21
  checkboxesEnabled?: boolean;
22
+ hideToolbar?: boolean;
23
+ hideFilters?: boolean;
22
24
  onLoad?: (e: SearchLoadEvent) => void;
23
25
  onChange?: (e: SearchChangeEvent) => void;
24
26
  onClick?: (e: SearchClickEvent) => void;
@@ -30,7 +30,7 @@ import { ElementDefinition, SearchParameter } from '@medplum/fhirtypes';
30
30
  export interface SearchControlField {
31
31
  readonly name: string;
32
32
  readonly elementDefinition?: ElementDefinition;
33
- readonly searchParam?: SearchParameter;
33
+ readonly searchParams?: SearchParameter[];
34
34
  }
35
35
  /**
36
36
  * Returns the collection of field definitions for the search request.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { IndexedStructureDefinition, SearchRequest } from '@medplum/core';
3
+ import './SearchFilterEditor.css';
3
4
  export interface SearchFilterEditorProps {
4
5
  schema: IndexedStructureDefinition;
5
6
  visible: boolean;
@@ -7,8 +7,8 @@ export interface SearchPopupMenuProps {
7
7
  visible: boolean;
8
8
  x: number;
9
9
  y: number;
10
- searchParam?: SearchParameter;
11
- onPrompt: (filter: Filter) => void;
10
+ searchParams?: SearchParameter[];
11
+ onPrompt: (searchParam: SearchParameter, filter: Filter) => void;
12
12
  onChange: (definition: SearchRequest) => void;
13
13
  onClose: () => void;
14
14
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Filter, IndexedStructureDefinition, Operator, SearchRequest } from '@medplum/core';
2
+ import { Filter, Operator, SearchRequest } from '@medplum/core';
3
3
  import { Resource, SearchParameter } from '@medplum/fhirtypes';
4
4
  import { SearchControlField } from './SearchControlField';
5
5
  /**
@@ -105,13 +105,11 @@ export declare function addDateFilter(definition: SearchRequest, field: string,
105
105
  */
106
106
  export declare function addDateFilterBetween(definition: SearchRequest, field: string, d1: Date, d2: Date): SearchRequest;
107
107
  /**
108
- * Adds a filter for a user field.
108
+ * Adds a filter that constrains the specified field to "missing".
109
109
  *
110
- * @param field
111
- * @param op
112
- * @param value
110
+ * @param {string} field The field key name.
113
111
  */
114
- export declare function addUserFilter(definition: SearchRequest, field: string, op: Operator, value: string): SearchRequest;
112
+ export declare function addMissingFilter(definition: SearchRequest, field: string, value?: boolean): SearchRequest;
115
113
  /**
116
114
  * Returns true if the search has any filters on the specified field.
117
115
  *
@@ -169,9 +167,8 @@ export declare function getOpString(op: Operator): string;
169
167
  export declare function buildFieldNameString(key: string): string;
170
168
  /**
171
169
  * Returns a fragment to be displayed in the search table for the value.
172
- * @param schema The currently indexed schema.
173
170
  * @param resource The parent resource.
174
171
  * @param key The search code or FHIRPath expression.
175
172
  * @returns The fragment to display.
176
173
  */
177
- export declare function renderValue(schema: IndexedStructureDefinition, resource: Resource, field: SearchControlField): string | JSX.Element | null | undefined;
174
+ export declare function renderValue(resource: Resource, field: SearchControlField): string | JSX.Element | null | undefined;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import './StatusBadge.css';
3
+ export interface StatusBadgeProps {
4
+ readonly status: string;
5
+ }
6
+ export declare function StatusBadge(props: StatusBadgeProps): JSX.Element;
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { Attachment } from '@medplum/fhirtypes';
2
+ import React from 'react';
3
3
  export interface UploadButtonProps {
4
4
  onUpload: (attachment: Attachment) => void;
5
+ children?: React.ReactNode;
5
6
  }
6
7
  export declare function UploadButton(props: UploadButtonProps): JSX.Element;
@@ -19,6 +19,7 @@ export * from './DiagnosticReportDisplay';
19
19
  export * from './Document';
20
20
  export * from './EncounterTimeline';
21
21
  export * from './ErrorBoundary';
22
+ export * from './FhirPathTable';
22
23
  export * from './FooterLinks';
23
24
  export * from './Form';
24
25
  export * from './FormSection';
@@ -34,6 +35,7 @@ export * from './MedplumLink';
34
35
  export * from './MedplumProvider';
35
36
  export * from './MenuItem';
36
37
  export * from './PatientTimeline';
38
+ export * from './PlanDefinitionBuilder';
37
39
  export * from './Popup';
38
40
  export * from './QuestionnaireBuilder';
39
41
  export * from './QuestionnaireForm';
@@ -41,6 +43,7 @@ export * from './QuestionnaireUtils';
41
43
  export * from './RangeDisplay';
42
44
  export * from './RangeInput';
43
45
  export * from './ReferenceInput';
46
+ export * from './RequestGroupDisplay';
44
47
  export * from './ResourceArrayDisplay';
45
48
  export * from './ResourceArrayInput';
46
49
  export * from './ResourceBadge';
@@ -62,7 +65,7 @@ export * from './SearchUtils';
62
65
  export * from './Select';
63
66
  export * from './ServiceRequestTimeline';
64
67
  export * from './SignInForm';
65
- export * from './FhirPathTable';
68
+ export * from './StatusBadge';
66
69
  export * from './Tab';
67
70
  export * from './TabList';
68
71
  export * from './TabPanel';
@@ -70,6 +73,7 @@ export * from './TabSwitch';
70
73
  export * from './TextArea';
71
74
  export * from './Timeline';
72
75
  export * from './TitleBar';
76
+ export * from './UploadButton';
73
77
  export * from './useResource';
74
78
  export * from './utils';
75
79
  export * from './utils/date';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Basic: () => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Simple: () => JSX.Element;
@@ -7,3 +7,7 @@ export declare const NoCheckboxes: () => JSX.Element;
7
7
  export declare const AllButtons: () => JSX.Element;
8
8
  export declare const ExtraFields: () => JSX.Element;
9
9
  export declare const ServiceRequests: () => JSX.Element;
10
+ export declare const Observations: () => JSX.Element;
11
+ export declare const HideToolbar: () => JSX.Element;
12
+ export declare const HideFilters: () => JSX.Element;
13
+ export declare const HideToolbarAndFilters: () => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const ExampleStatuses: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Example: () => JSX.Element;
6
+ export declare const CustomText: () => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/react",
3
- "version": "0.9.15",
3
+ "version": "0.9.18",
4
4
  "description": "Medplum React Component Library",
5
5
  "author": "Medplum <hello@medplum.com>",
6
6
  "license": "Apache-2.0",
@@ -19,36 +19,36 @@
19
19
  "storybook": "build-storybook"
20
20
  },
21
21
  "devDependencies": {
22
- "@medplum/core": "0.9.15",
23
- "@medplum/fhirtypes": "0.9.15",
24
- "@medplum/mock": "0.9.15",
25
- "@storybook/addon-actions": "6.5.8",
26
- "@storybook/addon-essentials": "6.5.8",
27
- "@storybook/addon-links": "6.5.8",
28
- "@storybook/builder-webpack5": "6.5.8",
29
- "@storybook/manager-webpack5": "6.5.8",
30
- "@storybook/react": "6.5.8",
31
- "@testing-library/dom": "8.13.0",
22
+ "@medplum/core": "0.9.18",
23
+ "@medplum/fhirtypes": "0.9.18",
24
+ "@medplum/mock": "0.9.18",
25
+ "@storybook/addon-actions": "6.5.9",
26
+ "@storybook/addon-essentials": "6.5.9",
27
+ "@storybook/addon-links": "6.5.9",
28
+ "@storybook/builder-webpack5": "6.5.9",
29
+ "@storybook/manager-webpack5": "6.5.9",
30
+ "@storybook/react": "6.5.9",
31
+ "@testing-library/dom": "8.14.0",
32
32
  "@testing-library/jest-dom": "5.16.4",
33
33
  "@testing-library/react": "13.3.0",
34
- "@types/jest": "28.1.1",
35
- "@types/node": "17.0.42",
36
- "@types/react": "18.0.12",
34
+ "@types/jest": "28.1.3",
35
+ "@types/node": "18.0.0",
36
+ "@types/react": "18.0.14",
37
37
  "@types/react-dom": "18.0.5",
38
38
  "@types/react-router-dom": "5.3.3",
39
- "dotenv-webpack": "7.1.0",
39
+ "dotenv-webpack": "7.1.1",
40
40
  "identity-obj-proxy": "3.0.0",
41
41
  "jest": "28.1.1",
42
42
  "jest-each": "28.1.1",
43
43
  "html-webpack-plugin": "5.5.0",
44
- "react": "18.1.0",
45
- "react-dom": "18.1.0",
44
+ "react": "18.2.0",
45
+ "react-dom": "18.2.0",
46
46
  "react-router-dom": "6.3.0",
47
47
  "rimraf": "3.0.2",
48
- "typescript": "4.7.3"
48
+ "typescript": "4.7.4"
49
49
  },
50
50
  "peerDependencies": {
51
- "@medplum/core": "0.9.15",
51
+ "@medplum/core": "0.9.18",
52
52
  "react": "^17.0.2 || ^18.0.0",
53
53
  "react-dom": "^17.0.2 || ^18.0.0",
54
54
  "react-router-dom": "^6.2.2"