@medplum/react 0.9.10 → 0.9.13

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.
@@ -498,8 +498,8 @@ table.medplum-table {
498
498
  width: 100%;
499
499
  }
500
500
 
501
- table.medplum-table th,
502
- table.medplum-table td {
501
+ table.medplum-table > thead > tr > th,
502
+ table.medplum-table > tbody > tr > td {
503
503
  border: 0.1px solid var(--medplum-gray-400);
504
504
  padding: 4px 6px;
505
505
  }
@@ -3,10 +3,8 @@
3
3
  --medplum-surface: #ffffff;
4
4
  --medplum-foreground: #424242;
5
5
  --medplum-navbar: #5b2876;
6
- --medplum-navbar-textbox: #7a4696;
7
- --medplum-navbar-icon: #5b2876;
8
- --medplum-navbar-placeholder: #ddc4eb;
9
- --medplum-navbar-hover: #5d5d85;
6
+ --medplum-navbar-textbox: rgba(255, 255, 255, 0.2);
7
+ --medplum-navbar-placeholder: rgba(255, 255, 255, 0.6);
10
8
  --medplum-shadow: rgba(0, 0, 0, 0.1);
11
9
  /* font sizes */
12
10
  --medplum-font-small: 12px;
@@ -97,10 +95,8 @@
97
95
  --medplum-surface: #000;
98
96
  --medplum-foreground: #eee;
99
97
  --medplum-navbar: #5b2876;
100
- --medplum-navbar-textbox: #7a4696;
101
- --medplum-navbar-icon: #5b2876;
102
- --medplum-navbar-placeholder: #ddc4eb;
103
- --medplum-navbar-hover: #5d5d85;
98
+ --medplum-navbar-textbox: rgba(255, 255, 255, 0.2);
99
+ --medplum-navbar-placeholder: rgba(255, 255, 255, 0.6);
104
100
  --medplum-shadow: rgba(0, 0, 0, 0.2);
105
101
  /* gray */
106
102
  --medplum-gray-900: #fafafa;
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { formatAddress, getDisplayString, getImageSrc, getPropertyDisplayName, formatHumanName, stringify, buildTypeName, PropertyType, capitalize, createReference, Operator, getReferenceString, isUUID, getSearchParameterDetails, evalFhirPath, SearchParameterType, parseSearchDefinition, DEFAULT_SEARCH_COUNT } from '@medplum/core';
1
+ import { formatAddress, getDisplayString, getImageSrc, getPropertyDisplayName, formatHumanName, stringify, buildTypeName, PropertyType, capitalize, createReference, getReferenceString, isUUID, getSearchParameterDetails, Operator, evalFhirPath, SearchParameterType, formatSearchQuery, parseSearchDefinition, DEFAULT_SEARCH_COUNT } from '@medplum/core';
2
2
  import React, { useState, useRef, createContext, useEffect, useContext, useCallback } from 'react';
3
3
  import { useNavigate, useLocation } from 'react-router-dom';
4
4
 
@@ -849,13 +849,12 @@ function PeriodDisplay(props) {
849
849
  }
850
850
 
851
851
  function QuantityDisplay(props) {
852
- const value = props.value;
853
- if (!value) {
854
- return null;
855
- }
856
- return React.createElement(React.Fragment, null, formatQuantityString(value));
852
+ return React.createElement(React.Fragment, null, formatQuantityString(props.value));
857
853
  }
858
854
  function formatQuantityString(quantity) {
855
+ if (!quantity) {
856
+ return '';
857
+ }
859
858
  const result = [];
860
859
  if (quantity.comparator) {
861
860
  result.push(quantity.comparator);
@@ -874,24 +873,19 @@ function formatQuantityString(quantity) {
874
873
  }
875
874
 
876
875
  function RangeDisplay(props) {
877
- const value = props.value;
878
- if (!value || (!value.low && !value.high)) {
879
- return null;
876
+ return React.createElement(React.Fragment, null, formatRangeString(props.value));
877
+ }
878
+ function formatRangeString(range) {
879
+ if (!range || (!range.low && !range.high)) {
880
+ return '';
880
881
  }
881
- if (value.low && !value.high) {
882
- return (React.createElement("span", null,
883
- ">=\u00A0",
884
- React.createElement(QuantityDisplay, { value: value.low })));
882
+ if (range.low && !range.high) {
883
+ return `>= ${formatQuantityString(range.low)}`;
885
884
  }
886
- if (!value.low && value.high) {
887
- return (React.createElement("span", null,
888
- "<=\u00A0",
889
- React.createElement(QuantityDisplay, { value: value.high })));
885
+ if (!range.low && range.high) {
886
+ return `<= ${formatQuantityString(range.high)}`;
890
887
  }
891
- return (React.createElement("span", null,
892
- React.createElement(QuantityDisplay, { value: value.low }),
893
- "\u00A0-\u00A0",
894
- React.createElement(QuantityDisplay, { value: value.high })));
888
+ return `${formatQuantityString(range.low)} - ${formatQuantityString(range.high)}`;
895
889
  }
896
890
 
897
891
  function RatioDisplay(props) {
@@ -1411,16 +1405,7 @@ function ResourceInput(props) {
1411
1405
  }
1412
1406
  return (React.createElement(Autocomplete, { loadOptions: (input) => {
1413
1407
  return medplum
1414
- .search({
1415
- resourceType: resourceTypeRef.current,
1416
- filters: [
1417
- {
1418
- code: 'name',
1419
- operator: Operator.EQUALS,
1420
- value: input,
1421
- },
1422
- ],
1423
- })
1408
+ .search(resourceTypeRef.current, 'name=' + encodeURIComponent(input))
1424
1409
  .then((bundle) => bundle.entry.map((entry) => entry.resource));
1425
1410
  }, getId: (item) => {
1426
1411
  return item.id;
@@ -2589,12 +2574,12 @@ function Header(props) {
2589
2574
  const [userMenuVisible, setUserMenuVisible] = useState(false);
2590
2575
  const [sidebarVisible, setSidebarVisible] = useState(false);
2591
2576
  return (React.createElement(React.Fragment, null,
2592
- React.createElement("header", { role: "banner", "data-testid": "header" },
2577
+ React.createElement("header", { role: "banner", "data-testid": "header", style: { background: props.bgColor } },
2593
2578
  React.createElement("div", null,
2594
2579
  React.createElement(MedplumLink, { label: "Toggle sidebar", testid: "header-menu-button", onClick: () => setSidebarVisible(!sidebarVisible) },
2595
2580
  React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style: { width: 20, height: 20, verticalAlign: 'text-top' }, viewBox: "0 0 20 20", fill: "currentColor" },
2596
2581
  React.createElement("path", { fillRule: "evenodd", d: "M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z", clipRule: "evenodd" }))),
2597
- React.createElement(MedplumLink, { id: "medplum-header-logo", testid: "header-logo", onClick: props.onLogo }, "Medplum"),
2582
+ React.createElement(MedplumLink, { id: "medplum-header-logo", testid: "header-logo", onClick: props.onLogo }, props.title || 'Medplum'),
2598
2583
  context.profile && (React.createElement(HeaderSearchInput, { key: `header-input-${location.pathname}`, name: "search", className: "medplum-nav-search-container", placeholder: "Search", onChange: (resource) => navigate(`/${resource.resourceType}/${resource.id}`) }))),
2599
2584
  context.profile && (React.createElement("div", { className: "medplum-nav-menu-container" },
2600
2585
  React.createElement(MedplumLink, { testid: "header-profile-menu-button", onClick: () => setUserMenuVisible(true) },
@@ -4561,7 +4546,7 @@ function SearchControl(props) {
4561
4546
  useEffect(() => {
4562
4547
  setOutcome(undefined);
4563
4548
  medplum
4564
- .search(Object.assign(Object.assign({}, search), { total: 'accurate' }))
4549
+ .search(search.resourceType, formatSearchQuery(Object.assign(Object.assign({}, search), { total: 'accurate' })))
4565
4550
  .then((response) => {
4566
4551
  setState(Object.assign(Object.assign({}, stateRef.current), { searchResponse: response }));
4567
4552
  if (onLoad) {
@@ -5125,5 +5110,5 @@ function TabSwitch(props) {
5125
5110
  })));
5126
5111
  }
5127
5112
 
5128
- export { AddressDisplay, AddressInput, AttachmentArrayDisplay, AttachmentArrayInput, AttachmentInput, Autocomplete, Avatar, BackboneElementInput, Button, CodeInput, CodeableConceptInput, ContactPointDisplay, ContactPointInput, DateTimeDisplay, DateTimeInput, DefaultResourceTimeline, DiagnosticReportDisplay, Document, ElementDefinitionInputSelector, ElementDefinitionTypeInput, EncounterTimeline, ErrorBoundary, FhirPathTable, FooterLinks, Form, FormSection, Header, HumanNameDisplay, HumanNameInput, IdentifierInput, Input, Loading, Logo, MedplumLink, MedplumProvider, MemoizedFhirPathTable, MemoizedSearchControl, MenuItem, ObservationTable, PatientTimeline, Popup, QuestionnaireBuilder, QuestionnaireForm, QuestionnaireFormItem, QuestionnaireItemType, ReferenceInput, ResourceArrayDisplay, ResourceArrayInput, ResourceBadge, ResourceBlame, ResourceDiff, ResourceForm, ResourceHistoryTable, ResourceInput, ResourceName, ResourcePropertyDisplay, ResourcePropertyInput, ResourceTable, ResourceTimeline, Scrollable, SearchChangeEvent, SearchClickEvent, SearchControl, SearchFieldEditor, SearchFilterEditor, SearchLoadEvent, Select, ServiceRequestTimeline, SignInForm, Tab, TabList, TabPanel, TabSwitch, TextArea, Timeline, TimelineItem, TitleBar, addDateEqualsFilter, addDateFilter, addDateFilterBetween, addField, addFilter, addLastMonthFilter, addNextMonthFilter, addQuestionnaireInitialValues, addThisMonthFilter, addTodayFilter, addTomorrowFilter, addUserFilter, addYearToDateFilter, addYesterdayFilter, buildFieldNameString, clearFilters, clearFiltersOnField, convertIsoToLocal, convertLocalToIso, createScriptTag, deleteFilter, getOpString, getSearchOperators, getSortField, getTimeString, getValueAndType, hasFilterOnField, isChoiceQuestion, isSortDescending, movePage, parseForm, renderValue, setFilters, setOffset, setPropertyValue, setSort, sortByDateAndPriority, toggleSort, useMedplum, useMedplumContext, useMedplumProfile, useResource };
5113
+ export { AddressDisplay, AddressInput, AttachmentArrayDisplay, AttachmentArrayInput, AttachmentInput, Autocomplete, Avatar, BackboneElementInput, Button, CodeInput, CodeableConceptDisplay, CodeableConceptInput, ContactPointDisplay, ContactPointInput, DateTimeDisplay, DateTimeInput, DefaultResourceTimeline, DiagnosticReportDisplay, Document, ElementDefinitionInputSelector, ElementDefinitionTypeInput, EncounterTimeline, ErrorBoundary, FhirPathTable, FooterLinks, Form, FormSection, Header, HumanNameDisplay, HumanNameInput, IdentifierInput, Input, Loading, Logo, MedplumLink, MedplumProvider, MemoizedFhirPathTable, MemoizedSearchControl, MenuItem, ObservationTable, PatientTimeline, Popup, QuestionnaireBuilder, QuestionnaireForm, QuestionnaireFormItem, QuestionnaireItemType, RangeDisplay, RangeInput, ReferenceInput, ResourceArrayDisplay, ResourceArrayInput, ResourceBadge, ResourceBlame, ResourceDiff, ResourceForm, ResourceHistoryTable, ResourceInput, ResourceName, ResourcePropertyDisplay, ResourcePropertyInput, ResourceTable, ResourceTimeline, Scrollable, SearchChangeEvent, SearchClickEvent, SearchControl, SearchFieldEditor, SearchFilterEditor, SearchLoadEvent, Select, ServiceRequestTimeline, SignInForm, Tab, TabList, TabPanel, TabSwitch, TextArea, Timeline, TimelineItem, TitleBar, addDateEqualsFilter, addDateFilter, addDateFilterBetween, addField, addFilter, addLastMonthFilter, addNextMonthFilter, addQuestionnaireInitialValues, addThisMonthFilter, addTodayFilter, addTomorrowFilter, addUserFilter, addYearToDateFilter, addYesterdayFilter, buildFieldNameString, clearFilters, clearFiltersOnField, convertIsoToLocal, convertLocalToIso, createScriptTag, deleteFilter, formatRangeString, getOpString, getSearchOperators, getSortField, getTimeString, getValueAndType, hasFilterOnField, isChoiceQuestion, isSortDescending, movePage, parseForm, renderValue, setFilters, setOffset, setPropertyValue, setSort, sortByDateAndPriority, toggleSort, useMedplum, useMedplumContext, useMedplumProfile, useResource };
5129
5114
  //# sourceMappingURL=index.js.map