@inseefr/lunatic 3.0.0-rc.25 → 3.0.0-rc.27

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 (184) hide show
  1. package/lib/components/Loop/Loop.js +6 -1
  2. package/lib/components/Loop/Loop.js.map +1 -1
  3. package/lib/components/LunaticComponents.d.ts +7 -11
  4. package/lib/components/LunaticComponents.js +4 -1
  5. package/lib/components/LunaticComponents.js.map +1 -1
  6. package/lib/components/RosterForLoop/RosterForLoop.js +4 -3
  7. package/lib/components/RosterForLoop/RosterForLoop.js.map +1 -1
  8. package/lib/components/Table/Table.js +1 -1
  9. package/lib/components/Table/Table.js.map +1 -1
  10. package/lib/components/library.d.ts +1 -1
  11. package/lib/components/shared/HOC/slottableComponent.d.ts +2 -2
  12. package/lib/components/shared/MDLabel/MDLabel.js +4 -1
  13. package/lib/components/shared/MDLabel/MDLabel.js.map +1 -1
  14. package/lib/components/shared/MDLabel/MDLabel.spec.js +4 -1
  15. package/lib/components/shared/MDLabel/MDLabel.spec.js.map +1 -1
  16. package/lib/components/shared/Table/Table.js +1 -1
  17. package/lib/components/shared/Table/Table.js.map +1 -1
  18. package/lib/components/shared/Table/TableHeader.d.ts +1 -1
  19. package/lib/components/shared/Table/TableHeader.js +3 -3
  20. package/lib/components/shared/Table/TableHeader.js.map +1 -1
  21. package/lib/components/shared/Table/Tbody.d.ts +0 -1
  22. package/lib/components/shared/Table/Tbody.js +2 -2
  23. package/lib/components/shared/Table/Tbody.js.map +1 -1
  24. package/lib/components/shared/Table/Tbody.spec.js +1 -2
  25. package/lib/components/shared/Table/Tbody.spec.js.map +1 -1
  26. package/lib/components/shared/Table/Td.d.ts +0 -1
  27. package/lib/components/shared/Table/Td.js +2 -2
  28. package/lib/components/shared/Table/Td.js.map +1 -1
  29. package/lib/components/shared/Table/Td.spec.js +1 -2
  30. package/lib/components/shared/Table/Td.spec.js.map +1 -1
  31. package/lib/components/shared/Table/Th.d.ts +0 -1
  32. package/lib/components/shared/Table/Th.js +2 -2
  33. package/lib/components/shared/Table/Th.js.map +1 -1
  34. package/lib/components/shared/Table/Th.spec.js +0 -2
  35. package/lib/components/shared/Table/Th.spec.js.map +1 -1
  36. package/lib/components/shared/Table/Thead.d.ts +0 -1
  37. package/lib/components/shared/Table/Thead.js +2 -2
  38. package/lib/components/shared/Table/Thead.js.map +1 -1
  39. package/lib/components/shared/Table/Thead.spec.js +1 -6
  40. package/lib/components/shared/Table/Thead.spec.js.map +1 -1
  41. package/lib/components/shared/Table/Tr.d.ts +0 -1
  42. package/lib/components/shared/Table/Tr.js +2 -2
  43. package/lib/components/shared/Table/Tr.js.map +1 -1
  44. package/lib/components/shared/Table/Tr.spec.js +2 -3
  45. package/lib/components/shared/Table/Tr.spec.js.map +1 -1
  46. package/lib/components/type.d.ts +10 -10
  47. package/lib/index.d.ts +1 -1
  48. package/lib/use-lunatic/actions.d.ts +3 -52
  49. package/lib/use-lunatic/actions.js +0 -7
  50. package/lib/use-lunatic/actions.js.map +1 -1
  51. package/lib/use-lunatic/commons/check-loops.d.ts +2 -2
  52. package/lib/use-lunatic/commons/check-loops.js.map +1 -1
  53. package/lib/use-lunatic/commons/compile-controls.d.ts +2 -2
  54. package/lib/use-lunatic/commons/compile-controls.js +5 -3
  55. package/lib/use-lunatic/commons/compile-controls.js.map +1 -1
  56. package/lib/use-lunatic/commons/create-map-pages.d.ts +2 -2
  57. package/lib/use-lunatic/commons/create-map-pages.js.map +1 -1
  58. package/lib/use-lunatic/commons/execute-condition-filter.d.ts +2 -2
  59. package/lib/use-lunatic/commons/execute-condition-filter.js +3 -4
  60. package/lib/use-lunatic/commons/execute-condition-filter.js.map +1 -1
  61. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +614 -6
  62. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +6 -13
  63. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
  64. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +1 -1
  65. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +1 -1
  66. package/lib/use-lunatic/commons/fill-components/fill-components.d.ts +19 -17
  67. package/lib/use-lunatic/commons/fill-components/fill-components.js +29 -29
  68. package/lib/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  69. package/lib/use-lunatic/commons/get-components-from-state.d.ts +2 -3
  70. package/lib/use-lunatic/commons/get-components-from-state.js +1 -2
  71. package/lib/use-lunatic/commons/get-components-from-state.js.map +1 -1
  72. package/lib/use-lunatic/commons/index.d.ts +0 -3
  73. package/lib/use-lunatic/commons/index.js +0 -3
  74. package/lib/use-lunatic/commons/index.js.map +1 -1
  75. package/lib/use-lunatic/commons/page.d.ts +2 -2
  76. package/lib/use-lunatic/commons/page.js +2 -1
  77. package/lib/use-lunatic/commons/page.js.map +1 -1
  78. package/lib/use-lunatic/hooks/use-loop-variables.d.ts +2 -2
  79. package/lib/use-lunatic/hooks/use-loop-variables.js.map +1 -1
  80. package/lib/use-lunatic/hooks/use-page-has-response.d.ts +2 -2
  81. package/lib/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  82. package/lib/use-lunatic/hooks/useOverview.d.ts +2 -2
  83. package/lib/use-lunatic/hooks/useOverview.js.map +1 -1
  84. package/lib/use-lunatic/props/propComponentType.d.ts +9 -0
  85. package/lib/use-lunatic/{commons/fill-components/fill-specific-expression.js → props/propComponentType.js} +21 -27
  86. package/lib/use-lunatic/props/propComponentType.js.map +1 -0
  87. package/lib/use-lunatic/props/propIterations.d.ts +7 -0
  88. package/lib/use-lunatic/props/propIterations.js +26 -0
  89. package/lib/use-lunatic/props/propIterations.js.map +1 -0
  90. package/lib/use-lunatic/props/propMissingResponse.d.ts +9 -0
  91. package/lib/use-lunatic/props/propMissingResponse.js +13 -0
  92. package/lib/use-lunatic/props/propMissingResponse.js.map +1 -0
  93. package/lib/use-lunatic/props/propValue.d.ts +6 -0
  94. package/lib/use-lunatic/props/propValue.js +28 -0
  95. package/lib/use-lunatic/props/propValue.js.map +1 -0
  96. package/lib/use-lunatic/{commons/fill-components/fill-component-value.spec.js → props/propValue.spec.js} +6 -6
  97. package/lib/use-lunatic/props/propValue.spec.js.map +1 -0
  98. package/lib/use-lunatic/reducer/commons/auto-explore-loop.d.ts +2 -2
  99. package/lib/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -1
  100. package/lib/use-lunatic/reducer/commons/validate-condition-filter.d.ts +2 -2
  101. package/lib/use-lunatic/reducer/commons/validate-condition-filter.js.map +1 -1
  102. package/lib/use-lunatic/reducer/controls/check-base-control.d.ts +2 -2
  103. package/lib/use-lunatic/reducer/controls/check-base-control.js.map +1 -1
  104. package/lib/use-lunatic/reducer/controls/check-roundabout-control.d.ts +2 -2
  105. package/lib/use-lunatic/reducer/controls/check-roundabout-control.js.map +1 -1
  106. package/lib/use-lunatic/reducer/overview/overviewOnInit.d.ts +4 -105
  107. package/lib/use-lunatic/reducer/overview/overviewOnInit.js +1 -12
  108. package/lib/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -1
  109. package/lib/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -2
  110. package/lib/use-lunatic/reducer/reduce-go-next-page.js.map +1 -1
  111. package/lib/use-lunatic/reducer/reduce-go-previous-page.d.ts +2 -3
  112. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +1 -2
  113. package/lib/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -1
  114. package/lib/use-lunatic/reducer/reduce-go-to-page.d.ts +2 -3
  115. package/lib/use-lunatic/reducer/reduce-go-to-page.js +1 -2
  116. package/lib/use-lunatic/reducer/reduce-go-to-page.js.map +1 -1
  117. package/lib/use-lunatic/reducer/reduce-handle-change.d.ts +2 -2
  118. package/lib/use-lunatic/reducer/reduce-handle-change.js.map +1 -1
  119. package/lib/use-lunatic/reducer/reducer.d.ts +2 -3
  120. package/lib/use-lunatic/reducer/reducer.js +3 -10
  121. package/lib/use-lunatic/reducer/reducer.js.map +1 -1
  122. package/lib/use-lunatic/reducer/reducerInitializer.d.ts +10 -0
  123. package/lib/use-lunatic/reducer/{reduce-on-init.js → reducerInitializer.js} +70 -72
  124. package/lib/use-lunatic/reducer/reducerInitializer.js.map +1 -0
  125. package/lib/use-lunatic/type.d.ts +77 -49
  126. package/lib/use-lunatic/use-lunatic.d.ts +23 -69
  127. package/lib/use-lunatic/use-lunatic.js +69 -74
  128. package/lib/use-lunatic/use-lunatic.js.map +1 -1
  129. package/lib/utils/object.d.ts +1 -0
  130. package/lib/utils/object.js +6 -0
  131. package/lib/utils/object.js.map +1 -1
  132. package/package.json +2 -1
  133. package/lib/stories/behaviour/cleaning/source-loop.json +0 -130
  134. package/lib/stories/behaviour/resizing/source-resizing-cleaning.json +0 -171
  135. package/lib/stories/overview/dataLoop.json +0 -189
  136. package/lib/stories/overview/source.json +0 -28
  137. package/lib/stories/overview/sourceLoop.json +0 -1423
  138. package/lib/stories/questionnaires/logement/source.json +0 -31762
  139. package/lib/stories/questionnaires2023/simpsons/source.json +0 -4728
  140. package/lib/use-lunatic/commons/fill-components/fill-component-required.d.ts +0 -442
  141. package/lib/use-lunatic/commons/fill-components/fill-component-required.js +0 -13
  142. package/lib/use-lunatic/commons/fill-components/fill-component-required.js.map +0 -1
  143. package/lib/use-lunatic/commons/fill-components/fill-component-value.d.ts +0 -5
  144. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +0 -34
  145. package/lib/use-lunatic/commons/fill-components/fill-component-value.js.map +0 -1
  146. package/lib/use-lunatic/commons/fill-components/fill-component-value.spec.js.map +0 -1
  147. package/lib/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -770
  148. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +0 -18
  149. package/lib/use-lunatic/commons/fill-components/fill-from-state.js.map +0 -1
  150. package/lib/use-lunatic/commons/fill-components/fill-iterations.d.ts +0 -124
  151. package/lib/use-lunatic/commons/fill-components/fill-iterations.js +0 -36
  152. package/lib/use-lunatic/commons/fill-components/fill-iterations.js.map +0 -1
  153. package/lib/use-lunatic/commons/fill-components/fill-management.d.ts +0 -6
  154. package/lib/use-lunatic/commons/fill-components/fill-management.js +0 -9
  155. package/lib/use-lunatic/commons/fill-components/fill-management.js.map +0 -1
  156. package/lib/use-lunatic/commons/fill-components/fill-missing-response.d.ts +0 -12
  157. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +0 -20
  158. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js.map +0 -1
  159. package/lib/use-lunatic/commons/fill-components/fill-pagination.d.ts +0 -9
  160. package/lib/use-lunatic/commons/fill-components/fill-pagination.js +0 -10
  161. package/lib/use-lunatic/commons/fill-components/fill-pagination.js.map +0 -1
  162. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +0 -1268
  163. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js.map +0 -1
  164. package/lib/use-lunatic/commons/fill-components/index.d.ts +0 -1
  165. package/lib/use-lunatic/commons/fill-components/index.js +0 -2
  166. package/lib/use-lunatic/commons/fill-components/index.js.map +0 -1
  167. package/lib/use-lunatic/commons/use-components-from-state.d.ts +0 -4
  168. package/lib/use-lunatic/commons/use-components-from-state.js +0 -15
  169. package/lib/use-lunatic/commons/use-components-from-state.js.map +0 -1
  170. package/lib/use-lunatic/initial-state.d.ts +0 -3
  171. package/lib/use-lunatic/initial-state.js +0 -39
  172. package/lib/use-lunatic/initial-state.js.map +0 -1
  173. package/lib/use-lunatic/reducer/index.d.ts +0 -1
  174. package/lib/use-lunatic/reducer/index.js +0 -2
  175. package/lib/use-lunatic/reducer/index.js.map +0 -1
  176. package/lib/use-lunatic/reducer/reduce-on-init.d.ts +0 -4
  177. package/lib/use-lunatic/reducer/reduce-on-init.js.map +0 -1
  178. package/lib/use-lunatic/reducer/reduce-on-set-waiting.d.ts +0 -4
  179. package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +0 -8
  180. package/lib/use-lunatic/reducer/reduce-on-set-waiting.js.map +0 -1
  181. package/lib/use-lunatic/use-lunatic.test.d.ts +0 -1
  182. package/lib/use-lunatic/use-lunatic.test.js +0 -280
  183. package/lib/use-lunatic/use-lunatic.test.js.map +0 -1
  184. /package/lib/use-lunatic/{commons/fill-components/fill-component-value.spec.d.ts → props/propValue.spec.d.ts} +0 -0
