@openmrs/esm-form-engine-lib 3.1.3-pre.1762 → 3.1.3-pre.1764
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/package.json
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { useTranslation } from 'react-i18next';
|
2
3
|
import MarkdownWrapper from './markdown-wrapper.component';
|
3
4
|
import { type FormFieldInputProps } from '../../../types';
|
4
5
|
|
5
6
|
const Markdown: React.FC<FormFieldInputProps> = ({ field }) => {
|
6
|
-
|
7
|
+
const { t } = useTranslation();
|
8
|
+
return !field.isHidden && <MarkdownWrapper
|
9
|
+
markdown={t(field.value, { defaultValue: field.value, interpolation: { escapeValue: false } })}
|
10
|
+
/>;
|
7
11
|
};
|
8
12
|
export default Markdown;
|
@@ -101,7 +101,7 @@ const MultiSelect: React.FC<FormFieldInputProps> = ({ field, value, errors, warn
|
|
101
101
|
initialSelectedItems={initiallySelectedQuestionItems}
|
102
102
|
label={''}
|
103
103
|
titleText={<FieldLabel field={field} />}
|
104
|
-
itemToString={(item) => (item ? item.label : ' ')}
|
104
|
+
itemToString={(item) => (item ? t(item.label) : ' ')}
|
105
105
|
disabled={field.isDisabled}
|
106
106
|
invalid={errors.length > 0}
|
107
107
|
invalidText={errors[0]?.message}
|
@@ -143,7 +143,7 @@ const MultiSelect: React.FC<FormFieldInputProps> = ({ field, value, errors, warn
|
|
143
143
|
<div className={styles.tagContainer}>
|
144
144
|
{formFieldAdapters[field.type]?.getDisplayValue(field, value)?.map((displayValue, index) => (
|
145
145
|
<Tag key={index} type="cool-gray">
|
146
|
-
{displayValue}
|
146
|
+
{t(displayValue)}
|
147
147
|
</Tag>
|
148
148
|
))}
|
149
149
|
</div>
|