@inseefr/lunatic 2.6.2-rc.1 → 2.6.3-rc.1

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.
Files changed (144) hide show
  1. package/lib/components/index.js +4 -4
  2. package/lib/components/loop/block-for-loop.js +6 -10
  3. package/lib/components/loop/roster-for-loop/roster-for-loop.js +27 -35
  4. package/lib/components/lunatic-components.js +16 -5
  5. package/lib/components/pairwise-links/pairwise-links.js +27 -30
  6. package/lib/components/table/lunatic-table.js +22 -13
  7. package/lib/components/table/{header.js → table-header.js} +3 -5
  8. package/lib/hooks/use-track-changes.js +50 -0
  9. package/lib/src/components/index.d.ts +2 -2
  10. package/lib/src/components/loop/block-for-loop.d.ts +3 -4
  11. package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +3 -4
  12. package/lib/src/components/lunatic-components.d.ts +5 -3
  13. package/lib/src/components/pairwise-links/pairwise-links.d.ts +1 -2
  14. package/lib/src/components/table/lunatic-table.d.ts +1 -1
  15. package/lib/src/components/table/{header.d.ts → table-header.d.ts} +2 -2
  16. package/lib/src/components/type.d.ts +5 -6
  17. package/lib/src/hooks/use-track-changes.d.ts +9 -0
  18. package/lib/src/use-lunatic/actions.d.ts +3 -16
  19. package/lib/src/use-lunatic/commons/compile-controls.d.ts +3 -2
  20. package/lib/src/use-lunatic/commons/component.d.ts +22 -0
  21. package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +2 -3
  22. package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +6 -0
  23. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +107 -122
  24. package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +112 -0
  25. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +53 -89
  26. package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +1 -0
  27. package/lib/src/use-lunatic/commons/index.d.ts +0 -3
  28. package/lib/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +7 -0
  29. package/lib/src/use-lunatic/commons/variables/behaviours/missing-behaviour.d.ts +7 -0
  30. package/lib/src/use-lunatic/commons/variables/behaviours/resizing-behaviour.d.ts +7 -0
  31. package/lib/src/use-lunatic/commons/variables/get-questionnaire-data.d.ts +4 -0
  32. package/lib/src/use-lunatic/commons/variables/lunatic-variables-store.d.ts +77 -0
  33. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +10 -8
  34. package/lib/src/use-lunatic/reducer/reduce-handle-change.d.ts +6 -0
  35. package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +1 -12
  36. package/lib/src/use-lunatic/type-source.d.ts +7 -21
  37. package/lib/src/use-lunatic/type.d.ts +13 -11
  38. package/lib/src/use-lunatic/use-lunatic.d.ts +33 -56
  39. package/lib/src/utils/array.d.ts +6 -1
  40. package/lib/src/utils/env.d.ts +1 -0
  41. package/lib/src/utils/number.d.ts +4 -0
  42. package/lib/src/utils/variables.d.ts +5 -0
  43. package/lib/src/utils/vtl.d.ts +14 -0
  44. package/lib/use-lunatic/actions.js +3 -3
  45. package/lib/use-lunatic/commons/compile-controls.js +3 -5
  46. package/lib/use-lunatic/commons/component.js +22 -0
  47. package/lib/use-lunatic/commons/execute-condition-filter.js +1 -9
  48. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +2 -3
  49. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +21 -7
  50. package/lib/use-lunatic/commons/fill-components/fill-components.js +5 -3
  51. package/lib/use-lunatic/commons/{execute-expression/get-safety-expression.js → fill-components/fill-iterations.js} +30 -20
  52. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +6 -13
  53. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +58 -5
  54. package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +1 -0
  55. package/lib/use-lunatic/commons/index.js +0 -21
  56. package/lib/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +39 -0
  57. package/lib/use-lunatic/commons/variables/behaviours/missing-behaviour.js +47 -0
  58. package/lib/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +78 -0
  59. package/lib/use-lunatic/{reducer/reduce-handle-change/reduce-variables-array.js → commons/variables/get-questionnaire-data.js} +53 -32
  60. package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +330 -0
  61. package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +216 -0
  62. package/lib/use-lunatic/initial-state.js +5 -2
  63. package/lib/use-lunatic/reducer/overview/overview-on-change.js +1 -1
  64. package/lib/use-lunatic/reducer/{reduce-handle-change/reduce-variables-simple.js → reduce-handle-change.js} +15 -14
  65. package/lib/use-lunatic/reducer/reduce-on-init.js +89 -181
  66. package/lib/use-lunatic/reducer/reducer.js +2 -2
  67. package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +2 -4
  68. package/lib/use-lunatic/use-lunatic.js +18 -14
  69. package/lib/use-lunatic/use-lunatic.test.js +131 -2
  70. package/lib/utils/array.js +57 -6
  71. package/lib/utils/array.spec.js +30 -0
  72. package/lib/utils/env.js +10 -0
  73. package/lib/utils/get-component-value.js +3 -9
  74. package/lib/utils/number.js +13 -1
  75. package/lib/utils/variables.js +37 -0
  76. package/lib/utils/vtl.js +100 -0
  77. package/package.json +1 -1
  78. package/lib/components/loop/utils/get-initial-nb-rows.js +0 -17
  79. package/lib/components/pairwise-links/index.js +0 -13
  80. package/lib/components/pairwise-links/orchestrator.js +0 -71
  81. package/lib/components/pairwise-links/row.js +0 -74
  82. package/lib/components/table/cell.js +0 -89
  83. package/lib/components/table/index.js +0 -13
  84. package/lib/components/table/row.js +0 -40
  85. package/lib/components/table/table-orchestrator.js +0 -35
  86. package/lib/src/components/loop/utils/get-initial-nb-rows.d.ts +0 -4
  87. package/lib/src/components/pairwise-links/index.d.ts +0 -1
  88. package/lib/src/components/pairwise-links/orchestrator.d.ts +0 -6
  89. package/lib/src/components/pairwise-links/row.d.ts +0 -7
  90. package/lib/src/components/table/cell.d.ts +0 -19
  91. package/lib/src/components/table/index.d.ts +0 -1
  92. package/lib/src/components/table/row.d.ts +0 -18
  93. package/lib/src/components/table/table-orchestrator.d.ts +0 -4
  94. package/lib/src/use-lunatic/commons/calculated-variables.d.ts +0 -8
  95. package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +0 -9
  96. package/lib/src/use-lunatic/commons/execute-expression/create-memoizer.d.ts +0 -8
  97. package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +0 -24
  98. package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +0 -11
  99. package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.d.ts +0 -7
  100. package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.spec.d.ts +0 -1
  101. package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +0 -6
  102. package/lib/src/use-lunatic/commons/execute-expression/index.d.ts +0 -1
  103. package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +0 -6
  104. package/lib/src/use-lunatic/commons/get-component-value/index.d.ts +0 -1
  105. package/lib/src/use-lunatic/commons/get-data.d.ts +0 -26
  106. package/lib/src/use-lunatic/reducer/reduce-handle-change/index.d.ts +0 -1
  107. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +0 -7
  108. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.d.ts +0 -1
  109. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +0 -4
  110. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +0 -15
  111. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +0 -7
  112. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +0 -4
  113. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +0 -14
  114. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +0 -9
  115. package/lib/src/use-lunatic/reducer/reduce-on-init.spec.d.ts +0 -1
  116. package/lib/src/utils/vtl/dataset-builder.d.ts +0 -5
  117. package/lib/src/utils/vtl/index.d.ts +0 -1
  118. package/lib/use-lunatic/commons/calculated-variables.js +0 -104
  119. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +0 -233
  120. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.spec.js +0 -155
  121. package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +0 -63
  122. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +0 -149
  123. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.spec.js +0 -130
  124. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +0 -90
  125. package/lib/use-lunatic/commons/execute-expression/execute-expression.spec.js +0 -38
  126. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +0 -40
  127. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.spec.js +0 -31
  128. package/lib/use-lunatic/commons/execute-expression/index.js +0 -13
  129. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +0 -174
  130. package/lib/use-lunatic/commons/get-component-value/index.js +0 -13
  131. package/lib/use-lunatic/commons/get-data.js +0 -80
  132. package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +0 -792
  133. package/lib/use-lunatic/reducer/reduce-handle-change/index.js +0 -13
  134. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +0 -72
  135. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.js +0 -46
  136. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +0 -115
  137. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +0 -89
  138. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +0 -88
  139. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +0 -110
  140. package/lib/use-lunatic/reducer/reduce-on-init.spec.js +0 -17
  141. package/lib/utils/vtl/dataset-builder.js +0 -27
  142. package/lib/utils/vtl/index.js +0 -13
  143. /package/lib/src/use-lunatic/commons/{execute-expression/create-refresh-calculated.spec.d.ts → variables/lunatic-variables-store.spec.d.ts} +0 -0
  144. /package/lib/src/{use-lunatic/commons/execute-expression/execute-expression.spec.d.ts → utils/array.spec.d.ts} +0 -0
