@inseefr/lunatic 3.6.4 → 3.6.6
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/components/CheckboxGroup/CustomCheckboxGroup.d.ts +1 -1
- package/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -1
- package/components/Roundabout/CustomRoundabout.js +2 -2
- package/components/Roundabout/CustomRoundabout.js.map +1 -1
- package/components/Roundabout/roundabout.spec.js +22 -0
- package/components/Roundabout/roundabout.spec.js.map +1 -1
- package/components/shared/Checkbox/CheckboxOption.d.ts +4 -2
- package/components/shared/Checkbox/CheckboxOption.js.map +1 -1
- package/components/shared/Radio/RadioGroup.d.ts +1 -1
- package/components/shared/Radio/RadioGroup.js.map +1 -1
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.d.ts +1 -1
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -1
- package/esm/components/Roundabout/CustomRoundabout.js +2 -2
- package/esm/components/Roundabout/CustomRoundabout.js.map +1 -1
- package/esm/components/Roundabout/roundabout.spec.js +22 -0
- package/esm/components/Roundabout/roundabout.spec.js.map +1 -1
- package/esm/components/shared/Checkbox/CheckboxOption.d.ts +4 -2
- package/esm/components/shared/Checkbox/CheckboxOption.js.map +1 -1
- package/esm/components/shared/Radio/RadioGroup.d.ts +1 -1
- package/esm/components/shared/Radio/RadioGroup.js.map +1 -1
- package/esm/type.source.d.ts +1 -0
- package/esm/type.source.js +1 -0
- package/esm/type.source.js.map +1 -1
- package/esm/use-lunatic/commons/compile-controls.js +25 -7
- package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +2 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +1 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
- package/package.json +2 -1
- package/src/components/CheckboxGroup/CustomCheckboxGroup.tsx +1 -0
- package/src/components/Roundabout/CustomRoundabout.tsx +11 -1
- package/src/components/Roundabout/roundabout.spec.tsx +38 -0
- package/src/components/shared/Checkbox/CheckboxOption.tsx +3 -2
- package/src/components/shared/Radio/RadioGroup.tsx +1 -0
- package/src/stories/roundabout/roundabout.stories.tsx +13 -0
- package/src/stories/roundabout/sourceWithControl.json +599 -0
- package/src/type.source.ts +2 -0
- package/src/use-lunatic/commons/compile-controls.ts +47 -11
- package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +1 -1
- package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +1 -0
- package/type.source.js +1 -0
- package/type.source.js.map +1 -1
- package/use-lunatic/commons/compile-controls.js +24 -7
- package/use-lunatic/commons/compile-controls.js.map +1 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.js +2 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +1 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
|
@@ -95,7 +95,7 @@ describe('lunatic-variables-store', () => {
|
|
|
95
95
|
variables.set('LASTNAME', 'Doe');
|
|
96
96
|
expect(variables.run('FIRSTNAME || " " || LASTNAME')).toEqual('John Doe');
|
|
97
97
|
expect(variables.run('FIRSTNAME || " " || LASTNAME')).toEqual('John Doe');
|
|
98
|
-
expect(variables.interpretCount).toBe(
|
|
98
|
+
expect(variables.interpretCount).toBe(1); // only once computation since improvment of caching result
|
|
99
99
|
variables.set('FIRSTNAME', 'Jane');
|
|
100
100
|
expect(variables.run('FIRSTNAME || " " || LASTNAME')).toEqual('Jane Doe');
|
|
101
101
|
});
|
|
@@ -384,7 +384,9 @@ class LunaticVariable {
|
|
|
384
384
|
if (hasNoBinding) {
|
|
385
385
|
iteration = undefined;
|
|
386
386
|
}
|
|
387
|
-
|
|
387
|
+
|
|
388
|
+
const checkCache = this.shapeFrom || iteration === undefined;
|
|
389
|
+
if (checkCache && !this.isOutdated(iteration)) {
|
|
388
390
|
return this.getSavedValue(iteration);
|
|
389
391
|
}
|
|
390
392
|
if (isTestEnv()) {
|