@arquimedes.co/eureka-forms 2.0.14-test → 2.0.16-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.
@@ -3,7 +3,7 @@ import { FormStep, Mapper } from '../@Types/FormStep';
3
3
  import { SiteState, ValuesStore } from '../States/SiteSlice';
4
4
  import { CustomStep } from '../FormSteps/CustomStep';
5
5
  import { MapperElement } from '../@Types/MapperElement';
6
- export declare const calcValuesStore: (form: Form, originalValues?: Record<string, any>, postview?: boolean, customSteps?: Record<string, CustomStep>) => ValuesStore;
6
+ export declare const calcValuesStore: (form: Readonly<Form>, originalValues?: Record<string, any>, postview?: boolean, customSteps?: Record<string, CustomStep>) => ValuesStore;
7
7
  export declare const addMapperStep: <Type>(step: Mapper, customSteps: Record<string, CustomStep>) => {
8
8
  element: MapperElement<Type>;
9
9
  /** Record of all the new mapper values created */
@@ -12,5 +12,5 @@ export declare const addMapperStep: <Type>(step: Mapper, customSteps: Record<str
12
12
  steps: Record<string, FormStep>;
13
13
  };
14
14
  export declare function calcRecursiveData<Type>(element: Readonly<MapperElement<Type>>, newSteps: Record<string, FormStep>, customSteps: Record<string, CustomStep>): void;
15
- export declare const mapOriginalValue: (step: FormStep, value: any, values: ValuesStore, form?: Form) => any;
15
+ export declare const mapOriginalValue: (step: FormStep, value: any, values: ValuesStore, form?: Readonly<Form>) => any;
16
16
  export declare const calcInitialSections: (form: Form) => Pick<SiteState, 'previousSections' | 'idCurrentSection' | 'nextSections'>;
@@ -147,6 +147,7 @@ export var useSetupApp = function (isEmbedded, _a) {
147
147
  }
148
148
  if (form) {
149
149
  form = createNextState(form, function (form) {
150
+ //If a rootStep is a mapper of type section
150
151
  if (form && classifiers)
151
152
  form.classifiers = classifiers;
152
153
  var _loop_1 = function (section) {
@@ -42,6 +42,7 @@ import CustomStep from './CustomStep';
42
42
  import { useAppSelector } from '../hooks';
43
43
  import { useContext } from 'react';
44
44
  import CustomContext from '../Contexts/CustomContext';
45
+ import { selectOriginalValue } from './StepHooks';
45
46
  function StepComponent(_a) {
46
47
  var _b;
47
48
  var step = _a.step, props = __rest(_a, ["step"]);
@@ -51,9 +52,14 @@ function StepComponent(_a) {
51
52
  }
52
53
  var _c = useAppSelector(function (state) { return state.global; }), postview = _c.postview, partial = _c.partial;
53
54
  var customSteps = useContext(CustomContext).customSteps;
55
+ var originalValue = useAppSelector(function (state) {
56
+ return selectOriginalValue(state, step);
57
+ });
54
58
  var customStep = customSteps[step.type];
55
59
  var editable = props.editable ? (_b = step.editable) !== null && _b !== void 0 ? _b : true : false;
56
- if ((postview || !editable) && (partial || step.partial)) {
60
+ if ((postview || !editable) &&
61
+ (partial || step.partial) &&
62
+ originalValue === undefined) {
57
63
  return _jsx("div", {});
58
64
  }
59
65
  if (customStep) {
@@ -1,7 +1,13 @@
1
1
  import { GBaseStep } from '../@Types/GenericFormSteps';
2
+ import { ValuesStore } from '../States/SiteSlice';
2
3
  import { RootState } from '../Utils/store';
3
4
  import { Form } from '../@Types';
4
5
  import { DependencyStore } from '../Form/Form';
6
+ export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & import("reselect").OutputSelectorFields<(args_0: ValuesStore, args_1: GBaseStep) => any, {
7
+ clearCache: () => void;
8
+ }> & {
9
+ clearCache: () => void;
10
+ };
5
11
  export interface StepDependency {
6
12
  originalValue: any;
7
13
  isDependency: boolean;
@@ -18,7 +18,7 @@ var selectIsDependency = createSelector([
18
18
  ], function (dependencies, step) {
19
19
  return dependencies[step.id] !== undefined;
20
20
  });
21
- var selectOriginalValue = createSelector([
21
+ export var selectOriginalValue = createSelector([
22
22
  function (state) { return state.site.values; },
23
23
  function (state, step) { return step; },
24
24
  ], function (values, step) { var _a; return (_a = values.sections[step.idSection]) === null || _a === void 0 ? void 0 : _a[step.id]; });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version":"2.0.14-test",
4
+ "version":"2.0.16-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",