@@ -1,10 +1,8 @@
1
1
  import { type FunctionComponent } from 'react';
2
- import type { LunaticState } from './type';
2
+ import type { LunaticData, LunaticState } from './type';
3
3
  import type { LunaticSource } from './type-source';
4
4
  import type { LunaticComponentType } from '../components/type';
5
- declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
6
- COLLECTED: Record<string, import("./type").LunaticCollectedValue>;
7
- }> | undefined, { features, preferences, savingType, onChange, management, shortcut, initialPage, lastReachedPage, autoSuggesterLoading, activeControls, getReferentiel, custom, withOverview, missing, missingStrategy, missingShortcut, dontKnowButton, refusedButton, }: {
5
+ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined, { features, preferences, savingType, onChange, management, shortcut, initialPage, lastReachedPage, autoSuggesterLoading, activeControls, getReferentiel, custom, withOverview, missing, missingStrategy, missingShortcut, dontKnowButton, refusedButton, trackChanges, }: {
8
6
  features?: LunaticState['features'];
9
7
  preferences?: LunaticState['preferences'];
10
8
  savingType?: LunaticState['savingType'];
@@ -26,6 +24,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
26
24
  };
27
25
  dontKnowButton?: string;
28
26
  refusedButton?: string;
27
+ trackChanges?: boolean;
29
28
  }): {
30
29
  getComponents: ({ only, except, }?: {
31
30
  only?: (keyof {
@@ -64,13 +63,12 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
64
63
  min: number;
65
64
  max: number;
66
65
  };
67
- iterations?: number | undefined;
66
+ iterations: number;
68
67
  getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
69
68
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
70
- iteration?: number | undefined;
71
- linksIterations?: number[] | undefined;
72
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
69
+ iteration?: number | number[] | undefined;
73
70
  bindingDependencies?: string[] | undefined;
71
+ deps?: string[] | undefined;
74
72
  } | undefined) => T;
75
73
  value: Record<string, unknown[]>;
76
74
  headers?: {
@@ -83,13 +81,12 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
83
81
  min: number;
84
82
  max: number;
85
83
  };
86
- iterations?: number | undefined;
84
+ iterations: number;
87
85
  getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
88
86
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
89
- iteration?: number | undefined;
90
- linksIterations?: number[] | undefined;
91
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
87
+ iteration?: number | number[] | undefined;
92
88
  bindingDependencies?: string[] | undefined;
89
+ deps?: string[] | undefined;
93
90
  } | undefined) => T;
