@inseefr/lunatic 3.0.0-rc.26 → 3.0.0-rc.28
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/lib/components/LunaticComponents.d.ts +7 -11
- package/lib/components/LunaticComponents.js +4 -1
- package/lib/components/LunaticComponents.js.map +1 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/library.d.ts +1 -1
- package/lib/components/shared/HOC/slottableComponent.d.ts +2 -2
- package/lib/components/shared/MDLabel/MDLabel.js +4 -1
- package/lib/components/shared/MDLabel/MDLabel.js.map +1 -1
- package/lib/components/shared/MDLabel/MDLabel.spec.js +4 -1
- package/lib/components/shared/MDLabel/MDLabel.spec.js.map +1 -1
- package/lib/components/shared/Table/Tbody.spec.js +0 -1
- package/lib/components/shared/Table/Tbody.spec.js.map +1 -1
- package/lib/components/shared/Table/Td.spec.js +0 -1
- package/lib/components/shared/Table/Td.spec.js.map +1 -1
- package/lib/components/type.d.ts +12 -12
- package/lib/hooks/useKeyboardKey.js +1 -0
- package/lib/hooks/useKeyboardKey.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/use-lunatic/actions.d.ts +4 -53
- package/lib/use-lunatic/actions.js +0 -7
- package/lib/use-lunatic/actions.js.map +1 -1
- package/lib/use-lunatic/commons/check-loops.d.ts +2 -2
- package/lib/use-lunatic/commons/check-loops.js.map +1 -1
- package/lib/use-lunatic/commons/check-pager.d.ts +2 -2
- package/lib/use-lunatic/commons/check-pager.js.map +1 -1
- package/lib/use-lunatic/commons/compile-controls.d.ts +2 -2
- package/lib/use-lunatic/commons/compile-controls.js +5 -3
- package/lib/use-lunatic/commons/compile-controls.js.map +1 -1
- package/lib/use-lunatic/commons/create-map-pages.d.ts +2 -2
- package/lib/use-lunatic/commons/create-map-pages.js.map +1 -1
- package/lib/use-lunatic/commons/execute-condition-filter.d.ts +2 -2
- package/lib/use-lunatic/commons/execute-condition-filter.js +3 -4
- package/lib/use-lunatic/commons/execute-condition-filter.js.map +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +614 -6
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +6 -13
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-components.d.ts +19 -17
- package/lib/use-lunatic/commons/fill-components/fill-components.js +29 -29
- package/lib/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/lib/use-lunatic/commons/get-components-from-state.d.ts +2 -3
- package/lib/use-lunatic/commons/get-components-from-state.js +1 -2
- package/lib/use-lunatic/commons/get-components-from-state.js.map +1 -1
- package/lib/use-lunatic/commons/index.d.ts +0 -3
- package/lib/use-lunatic/commons/index.js +0 -3
- package/lib/use-lunatic/commons/index.js.map +1 -1
- package/lib/use-lunatic/commons/is-First-last-page.d.ts +2 -2
- package/lib/use-lunatic/commons/is-First-last-page.js.map +1 -1
- package/lib/use-lunatic/commons/page-navigation.d.ts +3 -3
- package/lib/use-lunatic/commons/page-navigation.js.map +1 -1
- package/lib/use-lunatic/commons/page-navigation.spec.js.map +1 -1
- package/lib/use-lunatic/commons/page-tag.d.ts +4 -4
- package/lib/use-lunatic/commons/page-tag.js.map +1 -1
- package/lib/use-lunatic/commons/page.d.ts +3 -3
- package/lib/use-lunatic/commons/page.js +2 -1
- package/lib/use-lunatic/commons/page.js.map +1 -1
- package/lib/use-lunatic/hooks/use-loop-variables.d.ts +2 -2
- package/lib/use-lunatic/hooks/use-loop-variables.js.map +1 -1
- package/lib/use-lunatic/hooks/use-page-has-response.d.ts +2 -2
- package/lib/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/lib/use-lunatic/hooks/useOverview.d.ts +2 -2
- package/lib/use-lunatic/hooks/useOverview.js.map +1 -1
- package/lib/use-lunatic/props/propComponentType.d.ts +9 -0
- package/lib/use-lunatic/{commons/fill-components/fill-specific-expression.js → props/propComponentType.js} +21 -27
- package/lib/use-lunatic/props/propComponentType.js.map +1 -0
- package/lib/use-lunatic/props/propIterations.d.ts +7 -0
- package/lib/use-lunatic/props/propIterations.js +26 -0
- package/lib/use-lunatic/props/propIterations.js.map +1 -0
- package/lib/use-lunatic/props/propMissingResponse.d.ts +9 -0
- package/lib/use-lunatic/props/propMissingResponse.js +13 -0
- package/lib/use-lunatic/props/propMissingResponse.js.map +1 -0
- package/lib/use-lunatic/props/propValue.d.ts +6 -0
- package/lib/use-lunatic/props/propValue.js +28 -0
- package/lib/use-lunatic/props/propValue.js.map +1 -0
- package/lib/use-lunatic/{commons/fill-components/fill-component-value.spec.js → props/propValue.spec.js} +6 -6
- package/lib/use-lunatic/props/propValue.spec.js.map +1 -0
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.d.ts +2 -2
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -1
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.d.ts +2 -2
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js.map +1 -1
- package/lib/use-lunatic/reducer/controls/check-base-control.d.ts +2 -2
- package/lib/use-lunatic/reducer/controls/check-base-control.js.map +1 -1
- package/lib/use-lunatic/reducer/controls/check-roundabout-control.d.ts +2 -2
- package/lib/use-lunatic/reducer/controls/check-roundabout-control.js.map +1 -1
- package/lib/use-lunatic/reducer/overview/overviewOnInit.d.ts +4 -105
- package/lib/use-lunatic/reducer/overview/overviewOnInit.js +1 -12
- package/lib/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -2
- package/lib/use-lunatic/reducer/reduce-go-next-page.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-go-previous-page.d.ts +2 -3
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +1 -2
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-go-to-page.d.ts +2 -3
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +1 -2
- package/lib/use-lunatic/reducer/reduce-go-to-page.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-handle-change.d.ts +2 -2
- package/lib/use-lunatic/reducer/reduce-handle-change.js.map +1 -1
- package/lib/use-lunatic/reducer/reducer.d.ts +2 -3
- package/lib/use-lunatic/reducer/reducer.js +3 -10
- package/lib/use-lunatic/reducer/reducer.js.map +1 -1
- package/lib/use-lunatic/reducer/reducerInitializer.d.ts +10 -0
- package/lib/use-lunatic/reducer/{reduce-on-init.js → reducerInitializer.js} +70 -72
- package/lib/use-lunatic/reducer/reducerInitializer.js.map +1 -0
- package/lib/use-lunatic/type.d.ts +80 -49
- package/lib/use-lunatic/use-lunatic.d.ts +22 -65
- package/lib/use-lunatic/use-lunatic.js +69 -74
- package/lib/use-lunatic/use-lunatic.js.map +1 -1
- package/lib/utils/object.d.ts +1 -0
- package/lib/utils/object.js +6 -0
- package/lib/utils/object.js.map +1 -1
- package/package.json +2 -1
- package/lib/stories/behaviour/cleaning/source-loop.json +0 -130
- package/lib/stories/behaviour/resizing/source-resizing-cleaning.json +0 -171
- package/lib/stories/overview/dataLoop.json +0 -189
- package/lib/stories/overview/source.json +0 -28
- package/lib/stories/overview/sourceLoop.json +0 -1423
- package/lib/stories/questionnaires/logement/source.json +0 -31762
- package/lib/stories/questionnaires2023/simpsons/source.json +0 -4728
- package/lib/use-lunatic/commons/fill-components/fill-component-required.d.ts +0 -442
- package/lib/use-lunatic/commons/fill-components/fill-component-required.js +0 -13
- package/lib/use-lunatic/commons/fill-components/fill-component-required.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-value.d.ts +0 -5
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +0 -34
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-value.spec.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -770
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +0 -18
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-iterations.d.ts +0 -124
- package/lib/use-lunatic/commons/fill-components/fill-iterations.js +0 -36
- package/lib/use-lunatic/commons/fill-components/fill-iterations.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-management.d.ts +0 -6
- package/lib/use-lunatic/commons/fill-components/fill-management.js +0 -9
- package/lib/use-lunatic/commons/fill-components/fill-management.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.d.ts +0 -12
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +0 -20
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-pagination.d.ts +0 -9
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +0 -10
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +0 -1268
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/index.d.ts +0 -1
- package/lib/use-lunatic/commons/fill-components/index.js +0 -2
- package/lib/use-lunatic/commons/fill-components/index.js.map +0 -1
- package/lib/use-lunatic/commons/use-components-from-state.d.ts +0 -4
- package/lib/use-lunatic/commons/use-components-from-state.js +0 -15
- package/lib/use-lunatic/commons/use-components-from-state.js.map +0 -1
- package/lib/use-lunatic/initial-state.d.ts +0 -3
- package/lib/use-lunatic/initial-state.js +0 -39
- package/lib/use-lunatic/initial-state.js.map +0 -1
- package/lib/use-lunatic/reducer/index.d.ts +0 -1
- package/lib/use-lunatic/reducer/index.js +0 -2
- package/lib/use-lunatic/reducer/index.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-on-init.d.ts +0 -4
- package/lib/use-lunatic/reducer/reduce-on-init.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.d.ts +0 -4
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +0 -8
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js.map +0 -1
- package/lib/use-lunatic/use-lunatic.test.d.ts +0 -1
- package/lib/use-lunatic/use-lunatic.test.js +0 -280
- package/lib/use-lunatic/use-lunatic.test.js.map +0 -1
- /package/lib/use-lunatic/{commons/fill-components/fill-component-value.spec.d.ts → props/propValue.spec.d.ts} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isNumber } from '../../utils/number';
|
|
2
|
+
export function getMissingResponseProp(component, { pager, variables, }) {
|
|
3
|
+
// Component does not have a missing response
|
|
4
|
+
if (!('missingResponse' in component) || !component.missingResponse) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const missingResponse = component.missingResponse;
|
|
8
|
+
return {
|
|
9
|
+
...missingResponse,
|
|
10
|
+
value: variables.get(missingResponse.name, isNumber(pager.iteration) ? [pager.iteration] : undefined),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=propMissingResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propMissingResponse.js","sourceRoot":"","sources":["../../../src/use-lunatic/props/propMissingResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,UAAU,sBAAsB,CACrC,SAAqC,EACrC,EACC,KAAK,EACL,SAAS,GAIT;IAED,6CAA6C;IAC7C,IAAI,CAAC,CAAC,iBAAiB,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;IAClD,OAAO;QACN,GAAG,eAAe;QAClB,KAAK,EAAE,SAAS,CAAC,GAAG,CACnB,eAAe,CAAC,IAAI,EACpB,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CACzD;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LunaticComponentDefinition, LunaticPager } from '../type';
|
|
2
|
+
import type { LunaticVariablesStore } from '../commons/variables/lunatic-variables-store';
|
|
3
|
+
export declare function getValueProp(component: LunaticComponentDefinition, args: {
|
|
4
|
+
pager: LunaticPager;
|
|
5
|
+
variables: LunaticVariablesStore;
|
|
6
|
+
}): unknown;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isNumber } from '../../utils/number';
|
|
2
|
+
import { hasResponse, hasResponses } from '../commons/component';
|
|
3
|
+
export function getValueProp(component, args) {
|
|
4
|
+
let iteration = isNumber(args.pager.iteration)
|
|
5
|
+
? [args.pager.iteration]
|
|
6
|
+
: undefined;
|
|
7
|
+
if (args.pager.linksIterations) {
|
|
8
|
+
iteration = args.pager.linksIterations;
|
|
9
|
+
}
|
|
10
|
+
if (hasResponses(component)) {
|
|
11
|
+
return Object.fromEntries(component.responses?.map(({ response }) => [
|
|
12
|
+
response.name,
|
|
13
|
+
args.variables.get(response.name, iteration),
|
|
14
|
+
]) ?? []);
|
|
15
|
+
}
|
|
16
|
+
if (hasResponse(component)) {
|
|
17
|
+
return args.variables.get(component.response.name, iteration);
|
|
18
|
+
}
|
|
19
|
+
// For loop, value will be a map of child component values
|
|
20
|
+
if ('components' in component) {
|
|
21
|
+
return Object.fromEntries(component.components
|
|
22
|
+
.map((c) => ('response' in c ? c.response.name : null))
|
|
23
|
+
.filter((name) => name !== null)
|
|
24
|
+
.map((name) => [name, args.variables.get(name)]));
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=propValue.js.map
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AAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aACtD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC;aAC/B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAK,CAAC,CAAC,CAAC,CAClD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
import { LunaticVariablesStore } from '../variables/lunatic-variables-store';
|
|
4
|
-
import { times } from '
|
|
2
|
+
import { getValueProp } from './propValue';
|
|
3
|
+
import { LunaticVariablesStore } from '../commons/variables/lunatic-variables-store';
|
|
4
|
+
import { times } from '../../utils/array';
|
|
5
5
|
describe('fillComponentValue', () => {
|
|
6
6
|
// Helper to avoid repetition
|
|
7
7
|
const expectFilledComponent = (component,
|
|
@@ -9,14 +9,14 @@ describe('fillComponentValue', () => {
|
|
|
9
9
|
values = {},
|
|
10
10
|
// Pager iteration
|
|
11
11
|
iteration) => {
|
|
12
|
-
return expect(
|
|
12
|
+
return expect(getValueProp(component, {
|
|
13
13
|
variables: LunaticVariablesStore.makeFromObject(values),
|
|
14
14
|
pager: {
|
|
15
15
|
maxPage: 2,
|
|
16
16
|
page: 1,
|
|
17
17
|
iteration,
|
|
18
18
|
},
|
|
19
|
-
})
|
|
19
|
+
}));
|
|
20
20
|
};
|
|
21
21
|
describe('response', () => {
|
|
22
22
|
const component = {
|
|
@@ -51,4 +51,4 @@ describe('fillComponentValue', () => {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
|
-
//# sourceMappingURL=
|
|
54
|
+
//# sourceMappingURL=propValue.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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AAC,CAAC,CAAC,IAAI,CACvE,QAAQ,CACR,CAAC;YACF,qBAAqB,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CACvE,SAAS,CACT,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QAC1B,MAAM,SAAS,GAAG;YACjB,SAAS,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE;aAC9B,CAAC,CAAC;SAC4C,CAAC;QAEjD,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC9C,qBAAqB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;gBACxC,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;YACH,qBAAqB,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC;gBACzD,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LunaticReducerState } from '../../type';
|
|
2
2
|
/**
|
|
3
3
|
* Update the pager to enter a loop if the pager is on a loop
|
|
4
4
|
*/
|
|
5
|
-
export declare function autoExploreLoop(state:
|
|
5
|
+
export declare function autoExploreLoop(state: LunaticReducerState, direction?: 'forward' | 'backward'): LunaticReducerState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-explore-loop.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/commons/auto-explore-loop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,eAAe,CAC9B,
|
|
1
|
+
{"version":3,"file":"auto-explore-loop.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/commons/auto-explore-loop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,eAAe,CAC9B,KAA0B,EAC1B,YAAoC,SAAS;IAE7C,MAAM,QAAQ,GAAG;QAChB,GAAG,KAAK,CAAC,KAAK;KACd,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,MAAM,SAAS,GAAG,SAAS,KAAK,SAAS,CAAC;IAE1C,MAAM,eAAe,GAAG,CAAC,QAAkB,EAAE,WAAmB,EAAE,EAAE;QACnE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;QACnC,MAAM,YAAY,GAAG,mBAAmB,CACvC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CACxC,CAAC;QACF,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAChC,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;QAC9D,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;QACjC,QAAQ,CAAC,YAAY,GAAG,WAAW,CAAC;QACpC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,GAAG,CAAC,CAAC;QAC/D,eAAe,GAAG,IAAI,CAAC;IACxB,CAAC,CAAC;IAEF,qBAAqB;IACrB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9D,eAAe,CACd,IAAI,CAAC,QAAQ,EACb,KAAK,CAAC,iBAAiB,CAAS,IAAI,CAAC,UAAU,CAAC,CAChD,CAAC;IACH,CAAC;IAED,yFAAyF;IACzF,IACC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,aAAa,KAAK,YAAY;QACjD,IAAI,CAAC,QAAQ;QACb,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EACvB,CAAC;QACF,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAS,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;YACxB,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;IAED,gDAAgD;IAChD,IAAI,CAAC,eAAe,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO;QACN,GAAG,KAAK;QACR,QAAQ,EAAE,QAAQ,CAAC,YAAY,KAAK,SAAS;QAC7C,KAAK,EAAE,QAAQ;KACf,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare function validateLoopConditionFilter(state:
|
|
1
|
+
import type { LunaticReducerState } from '../../type';
|
|
2
|
+
declare function validateLoopConditionFilter(state: Pick<LunaticReducerState, 'pages' | 'executeExpression'>, { next, iteration }: {
|
|
3
3
|
next: string;
|
|
4
4
|
iteration?: number;
|
|
5
5
|
}): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-condition-filter.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/commons/validate-condition-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGvD,SAAS,2BAA2B,CACnC,
|
|
1
|
+
{"version":3,"file":"validate-condition-filter.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/commons/validate-condition-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGvD,SAAS,2BAA2B,CACnC,KAA+D,EAC/D,EAAE,IAAI,EAAE,SAAS,EAAwC;IAEzD,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;IAC1B,IAAI,IAAI,EAAE,CAAC;QACV,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;QACjC,IAAI,eAAe,EAAE,CAAC;YACrB,OAAO,CAAC,CAAC,sBAAsB,CAC9B,eAAe,EACf,iBAAiB,EACjB,SAAS,CACT,CAAC;QACH,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { LunaticControl, LunaticError,
|
|
2
|
-
export declare function checkBaseControl(control: LunaticControl, executeExpression:
|
|
1
|
+
import type { LunaticControl, LunaticError, LunaticReducerState } from '../../type';
|
|
2
|
+
export declare function checkBaseControl(control: LunaticControl, executeExpression: LunaticReducerState['executeExpression'], pager: LunaticReducerState['pager']): LunaticError | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-base-control.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/controls/check-base-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"check-base-control.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/controls/check-base-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;AAOvC,MAAM,UAAU,gBAAgB,CAC/B,OAAuB,EACvB,iBAA2D,EAC3D,KAAmC;IAEnC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC;IAEhD,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE;QACvC,SAAS,EAAE,eAAe,IAAI,SAAS;KACvC,CAAC,CAAC;IAEH,IAAI,CAAC;QACJ;;;;;WAKG;QACH,IAAI,MAAM;YAAE,OAAO,SAAS,CAAC;QAE7B,MAAM,KAAK,GAAG,iBAAiB,CAAY,YAAY,EAAE;YACxD,SAAS;SACT,CAAC,CAAC;QACH,OAAO;YACN,WAAW;YACX,YAAY,EAAE,KAAK;YACnB,EAAE;YACF,aAAa;SACb,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC;QACrD,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LunaticControl, LunaticError } from '../../type';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LunaticReducerState } from '../../type';
|
|
3
3
|
/**
|
|
4
4
|
* Pour le Roundabout, le controle doit être validé pour chaque itération
|
|
5
5
|
* composants l'unité enquêtée.
|
|
@@ -7,4 +7,4 @@ import type { LunaticState } from '../../type';
|
|
|
7
7
|
* Le rondpoint ne peut pas être placé dans une boucle car l'itération est effacée.
|
|
8
8
|
* TODO intégrer cela dans le cadre de boucle de bloucle.
|
|
9
9
|
*/
|
|
10
|
-
export declare function checkRoundaboutControl(control: LunaticControl, executeExpression:
|
|
10
|
+
export declare function checkRoundaboutControl(control: LunaticControl, executeExpression: LunaticReducerState['executeExpression']): LunaticError | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-roundabout-control.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/controls/check-roundabout-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;AAIvC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"check-roundabout-control.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/controls/check-roundabout-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;AAIvC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAAuB,EACvB,iBAA2D;IAE3D,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC7E,MAAM,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC;IAEhD,IAAI,CAAC,UAAU,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7D;;;;;WAKG;SACF,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;SAC/D,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAClB,iBAAiB,CAAY,YAAY,EAAE,EAAE,SAAS,EAAE,CAAC,CACzD,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC;IACjE,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -1,107 +1,6 @@
|
|
|
1
|
-
import type { LunaticOverviewItem
|
|
2
|
-
import {
|
|
3
|
-
import type { ComponentType } from '../../type-source';
|
|
1
|
+
import type { LunaticOverviewItem } from '../../type';
|
|
2
|
+
import type { LunaticSource } from '../../type-source';
|
|
4
3
|
/**
|
|
5
|
-
* Build a static overview
|
|
6
|
-
* This step extracts all the Sequence / Subsequence as a flat structure with the expressions required to build the overview later.
|
|
4
|
+
* Build a static overview from the state, this overview will be interpreted on page change
|
|
7
5
|
*/
|
|
8
|
-
export declare function
|
|
9
|
-
overview: LunaticOverviewItem[];
|
|
10
|
-
updatedAt: number;
|
|
11
|
-
variables: import("../../commons/variables/lunatic-variables-store").LunaticVariablesStore;
|
|
12
|
-
pages: {
|
|
13
|
-
[key: string]: {
|
|
14
|
-
components: ComponentType[];
|
|
15
|
-
isLoop: false;
|
|
16
|
-
iterations?: undefined;
|
|
17
|
-
loopDependencies?: undefined;
|
|
18
|
-
subPages?: undefined;
|
|
19
|
-
} | {
|
|
20
|
-
components: ComponentType[];
|
|
21
|
-
isLoop: true;
|
|
22
|
-
iterations: import("../../type").ExpressionType;
|
|
23
|
-
loopDependencies: string[];
|
|
24
|
-
subPages: string[];
|
|
25
|
-
};
|
|
26
|
-
[key: number]: {
|
|
27
|
-
components: ComponentType[];
|
|
28
|
-
isLoop: false;
|
|
29
|
-
iterations?: undefined;
|
|
30
|
-
loopDependencies?: undefined;
|
|
31
|
-
subPages?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
components: ComponentType[];
|
|
34
|
-
isLoop: true;
|
|
35
|
-
iterations: import("../../type").ExpressionType;
|
|
36
|
-
loopDependencies: string[];
|
|
37
|
-
subPages: string[];
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
isInLoop: boolean;
|
|
41
|
-
isFirstPage: boolean;
|
|
42
|
-
isLastPage: boolean;
|
|
43
|
-
features: ["VTL"] | ["VTL", "MD"];
|
|
44
|
-
preferences: ["COLLECTED"];
|
|
45
|
-
savingType: "COLLECTED";
|
|
46
|
-
cleaning: {
|
|
47
|
-
[variableName: string]: {
|
|
48
|
-
[variableName: string]: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
missingBlock: {
|
|
52
|
-
[variable: string]: string[];
|
|
53
|
-
};
|
|
54
|
-
resizing: {
|
|
55
|
-
[variable: string]: {
|
|
56
|
-
size: string;
|
|
57
|
-
variables: string[];
|
|
58
|
-
sizeForLinksVariables?: unknown;
|
|
59
|
-
linksVariables?: string[] | undefined;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
pager: {
|
|
63
|
-
lastReachedPage?: import("../../type").PageTag | undefined;
|
|
64
|
-
maxPage: number;
|
|
65
|
-
nbSubPages?: number | undefined;
|
|
66
|
-
page: number;
|
|
67
|
-
subPage?: number | undefined;
|
|
68
|
-
iteration?: number | undefined;
|
|
69
|
-
nbIterations?: number | undefined;
|
|
70
|
-
shallowIteration?: number | undefined;
|
|
71
|
-
linksIterations?: number[] | undefined;
|
|
72
|
-
};
|
|
73
|
-
waiting: boolean;
|
|
74
|
-
errors?: {
|
|
75
|
-
[page: string]: {
|
|
76
|
-
[id: string]: import("../../type").LunaticError[];
|
|
77
|
-
};
|
|
78
|
-
} | undefined;
|
|
79
|
-
currentErrors?: {
|
|
80
|
-
[id: string]: import("../../type").LunaticError[];
|
|
81
|
-
} | undefined;
|
|
82
|
-
modalErrors?: Record<string, import("../../type").LunaticError[]> | undefined;
|
|
83
|
-
handleChange: (response: {
|
|
84
|
-
name: string;
|
|
85
|
-
}, value: any, args?: {
|
|
86
|
-
iteration?: number[] | undefined;
|
|
87
|
-
} | undefined) => void;
|
|
88
|
-
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
89
|
-
iteration?: number | number[] | undefined;
|
|
90
|
-
bindingDependencies?: string[] | undefined;
|
|
91
|
-
deps?: string[] | undefined;
|
|
92
|
-
} | undefined) => T;
|
|
93
|
-
updateBindings: (variableName: string, value: unknown, options: {
|
|
94
|
-
iteration?: number[] | undefined;
|
|
95
|
-
}) => unknown;
|
|
96
|
-
activeControls: boolean;
|
|
97
|
-
shortcut?: boolean | undefined;
|
|
98
|
-
management?: boolean | undefined;
|
|
99
|
-
goToPage: (page: {
|
|
100
|
-
page: number | import("../../type").PageTag;
|
|
101
|
-
iteration?: number | undefined;
|
|
102
|
-
nbIterations?: number | undefined;
|
|
103
|
-
subPage?: number | undefined;
|
|
104
|
-
}) => void;
|
|
105
|
-
goNextPage: () => void;
|
|
106
|
-
goPreviousPage: () => void;
|
|
107
|
-
};
|
|
6
|
+
export declare function buildOverview(source: LunaticSource): LunaticOverviewItem[];
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import {} from '../../actions';
|
|
2
|
-
/**
|
|
3
|
-
* Build a static overview that will be interpreted on page change.
|
|
4
|
-
* This step extracts all the Sequence / Subsequence as a flat structure with the expressions required to build the overview later.
|
|
5
|
-
*/
|
|
6
|
-
export function reduceOverviewOnInit(state, action) {
|
|
7
|
-
const overview = action.payload.withOverview
|
|
8
|
-
? buildOverview(action.payload.source)
|
|
9
|
-
: [];
|
|
10
|
-
return { ...state, overview };
|
|
11
|
-
}
|
|
12
1
|
/**
|
|
13
2
|
* Resolve overview items from component definition
|
|
14
3
|
*/
|
|
@@ -53,7 +42,7 @@ function overviewFromLoop(items, component) {
|
|
|
53
42
|
/**
|
|
54
43
|
* Build a static overview from the state, this overview will be interpreted on page change
|
|
55
44
|
*/
|
|
56
|
-
function buildOverview(source) {
|
|
45
|
+
export function buildOverview(source) {
|
|
57
46
|
return source.components.reduce((acc, c) => overviewFromComponent(acc, c), []);
|
|
58
47
|
}
|
|
59
48
|
//# sourceMappingURL=overviewOnInit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overviewOnInit.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/overview/overviewOnInit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overviewOnInit.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/overview/overviewOnInit.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,SAAS,qBAAqB,CAC7B,KAA4B,EAC5B,SAAwB,EACxB,QAAsC,EAAE;IAExC,0DAA0D;IAC1D,IAAI,SAAS,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED,kEAAkE;IAClE,IACC,SAAS,CAAC,aAAa,KAAK,aAAa;QACzC,SAAS,CAAC,aAAa,KAAK,UAAU,EACrC,CAAC;QACF,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,QAAQ,CAAC;QAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC;YACV,EAAE,EAAE,SAAS,CAAC,EAAE;YAChB,IAAI,EAAE,SAAS,CAAC,aAAa;YAC7B,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC5B,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,WAAW,EAAE,SAAS,CAAC,WAAW;YAClC,eAAe,EAAE,SAAS,CAAC,eAAe;YAC1C,GAAG,KAAK;SACR,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CACxB,KAA4B,EAC5B,SAAgD;IAEhD,uEAAuE;IACvE,IAAI,CAAC,CAAC,YAAY,IAAI,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;QAC1C,KAAK,GAAG,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE;YAC3C,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK;SACtC,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAqB;IAClD,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAC9B,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,GAAG,EAAE,CAAC,CAAC,EACzC,EAA2B,CAC3B,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function reduceGoNextPage(state:
|
|
1
|
+
import type { LunaticReducerState } from '../type';
|
|
2
|
+
export declare function reduceGoNextPage(state: LunaticReducerState): LunaticReducerState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduce-go-next-page.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-go-next-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,UAAU,gBAAgB,
|
|
1
|
+
{"version":3,"file":"reduce-go-next-page.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-go-next-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE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eAAe,EAAE,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC;SAClD;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare function reduceGoPreviousPage(state:
|
|
3
|
-
export default reduceGoPreviousPage;
|
|
1
|
+
import type { LunaticReducerState } from '../type';
|
|
2
|
+
export declare function reduceGoPreviousPage(state: LunaticReducerState): LunaticReducerState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPrevPager } from '../commons/page-navigation';
|
|
2
2
|
import { autoExploreLoop } from './commons/auto-explore-loop';
|
|
3
3
|
import { getPageId, isPageEmpty } from '../commons/page';
|
|
4
|
-
function reduceGoPreviousPage(state) {
|
|
4
|
+
export function reduceGoPreviousPage(state) {
|
|
5
5
|
const { pages, pager } = state;
|
|
6
6
|
const parentType = pages[pager.page]?.components[0].componentType;
|
|
7
7
|
const prevPager = getPrevPager(pager, parentType);
|
|
@@ -26,5 +26,4 @@ function reduceGoPreviousPage(state) {
|
|
|
26
26
|
isInLoop: newState.pager.iteration !== undefined,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
export default reduceGoPreviousPage;
|
|
30
29
|
//# sourceMappingURL=reduce-go-previous-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduce-go-previous-page.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-go-previous-page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reduce-go-previous-page.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-go-previous-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,UAAU,oBAAoB,CACnC,KAA0B;IAE1B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IAClE,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE9C,gDAAgD;IAChD,IAAI,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,4DAA4D;IAC5D,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEjD,uEAAuE;IACvE,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;QACjE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,OAAO;QACN,GAAG,QAAQ;QACX,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS;KAChD,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type ActionGoToPage } from '../actions';
|
|
2
|
-
import type {
|
|
3
|
-
declare function reduceGoToPage(state:
|
|
4
|
-
export default reduceGoToPage;
|
|
2
|
+
import type { LunaticReducerState } from '../type';
|
|
3
|
+
export declare function reduceGoToPage(state: LunaticReducerState, action: ActionGoToPage): LunaticReducerState;
|
|
@@ -2,7 +2,7 @@ import {} from '../actions';
|
|
|
2
2
|
import { getPageId, isPageEmpty } from '../commons/page';
|
|
3
3
|
import { getPagerFromPageTag } from '../commons/page-tag';
|
|
4
4
|
import { reduceGoNextPage } from './reduce-go-next-page';
|
|
5
|
-
function reduceGoToPage(state, action) {
|
|
5
|
+
export function reduceGoToPage(state, action) {
|
|
6
6
|
// The page contains non digit, extract information from it
|
|
7
7
|
if (typeof action.payload.page === 'string') {
|
|
8
8
|
const pager = getPagerFromPageTag(action.payload.page);
|
|
@@ -51,5 +51,4 @@ function reduceGoToPage(state, action) {
|
|
|
51
51
|
}
|
|
52
52
|
return newState;
|
|
53
53
|
}
|
|
54
|
-
export default reduceGoToPage;
|
|
55
54
|
//# sourceMappingURL=reduce-go-to-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduce-go-to-page.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-go-to-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"reduce-go-to-page.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-go-to-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,UAAU,cAAc,CAC7B,KAA0B,EAC1B,MAAsB;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CAAC,UAAU,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC;QAClD,QAAQ,CAAC,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAC9C,UAAU,CAAC,UAAU,CACrB,CAAC;IACH,CAAC;IAED,oCAAoC;IACpC,IACC,QAAQ,CAAC,SAAS,KAAK,SAAS;QAChC,QAAQ,CAAC,YAAY,KAAK,SAAS;QACnC,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,YAAY,EAC1C,CAAC;QACF,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,YAAY,GAAG,CAAC,CAAC;IAChD,CAAC;IAED,oCAAoC;IACpC,MAAM,QAAQ,GAAG;QAChB,GAAG,KAAK;QACR,QAAQ,EAAE,QAAQ,CAAC,YAAY,KAAK,SAAS;QAC7C,KAAK,EAAE,QAAQ;KACf,CAAC;IACF,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ActionHandleChange } from '../actions';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LunaticReducerState } from '../type';
|
|
3
3
|
/**
|
|
4
4
|
* Update collected variables
|
|
5
5
|
*/
|
|
6
|
-
export declare function reduceHandleChange(state:
|
|
6
|
+
export declare function reduceHandleChange(state: LunaticReducerState, action: ActionHandleChange): LunaticReducerState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduce-handle-change.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-handle-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,
|
|
1
|
+
{"version":3,"file":"reduce-handle-change.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reduce-handle-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,KAA0B,EAC1B,MAA0B;IAE1B,IAAI,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;IACzC,yCAAyC;IACzC,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACnD,SAAS,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IACD,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;QAC/D,SAAS;KACT,CAAC,CAAC;IAEH,OAAO;QACN,GAAG,KAAK;QACR,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACrB,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type Action } from '../actions';
|
|
2
|
-
import type {
|
|
3
|
-
declare function reducer(state:
|
|
4
|
-
export default reducer;
|
|
2
|
+
import type { LunaticReducerState } from '../type';
|
|
3
|
+
export declare function reducer(state: LunaticReducerState, action: Action): LunaticReducerState;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { ActionKind } from '../actions';
|
|
2
2
|
import { reduceGoNextPage } from './reduce-go-next-page';
|
|
3
|
-
import reduceGoPreviousPage from './reduce-go-previous-page';
|
|
4
|
-
import reduceGoToPage from './reduce-go-to-page';
|
|
5
3
|
import { reduceHandleChange } from './reduce-handle-change';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
function reducer(state, action) {
|
|
4
|
+
import { reduceGoPreviousPage } from './reduce-go-previous-page';
|
|
5
|
+
import { reduceGoToPage } from './reduce-go-to-page';
|
|
6
|
+
export function reducer(state, action) {
|
|
9
7
|
switch (action.type) {
|
|
10
|
-
case ActionKind.ON_INIT:
|
|
11
|
-
return reduceOnInit(state, action);
|
|
12
8
|
case ActionKind.GO_PREVIOUS_PAGE:
|
|
13
9
|
return reduceGoPreviousPage(state);
|
|
14
10
|
case ActionKind.GO_NEXT_PAGE:
|
|
@@ -17,11 +13,8 @@ function reducer(state, action) {
|
|
|
17
13
|
return reduceGoToPage(state, action);
|
|
18
14
|
case ActionKind.HANDLE_CHANGE:
|
|
19
15
|
return reduceHandleChange(state, action);
|
|
20
|
-
case ActionKind.ON_SET_WAITING:
|
|
21
|
-
return reduceOnSetWaiting(state, action);
|
|
22
16
|
default:
|
|
23
17
|
return state;
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
|
-
export default reducer;
|
|
27
20
|
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../src/use-lunatic/reducer/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,UAAU,OAAO,CACtB,KAA0B,EAC1B,MAAc;IAEd,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,UAAU,CAAC,gBAAgB;YAC/B,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACpC,KAAK,UAAU,CAAC,YAAY;YAC3B,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,UAAU,CAAC,UAAU;YACzB,OAAO,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACtC,KAAK,UAAU,CAAC,aAAa;YAC5B,OAAO,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1C;YACC,OAAO,KAAK,CAAC;IACf,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LunaticSource } from '../type-source';
|
|
2
|
+
import type { LunaticOptions, LunaticData, LunaticReducerState } from '../type';
|
|
3
|
+
export declare function reducerInitializer({ source, data, features, initialPage, lastReachedPage, withOverview, }: {
|
|
4
|
+
source: LunaticSource;
|
|
5
|
+
data: LunaticData;
|
|
6
|
+
features?: LunaticOptions['features'];
|
|
7
|
+
initialPage?: LunaticOptions['initialPage'];
|
|
8
|
+
lastReachedPage?: LunaticOptions['lastReachedPage'];
|
|
9
|
+
withOverview?: LunaticOptions['withOverview'];
|
|
10
|
+
}): LunaticReducerState;
|