@openmrs/esm-form-engine-lib 3.0.0-pre.1623 → 3.0.0-pre.1626
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,13 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import classNames from 'classnames';
|
3
3
|
import { useTranslation } from 'react-i18next';
|
4
|
-
import { Button } from '@carbon/react';
|
5
|
-
import { type FormPage, type SessionMode } from '../../types';
|
6
|
-
import styles from './sidebar.scss';
|
7
|
-
import { usePageObserver } from './usePageObserver';
|
8
|
-
import { useCurrentActivePage } from './useCurrentActivePage';
|
4
|
+
import { Button, InlineLoading } from '@carbon/react';
|
9
5
|
import { isPageContentVisible } from '../../utils/form-helper';
|
10
|
-
import {
|
6
|
+
import { useCurrentActivePage } from './useCurrentActivePage';
|
7
|
+
import { usePageObserver } from './usePageObserver';
|
8
|
+
import type { FormPage, SessionMode } from '../../types';
|
9
|
+
import styles from './sidebar.scss';
|
11
10
|
|
12
11
|
interface SidebarProps {
|
13
12
|
defaultPage: string;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
@use '@carbon/colors';
|
2
|
+
@use '@carbon/layout';
|
2
3
|
@use '@carbon/type';
|
3
4
|
|
4
5
|
.pageLink {
|
@@ -95,6 +96,10 @@
|
|
95
96
|
.saveButton {
|
96
97
|
@extend .button;
|
97
98
|
margin-bottom: 0.625rem;
|
99
|
+
|
100
|
+
&:global(.cds--inline-loading) {
|
101
|
+
min-height: layout.$spacing-05;
|
102
|
+
}
|
98
103
|
}
|
99
104
|
|
100
105
|
.closeButton {
|
@@ -1,24 +1,24 @@
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
2
|
-
import type { FormField, FormSchema, SessionMode } from './types';
|
3
|
-
import { useSession, type Visit } from '@openmrs/esm-framework';
|
4
|
-
import { isEmpty, useFormJson } from '.';
|
5
|
-
import FormProcessorFactory from './components/processor-factory/form-processor-factory.component';
|
6
|
-
import Loader from './components/loaders/loader.component';
|
7
|
-
import { usePatientData } from './hooks/usePatientData';
|
8
|
-
import { FormFactoryProvider } from './provider/form-factory-provider';
|
9
2
|
import classNames from 'classnames';
|
10
|
-
import styles from './form-engine.scss';
|
11
3
|
import { Button, ButtonSet, InlineLoading } from '@carbon/react';
|
12
4
|
import { I18nextProvider, useTranslation } from 'react-i18next';
|
13
|
-
import
|
14
|
-
import
|
5
|
+
import { useSession, type Visit } from '@openmrs/esm-framework';
|
6
|
+
import { FormFactoryProvider } from './provider/form-factory-provider';
|
15
7
|
import { init, teardown } from './lifecycle';
|
16
|
-
import {
|
8
|
+
import { isEmpty, useFormJson } from '.';
|
17
9
|
import { moduleName } from './globals';
|
10
|
+
import { reportError } from './utils/error-utils';
|
18
11
|
import { useFormCollapse } from './hooks/useFormCollapse';
|
19
|
-
import Sidebar from './components/sidebar/sidebar.component';
|
20
12
|
import { useFormWorkspaceSize } from './hooks/useFormWorkspaceSize';
|
21
13
|
import { usePageObserver } from './components/sidebar/usePageObserver';
|
14
|
+
import { usePatientData } from './hooks/usePatientData';
|
15
|
+
import type { FormField, FormSchema, SessionMode } from './types';
|
16
|
+
import FormProcessorFactory from './components/processor-factory/form-processor-factory.component';
|
17
|
+
import Loader from './components/loaders/loader.component';
|
18
|
+
import MarkdownWrapper from './components/inputs/markdown/markdown-wrapper.component';
|
19
|
+
import PatientBanner from './components/patient-banner/patient-banner.component';
|
20
|
+
import Sidebar from './components/sidebar/sidebar.component';
|
21
|
+
import styles from './form-engine.scss';
|
22
22
|
|
23
23
|
interface FormEngineProps {
|
24
24
|
patientUUID: string;
|
@@ -176,7 +176,11 @@ const FormEngine = ({
|
|
176
176
|
}}>
|
177
177
|
{mode === 'view' ? t('close', 'Close') : t('cancel', 'Cancel')}
|
178
178
|
</Button>
|
179
|
-
<Button
|
179
|
+
<Button
|
180
|
+
className={styles.saveButton}
|
181
|
+
disabled={isLoadingDependencies || isSubmitting || mode === 'view'}
|
182
|
+
kind="primary"
|
183
|
+
type="submit">
|
180
184
|
{isSubmitting ? (
|
181
185
|
<InlineLoading description={t('submitting', 'Submitting') + '...'} />
|
182
186
|
) : (
|
package/src/form-engine.scss
CHANGED