94
91
  value: Record<string, unknown[]>;
95
92
  headers?: {
@@ -104,14 +101,11 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
104
101
  rowspan?: number | undefined;
105
102
  colspan?: number | undefined;
106
103
  }[];
107
- body: {
108
- label: import("./type").LunaticExpression;
109
- }[][];
104
+ body: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[][];
110
105
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
111
- iteration?: number | undefined;
112
- linksIterations?: number[] | undefined;
113
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
106
+ iteration?: number | number[] | undefined;
114
107
  bindingDependencies?: string[] | undefined;
108
+ deps?: string[] | undefined;
115
109
  } | undefined) => T;
116
110
  iteration: number | undefined;
117
111
  };
@@ -220,15 +214,15 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
220
214
  components: import("./type").LunaticComponentDefinition[];
221
215
  features?: ["VTL"] | ["VTL", "MD"] | undefined;
222
216
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
223
- iteration?: number | undefined;
224
- linksIterations?: number[] | undefined;
225
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
217
+ iteration?: number | number[] | undefined;
226
218
  bindingDependencies?: string[] | undefined;
219
+ deps?: string[] | undefined;
227
220
  } | undefined) => T;
228
221
  xAxisIterations: number;
229
222
  yAxisIterations: number;
230
223
  symLinks: Record<string, Record<string, string>>;
231
224
  value: Record<string, unknown[]>;
225
+ getComponents: (x: number, y: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
232
226
  };
