@inseefr/lunatic 2.5.2-rc1-beta → 2.6.0-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 (436) hide show
  1. package/README.fr.md +186 -0
  2. package/README.md +111 -94
  3. package/lib/components/button/lunatic-button.js +10 -13
  4. package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +0 -1
  5. package/lib/components/commons/components/combo-box/combo-box-content.js +2 -1
  6. package/lib/components/commons/components/combo-box/combo-box.js +94 -66
  7. package/lib/components/commons/components/combo-box/combo-box.stories.js +69 -8
  8. package/lib/components/commons/components/combo-box/panel/panel.js +0 -1
  9. package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +4 -1
  10. package/lib/components/commons/components/combo-box/selection/LabelOrInput.spec.js +2 -4
  11. package/lib/components/commons/components/combo-box/selection/combo-box-label-selection.js +5 -2
  12. package/lib/components/commons/components/combo-box/selection/label-selection.js +4 -2
  13. package/lib/components/commons/components/combo-box/selection/selection.js +2 -0
  14. package/lib/components/commons/components/fab/fab.js +0 -1
  15. package/lib/components/commons/components/fieldset.js +0 -1
  16. package/lib/components/commons/components/lunatic-component-with-label.js +1 -3
  17. package/lib/components/commons/components/md-label/md-label.js +5 -1
  18. package/lib/components/commons/components/md-label/md-label.spec.js +15 -0
  19. package/lib/components/commons/components/missing/missing.js +1 -3
  20. package/lib/components/commons/components/variable-status/variable-status.js +2 -3
  21. package/lib/components/commons/create-customizable-field.js +1 -0
  22. package/lib/components/commons/icons/closed-icon.js +0 -2
  23. package/lib/components/commons/icons/cross-icon.js +0 -2
  24. package/lib/components/commons/index.js +0 -7
  25. package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +124 -0
  26. package/lib/components/component-set/html/{legend/legend.js → component-set-legend.js} +4 -6
  27. package/lib/components/component-set/html/component-set-wrapper.js +16 -0
  28. package/lib/components/component-set/html/component-set.js +7 -8
  29. package/lib/components/component-set/html/component-set.spec.js +91 -0
  30. package/lib/components/component-set/lunatic-component-set.js +19 -9
  31. package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +34 -0
  32. package/lib/components/datepicker/html/datepicker-input.js +0 -1
  33. package/lib/components/datepicker/html/datepicker.js +1 -4
  34. package/lib/components/datepicker/html/datepicker.spec.js +38 -0
  35. package/lib/components/datepicker/lunatic-datepicker.js +0 -1
  36. package/lib/components/dropdown/html/__snapshots__/dropdown.spec.tsx.snap +85 -0
  37. package/lib/components/dropdown/html/dropdown-simple/dropdown-simple.js +3 -2
  38. package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +0 -2
  39. package/lib/components/dropdown/html/dropdown-writable/dropdown-writable.js +4 -5
  40. package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +1 -4
  41. package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +1 -3
  42. package/lib/components/dropdown/html/dropdown.js +4 -2
  43. package/lib/components/dropdown/html/dropdown.spec.js +48 -0
  44. package/lib/components/dropdown/lunatic-dropdown.js +5 -4
  45. package/lib/components/duration/getDurationFromValue.js +0 -1
  46. package/lib/components/filter-description/component.js +0 -2
  47. package/lib/components/index.js +6 -5
  48. package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +34 -0
  49. package/lib/components/input/html/input.js +4 -5
  50. package/lib/components/input/html/input.spec.js +81 -0
  51. package/lib/components/input/lunatic-input.js +4 -2
  52. package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +38 -90
  53. package/lib/components/input-number/html/input-number-thousand.js +2 -0
  54. package/lib/components/input-number/html/input-number.js +3 -0
  55. package/lib/components/input-number/html/input-number.spec.js +35 -19
  56. package/lib/components/input-number/lunatic-input-number.js +2 -1
  57. package/lib/components/loop/{block-for-loop/block-for-loop.js → block-for-loop.js} +39 -64
  58. package/lib/components/loop/{commons/handle-row-button.js → loop-button.js} +4 -7
  59. package/lib/components/loop/{roster-for-loop/header.js → loop-header.js} +4 -8
  60. package/lib/components/loop/loop.js +19 -65
  61. package/lib/components/loop/roster-for-loop/roster-for-loop.js +102 -83
  62. package/lib/components/loop/{commons/get-init-length.js → utils/get-initial-nb-rows.js} +6 -5
  63. package/lib/components/{loop/roster-for-loop/body.js → lunatic-components.js} +46 -37
  64. package/lib/components/modal/html/modal.js +45 -73
  65. package/lib/components/modal/html/modal.scss +25 -42
  66. package/lib/components/modal/lunatic-modal.js +33 -9
  67. package/lib/components/modal-controls/close-or-skip.js +0 -1
  68. package/lib/components/modal-controls/modal-controls.spec.js +5 -6
  69. package/lib/components/pairwise-links/orchestrator.js +1 -4
  70. package/lib/components/pairwise-links/row.js +1 -4
  71. package/lib/components/question-explication/html/question-explication.js +0 -1
  72. package/lib/components/radio/html/radio-group-content.js +4 -3
  73. package/lib/components/radio/html/radio-group.js +4 -2
  74. package/lib/components/radio/html/radio-option.js +7 -8
  75. package/lib/components/radio/lunatic-radio-group.js +4 -2
  76. package/lib/components/roundabout/components/roundabout-it-title.js +0 -2
  77. package/lib/components/roundabout/components/roundabout-label.js +0 -2
  78. package/lib/components/roundabout/lunatic-roundabout.js +1 -4
  79. package/lib/components/roundabout/roundabout.js +0 -1
  80. package/lib/components/suggester/html/notification.js +0 -1
  81. package/lib/components/suggester/html/suggester.js +3 -3
  82. package/lib/components/suggester/idb-suggester/check-store.js +3 -5
  83. package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -5
  84. package/lib/components/suggester/idb-suggester/suggester-notification.js +2 -2
  85. package/lib/components/suggester/lunatic-suggester.js +3 -1
  86. package/lib/components/suggester-loader-widget/loader-row.js +1 -4
  87. package/lib/components/suggester-loader-widget/loader.js +1 -3
  88. package/lib/components/summary/html/summary-responses.js +13 -7
  89. package/lib/components/summary/lunatic-summary.js +8 -4
  90. package/lib/components/switch/html/switch.js +0 -1
  91. package/lib/components/table/cell.js +0 -2
  92. package/lib/components/table/header.js +0 -2
  93. package/lib/components/table/row.js +0 -1
  94. package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +30 -0
  95. package/lib/components/textarea/html/textarea.js +5 -6
  96. package/lib/components/textarea/html/textarea.spec.js +38 -0
  97. package/lib/components/textarea/lunatic-textarea.js +4 -2
  98. package/lib/index.js +8 -0
  99. package/lib/src/components/button/lunatic-button.d.ts +5 -3
  100. package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +2 -2
  101. package/lib/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.d.ts +1 -1
  102. package/lib/src/components/checkbox/checkbox-group/checkbox-group-content.d.ts +1 -1
  103. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +1 -1
  104. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +4 -4
  105. package/lib/src/components/checkbox/checkbox-group/lunatic-checkbox-group.d.ts +2 -2
  106. package/lib/src/components/checkbox/checkbox-one/html/checkbox-one.d.ts +1 -1
  107. package/lib/src/components/checkbox/checkbox-one/lunatic-checkbox-one.d.ts +1 -1
  108. package/lib/src/components/checkbox/commons/checkbox-option.d.ts +2 -2
  109. package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +1 -1
  110. package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +1 -1
  111. package/lib/src/components/commons/components/combo-box/combo-box-content.d.ts +1 -1
  112. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +6 -5
  113. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +30 -2
  114. package/lib/src/components/commons/components/combo-box/combo-box.type.d.ts +1 -1
  115. package/lib/src/components/commons/components/combo-box/panel/combo-box-option.d.ts +1 -1
  116. package/lib/src/components/commons/components/combo-box/panel/panel-container.d.ts +1 -1
  117. package/lib/src/components/commons/components/combo-box/panel/panel.d.ts +2 -2
  118. package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +3 -2
  119. package/lib/src/components/commons/components/combo-box/selection/combo-box-label-selection.d.ts +2 -1
  120. package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -1
  121. package/lib/src/components/commons/components/combo-box/selection/label-selection.d.ts +4 -3
  122. package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +1 -1
  123. package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +3 -2
  124. package/lib/src/components/commons/components/description.d.ts +1 -1
  125. package/lib/src/components/commons/components/dragger/dragger.d.ts +1 -1
  126. package/lib/src/components/commons/components/errors/errors.d.ts +1 -1
  127. package/lib/src/components/commons/components/fab/fab.d.ts +1 -1
  128. package/lib/src/components/commons/components/field-container/field-container.d.ts +1 -1
  129. package/lib/src/components/commons/components/fieldset.d.ts +3 -3
  130. package/lib/src/components/commons/components/html-table/table.d.ts +1 -1
  131. package/lib/src/components/commons/components/html-table/thead.d.ts +1 -1
  132. package/lib/src/components/commons/components/label/label.d.ts +1 -1
  133. package/lib/src/components/commons/components/lunatic-component-with-label.d.ts +2 -2
  134. package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +2 -2
  135. package/lib/src/components/commons/components/md-label/link.d.ts +1 -1
  136. package/lib/src/components/commons/components/md-label/md-label.spec.d.ts +1 -0
  137. package/lib/src/components/commons/components/missing/missing.d.ts +1 -1
  138. package/lib/src/components/commons/components/orchestrated-component.d.ts +2 -2
  139. package/lib/src/components/commons/components/variable-status/variable-status.d.ts +1 -1
  140. package/lib/src/components/commons/create-customizable-field.d.ts +1 -1
  141. package/lib/src/components/commons/icons/checkbox-checked-icon.d.ts +1 -1
  142. package/lib/src/components/commons/icons/checkbox-unchecked-icon.d.ts +1 -1
  143. package/lib/src/components/commons/icons/closed-icon.d.ts +1 -1
  144. package/lib/src/components/commons/icons/cross-icon.d.ts +1 -1
  145. package/lib/src/components/commons/icons/load-icon.d.ts +1 -1
  146. package/lib/src/components/commons/icons/lunatic-icon.d.ts +1 -1
  147. package/lib/src/components/commons/icons/network-icon.d.ts +1 -1
  148. package/lib/src/components/commons/icons/on-drag-icon.d.ts +1 -1
  149. package/lib/src/components/commons/icons/opened-icon.d.ts +1 -1
  150. package/lib/src/components/commons/icons/radio-checked-icon.d.ts +1 -1
  151. package/lib/src/components/commons/icons/radio-unchecked-icon.d.ts +1 -1
  152. package/lib/src/components/commons/index.d.ts +0 -1
  153. package/lib/src/components/commons/safety-label.d.ts +1 -1
  154. package/lib/src/components/component-set/html/component-set-legend.d.ts +8 -0
  155. package/lib/src/components/component-set/html/component-set-wrapper.d.ts +6 -0
  156. package/lib/src/components/component-set/html/component-set.d.ts +5 -4
  157. package/lib/src/components/component-set/html/component-set.spec.d.ts +1 -0
  158. package/lib/src/components/component-set/lunatic-component-set.d.ts +3 -4
  159. package/lib/src/components/datepicker/html/datepicker-container.d.ts +1 -1
  160. package/lib/src/components/datepicker/html/datepicker-input.d.ts +1 -1
  161. package/lib/src/components/datepicker/html/datepicker.d.ts +3 -3
  162. package/lib/src/components/datepicker/html/datepicker.spec.d.ts +1 -0
  163. package/lib/src/components/datepicker/lunatic-datepicker.d.ts +2 -2
  164. package/lib/src/components/declarations/declaration.d.ts +1 -1
  165. package/lib/src/components/declarations/declarations-after-text.d.ts +1 -1
  166. package/lib/src/components/declarations/declarations-before-text.d.ts +1 -1
  167. package/lib/src/components/declarations/declarations-detachable.d.ts +1 -1
  168. package/lib/src/components/declarations/declarations.d.ts +1 -1
  169. package/lib/src/components/dropdown/html/dropdown-simple/dropdown-simple.d.ts +2 -2
  170. package/lib/src/components/dropdown/html/dropdown-simple/simple-label-renderer.d.ts +1 -1
  171. package/lib/src/components/dropdown/html/dropdown-simple/simple-option-renderer.d.ts +1 -1
  172. package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +5 -4
  173. package/lib/src/components/dropdown/html/dropdown-writable/writable-label-renderer.d.ts +1 -1
  174. package/lib/src/components/dropdown/html/dropdown-writable/writable-option-renderer.d.ts +1 -1
  175. package/lib/src/components/dropdown/html/dropdown.d.ts +4 -3
  176. package/lib/src/components/dropdown/html/dropdown.spec.d.ts +1 -0
  177. package/lib/src/components/dropdown/lunatic-dropdown.d.ts +2 -2
  178. package/lib/src/components/duration/duration.d.ts +1 -1
  179. package/lib/src/components/duration/durationInput.d.ts +1 -1
  180. package/lib/src/components/duration/formatDuration.d.ts +1 -1
  181. package/lib/src/components/duration/getDurationFromValue.d.ts +1 -1
  182. package/lib/src/components/duration/index.d.ts +1 -1
  183. package/lib/src/components/filter-description/component.d.ts +2 -2
  184. package/lib/src/components/index.d.ts +4 -4
  185. package/lib/src/components/input/html/input.d.ts +4 -3
  186. package/lib/src/components/input/html/input.spec.d.ts +1 -0
  187. package/lib/src/components/input/lunatic-input.d.ts +1 -1
  188. package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -1
  189. package/lib/src/components/input-number/html/input-number.d.ts +3 -2
  190. package/lib/src/components/input-number/lunatic-input-number.d.ts +1 -1
  191. package/lib/src/components/loop/{block-for-loop/block-for-loop.d.ts → block-for-loop.d.ts} +6 -4
  192. package/lib/src/components/loop/loop-button.d.ts +7 -0
  193. package/lib/src/components/loop/loop-header.d.ts +9 -0
  194. package/lib/src/components/loop/loop.d.ts +2 -3
  195. package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +7 -5
  196. package/lib/src/components/loop/utils/get-initial-nb-rows.d.ts +4 -0
  197. package/lib/src/components/lunatic-components.d.ts +13 -0
  198. package/lib/src/components/modal/html/modal.d.ts +10 -13
  199. package/lib/src/components/modal/lunatic-modal.d.ts +2 -2
  200. package/lib/src/components/modal-controls/close-or-skip.d.ts +1 -1
  201. package/lib/src/components/modal-controls/modal-container.d.ts +1 -1
  202. package/lib/src/components/modal-controls/modal-controls.d.ts +2 -2
  203. package/lib/src/components/pairwise-links/orchestrator.d.ts +1 -1
  204. package/lib/src/components/pairwise-links/pairwise-links.d.ts +1 -1
  205. package/lib/src/components/pairwise-links/row.d.ts +1 -1
  206. package/lib/src/components/question-explication/html/question-explication.d.ts +1 -1
  207. package/lib/src/components/question-explication/lunatic-question-explication.d.ts +1 -1
  208. package/lib/src/components/radio/html/radio-group-content.d.ts +3 -2
  209. package/lib/src/components/radio/html/radio-group.d.ts +3 -2
  210. package/lib/src/components/radio/html/radio-option.d.ts +3 -2
  211. package/lib/src/components/roundabout/components/roundabout-it-title.d.ts +3 -3
  212. package/lib/src/components/roundabout/components/roundabout-label.d.ts +3 -3
  213. package/lib/src/components/roundabout/lunatic-roundabout.d.ts +1 -1
  214. package/lib/src/components/roundabout/roundabout.d.ts +2 -2
  215. package/lib/src/components/sequence/html/sequence.d.ts +1 -1
  216. package/lib/src/components/sequence/lunatic-sequence.d.ts +2 -2
  217. package/lib/src/components/suggester/html/notification.d.ts +2 -2
  218. package/lib/src/components/suggester/html/suggester.d.ts +6 -5
  219. package/lib/src/components/suggester/idb-suggester/check-store.d.ts +1 -1
  220. package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +3 -3
  221. package/lib/src/components/suggester/idb-suggester/suggester-notification.d.ts +1 -1
  222. package/lib/src/components/suggester/idb-suggester/suggester-status.d.ts +1 -1
  223. package/lib/src/components/suggester/lunatic-suggester.d.ts +2 -2
  224. package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
  225. package/lib/src/components/suggester-loader-widget/loader-row.d.ts +1 -1
  226. package/lib/src/components/suggester-loader-widget/loader.d.ts +1 -1
  227. package/lib/src/components/suggester-loader-widget/tools/action-tool.d.ts +1 -1
  228. package/lib/src/components/suggester-loader-widget/tools/tools.d.ts +1 -1
  229. package/lib/src/components/suggester-loader-widget/widget.d.ts +1 -1
  230. package/lib/src/components/summary/html/summary-container.d.ts +1 -1
  231. package/lib/src/components/summary/html/summary-responses.d.ts +3 -1
  232. package/lib/src/components/summary/html/summary-title.d.ts +1 -1
  233. package/lib/src/components/summary/lunatic-summary.d.ts +3 -2
  234. package/lib/src/components/switch/html/switch.d.ts +3 -3
  235. package/lib/src/components/switch/lunatic-switch.d.ts +1 -1
  236. package/lib/src/components/table/cell.d.ts +1 -1
  237. package/lib/src/components/table/header.d.ts +1 -1
  238. package/lib/src/components/table/lunatic-table.d.ts +1 -1
  239. package/lib/src/components/table/row.d.ts +1 -1
  240. package/lib/src/components/table/table-orchestrator.d.ts +1 -1
  241. package/lib/src/components/textarea/html/textarea.d.ts +4 -3
  242. package/lib/src/components/textarea/html/textarea.spec.d.ts +1 -0
  243. package/lib/src/components/textarea/lunatic-textarea.d.ts +1 -1
  244. package/lib/src/components/type.d.ts +9 -6
  245. package/lib/src/i18n/build-dictionary.d.ts +1 -1
  246. package/lib/src/index.d.ts +1 -0
  247. package/lib/src/use-lunatic/actions.d.ts +4 -8
  248. package/lib/src/use-lunatic/commons/calculated-variables.d.ts +1 -1
  249. package/lib/src/use-lunatic/commons/check-loops.d.ts +1 -1
  250. package/lib/src/use-lunatic/commons/check-pager.d.ts +1 -1
  251. package/lib/src/use-lunatic/commons/compile-controls.d.ts +1 -1
  252. package/lib/src/use-lunatic/commons/compose.d.ts +1 -1
  253. package/lib/src/use-lunatic/commons/create-map-pages.d.ts +2 -2
  254. package/lib/src/use-lunatic/commons/execute-condition-filter.d.ts +1 -1
  255. package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +1 -1
  256. package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +2 -2
  257. package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +3 -3
  258. package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +1 -1
  259. package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +5 -2
  260. package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +1 -1
  261. package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +15 -10
  262. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +38 -1
  263. package/lib/src/use-lunatic/commons/fill-components/fill-management.d.ts +1 -1
  264. package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +1 -1
  265. package/lib/src/use-lunatic/commons/fill-components/fill-pagination.d.ts +1 -1
  266. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +62 -33
  267. package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +1 -1
  268. package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +1 -1
  269. package/lib/src/use-lunatic/commons/get-components-from-state.d.ts +1 -2
  270. package/lib/src/use-lunatic/commons/get-data.d.ts +1 -1
  271. package/lib/src/use-lunatic/commons/get-errors-without-empty-value.d.ts +1 -1
  272. package/lib/src/use-lunatic/commons/getOverview.d.ts +1 -1
  273. package/lib/src/use-lunatic/commons/is-First-last-page.d.ts +1 -1
  274. package/lib/src/use-lunatic/commons/is-paginated-loop.d.ts +1 -1
  275. package/lib/src/use-lunatic/commons/is-roundabout.d.ts +1 -1
  276. package/lib/src/use-lunatic/commons/page-navigation.d.ts +2 -2
  277. package/lib/src/use-lunatic/commons/page-tag.d.ts +1 -1
  278. package/lib/src/use-lunatic/commons/page.d.ts +2 -2
  279. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +2 -2
  280. package/lib/src/use-lunatic/hooks/use-loop-variables.d.ts +1 -1
  281. package/lib/src/use-lunatic/lunatic-context.d.ts +1 -1
  282. package/lib/src/use-lunatic/reducer/commons/auto-explore-loop.d.ts +1 -1
  283. package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +3 -3
  284. package/lib/src/use-lunatic/reducer/commons/validate-condition-filter.d.ts +1 -1
  285. package/lib/src/use-lunatic/reducer/overview/overview-on-change.d.ts +1 -1
  286. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +2 -2
  287. package/lib/src/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -4
  288. package/lib/src/use-lunatic/reducer/reduce-go-next-page.spec.d.ts +1 -0
  289. package/lib/src/use-lunatic/reducer/reduce-go-previous-page.d.ts +1 -1
  290. package/lib/src/use-lunatic/reducer/reduce-go-previous-page.spec.d.ts +1 -0
  291. package/lib/src/use-lunatic/reducer/reduce-go-to-page.d.ts +2 -2
  292. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +2 -2
  293. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +2 -2
  294. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +2 -2
  295. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +2 -2
  296. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +2 -2
  297. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +1 -1
  298. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +1 -1
  299. package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +2 -2
  300. package/lib/src/use-lunatic/reducer/reduce-on-set-waiting.d.ts +2 -2
  301. package/lib/src/use-lunatic/reducer/reduce-update-state.d.ts +2 -2
  302. package/lib/src/use-lunatic/reducer/reducer.d.ts +2 -2
  303. package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-component-control.d.ts +2 -2
  304. package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.d.ts +2 -2
  305. package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.d.ts +2 -2
  306. package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -1
  307. package/lib/src/use-lunatic/type-source.d.ts +3 -1
  308. package/lib/src/use-lunatic/type.d.ts +3 -3
  309. package/lib/src/use-lunatic/use-lunatic.d.ts +21 -15
  310. package/lib/src/use-lunatic/use-suggesters.d.ts +1 -1
  311. package/lib/src/utils/array.d.ts +8 -0
  312. package/lib/src/utils/dom.d.ts +14 -0
  313. package/lib/src/utils/get-component-value.d.ts +1 -1
  314. package/lib/src/utils/get-component-value.test.d.ts +1 -0
  315. package/lib/src/utils/is-element.d.ts +1 -1
  316. package/lib/src/utils/number.d.ts +5 -0
  317. package/lib/src/utils/number.spec.d.ts +1 -0
  318. package/lib/src/utils/store-tools/initStore.d.ts +1 -1
  319. package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +1 -1
  320. package/lib/src/utils/suggester-workers/searching/compute-score.d.ts +1 -1
  321. package/lib/stories/checkbox-one/source.json +2 -2
  322. package/lib/stories/component-set/component-set.stories.js +9 -9
  323. package/lib/stories/component-set/{data2.json → data-roundabout.json} +1 -1
  324. package/lib/stories/component-set/data.json +8 -1
  325. package/lib/stories/component-set/source-loop.json +308 -0
  326. package/lib/stories/component-set/source-roundabout.json +434 -0
  327. package/lib/stories/component-set/source.json +16 -2
  328. package/lib/stories/disabled/data.json +32 -0
  329. package/lib/{components/commons/components/combo-box/state-management/reduce-on-keydown/on-end.js → stories/disabled/disabled.stories.js} +25 -12
  330. package/lib/stories/disabled/source.json +382 -0
  331. package/lib/stories/input/source-with-question.json +9 -3
  332. package/lib/stories/input/source.json +6 -0
  333. package/lib/stories/loop/source-paginated.json +2 -2
  334. package/lib/stories/overview/source.json +1 -1
  335. package/lib/stories/overview/sourceWithHierarchy.json +10 -2
  336. package/lib/stories/pairwise/links-componentset.json +292 -0
  337. package/lib/stories/pairwise/pairwise-links.stories.js +11 -2
  338. package/lib/stories/question-explication/source.json +16 -16
  339. package/lib/stories/questionnaires/logement/source-sum.json +31805 -34611
  340. package/lib/stories/questionnaires/recensement/source.json +2 -2
  341. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +4 -4
  342. package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +963 -847
  343. package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4350 -4090
  344. package/lib/stories/suggester/simple.json +4 -0
  345. package/lib/stories/summary/source.json +55 -40
  346. package/lib/stories/utils/orchestrator.js +11 -22
  347. package/lib/tests/utils/lunatic.d.ts +16 -2
  348. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +13 -45
  349. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +0 -1
  350. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +5 -1
  351. package/lib/use-lunatic/commons/fill-components/fill-components.js +10 -2
  352. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +3 -0
  353. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +66 -21
  354. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +1 -3
  355. package/lib/use-lunatic/commons/page.js +6 -0
  356. package/lib/use-lunatic/hooks/use-loop-variables.js +1 -1
  357. package/lib/use-lunatic/reducer/reduce-go-next-page.js +10 -10
  358. package/lib/use-lunatic/reducer/reduce-go-next-page.spec.js +13 -0
  359. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +3 -3
  360. package/lib/use-lunatic/reducer/reduce-go-previous-page.spec.js +14 -0
  361. package/lib/use-lunatic/reducer/reduce-go-to-page.js +3 -8
  362. package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +790 -924
  363. package/lib/use-lunatic/reducer/reducer.js +2 -2
  364. package/lib/use-lunatic/use-lunatic.js +5 -2
  365. package/lib/use-lunatic/use-lunatic.test.js +26 -0
  366. package/lib/utils/array.js +33 -0
  367. package/lib/utils/dom.js +27 -0
  368. package/lib/utils/get-component-value.js +13 -11
  369. package/lib/utils/get-component-value.test.js +57 -0
  370. package/lib/utils/number.js +30 -0
  371. package/lib/utils/number.spec.js +11 -0
  372. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +0 -2
  373. package/package.json +9 -3
  374. package/lib/components/commons/components/combo-box/state-management/actions.js +0 -79
  375. package/lib/components/commons/components/combo-box/state-management/index.js +0 -25
  376. package/lib/components/commons/components/combo-box/state-management/reduce-on-init.js +0 -38
  377. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-down.js +0 -30
  378. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-up.js +0 -30
  379. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-enter.js +0 -19
  380. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-escape.js +0 -18
  381. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-home.js +0 -23
  382. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-tab.js +0 -18
  383. package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/reduce-on-keydown.js +0 -40
  384. package/lib/components/commons/components/combo-box/state-management/reducer.js +0 -53
  385. package/lib/components/commons/create-row-orchestrator.js +0 -58
  386. package/lib/components/component-set/html/component-set-component-container.js +0 -20
  387. package/lib/components/component-set/html/component-set-components.js +0 -45
  388. package/lib/components/component-set/html/legend/index.js +0 -13
  389. package/lib/components/component-set/index.js +0 -13
  390. package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +0 -12
  391. package/lib/components/loop/block-for-loop/index.js +0 -13
  392. package/lib/components/loop/block-for-loop/row.js +0 -56
  393. package/lib/components/loop/commons/index.js +0 -20
  394. package/lib/components/loop/commons/row-component.js +0 -72
  395. package/lib/components/loop/index.js +0 -13
  396. package/lib/components/loop/roster-for-loop/index.js +0 -13
  397. package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +0 -12
  398. package/lib/components/loop/roster-for-loop/roster-table.js +0 -50
  399. package/lib/components/loop/roster-for-loop/row.js +0 -85
  400. package/lib/src/components/commons/components/combo-box/state-management/actions.d.ts +0 -78
  401. package/lib/src/components/commons/components/combo-box/state-management/index.d.ts +0 -9
  402. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-init.d.ts +0 -4
  403. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-down.d.ts +0 -2
  404. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-up.d.ts +0 -2
  405. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-end.d.ts +0 -2
  406. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-enter.d.ts +0 -2
  407. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-escape.d.ts +0 -2
  408. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-home.d.ts +0 -2
  409. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-tab.d.ts +0 -2
  410. package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/reduce-on-keydown.d.ts +0 -9
  411. package/lib/src/components/commons/components/combo-box/state-management/reducer.d.ts +0 -3
  412. package/lib/src/components/commons/create-row-orchestrator.d.ts +0 -32
  413. package/lib/src/components/component-set/html/component-set-component-container.d.ts +0 -6
  414. package/lib/src/components/component-set/html/component-set-components.d.ts +0 -7
  415. package/lib/src/components/component-set/html/legend/index.d.ts +0 -1
  416. package/lib/src/components/component-set/html/legend/legend.d.ts +0 -8
  417. package/lib/src/components/component-set/index.d.ts +0 -1
  418. package/lib/src/components/loop/block-for-loop/block-for-loop-ochestrator.d.ts +0 -51
  419. package/lib/src/components/loop/block-for-loop/index.d.ts +0 -1
  420. package/lib/src/components/loop/block-for-loop/row.d.ts +0 -23
  421. package/lib/src/components/loop/commons/get-init-length.d.ts +0 -2
  422. package/lib/src/components/loop/commons/handle-row-button.d.ts +0 -7
  423. package/lib/src/components/loop/commons/index.d.ts +0 -2
  424. package/lib/src/components/loop/commons/row-component.d.ts +0 -9
  425. package/lib/src/components/loop/index.d.ts +0 -1
  426. package/lib/src/components/loop/roster-for-loop/body.d.ts +0 -12
  427. package/lib/src/components/loop/roster-for-loop/header.d.ts +0 -9
  428. package/lib/src/components/loop/roster-for-loop/index.d.ts +0 -1
  429. package/lib/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.d.ts +0 -51
  430. package/lib/src/components/loop/roster-for-loop/roster-table.d.ts +0 -13
  431. package/lib/src/components/loop/roster-for-loop/row.d.ts +0 -24
  432. package/lib/stories/component-set/source1.json +0 -287
  433. package/lib/stories/component-set/source2.json +0 -413
  434. /package/lib/components/commons/components/combo-box/{state-management/reduce-on-keydown/keyboard-key-codes.js → keyboard-key-codes.js} +0 -0
  435. /package/lib/src/components/commons/components/combo-box/{state-management/reduce-on-keydown/keyboard-key-codes.d.ts → keyboard-key-codes.d.ts} +0 -0
  436. /package/lib/stories/component-set/{data1.json → data-loop.json} +0 -0
