@arquimedes.co/eureka-forms 3.0.56 → 3.0.57-test
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/App/App.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Classifier, Form } from '../@Types/Form';
|
|
1
|
+
import { Classifier, Form, FormStyle } from '../@Types/Form';
|
|
2
2
|
import './App.css';
|
|
3
3
|
import { CustomStep, CustomStepProps } from '../FormSteps/CustomStep';
|
|
4
4
|
import { EditorState } from 'draft-js';
|
|
@@ -17,6 +17,11 @@ export interface AppProps {
|
|
|
17
17
|
formData?: Form;
|
|
18
18
|
/** If the widget is usedInternally */
|
|
19
19
|
internal?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Overrides for the built-in internal style — only honored with `internal`, where the form's own
|
|
22
|
+
* style is ignored. Lets the host app (the admin) render the form in its color scheme, e.g. dark mode.
|
|
23
|
+
*/
|
|
24
|
+
formStyle?: Partial<FormStyle>;
|
|
20
25
|
/** If the widget is a postview (view what the user filled)*/
|
|
21
26
|
postview?: boolean;
|
|
22
27
|
/** If postview should only show steps with values*/
|
package/dist/App/AppHooks.js
CHANGED
|
@@ -12,7 +12,7 @@ import { iterateNestedSteps } from '../FormSteps/StepFunctions';
|
|
|
12
12
|
import { createNextState } from '@reduxjs/toolkit';
|
|
13
13
|
import { BaseConfirmationMessage } from '../Contexts/FormContext';
|
|
14
14
|
export const useSetupApp = (isEmbedded, props) => {
|
|
15
|
-
const { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, idCurrentAgent, ...others } = props;
|
|
15
|
+
const { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, idCurrentAgent, formStyle: formStyleOverride, ...others } = props;
|
|
16
16
|
const [form, setForm] = useState(undefined);
|
|
17
17
|
const [organization, setOrganization] = useState(undefined);
|
|
18
18
|
const dispatch = useAppDispatch();
|
|
@@ -112,7 +112,7 @@ export const useSetupApp = (isEmbedded, props) => {
|
|
|
112
112
|
user,
|
|
113
113
|
apiKey,
|
|
114
114
|
formStyle: internal
|
|
115
|
-
? InternalFormStyle
|
|
115
|
+
? { ...InternalFormStyle, ...(formStyleOverride ?? {}) }
|
|
116
116
|
: {
|
|
117
117
|
...InternalFormStyle,
|
|
118
118
|
...(form?.style ?? {}),
|
|
@@ -42,6 +42,12 @@ function MaterialProviders({ children, formStyle = InternalFormStyle }) {
|
|
|
42
42
|
primary: formStyle.textColor,
|
|
43
43
|
secondary: formStyle.descriptionTextColor,
|
|
44
44
|
},
|
|
45
|
+
// Paper follows the form surface so menus, pickers and dialogs match a non-white form
|
|
46
|
+
// (the admin's dark scheme in particular) instead of MUI's default white.
|
|
47
|
+
background: {
|
|
48
|
+
default: formStyle.standAloneBackgroundColor,
|
|
49
|
+
paper: formStyle.backgroundColor,
|
|
50
|
+
},
|
|
45
51
|
},
|
|
46
52
|
}, DatePickersEs //Potencialmente cambiar esto dependiendo de la empresa?
|
|
47
53
|
), children: _jsx(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: getLocale(), children: children }) }));
|
package/package.json
CHANGED