233
227
  Suggester: import("../components/type").LunaticBaseProps<string | null> & {
234
228
  storeName: string;
@@ -312,13 +306,12 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
312
306
  min: number;
313
307
  max: number;
314
308
  };
315
- iterations?: number | undefined;
309
+ iterations: number;
316
310
  getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
317
311
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
318
- iteration?: number | undefined;
319
- linksIterations?: number[] | undefined;
320
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
312
+ iteration?: number | number[] | undefined;
321
313
  bindingDependencies?: string[] | undefined;
314
+ deps?: string[] | undefined;
322
315
  } | undefined) => T;
323
316
  value: Record<string, unknown[]>;
324
317
  headers?: {
@@ -331,13 +324,12 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
331
324
  min: number;
332
325
  max: number;
333
326
  };
334
- iterations?: number | undefined;
327
+ iterations: number;
335
328
  getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
336
329
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
337
- iteration?: number | undefined;
338
- linksIterations?: number[] | undefined;
339
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
330
+ iteration?: number | number[] | undefined;
340
331
  bindingDependencies?: string[] | undefined;
332
+ deps?: string[] | undefined;
341
333
  } | undefined) => T;
342
334
  value: Record<string, unknown[]>;
343
335
  headers?: {
@@ -352,14 +344,11 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
352
344
  rowspan?: number | undefined;
353
345
  colspan?: number | undefined;
354
346
  }[];
355
- body: {
356
- label: import("./type").LunaticExpression;
357
- }[][];
347
+ body: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[][];
358
348
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
359
- iteration?: number | undefined;
360
- linksIterations?: number[] | undefined;
361
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
349
+ iteration?: number | number[] | undefined;
362
350
  bindingDependencies?: string[] | undefined;
351
+ deps?: string[] | undefined;
363
352
  } | undefined) => T;
364
353
  iteration: number | undefined;
365
354
  };
@@ -468,15 +457,15 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
468
457
  components: import("./type").LunaticComponentDefinition[];
469
458
  features?: ["VTL"] | ["VTL", "MD"] | undefined;
470
459
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
471
- iteration?: number | undefined;
472
- linksIterations?: number[] | undefined;
473
- logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
460
+ iteration?: number | number[] | undefined;
474
461
  bindingDependencies?: string[] | undefined;
462
+ deps?: string[] | undefined;
475
463
  } | undefined) => T;
476
464
  xAxisIterations: number;
477
465
  yAxisIterations: number;
478
466
  symLinks: Record<string, Record<string, string>>;
479
467
  value: Record<string, unknown[]>;
468
+ getComponents: (x: number, y: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
480
469
  };
481
470
  Suggester: import("../components/type").LunaticBaseProps<string | null> & {
482
471
  storeName: string;
@@ -552,29 +541,15 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
552
541
  linksIterations?: number[] | undefined;
553
542
  };
554
543
  waiting: boolean;
555
- getData: (withRefreshedCalculated: boolean) => {
556
- CALCULATED: {};
557
- EXTERNAL: ({
558
- variableType: "EXTERNAL";
559
- name: string;
560
- value: unknown;
561
- } & {
562
- variableType: "EXTERNAL";
563
- })[];
564
- COLLECTED: ({
565
- variableType: "COLLECTED";
566
- name: string;
567
- values: import("./type-source").ValuesType<unknown> | import("./type-source").ValuesTypeArray<unknown>;
568
- } & {
569
- variableType: "COLLECTED";
570
- })[];
571
- };
544
+ getData: (withRefreshedCalculated: boolean, variableNames?: string[]) => LunaticData;
572
545
  Provider: FunctionComponent<{
573
546
  children?: import("react").ReactNode;
574
547
  }>;
575
548
  onChange: (response: {
576
549
  name: string;
577
- }, value: any, args?: Record<string, unknown> | undefined) => void;
550
+ }, value: any, args?: {
551
+ iteration?: number[] | undefined;
552
+ } | undefined) => void;
578
553
  overview: {
579
554
  lunaticId: string;
580
555
  page: string;
@@ -585,5 +560,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
585
560
  children: import("./commons/getOverview").OverviewItem[];
586
561
  }[];
587
562
  loopVariables: string[];
563
+ getChangedData: (reset?: boolean) => LunaticData;
564
+ resetChangedData: () => void;
588
565
  };
589
566
  export default useLunatic;