@@ -1,4 +1,4 @@
1
- import { LunaticExpression } from '../type';
1
+ import type { LunaticExpression } from '../type';
2
2
  /**
3
3
  * Ensure that an expression is compatible with VTL (convert if necessary)
4
4
  */
@@ -1,4 +1,4 @@
1
- import { LunaticComponentDefinition, LunaticState } from '../../type';
1
+ import type { LunaticComponentDefinition, LunaticState } from '../../type';
2
2
  /**
3
3
  * Get the value from the component
4
4
  */
@@ -1,5 +1,4 @@
1
- import type { LunaticState } from '../type';
2
- import { LunaticComponentDefinition } from '../type';
1
+ import type { LunaticState, LunaticComponentDefinition } from '../type';
3
2
  /**
4
3
  * Extract the list of components to display for the current page
5
4
  */
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  /**
3
3
  * Extract the value from a questionnaire
4
4
  *
@@ -1,4 +1,4 @@
1
- import { LunaticError } from '../type';
1
+ import type { LunaticError } from '../type';
2
2
  /**
3
3
  * Keep errors with at least one error inside
4
4
  */
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  export type OverviewItem = {
3
3
  lunaticId: string;
4
4
  page: string;
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  declare function isFirstLastPage(pager: LunaticState['pager']): {
3
3
  isFirstPage: boolean;
4
4
  isLastPage: boolean;
@@ -1,4 +1,4 @@
1
- import { LunaticComponentDefinition } from '../type';
1
+ import type { LunaticComponentDefinition } from '../type';
2
2
  declare function isPaginatedLoop(component: LunaticComponentDefinition): component is LunaticComponentDefinition & {
3
3
  componentType: 'Loop';
4
4
  paginatedLoop: true;
@@ -1,2 +1,2 @@
1
- import { LunaticComponentDefinition } from '../type';
1
+ import type { LunaticComponentDefinition } from '../type';
2
2
  export default function isRoundabout(component: LunaticComponentDefinition): component is LunaticComponentDefinition<'Roundabout'>;
@@ -1,5 +1,5 @@
1
- import { LunaticState } from '../type';
2
- import { LunaticComponentType } from '../../components/type';
1
+ import type { LunaticState } from '../type';
2
+ import type { LunaticComponentType } from '../../components/type';
3
3
  /**
4
4
  * Increment the pager to reach the next page or iteration
5
5
  */
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  /**
3
3
  * Generate page name from the pager
4
4
  */
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  export declare function getPageId({ subPage, page, }: Pick<LunaticState['pager'], 'page' | 'subPage'>): string;
3
3
  /**
4
4
  * Converts a page number (3.1.2) to an array of numbers [3, 1, 2]
@@ -8,4 +8,4 @@ export declare function pageStringToNumbers(page: string): number[];
8
8
  * Check if we are on an empty page
9
9
  * if no components can be displayed on this page (using filter)
10
10
  */
11
- export declare function isPageEmpty(state: LunaticState): boolean;
11
+ export declare function isPageEmpty(state: LunaticState, isMovingBackward?: boolean): boolean;
@@ -1,3 +1,3 @@
1
- import { LunaticState } from '../type';
2
- declare function useComponentsFromState(state: LunaticState): import("./fill-components/fill-components").LunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
1
+ import type { LunaticState } from '../type';
2
+ declare function useComponentsFromState(state: LunaticState): import("./fill-components/fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
3
3
  export default useComponentsFromState;
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  /**
3
3
  * Extract the list of variables used for the current loop
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FunctionComponent, PropsWithChildren } from 'react';
1
+ import { type FunctionComponent, type PropsWithChildren } from 'react';
2
2
  /** Provide `missing` `missingStrategy`, `shortcut` and `missingShortcut`, `dontKnowButton`, `refusedButton` to Missing component
3
3
  * to manage non-response buttons and shortcut */
4
4
  export declare const useLunaticMissing: () => {
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../../type';
1
+ import type { LunaticState } from '../../type';
2
2
  /**
3
3
  * Update the pager to enter a loop if the pager is on a loop
4
4
  */
@@ -1,10 +1,10 @@
1
- import { LunaticComponentDefinition } from '../../type';
1
+ import type { LunaticComponentDefinition } from '../../type';
2
2
  export declare const isLoopComponent: (component: LunaticComponentDefinition) => component is (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRosterForLoopType & {
3
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ComponentSet" | "Roundabout" | "QuestionExplication";
3
+ componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication";
4
4
  } & {
5
5
  componentType: 'Loop' | 'RosterForLoop';
6
6
  }) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentLoopType & {
7
- componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ComponentSet" | "Roundabout" | "QuestionExplication";
7
+ componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication";
8
8
  } & {
9
9
  componentType: 'Loop' | 'RosterForLoop';
10
10
  });
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../../type';
1
+ import type { LunaticState } from '../../type';
2
2
  declare function validateLoopConditionFilter(state: LunaticState, { next, iteration }: {
3
3
  next: string;
4
4
  iteration?: number;
@@ -1,2 +1,2 @@
1
- import { LunaticState } from '../../type';
1
+ import type { LunaticState } from '../../type';
2
2
  export declare const overviewOnChange: (state: LunaticState) => LunaticState;
@@ -1,5 +1,5 @@
1
- import { LunaticOverviewItem, LunaticState } from '../../type';
2
- import { ActionInit } from '../../actions';
1
+ import type { LunaticOverviewItem, LunaticState } from '../../type';
2
+ import { type ActionInit } from '../../actions';
3
3
  export declare function reduceOverviewOnInit(state: LunaticState, action: ActionInit): {
4
4
  overview: LunaticOverviewItem[];
5
5
  variables: {
@@ -1,4 +1,2 @@
1
- import { ActionGoNextPage } from '../actions';
2
- import { LunaticState } from '../type';
3
- declare const _default: (acc: LunaticState, action: ActionGoNextPage) => LunaticState;
4
- export default _default;
1
+ import type { LunaticState } from '../type';
2
+ export declare const reduceGoNextPage: (state: LunaticState) => LunaticState;
@@ -1,3 +1,3 @@
1
- import { LunaticState } from '../type';
1
+ import type { LunaticState } from '../type';
2
2
  declare function reduceGoPreviousPage(state: LunaticState): LunaticState;
3
3
  export default reduceGoPreviousPage;
@@ -1,4 +1,4 @@
1
- import { ActionGoToPage } from '../actions';
2
- import { LunaticState } from '../type';
1
+ import { type ActionGoToPage } from '../actions';
2
+ import type { LunaticState } from '../type';
3
3
  declare function reduceGoToPage(state: LunaticState, action: ActionGoToPage): LunaticState;
4
4
  export default reduceGoToPage;
@@ -1,5 +1,5 @@
1
- import { LunaticState } from '../../type';
2
- import { ActionHandleChange } from '../../actions';
1
+ import type { LunaticState } from '../../type';
2
+ import { type ActionHandleChange } from '../../actions';
3
3
  /**
4
4
  * Reset variables to null using the cleaning definition in the source.json
5
5
  */
@@ -1,4 +1,4 @@
1
- import { ActionHandleChange } from '../../actions';
2
- import { LunaticState } from '../../type';
1
+ import { type ActionHandleChange } from '../../actions';
2
+ import type { LunaticState } from '../../type';
3
3
  declare function reduceHandleChange(state: LunaticState, action: ActionHandleChange): LunaticState;
4
4
  export default reduceHandleChange;
@@ -1,5 +1,5 @@
1
- import { LunaticState } from '../../type';
2
- import { ActionHandleChange } from '../../actions';
1
+ import type { LunaticState } from '../../type';
2
+ import { type ActionHandleChange } from '../../actions';
3
3
  type Payload = ActionHandleChange['payload']['args'] & {
4
4
  name: string;
5
5
  value: string;
@@ -1,5 +1,5 @@
1
- import { LunaticState } from '../../type';
2
- import { ActionHandleChange } from '../../actions';
1
+ import type { LunaticState } from '../../type';
2
+ import { type ActionHandleChange } from '../../actions';
3
3
  /**
4
4
  * Update value for missing variables
5
5
  */
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../../type';
2
- import { ActionHandleChange } from '../../actions';
1
+ import type { LunaticState } from '../../type';
2
+ import { type ActionHandleChange } from '../../actions';
3
3
  declare function reduceResizing(state: LunaticState, action: ActionHandleChange): LunaticState;
4
4
  export default reduceResizing;
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../../type';
1
+ import type { LunaticState } from '../../type';
2
2
  type Args = {
3
3
  name: string;
4
4
  value: unknown;
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../../type';
1
+ import type { LunaticState } from '../../type';
2
2
  /**
3
3
  * Add the value for the variable in the corresponding variable object
4
4
  */
@@ -1,5 +1,5 @@
1
- import { ActionInit } from '../actions';
2
- import { LunaticState, LunaticVariable } from '../type';
1
+ import { type ActionInit } from '../actions';
2
+ import type { LunaticState, LunaticVariable } from '../type';
3
3
  export type VariablesByType = {
4
4
  EXTERNAL: (LunaticVariable & {
5
5
  variableType: 'EXTERNAL';
@@ -1,4 +1,4 @@
1
- import { LunaticState } from '../type';
2
- import { ActionOnSetWaiting } from '../actions';
1
+ import type { LunaticState } from '../type';
2
+ import { type ActionOnSetWaiting } from '../actions';
3
3
  declare function reduceOnSetWaiting(state: LunaticState, action: ActionOnSetWaiting): LunaticState;
4
4
  export default reduceOnSetWaiting;
@@ -1,3 +1,3 @@
1
- import { ActionUpdateState } from '../actions';
2
- import { LunaticState } from '../type';
1
+ import { type ActionUpdateState } from '../actions';
2
+ import { type LunaticState } from '../type';
3
3
  export declare function reduceUpdateState(state: LunaticState, action: ActionUpdateState): LunaticState;
@@ -1,4 +1,4 @@
1
- import { Action } from '../actions';
2
- import { LunaticState } from '../type';
1
+ import { type Action } from '../actions';
2
+ import type { LunaticState } from '../type';
3
3
  declare function reducer(state: LunaticState, action: Action): LunaticState;
4
4
  export default reducer;
@@ -1,5 +1,5 @@
1
- import { StateForControls } from '../../commons/compile-controls';
2
- import { LunaticControl, LunaticError } from '../../type';
1
+ import { type StateForControls } from '../../commons/compile-controls';
2
+ import type { LunaticControl, LunaticError } from '../../type';
3
3
  /**
4
4
  * Convert controls into errors
5
5
  */
@@ -1,5 +1,5 @@
1
- import { StateForControls } from '../../commons/compile-controls';
2
- import { LunaticControl, LunaticError } from '../../type';
1
+ import { type StateForControls } from '../../commons/compile-controls';
2
+ import type { LunaticControl, LunaticError } 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.
@@ -1,3 +1,3 @@
1
- import { StateForControls } from '../../commons/compile-controls';
2
- import { LunaticControl, LunaticError } from '../../type';
1
+ import { type StateForControls } from '../../commons/compile-controls';
2
+ import type { LunaticControl, LunaticError } from '../../type';
3
3
  export declare function resolveSimpleControl(state: StateForControls, control: LunaticControl): LunaticError | undefined;
@@ -1,4 +1,4 @@
1
- import { LunaticComponentDefinition } from './type';
1
+ import type { LunaticComponentDefinition } from './type';
2
2
  /**
3
3
  * Pour le ComponentSet : les composants du fieldset n'existe pas dans pages.
4
4
  * Ils échappent donc aux controls. On les substitue ici au ComponentSet.
@@ -8,4 +8,6 @@ import { LunaticComponentDefinition } from './type';
8
8
  */
9
9
  export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): ((import("./type-source").ComponentTypeBase & import("./type-source").ComponentSequenceType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentSubSequenceType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRosterForLoopType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentLoopType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentTableType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentNumberType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDatePickerType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxGroupType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxBooleanType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRadioType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentFilterDescriptionType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDropdownType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentPairWiseLinksType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRoundaboutType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentSuggesterType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentInputOrTextareaType) | (import("./type-source").ComponentTypeBase & {
10
10
  componentType: "CheckboxOne";
11
+ }) | (import("./type-source").ComponentTypeBase & {
12
+ componentType: "ConfirmationModal";
11
13
  }) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentComponentSetType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentQuestionExplicationType))[];
@@ -5,7 +5,7 @@ export type LabelType = {
5
5
  value: string;
6
6
  type: 'VTL' | 'VTL|MD';
7
7
  };
8
- export type ComponentTypeEnum = 'Sequence' | 'Subsequence' | 'RosterForLoop' | 'Loop' | 'Table' | 'Input' | 'InputNumber' | 'Datepicker' | 'CheckboxGroup' | 'CheckboxOne' | 'CheckboxBoolean' | 'Radio' | 'Dropdown' | 'Textarea' | 'FilterDescription' | 'PairwiseLinks' | 'Suggester' | 'ComponentSet';
8
+ export type ComponentTypeEnum = 'Sequence' | 'Subsequence' | 'RosterForLoop' | 'Loop' | 'Table' | 'Input' | 'InputNumber' | 'Datepicker' | 'CheckboxGroup' | 'CheckboxOne' | 'CheckboxBoolean' | 'Radio' | 'Dropdown' | 'Textarea' | 'FilterDescription' | 'PairwiseLinks' | 'Suggester' | 'ConfirmationModal' | 'ComponentSet';
9
9
  export type ValuesType<T = unknown> = {
10
10
  PREVIOUS: T | null;
11
11
  COLLECTED: T | null;
@@ -77,6 +77,8 @@ export type ComponentTypeBase = {
77
77
  };
78
78
  export type ComponentType = (ComponentTypeBase & ComponentSequenceType) | (ComponentTypeBase & ComponentSubSequenceType) | (ComponentTypeBase & ComponentRosterForLoopType) | (ComponentTypeBase & ComponentLoopType) | (ComponentTypeBase & ComponentTableType) | (ComponentTypeBase & ComponentNumberType) | (ComponentTypeBase & ComponentDatePickerType) | (ComponentTypeBase & ComponentCheckboxGroupType) | (ComponentTypeBase & ComponentCheckboxBooleanType) | (ComponentTypeBase & ComponentRadioType) | (ComponentTypeBase & ComponentFilterDescriptionType) | (ComponentTypeBase & ComponentDropdownType) | (ComponentTypeBase & ComponentPairWiseLinksType) | (ComponentTypeBase & ComponentRoundaboutType) | (ComponentTypeBase & ComponentSuggesterType) | (ComponentTypeBase & ComponentInputOrTextareaType) | (ComponentTypeBase & {
79
79
  componentType: 'CheckboxOne';
80
+ }) | (ComponentTypeBase & {
81
+ componentType: 'ConfirmationModal';
80
82
  }) | (ComponentTypeBase & ComponentComponentSetType) | (ComponentTypeBase & ComponentQuestionExplicationType);
81
83
  export type ComponentInputOrTextareaType = {
82
84
  componentType: 'Input' | 'Textarea';
@@ -1,6 +1,6 @@
1
- import { ReactNode } from 'react';
2
- import { ComponentType, ControlType, LunaticSource, Variable } from './type-source';
3
- import { ExpressionLogger } from './commons/execute-expression/create-execute-expression';
1
+ import type { ReactNode } from 'react';
2
+ import type { ComponentType, ControlType, LunaticSource, Variable } from './type-source';
3
+ import { type ExpressionLogger } from './commons/execute-expression/create-execute-expression';
4
4
  import { SuggesterStatus } from './use-suggesters';
5
5
  export type LunaticComponentDefinition<T extends ComponentType['componentType'] = ComponentType['componentType']> = ComponentType & {
6
6
  componentType: T;
@@ -1,15 +1,14 @@
1
- import { FunctionComponent } from 'react';
2
- import { LunaticState } from './type';
3
- import { LunaticSource } from './type-source';
4
- import { LunaticComponentType } from '../components/type';
5
- declare const nothing: LunaticState['handleChange'];
1
+ import { type FunctionComponent } from 'react';
2
+ import type { LunaticState } from './type';
3
+ import type { LunaticSource } from './type-source';
4
+ import type { LunaticComponentType } from '../components/type';
6
5
  declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
7
6
  COLLECTED: Record<string, import("./type").LunaticCollectedValue>;
8
7
  }> | undefined, { features, preferences, savingType, onChange, management, shortcut, initialPage, lastReachedPage, autoSuggesterLoading, activeControls, getReferentiel, custom, withOverview, missing, missingStrategy, missingShortcut, dontKnowButton, refusedButton, }: {
9
8
  features?: LunaticState['features'];
10
9
  preferences?: LunaticState['preferences'];
11
10
  savingType?: LunaticState['savingType'];
12
- onChange?: typeof nothing;
11
+ onChange?: LunaticState['handleChange'];
13
12
  management?: boolean;
14
13
  shortcut?: boolean;
15
14
  initialPage?: string;
@@ -56,7 +55,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
56
55
  Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "declarations">;
57
56
  Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
58
57
  ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
59
- components: import("./type").LunaticComponentDefinition[];
58
+ components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
60
59
  value: Record<string, unknown>;
61
60
  response: undefined;
62
61
  };
@@ -66,7 +65,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
66
65
  max: number;
67
66
  };
68
67
  iterations?: number | undefined;
69
- components: import("./type").LunaticComponentDefinition[];
68
+ getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
70
69
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
71
70
  iteration?: number | undefined;
72
71
  linksIterations?: number[] | undefined;
@@ -85,7 +84,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
85
84
  max: number;
86
85
  };
87
86
  iterations?: number | undefined;
88
- components: import("./type").LunaticComponentDefinition[];
87
+ getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
89
88
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
90
89
  iteration?: number | undefined;
91
90
  linksIterations?: number[] | undefined;
@@ -255,7 +254,9 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
255
254
  };
256
255
  Summary: import("../components/type").LunaticBaseProps<string | null> & {
257
256
  sections: {
257
+ id: string;
258
258
  responses?: {
259
+ id: string;
259
260
  label: import("../components/type").VtlExpression;
260
261
  value: import("../components/type").VtlExpression;
261
262
  }[] | undefined;
@@ -263,7 +264,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
263
264
  iterations?: number | undefined;
264
265
  }[];
265
266
  };
266
- Modal: import("../components/type").LunaticBaseProps<string | null> & {
267
+ ConfirmationModal: import("../components/type").LunaticBaseProps<string | null> & {
267
268
  goToPage: (page: {
268
269
  page: string;
269
270
  iteration?: number | undefined;
@@ -302,7 +303,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
302
303
  Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "declarations">;
303
304
  Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
304
305
  ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
305
- components: import("./type").LunaticComponentDefinition[];
306
+ components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
306
307
  value: Record<string, unknown>;
307
308
  response: undefined;
308
309
  };
@@ -312,7 +313,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
312
313
  max: number;
313
314
  };
314
315
  iterations?: number | undefined;
315
- components: import("./type").LunaticComponentDefinition[];
316
+ getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
316
317
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
317
318
  iteration?: number | undefined;
318
319
  linksIterations?: number[] | undefined;
@@ -331,7 +332,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
331
332
  max: number;
332
333
  };
333
334
  iterations?: number | undefined;
334
- components: import("./type").LunaticComponentDefinition[];
335
+ getComponents: (n: number) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
335
336
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
336
337
  iteration?: number | undefined;
337
338
  linksIterations?: number[] | undefined;
@@ -501,7 +502,9 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
501
502
  };
502
503
  Summary: import("../components/type").LunaticBaseProps<string | null> & {
503
504
  sections: {
505
+ id: string;
504
506
  responses?: {
507
+ id: string;
505
508
  label: import("../components/type").VtlExpression;
506
509
  value: import("../components/type").VtlExpression;
507
510
  }[] | undefined;
@@ -509,7 +512,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
509
512
  iterations?: number | undefined;
510
513
  }[];
511
514
  };
512
- Modal: import("../components/type").LunaticBaseProps<string | null> & {
515
+ ConfirmationModal: import("../components/type").LunaticBaseProps<string | null> & {
513
516
  goToPage: (page: {
514
517
  page: string;
515
518
  iteration?: number | undefined;
@@ -521,7 +524,7 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
521
524
  goPreviousPage: () => void;
522
525
  };
523
526
  })[] | undefined;
524
- }) => import("./commons/fill-components/fill-components").LunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
527
+ }) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
525
528
  goPreviousPage: () => void;
526
529
  goNextPage: (payload?: {}) => void;
527
530
  goToPage: (page: {
@@ -569,6 +572,9 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
569
572
  Provider: FunctionComponent<{
570
573
  children?: import("react").ReactNode;
571
574
  }>;
575
+ onChange: (response: {
576
+ name: string;
577
+ }, value: any, args?: Record<string, unknown> | undefined) => void;
572
578
  overview: {
573
579
  lunaticId: string;
574
580
  page: string;
@@ -1,4 +1,4 @@
1
- import { SuggesterType } from './type-source';
1
+ import type { SuggesterType } from './type-source';
2
2
  type useSuggestersType = {
3
3
  auto: boolean;
4
4
  getReferentiel?: (name: string) => Promise<Array<unknown>>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Call a callback x times
3
+ */
4
+ export declare function times<T>(n: number, cb: (k: number) => T): T[];
5
+ /**
6
+ * Update an item in an array without mutating the array
7
+ */
8
+ export declare function setAtIndex<T>(arr: T[], index: number, newValue: T): T[];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Wrap a callback calling preventDefault and stopPropagation on the event before passing it
3
+ */
4
+ export declare function prevent<T extends {
5
+ preventDefault: () => void;
6
+ stopPropagation: () => void;
7
+ }>(cb?: (e: T) => void): undefined | ((e: T) => void);
8
+ /**
9
+ * Check if an event is within a rectangle
10
+ */
11
+ export declare function isEventInRect(event: {
12
+ clientX: number;
13
+ clientY: number;
14
+ }, rect: DOMRect): boolean;
@@ -2,4 +2,4 @@
2
2
  * Extract the value associated with a component
3
3
  * If the component expect multiple values (it has a responses property) then extract a map of values
4
4
  */
5
- export declare function getComponentValue<T = unknown>(component: unknown, valueMap: Record<string, unknown>, rowIndex?: number): T;
5
+ export declare function getComponentValue(component: unknown, valueMap: Record<string, unknown>, rowIndex?: number): unknown;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { ReactElement } from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  declare function isElement<P = unknown>(element: unknown): element is ReactElement<P>;
3
3
  export { isElement };
@@ -0,0 +1,5 @@
1
+ export declare function forceInt(n: unknown): number;
2
+ /**
3
+ * Limit a number between 2 values
4
+ */
5
+ export declare function between(n: number, min: number, max: number): number;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- import { SuggesterType } from '../../use-lunatic/type-source';
1
+ import type { SuggesterType } from '../../use-lunatic/type-source';
2
2
  export declare function initStore(storeInfo: SuggesterType): Promise<boolean>;
@@ -1,4 +1,4 @@
1
- import { SuggesterType } from '../../../use-lunatic/type-source';
1
+ import type { SuggesterType } from '../../../use-lunatic/type-source';
2
2
  declare function consoleLogging(...args: Array<any>): void;
3
3
  /**
4
4
  * Only with Worker
@@ -1,3 +1,3 @@
1
- import { Entities } from './meloto-order';
1
+ import { type Entities } from './meloto-order';
2
2
  declare function computeScore(documents: Entities, tokens: Array<string>, meloto?: boolean): Entities;
3
3
  export default computeScore;
@@ -6,7 +6,7 @@
6
6
  "mandatory": false,
7
7
  "page": "3",
8
8
  "label": {
9
- "value": "\"checkboxone ONE component\"",
9
+ "value": "\"checkboxone ONE component \"",
10
10
  "type": "VTL|MD"
11
11
  },
12
12
  "description": {
@@ -18,7 +18,7 @@
18
18
  {
19
19
  "value": "1",
20
20
  "description": {
21
- "value": "\"Déclaration oui\"",
21
+ "value": "Déclaration :warning:",
22
22
  "type": "VTL|MD"
23
23
  },
24
24
  "label": { "value": "\"oui\"", "type": "VTL|MD" }