tweak: Multiline records (#21636)

This commit is contained in:
larentoun
2023-08-28 13:51:40 +01:00
committed by GitHub
parent edb8c481c5
commit 0ff7e6188d
5 changed files with 10 additions and 7 deletions
+1
View File
@@ -99,6 +99,7 @@ const styleMapperByPropName = {
bold: mapBooleanPropTo('font-weight', 'bold'),
italic: mapBooleanPropTo('font-style', 'italic'),
nowrap: mapBooleanPropTo('white-space', 'nowrap'),
prewrap: mapBooleanPropTo('white-space', 'pre-wrap'),
// Margins
m: mapDirectionalUnitPropTo('margin', halfUnit, [
'top',
@@ -21,6 +21,7 @@ export const LabeledListItem = (props) => {
content,
children,
noColon = false,
...rest
} = props;
const colon = noColon ? '' : ':';
return (
@@ -40,6 +41,7 @@ export const LabeledListItem = (props) => {
verticalAlign={verticalAlign}
className={classes(['LabeledList__cell', 'LabeledList__content'])}
colSpan={buttons ? undefined : 2}
{...rest}
>
{content}
{children}
@@ -325,7 +325,7 @@ const MedicalRecordsViewMedical = (_properties, context) => {
<Fragment>
<LabeledList>
{medical.fields.map((field, i) => (
<LabeledList.Item key={i} label={field.field}>
<LabeledList.Item key={i} label={field.field} prewrap>
{field.value}
<Button
icon="pen"
@@ -350,7 +350,7 @@ const MedicalRecordsViewMedical = (_properties, context) => {
<Box color="label">No comments found.</Box>
) : (
medical.comments.map((comment, i) => (
<Box key={i}>
<Box key={i} prewrap>
<Box color="label" display="inline">
{comment.header}
</Box>
@@ -286,7 +286,7 @@ const SecurityRecordsViewGeneral = (_properties, context) => {
<Box float="left">
<LabeledList>
{general.fields.map((field, i) => (
<LabeledList.Item key={i} label={field.field}>
<LabeledList.Item key={i} label={field.field} prewrap>
{decodeHtmlEntities('' + field.value)}
{!!field.edit && (
<Button
@@ -347,7 +347,7 @@ const SecurityRecordsViewSecurity = (_properties, context) => {
<Fragment>
<LabeledList>
{security.fields.map((field, i) => (
<LabeledList.Item key={i} label={field.field}>
<LabeledList.Item key={i} label={field.field} prewrap>
{decodeHtmlEntities(field.value)}
{!!field.edit && (
<Button
@@ -375,7 +375,7 @@ const SecurityRecordsViewSecurity = (_properties, context) => {
<Box color="label">No comments found.</Box>
) : (
security.comments.map((comment, i) => (
<Box key={i}>
<Box key={i} prewrap>
<Box color="label" display="inline">
{comment.header || 'Auto-generated'}
</Box>
File diff suppressed because one or more lines are too long