@@ -5,4 +5,9 @@ export declare function times<T>(n: number, cb: (k: number) => T): T[];
5
5
  /**
6
6
  * Update an item in an array without mutating the array
7
7
  */
8
- export declare function setAtIndex<T>(arr: T[], index: number, newValue: T): T[];
8
+ export declare function setAtIndex<T>(arr: T, index: number | number[], newValue: unknown): T;
9
+ /**
10
+ * Get a value inside an array
11
+ */
12
+ export declare function getAtIndex(arr: unknown, indexes: number[]): unknown;
13
+ export declare function resizeArray<T = unknown>(array: unknown, newLength: number, defaultValue?: T): T[];
@@ -0,0 +1 @@
1
+ export declare function isTestEnv(): boolean;
@@ -3,3 +3,7 @@ export declare function forceInt(n: unknown): number;
3
3
  * Limit a number between 2 values
4
4
  */
5
5
  export declare function between(n: number, min: number, max: number): number;
6
+ /**
7
+ * Check if the value is a number
8
+ */
9
+ export declare function isNumber(n: unknown): n is number;
@@ -0,0 +1,5 @@
1
+ import type { LunaticData, LunaticVariable } from '../use-lunatic/type';
2
+ /**
3
+ * Extract the initial value from the source.json and data.json
4
+ */
5
+ export declare function getInitialVariableValue(variable: LunaticVariable, data?: LunaticData): unknown;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Simplified version of interpret (that converts binding and value)
3
+ */
4
+ export declare function interpretVTL<T>(expression: string, bindings: Record<string, unknown>): T;
5
+ /**
6
+ * Extract variables used in a VTL expression
7
+ */
8
+ export declare function parseVTLVariables(expression: string): string[];
9
+ /**
10
+ * Transform a value to make it compatible with VTL (for bindings)
11
+ */
12
+ export declare function getVTLCompatibleValue(value: unknown): {} | null;
13
+ export declare function getExpressionType(expression: unknown): string;
14
+ export declare function getExpressionAsString(expression: unknown): string;
@@ -36,13 +36,13 @@ var goToPage = actionCreator(ActionKind.GO_TO_PAGE);
36
36
  exports.goToPage = goToPage;
37
37
  var onInit = actionCreator(ActionKind.ON_INIT);
38
38
  exports.onInit = onInit;