@@ -1,18 +0,0 @@
1
- /**
2
- * Add state data as component props
3
- */
4
- function fillFromState(component, state) {
5
- const { handleChange, executeExpression, preferences, goToPage, shortcut, goNextPage, goPreviousPage, } = state;
6
- return {
7
- ...component,
8
- handleChange,
9
- executeExpression,
10
- preferences,
11
- goToPage,
12
- shortcut,
13
- goNextPage,
14
- goPreviousPage,
15
- };
16
- }
17
- export default fillFromState;
18
- //# sourceMappingURL=fill-from-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fill-from-state.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-from-state.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,SAAS,aAAa,CACrB,SAAqC,EACrC,KAAmB;IAEnB,MAAM,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,cAAc,GACd,GAAG,KAAK,CAAC;IACV,OAAO;QACN,GAAG,SAAS;QACZ,YAAY;QACZ,iBAAiB;QACjB,WAAW;QACX,QAAQ;QACR,QAAQ;QACR,UAAU;QACV,cAAc;KACd,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -1,124 +0,0 @@
1
- import type { LunaticComponentDefinition, LunaticState } from '../../type';
2
- /**
3
- * Fill the number of iterations for loop components without "iterations" expression
4
- */
5
- export declare function fillIterations(component: LunaticComponentDefinition, state: LunaticState): (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSequenceType & {
6
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
7
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSubSequenceType & {
8
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
9
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentTableType & {
10
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
11
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentNumberType & {
12
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
13
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDatePickerType & {
14
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
15
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDurationType & {
16
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
17
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxGroupType & {
18
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
19
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxBooleanType & {
20
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
21
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRadioType & {
22
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
23
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentFilterDescriptionType & {
24
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
25
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDropdownType & {
26
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
27
- }) | (Omit<import("../../type-source").ComponentTypeBase, "label"> & import("../../type-source").ComponentPairWiseLinksType & {
28
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
29
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRoundaboutType & {
30
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
31
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSuggesterType & {
32
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
33
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentInputOrTextareaType & {
34
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
35
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxOneType & {
36
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
37
- }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentQuestionType & {
38
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
39
- }) | {
40
- iterations: number;
41
- label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
42
- description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
43
- declarations?: import("../../type-source").DeclarationType[] | undefined;
44
- conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
45
- controls?: import("../../type-source").ControlType[] | undefined;
46
- id: string;
47
- bindingDependencies?: string[] | undefined;
48
- hierarchy?: import("../../type-source").Hierarchy | undefined;
49
- mandatory?: boolean | undefined;
50
- page: string;
51
- componentType: "Loop";
52
- loopDependencies: string[];
53
- components: import("../../type-source").ComponentType[];
54
- depth: number;
55
- paginatedLoop: true;
56
- maxPage: string;
57
- } | {
58
- iterations: number;
59
- label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
60
- description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
61
- declarations?: import("../../type-source").DeclarationType[] | undefined;
62
- conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
63
- controls?: import("../../type-source").ControlType[] | undefined;
64
- id: string;
65
- bindingDependencies?: string[] | undefined;
66
- hierarchy?: import("../../type-source").Hierarchy | undefined;
67
- mandatory?: boolean | undefined;
68
- page: string;
69
- componentType: "Roundabout";
70
- components: import("../../type-source").ComponentType[];
71
- locked: boolean;
72
- expressions: Record<string, import("../../type-source").LabelType<"VTL" | "VTL|MD">>;
73
- } | {
74
- iterations: number;
75
- label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
76
- description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
77
- declarations?: import("../../type-source").DeclarationType[] | undefined;
78
- conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
79
- controls?: import("../../type-source").ControlType[] | undefined;
80
- id: string;
81
- bindingDependencies?: string[] | undefined;
82
- hierarchy?: import("../../type-source").Hierarchy | undefined;
83
- mandatory?: boolean | undefined;
84
- page: string;
85
- componentType: "RosterForLoop";
86
- components: import("../../type-source").ComponentType[];
87
- lines: {
88
- min: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
89
- max: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
90
- };
91
- header?: {
92
- value: string;
93
- label: string | import("../../type-source").LabelType<"VTL" | "VTL|MD">;
94
- options: {
95
- value: string;
96
- label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
97
- description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
98
- }[];
99
- colspan?: number | undefined;
100
- rowspan?: number | undefined;
101
- }[] | undefined;
102
- positioning: "HORIZONTAL";
103
- } | {
104
- iterations: number;
105
- label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
106
- description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
107
- declarations?: import("../../type-source").DeclarationType[] | undefined;
108
- conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
109
- controls?: import("../../type-source").ControlType[] | undefined;
110
- id: string;
111
- bindingDependencies?: string[] | undefined;
112
- hierarchy?: import("../../type-source").Hierarchy | undefined;
113
- mandatory?: boolean | undefined;
114
- page: string;
115
- componentType: "Loop";
116
- loopDependencies: string[];
117
- components: import("../../type-source").ComponentType[];
118
- depth: number;
119
- paginatedLoop: false;
120
- lines: {
121
- min: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
122
- max: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
123
- };
124
- };
@@ -1,36 +0,0 @@
1
- import { hasResponse } from '../component';
2
- import { forceInt, isNumber } from '../../../utils/number';
3
- /**
4
- * Fill the number of iterations for loop components without "iterations" expression
5
- */
6
- export function fillIterations(component, state) {
7
- if ('iterations' in component && component.iterations) {
8
- return {
9
- ...component,
10
- iterations: forceInt(state.executeExpression(component.iterations, {
11
- iteration: state.pager.iteration,
12
- })),
13
- };
14
- }
15
- if (component.componentType !== 'RosterForLoop' &&
16
- component.componentType !== 'Loop') {
17
- return component;
18
- }
19
- // Iterations expression is not present on the component definition
20
- // infer it from the value of child components
21
- const iterations = component.components.reduce((acc, component) => {
22
- if (!hasResponse(component)) {
23
- return acc;
24
- }
25
- const value = state.variables.get(component.response.name, isNumber(state.pager.iteration) ? [state.pager.iteration] : undefined);
26
- if (Array.isArray(value) && value.length > acc) {
27
- return value.length;
28
- }
29
- return acc;
30
- }, 0);
31
- return {
32
- ...component,
33
- iterations,
34
- };
35
- }
36
- //# sourceMappingURL=fill-iterations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fill-iterations.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-iterations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,cAAc,CAC7B,SAAqC,EACrC,KAAmB;IAEnB,IAAI,YAAY,IAAI,SAAS,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;QACvD,OAAO;YACN,GAAG,SAAS;YACZ,UAAU,EAAE,QAAQ,CACnB,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,UAAU,EAAE;gBAC7C,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS;aAChC,CAAC,CACF;SACD,CAAC;IACH,CAAC;IAED,IACC,SAAS,CAAC,aAAa,KAAK,eAAe;QAC3C,SAAS,CAAC,aAAa,KAAK,MAAM,EACjC,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,mEAAmE;IACnE,8CAA8C;IAC9C,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;QACjE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAChC,SAAS,CAAC,QAAQ,CAAC,IAAI,EACvB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CACrE,CAAC;QACF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC,MAAM,CAAC;QACrB,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,OAAO;QACN,GAAG,SAAS;QACZ,UAAU;KACV,CAAC;AACH,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { LunaticComponentDefinition, LunaticState } from '../../type';
2
- export type FilledProps = {
3
- management?: boolean;
4
- };
5
- declare function fillManagement(component: LunaticComponentDefinition, state: LunaticState): LunaticComponentDefinition & FilledProps;
6
- export default fillManagement;
@@ -1,9 +0,0 @@
1
- function fillManagement(component, state) {
2
- const { management } = state;
3
- if (management) {
4
- return { ...component, management };
5
- }
6
- return component;
7
- }
8
- export default fillManagement;
9
- //# sourceMappingURL=fill-management.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fill-management.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-management.ts"],"names":[],"mappings":"AAIA,SAAS,cAAc,CACtB,SAAqC,EACrC,KAAmB;IAEnB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,EAAE,GAAG,SAAS,EAAE,UAAU,EAAE,CAAC;IACrC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { LunaticComponentDefinition, LunaticState } from '../../type';
2
- export type FilledProps = {
3
- missingResponse?: {
4
- name: string;
5
- value?: unknown;
6
- };
7
- };
8
- /**
9
- * Inject the value for the missingResponse variable
10
- */
11
- declare function fillMissingResponse(component: LunaticComponentDefinition, state: LunaticState): LunaticComponentDefinition & FilledProps;
12
- export default fillMissingResponse;
@@ -1,20 +0,0 @@
1
- import { isNumber } from '../../../utils/number';
2
- /**
3
- * Inject the value for the missingResponse variable
4
- */
5
- function fillMissingResponse(component, state) {
6
- // Component does not have a missing response
7
- if (!('missingResponse' in component) || !component.missingResponse) {
8
- return component;
9
- }
10
- const missingResponse = component.missingResponse;
11
- return {
12
- ...component,
13
- missingResponse: {
14
- ...missingResponse,
15
- value: state.variables.get(missingResponse.name, isNumber(state.pager.iteration) ? [state.pager.iteration] : undefined),
16
- },
17
- };
18
- }
19
- export default fillMissingResponse;
20
- //# sourceMappingURL=fill-missing-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fill-missing-response.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-missing-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AASjD;;GAEG;AACH,SAAS,mBAAmB,CAC3B,SAAqC,EACrC,KAAmB;IAEnB,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,SAAS;QACZ,eAAe,EAAE;YAChB,GAAG,eAAe;YAClB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CACzB,eAAe,CAAC,IAAI,EACpB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CACrE;SACD;KACD,CAAC;AACH,CAAC;AAED,eAAe,mBAAmB,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { LunaticComponentDefinition, LunaticState } from '../../type';
2
- export type FilledProps = {
3
- iteration?: number;
4
- };
5
- /**
6
- * Inject the iteration index in the component props
7
- */
8
- declare function fillPagination<T extends LunaticComponentDefinition>(component: T, state: LunaticState): LunaticComponentDefinition & FilledProps;
9
- export default fillPagination;
@@ -1,10 +0,0 @@
1
- /**
2
- * Inject the iteration index in the component props
3
- */
4
- function fillPagination(component, state) {
5
- const { pager } = state;
6
- const { iteration } = pager;
7
- return { ...component, iteration };
8
- }
9
- export default fillPagination;
10
- //# sourceMappingURL=fill-pagination.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fill-pagination.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-pagination.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,SAAS,cAAc,CACtB,SAAY,EACZ,KAAmB;IAEnB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE5B,OAAO,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC;AAED,eAAe,cAAc,CAAC"}