@medplum/react 0.9.16 → 0.9.19
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/defaulttheme.css +9 -7
- package/dist/cjs/index.js +2721 -2419
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/styles.css +501 -392
- package/dist/esm/defaulttheme.css +9 -7
- package/dist/esm/index.js +2724 -2428
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/styles.css +501 -392
- package/dist/types/BackboneElementDisplay.d.ts +2 -4
- package/dist/types/BackboneElementInput.d.ts +2 -5
- package/dist/types/Checkbox.d.ts +12 -0
- package/dist/types/CheckboxFormSection.d.ts +9 -0
- package/dist/types/FhirPathDisplay.d.ts +1 -1
- package/dist/types/MedplumLink.d.ts +1 -0
- package/dist/types/PlanDefinitionBuilder.d.ts +7 -0
- package/dist/types/QuestionnaireForm.d.ts +0 -2
- package/dist/types/RequestGroupDisplay.d.ts +9 -0
- package/dist/types/ResourceArrayDisplay.d.ts +0 -2
- package/dist/types/ResourceArrayInput.d.ts +0 -2
- package/dist/types/ResourcePropertyDisplay.d.ts +2 -3
- package/dist/types/ResourcePropertyInput.d.ts +1 -2
- package/dist/types/SearchControl.d.ts +2 -0
- package/dist/types/SearchControlField.d.ts +1 -1
- package/dist/types/SearchFilterEditor.d.ts +1 -0
- package/dist/types/SearchPopupMenu.d.ts +2 -2
- package/dist/types/SearchUtils.d.ts +5 -8
- package/dist/types/StatusBadge.d.ts +6 -0
- package/dist/types/TextArea.d.ts +1 -0
- package/dist/types/UploadButton.d.ts +2 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/stories/PlanDefinitionBuilder.stories.d.ts +5 -0
- package/dist/types/stories/RequestGroupDisplay.stories.d.ts +5 -0
- package/dist/types/stories/SearchControl.stories.d.ts +4 -0
- package/dist/types/stories/StatusBadge.stories.d.ts +5 -0
- package/dist/types/stories/UploadButton.stories.d.ts +6 -0
- package/package.json +19 -19
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { TypedValue } from '@medplum/core';
|
|
3
3
|
export interface BackboneElementDisplayProps {
|
|
4
|
-
|
|
5
|
-
typeName: string;
|
|
6
|
-
value?: any;
|
|
4
|
+
value: TypedValue;
|
|
7
5
|
compact?: boolean;
|
|
8
6
|
ignoreMissingValues?: boolean;
|
|
9
7
|
link?: boolean;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { ElementDefinition, OperationOutcome } from '@medplum/fhirtypes';
|
|
2
|
+
import { OperationOutcome } from '@medplum/fhirtypes';
|
|
4
3
|
export interface BackboneElementInputProps {
|
|
5
|
-
|
|
6
|
-
property: ElementDefinition;
|
|
7
|
-
name: string;
|
|
4
|
+
typeName: string;
|
|
8
5
|
defaultValue?: any;
|
|
9
6
|
outcome?: OperationOutcome;
|
|
10
7
|
onChange?: (value: any) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import './Checkbox.css';
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
name?: string;
|
|
5
|
+
defaultValue?: boolean | number;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
8
|
+
testid?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onChange?: (newValue: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './CheckboxFormSection.css';
|
|
3
|
+
export interface CheckboxFormSectionProps {
|
|
4
|
+
htmlFor?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function CheckboxFormSection(props: CheckboxFormSectionProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PlanDefinition, Reference } from '@medplum/fhirtypes';
|
|
3
|
+
export interface PlanDefinitionBuilderProps {
|
|
4
|
+
value: PlanDefinition | Reference<PlanDefinition>;
|
|
5
|
+
onSubmit: (result: PlanDefinition) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function PlanDefinitionBuilder(props: PlanDefinitionBuilderProps): JSX.Element | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IndexedStructureDefinition } from '@medplum/core';
|
|
3
2
|
import { Questionnaire, QuestionnaireItem, QuestionnaireResponse, QuestionnaireResponseItem, Reference } from '@medplum/fhirtypes';
|
|
4
3
|
import './QuestionnaireForm.css';
|
|
5
4
|
export interface QuestionnaireFormProps {
|
|
@@ -9,7 +8,6 @@ export interface QuestionnaireFormProps {
|
|
|
9
8
|
}
|
|
10
9
|
export declare function QuestionnaireForm(props: QuestionnaireFormProps): JSX.Element | null;
|
|
11
10
|
export interface QuestionnaireFormItemProps {
|
|
12
|
-
schema: IndexedStructureDefinition;
|
|
13
11
|
item: QuestionnaireItem;
|
|
14
12
|
onChange: (newResponseItem: QuestionnaireResponseItem) => void;
|
|
15
13
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Reference, RequestGroup, Task } from '@medplum/fhirtypes';
|
|
3
|
+
import './RequestGroupDisplay.css';
|
|
4
|
+
export interface RequestGroupDisplayProps {
|
|
5
|
+
value?: RequestGroup | Reference<RequestGroup>;
|
|
6
|
+
onStart: (task: Task, input: Reference) => void;
|
|
7
|
+
onEdit: (task: Task, input: Reference, output: Reference) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function RequestGroupDisplay(props: RequestGroupDisplayProps): JSX.Element | null;
|
|
@@ -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 {
|
|
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:
|
|
24
|
+
export declare function getValueAndType(context: TypedValue, path: string): [any, PropertyType];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
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
|
|
33
|
+
readonly searchParams?: SearchParameter[];
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Returns the collection of field definitions for the search request.
|
|
@@ -7,8 +7,8 @@ export interface SearchPopupMenuProps {
|
|
|
7
7
|
visible: boolean;
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
|
-
|
|
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,
|
|
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
|
|
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
|
|
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(
|
|
174
|
+
export declare function renderValue(resource: Resource, field: SearchControlField): string | JSX.Element | null | undefined;
|
package/dist/types/TextArea.d.ts
CHANGED
|
@@ -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;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from './Autocomplete';
|
|
|
7
7
|
export * from './Avatar';
|
|
8
8
|
export * from './BackboneElementInput';
|
|
9
9
|
export * from './Button';
|
|
10
|
+
export * from './Checkbox';
|
|
11
|
+
export * from './CheckboxFormSection';
|
|
10
12
|
export * from './CodeableConceptDisplay';
|
|
11
13
|
export * from './CodeableConceptInput';
|
|
12
14
|
export * from './CodeInput';
|
|
@@ -19,6 +21,7 @@ export * from './DiagnosticReportDisplay';
|
|
|
19
21
|
export * from './Document';
|
|
20
22
|
export * from './EncounterTimeline';
|
|
21
23
|
export * from './ErrorBoundary';
|
|
24
|
+
export * from './FhirPathTable';
|
|
22
25
|
export * from './FooterLinks';
|
|
23
26
|
export * from './Form';
|
|
24
27
|
export * from './FormSection';
|
|
@@ -34,6 +37,7 @@ export * from './MedplumLink';
|
|
|
34
37
|
export * from './MedplumProvider';
|
|
35
38
|
export * from './MenuItem';
|
|
36
39
|
export * from './PatientTimeline';
|
|
40
|
+
export * from './PlanDefinitionBuilder';
|
|
37
41
|
export * from './Popup';
|
|
38
42
|
export * from './QuestionnaireBuilder';
|
|
39
43
|
export * from './QuestionnaireForm';
|
|
@@ -41,6 +45,7 @@ export * from './QuestionnaireUtils';
|
|
|
41
45
|
export * from './RangeDisplay';
|
|
42
46
|
export * from './RangeInput';
|
|
43
47
|
export * from './ReferenceInput';
|
|
48
|
+
export * from './RequestGroupDisplay';
|
|
44
49
|
export * from './ResourceArrayDisplay';
|
|
45
50
|
export * from './ResourceArrayInput';
|
|
46
51
|
export * from './ResourceBadge';
|
|
@@ -62,7 +67,7 @@ export * from './SearchUtils';
|
|
|
62
67
|
export * from './Select';
|
|
63
68
|
export * from './ServiceRequestTimeline';
|
|
64
69
|
export * from './SignInForm';
|
|
65
|
-
export * from './
|
|
70
|
+
export * from './StatusBadge';
|
|
66
71
|
export * from './Tab';
|
|
67
72
|
export * from './TabList';
|
|
68
73
|
export * from './TabPanel';
|
|
@@ -70,6 +75,7 @@ export * from './TabSwitch';
|
|
|
70
75
|
export * from './TextArea';
|
|
71
76
|
export * from './Timeline';
|
|
72
77
|
export * from './TitleBar';
|
|
78
|
+
export * from './UploadButton';
|
|
73
79
|
export * from './useResource';
|
|
74
80
|
export * from './utils';
|
|
75
81
|
export * from './utils/date';
|
|
@@ -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,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.
|
|
3
|
+
"version": "0.9.19",
|
|
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.
|
|
23
|
-
"@medplum/fhirtypes": "0.9.
|
|
24
|
-
"@medplum/mock": "0.9.
|
|
25
|
-
"@storybook/addon-actions": "6.5.
|
|
26
|
-
"@storybook/addon-essentials": "6.5.
|
|
27
|
-
"@storybook/addon-links": "6.5.
|
|
28
|
-
"@storybook/builder-webpack5": "6.5.
|
|
29
|
-
"@storybook/manager-webpack5": "6.5.
|
|
30
|
-
"@storybook/react": "6.5.
|
|
31
|
-
"@testing-library/dom": "8.
|
|
22
|
+
"@medplum/core": "0.9.19",
|
|
23
|
+
"@medplum/fhirtypes": "0.9.19",
|
|
24
|
+
"@medplum/mock": "0.9.19",
|
|
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.
|
|
35
|
-
"@types/node": "
|
|
36
|
-
"@types/react": "18.0.
|
|
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.
|
|
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.
|
|
45
|
-
"react-dom": "18.
|
|
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.
|
|
48
|
+
"typescript": "4.7.4"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@medplum/core": "0.9.
|
|
51
|
+
"@medplum/core": "0.9.19",
|
|
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"
|