39
- var handleChange = function handleChange(response, value, args) {
39
+ var handleChange = function handleChange(name, value, iteration) {
40
40
  return {
41
41
  type: ActionKind.HANDLE_CHANGE,
42
42
  payload: {
43
- response: response,
43
+ name: name,
44
44
  value: value,
45
- args: args
45
+ iteration: iteration
46
46
  }
47
47
  };
48
48
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.compileControls = compileControls;
7
7
  var _commons = require("../reducer/commons");
8
8
  var _resolveComponentControls = require("../reducer/resolve-component-controls");
9
9
  var _replaceComponentSequence = require("../replace-component-sequence");
@@ -53,7 +53,7 @@ function isCriticalErrors(errors) {
53
53
  }
54
54
  return false;
55
55
  }
56
- function computeErrors(state) {
56
+ function compileControls(state) {
57
57
  var components = (0, _replaceComponentSequence.replaceComponentSequence)((0, _getComponentsFromState["default"])(state));
58
58
  var componentFiltered = components.map(function (component) {
59
59
  return (0, _fillComponentExpressions["default"])(component, state);
@@ -68,6 +68,4 @@ function computeErrors(state) {
68
68
  currentErrors: currentErrors,
69
69
  isCritical: isCritical
70
70
  };
71
- }
72
- var _default = computeErrors;
73
- exports["default"] = _default;
71
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.hasBody = hasBody;
7
+ exports.hasComponentType = hasComponentType;
8
+ exports.hasResponse = hasResponse;
9
+ exports.hasResponses = hasResponses;
10
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
11
+ function hasResponse(component) {
12
+ return !!component && _typeof(component) === 'object' && 'response' in component && 'name' in component.response;
13
+ }
14
+ function hasResponses(component) {
15
+ return !!component && _typeof(component) === 'object' && 'responses' in component;
16
+ }
17
+ function hasBody(component) {
18
+ return !!component && _typeof(component) === 'object' && 'body' in component && Array.isArray(component.body);
19
+ }
20
+ function hasComponentType(component) {
21
+ return !!component && _typeof(component) === 'object' && 'componentType' in component && typeof component.componentType === 'string';
22
+ }
@@ -9,16 +9,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
9
9
  function executeConditionFilter(filter, execute, iteration) {
10
10
  if (filter && typeof execute === 'function') {
11
11
  var value = filter.value;
12
- var logging = function logging() {
13
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14
- args[_key] = arguments[_key];
15
- }
16
- console.warn(args);
17
- console.warn('executeConditionFilter:', filter);
18
- };
19
12
  return execute((0, _getCompatibleVtlExpression["default"])(value), {
20
- iteration: iteration,
21
- logging: logging
13
+ iteration: iteration
22
14
  });
23
15
  }
24
16
  return undefined;
@@ -24,7 +24,7 @@ var VTL_ATTRIBUTES = ['label', 'options.label', 'responses.label', 'hierarchy.la
24
24
  // Disable controls compilation
25
25
  // 'controls.control',
26
26
  // 'controls.errorMessage',
27
- 'controls.iterations', 'lines.min', 'lines.max', 'iterations', 'xAxisIterations', 'yAxisIterations', 'conditionFilter', 'headers.label', 'header.label', 'disabled', 'readOnly'];
27
+ 'controls.iterations', 'lines.min', 'lines.max', 'xAxisIterations', 'yAxisIterations', 'conditionFilter', 'headers.label', 'header.label', 'disabled', 'readOnly'];
28
28
 
29
29
  // Utility type to replace all expression from an object into a translated version
30
30
 
@@ -39,8 +39,7 @@ function createCrawl(_ref) {
39
39
  var candidate = object[path];
40
40
  try {
41
41
  return _objectSpread(_objectSpread({}, object), {}, _defineProperty({}, path, executeExpression(candidate, {
42
- iteration: iteration,
43
- linksIterations: linksIterations
42
+ iteration: linksIterations !== null && linksIterations !== void 0 ? linksIterations : iteration
44
43
  })));
45
44
  } catch (e) {
46
45
  return _objectSpread(_objectSpread({}, object), {}, _defineProperty({}, path, e instanceof Error ? e.toString() : e));
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
7
- var _getComponentValue = _interopRequireDefault(require("../get-component-value"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6
+ exports.fillComponentValue = fillComponentValue;
7
+ var _component = require("../component");
8
+ var _number = require("../../../utils/number");
9
9
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -13,10 +13,24 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
13
13
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
14
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
15
  function fillComponentValue(component, state) {
16
- var value = (0, _getComponentValue["default"])(component, state);
17
16
  return _objectSpread(_objectSpread({}, component), {}, {
18
- value: value
17
+ value: getValueForComponent(component, state)
19
18
  });
20
19
  }
21
- var _default = fillComponentValue;
22
- exports["default"] = _default;
20
+ function getValueForComponent(component, state) {
21
+ var iteration = (0, _number.isNumber)(state.pager.iteration) ? [state.pager.iteration] : undefined;
22
+ if (state.pager.linksIterations) {
23
+ iteration = state.pager.linksIterations;
24
+ }
25
+ if ((0, _component.hasResponses)(component)) {
26
+ var _component$responses$, _component$responses;
27
+ return Object.entries((_component$responses$ = (_component$responses = component.responses) === null || _component$responses === void 0 ? void 0 : _component$responses.map(function (_ref) {
28
+ var response = _ref.response;
29
+ return [response.name, state.variables.get(response.name, iteration)];
30
+ })) !== null && _component$responses$ !== void 0 ? _component$responses$ : []);
31
+ }
32
+ if ((0, _component.hasResponse)(component)) {
33
+ return state.variables.get(component.response.name, iteration);
34
+ }
35
+ return null;
36
+ }
@@ -3,14 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.fillComponent = exports["default"] = void 0;
7
7
  var _fillComponentExpressions = _interopRequireDefault(require("./fill-component-expressions"));
8
- var _fillComponentValue = _interopRequireDefault(require("./fill-component-value"));
8
+ var _fillComponentValue = require("./fill-component-value");
9
9
  var _fillFromState = _interopRequireDefault(require("./fill-from-state"));
10
10
  var _fillManagement = _interopRequireDefault(require("./fill-management"));
11
11
  var _fillMissingResponse = _interopRequireDefault(require("./fill-missing-response"));
12
12
  var _fillPagination = _interopRequireDefault(require("./fill-pagination"));
13
13
  var _fillSpecificExpression = _interopRequireDefault(require("./fill-specific-expression"));
14
+ var _fillIterations = require("./fill-iterations");
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
16
  /**
16
17
  * Compose multiple methods together to create a new method
@@ -35,11 +36,12 @@ function compose() {
35
36
  *
36
37
  * Force typing for this function since it's doo dynamic
37
38
  */
38
- var fillComponent = compose(_fillFromState["default"], _fillComponentExpressions["default"], _fillPagination["default"], _fillComponentValue["default"], _fillMissingResponse["default"], _fillManagement["default"], _fillSpecificExpression["default"]);
39
+ var fillComponent = compose(_fillFromState["default"], _fillComponentExpressions["default"], _fillPagination["default"], _fillComponentValue.fillComponentValue, _fillMissingResponse["default"], _fillManagement["default"], _fillIterations.fillIterations, _fillSpecificExpression["default"]);
39
40
 
40
41
  /**
41
42
  * Fill components with values coming from the state, and interpret VTL expression
42
43
  */
44
+ exports.fillComponent = fillComponent;
43
45
  function fillComponents(components, state) {
44
46
  return components.map(function (component) {
45
47
  return fillComponent(component, state);
@@ -3,33 +3,43 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
7
- var _constants = require("../../../utils/constants");
6
+ exports.fillIterations = fillIterations;
7
+ var _component = require("../component");
8
+ var _number = require("../../../utils/number");
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
13
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
14
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
14
15
  /**
15
- * Convert an unknown variable into a valid VTL expression object
16
+ * Fill the number of iterations for loop components without "iterations" expression
16
17
  */
17
- function getSafetyExpression(expression) {
18
- if (typeof expression === 'string') {
19
- return {
20
- value: expression,
21
- type: _constants.VTL
22
- };
23
- }
24
- // TODO: fix into model and supress this block
25
- if (expression && _typeof(expression) === 'object' && 'value' in expression && !('type' in expression)) {
26
- return _objectSpread(_objectSpread({}, expression), {}, {
27
- type: _constants.VTL
18
+ function fillIterations(component, state) {
19
+ if ('iterations' in component && component.iterations) {
20
+ return _objectSpread(_objectSpread({}, component), {}, {
21
+ iterations: (0, _number.forceInt)(state.executeExpression(component.iterations, {
22
+ iteration: state.pager.iteration
23
+ }))
28
24
  });
29
25
  }
26
+ if (component.componentType !== 'RosterForLoop' && component.componentType !== 'Loop') {
27
+ return component;
28
+ }
30
29
 
31
- // TODO: ensure we really have an expression here or throw an error
32
- return expression;
33
- }
34
- var _default = getSafetyExpression;
35
- exports["default"] = _default;
30
+ // Iterations expression is not present on the component definition
31
+ // infer it from the value of child components
32
+ var iterations = component.components.reduce(function (acc, component) {
33
+ if (!(0, _component.hasResponse)(component)) {
34
+ return acc;
35
+ }
36
+ var value = state.variables.get(component.response.name, (0, _number.isNumber)(state.pager.iteration) ? [state.pager.iteration] : undefined);
37
+ if (Array.isArray(value) && value.length > acc) {
38
+ return value.length;
39
+ }
40
+ return acc;
41
+ }, 0);
42
+ return _objectSpread(_objectSpread({}, component), {}, {
43
+ iterations: iterations
44
+ });
45
+ }
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+ var _number = require("../../../utils/number");
7
8
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
10
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -19,19 +20,11 @@ function fillMissingResponse(component, state) {
19
20
  return component;
20
21
  }
21
22
  var missingResponse = component.missingResponse;
22
- var variables = state.variables,
23
- pager = state.pager;
24
- var name = missingResponse.name;
25
- if (name in variables) {
26
- var value = variables[name].value;
27
- var missingValue = pager.iteration === undefined ? value : value[pager.iteration];
28
- return _objectSpread(_objectSpread({}, component), {}, {
29
- missingResponse: _objectSpread(_objectSpread({}, missingResponse), {}, {
30
- value: missingValue
31
- })
32
- });
33
- }
34
- return component;
23
+ return _objectSpread(_objectSpread({}, component), {}, {
24
+ missingResponse: _objectSpread(_objectSpread({}, missingResponse), {}, {
25
+ value: state.variables.get(missingResponse.name, (0, _number.isNumber)(state.pager.iteration) ? [state.pager.iteration] : undefined)
26
+ })
27
+ });
35
28
  }
36
29
  var _default = fillMissingResponse;
37
30
  exports["default"] = _default;
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports["default"] = void 0;
8
- var _fillComponents = _interopRequireDefault(require("./fill-components"));
9
- var _array = require("../../../utils/array");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
+ var _fillComponents = _interopRequireWildcard(require("./fill-components"));
9
+ var _component = require("../component");
10
+ var _vtl = require("../../../utils/vtl");
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
15
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -59,8 +61,9 @@ function fillChildComponentsWithIteration(component, state) {
59
61
  getComponents: function getComponents(iteration) {
60
62
  return (0, _fillComponents["default"])(component.components, _objectSpread(_objectSpread({}, state), {}, {
61
63
  handleChange: function handleChange(response, value) {
62
- var _component$value$resp, _component$value;
63
- state.handleChange(response, (0, _array.setAtIndex)((_component$value$resp = (_component$value = component.value) === null || _component$value === void 0 ? void 0 : _component$value[response.name]) !== null && _component$value$resp !== void 0 ? _component$value$resp : [], iteration, value));
64
+ state.handleChange(response, value, {
65
+ iteration: [iteration]
66
+ });
64
67
  },
65
68
  pager: _objectSpread(_objectSpread({}, state.pager), {}, {
66
69
  iteration: iteration,
@@ -71,6 +74,52 @@ function fillChildComponentsWithIteration(component, state) {
71
74
  });
72
75
  }
73
76
 
77
+ /**
78
+ * For pairwise, inject a method to retrieve component at a specific iteration combination
79
+ */
80
+ function fillPairwise(component, state) {
81
+ return _objectSpread(_objectSpread({}, component), {}, {
82
+ getComponents: function getComponents(x, y) {
83
+ if (x === y) {
84
+ return [];
85
+ }
86
+ return (0, _fillComponents["default"])(component.components, _objectSpread(_objectSpread({}, state), {}, {
87
+ handleChange: function handleChange(response, value) {
88
+ state.handleChange(response, value, {
89
+ iteration: [x, y]
90
+ });
91
+ // Update linked value
92
+ if (response.name in component.symLinks && value in component.symLinks[response.name]) {
93
+ state.handleChange(response, component.symLinks[response.name][value], {
94
+ iteration: [y, x]
95
+ });
96
+ }
97
+ },
98
+ pager: _objectSpread(_objectSpread({}, state.pager), {}, {
99
+ linksIterations: [x, y],
100
+ subPage: 0 // Fake a subpage to simulate an iteration
101
+ })
102
+ }));
103
+ }
104
+ });
105
+ }
106
+
107
+ /**
108
+ * For pairwise, inject a method to retrieve component at a specific iteration combination
109
+ */
110
+ function fillTable(component, state) {
111
+ return _objectSpread(_objectSpread({}, component), {}, {
112
+ body: component.body.map(function (row) {
113
+ return row.map(function (component) {
114
+ if ((0, _component.hasComponentType)(component)) {
115
+ return (0, _fillComponents.fillComponent)(component, state);
116
+ }
117
+ return state.executeExpression((0, _vtl.getVTLCompatibleValue)(component.label));
118
+ });
119
+ })
120
+ });
121
+ }
122
+
74
123
  /**
75
124
  * Fill component specific props (RoundAbout for instance)
76
125
  */
@@ -83,6 +132,10 @@ function fillSpecificExpressions(component, state) {
83
132
  case 'Loop':
84
133
  case 'RosterForLoop':
85
134
  return fillChildComponentsWithIteration(component, state);
135
+ case 'PairwiseLinks':
136
+ return fillPairwise(component, state);
137
+ case 'Table':
138
+ return fillTable(component, state);
86
139
  default:
87
140
  return component;
88
141
  }
@@ -8,6 +8,7 @@ var _constants = require("../../utils/constants");
8
8
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
  /**
10
10
  * Ensure that an expression is compatible with VTL (convert if necessary)
11
+ * @deprecated use getExpressionAsString() instead
11
12
  */
12
13
  function getCompatibleVTLExpression(expression) {
13
14
  if (typeof expression === 'string') {