@inseefr/lunatic 2.0.4-v2 → 2.0.5-v2

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 (400) hide show
  1. package/lib/components/button/index.js +0 -2
  2. package/lib/components/button/lunatic-button.js +4 -18
  3. package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +5 -12
  4. package/lib/components/checkbox/checkbox-boolean/index.js +0 -2
  5. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -15
  6. package/lib/components/checkbox/checkbox-group/checkbox-group.js +14 -26
  7. package/lib/components/checkbox/checkbox-group/index.js +0 -2
  8. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +6 -13
  9. package/lib/components/checkbox/checkbox-one/index.js +0 -2
  10. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +1 -13
  11. package/lib/components/checkbox/commons/checkbox-option.js +7 -20
  12. package/lib/components/checkbox/commons/index.js +0 -2
  13. package/lib/components/checkbox/index.js +0 -4
  14. package/lib/components/commons/build-style-object.js +2 -13
  15. package/lib/components/commons/components/combo-box/combo-box-container.js +3 -9
  16. package/lib/components/commons/components/combo-box/combo-box-content.js +6 -19
  17. package/lib/components/commons/components/combo-box/combo-box.js +30 -64
  18. package/lib/components/commons/components/combo-box/index.js +0 -2
  19. package/lib/components/commons/components/combo-box/panel/index.js +0 -2
  20. package/lib/components/commons/components/combo-box/panel/option-container.js +4 -19
  21. package/lib/components/commons/components/combo-box/panel/panel-container.js +3 -8
  22. package/lib/components/commons/components/combo-box/panel/panel.js +13 -22
  23. package/lib/components/commons/components/combo-box/selection/delete.js +3 -19
  24. package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +1 -8
  25. package/lib/components/commons/components/combo-box/selection/index.js +0 -2
  26. package/lib/components/commons/components/combo-box/selection/input.js +7 -20
  27. package/lib/components/commons/components/combo-box/selection/label-selection.js +6 -13
  28. package/lib/components/commons/components/combo-box/selection/selection-container.js +4 -9
  29. package/lib/components/commons/components/combo-box/selection/selection.js +12 -22
  30. package/lib/components/commons/components/combo-box/state-management/actions.js +2 -21
  31. package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +0 -4
  32. package/lib/components/commons/components/combo-box/state-management/index.js +0 -9
  33. package/lib/components/commons/components/combo-box/state-management/reducer/index.js +0 -2
  34. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +0 -5
  35. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +0 -5
  36. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +0 -5
  37. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +0 -5
  38. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +4 -13
  39. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +0 -2
  40. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +0 -8
  41. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +0 -8
  42. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +0 -6
  43. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +0 -5
  44. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +0 -5
  45. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +0 -6
  46. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +0 -5
  47. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +1 -20
  48. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +0 -5
  49. package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +0 -22
  50. package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +10 -21
  51. package/lib/components/commons/components/create-lunatic-component/index.js +0 -3
  52. package/lib/components/commons/components/default-label-renderer.js +4 -14
  53. package/lib/components/commons/components/default-option-renderer.js +3 -10
  54. package/lib/components/commons/components/dragger/dragger.js +19 -45
  55. package/lib/components/commons/components/dragger/index.js +0 -2
  56. package/lib/components/commons/components/errors/errors.js +3 -17
  57. package/lib/components/commons/components/errors/index.js +0 -2
  58. package/lib/components/commons/components/fab/fab.js +6 -14
  59. package/lib/components/commons/components/fab/index.js +0 -2
  60. package/lib/components/commons/components/field-container/field-container.js +3 -12
  61. package/lib/components/commons/components/field-container/index.js +0 -2
  62. package/lib/components/commons/components/fieldset.js +1 -9
  63. package/lib/components/commons/components/html-table/index.js +0 -7
  64. package/lib/components/commons/components/html-table/table.js +2 -11
  65. package/lib/components/commons/components/html-table/tbody.js +2 -11
  66. package/lib/components/commons/components/html-table/td.js +6 -15
  67. package/lib/components/commons/components/html-table/th.js +5 -14
  68. package/lib/components/commons/components/html-table/thead.js +2 -11
  69. package/lib/components/commons/components/html-table/tr.js +3 -12
  70. package/lib/components/commons/components/is-network/index.js +0 -2
  71. package/lib/components/commons/components/is-network/is-network.js +7 -26
  72. package/lib/components/commons/components/is-network/use-online-status.js +0 -9
  73. package/lib/components/commons/components/label.js +4 -12
  74. package/lib/components/commons/components/lunatic-component.js +12 -24
  75. package/lib/components/commons/components/lunatic-fieldset-component.js +9 -20
  76. package/lib/components/commons/components/md-label/index.js +0 -2
  77. package/lib/components/commons/components/md-label/link.js +8 -14
  78. package/lib/components/commons/components/md-label/md-label.js +2 -13
  79. package/lib/components/commons/components/missing/index.js +0 -2
  80. package/lib/components/commons/components/missing/missing.js +11 -25
  81. package/lib/components/commons/components/nothing-to-display.js +0 -4
  82. package/lib/components/commons/components/orchestrated-component.js +13 -25
  83. package/lib/components/commons/components/variable-status/img/index.js +0 -3
  84. package/lib/components/commons/components/variable-status/index.js +0 -2
  85. package/lib/components/commons/components/variable-status/variable-status.js +17 -34
  86. package/lib/components/commons/create-customizable-field.js +1 -12
  87. package/lib/components/commons/create-row-orchestrator.js +14 -21
  88. package/lib/components/commons/icons/checkbox-checked.icon.js +4 -9
  89. package/lib/components/commons/icons/checkbox-unchecked.icon.js +4 -9
  90. package/lib/components/commons/icons/closed.icon.js +4 -9
  91. package/lib/components/commons/icons/cross.icon.js +4 -9
  92. package/lib/components/commons/icons/index.js +0 -11
  93. package/lib/components/commons/icons/load.icon.js +4 -9
  94. package/lib/components/commons/icons/lunatic-icon.js +1 -7
  95. package/lib/components/commons/icons/network.icon.js +4 -9
  96. package/lib/components/commons/icons/on-drag.icon.js +4 -9
  97. package/lib/components/commons/icons/opened.icon.js +4 -9
  98. package/lib/components/commons/icons/radio-checked.icon.js +4 -9
  99. package/lib/components/commons/icons/radio-unchecked.icon.js +4 -9
  100. package/lib/components/commons/index.js +0 -24
  101. package/lib/components/commons/prop-types/declarations.js +0 -8
  102. package/lib/components/commons/prop-types/index.js +0 -6
  103. package/lib/components/commons/prop-types/lines.js +0 -4
  104. package/lib/components/commons/prop-types/options.js +0 -4
  105. package/lib/components/commons/prop-types/response.js +0 -4
  106. package/lib/components/commons/prop-types/value-type.js +0 -8
  107. package/lib/components/commons/safety-label.js +0 -8
  108. package/lib/components/commons/use-document-add-event-listener.js +4 -31
  109. package/lib/components/commons/use-on-handle-change.js +2 -5
  110. package/lib/components/commons/use-options-keydown.js +1 -6
  111. package/lib/components/commons/use-previous.js +0 -3
  112. package/lib/components/components.js +8 -33
  113. package/lib/components/datepicker/datepicker.js +7 -18
  114. package/lib/components/datepicker/index.js +0 -2
  115. package/lib/components/datepicker/lunatic-datepicker.js +1 -13
  116. package/lib/components/declarations/declaration.js +1 -8
  117. package/lib/components/declarations/declarations-after-text.js +0 -9
  118. package/lib/components/declarations/declarations-before-text.js +0 -9
  119. package/lib/components/declarations/declarations-detachable.js +0 -9
  120. package/lib/components/declarations/declarations.js +6 -16
  121. package/lib/components/declarations/index.js +0 -8
  122. package/lib/components/dropdown/dropdown-simple/dropdown-simple.js +7 -14
  123. package/lib/components/dropdown/dropdown-simple/index.js +0 -2
  124. package/lib/components/dropdown/dropdown-simple/simple-label-renderer.js +3 -13
  125. package/lib/components/dropdown/dropdown-simple/simple-option-renderer.js +2 -9
  126. package/lib/components/dropdown/dropdown-writable/dropdown-writable.js +10 -30
  127. package/lib/components/dropdown/dropdown-writable/filter-tools/filter-options.js +1 -12
  128. package/lib/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +0 -11
  129. package/lib/components/dropdown/dropdown-writable/filter-tools/match.js +0 -5
  130. package/lib/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +0 -4
  131. package/lib/components/dropdown/dropdown-writable/index.js +0 -2
  132. package/lib/components/dropdown/dropdown-writable/writable-label-renderer.js +3 -13
  133. package/lib/components/dropdown/dropdown-writable/writable-option-renderer.js +14 -50
  134. package/lib/components/dropdown/dropdown.js +8 -19
  135. package/lib/components/dropdown/index.js +0 -2
  136. package/lib/components/dropdown/lunatic-dropdown.js +8 -17
  137. package/lib/components/filter-description/component.js +1 -7
  138. package/lib/components/filter-description/index.js +0 -2
  139. package/lib/components/index.js +0 -4
  140. package/lib/components/input/index.js +0 -2
  141. package/lib/components/input/input.js +6 -18
  142. package/lib/components/input/lunatic-input.js +1 -14
  143. package/lib/components/input-number/index.js +0 -2
  144. package/lib/components/input-number/input-number.js +9 -20
  145. package/lib/components/input-number/lunatic-input-number.js +1 -12
  146. package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +0 -4
  147. package/lib/components/loop/block-for-loop/block-for-loop.js +28 -61
  148. package/lib/components/loop/block-for-loop/index.js +0 -2
  149. package/lib/components/loop/block-for-loop/row.js +13 -29
  150. package/lib/components/loop/commons/get-init-length.js +0 -3
  151. package/lib/components/loop/commons/handle-row-button.js +2 -7
  152. package/lib/components/loop/commons/index.js +0 -3
  153. package/lib/components/loop/commons/row-component.js +16 -37
  154. package/lib/components/loop/index.js +0 -2
  155. package/lib/components/loop/loop.js +19 -29
  156. package/lib/components/loop/roster-for-loop/body.js +10 -24
  157. package/lib/components/loop/roster-for-loop/header.js +2 -9
  158. package/lib/components/loop/roster-for-loop/index.js +0 -2
  159. package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +0 -4
  160. package/lib/components/loop/roster-for-loop/roster-for-loop.js +21 -51
  161. package/lib/components/loop/roster-for-loop/roster-table.js +10 -21
  162. package/lib/components/loop/roster-for-loop/row.js +13 -26
  163. package/lib/components/modal-controls/close-or-skip.js +3 -10
  164. package/lib/components/modal-controls/index.js +0 -2
  165. package/lib/components/modal-controls/modal-container.js +0 -5
  166. package/lib/components/modal-controls/modal-controls.js +5 -28
  167. package/lib/components/modal-controls/modal-controls.scss +7 -6
  168. package/lib/components/{pairwise/links → pairwise-links}/index.js +0 -2
  169. package/lib/components/pairwise-links/orchestrator.js +69 -0
  170. package/lib/components/{pairwise/links → pairwise-links}/pairwise-links.js +20 -27
  171. package/lib/components/{pairwise/links → pairwise-links}/row.js +50 -65
  172. package/lib/components/radio/index.js +0 -2
  173. package/lib/components/radio/lunatic-radio-group.js +6 -14
  174. package/lib/components/radio/radio-group.js +6 -13
  175. package/lib/components/radio/radio-option.js +9 -23
  176. package/lib/components/sequence/index.js +0 -2
  177. package/lib/components/sequence/sequence.js +3 -11
  178. package/lib/components/subsequence/index.js +0 -2
  179. package/lib/components/subsequence/subsequence.js +2 -9
  180. package/lib/components/suggester/check-store.js +13 -47
  181. package/lib/components/suggester/find-best-label/find-best-label.js +2 -14
  182. package/lib/components/suggester/find-best-label/index.js +0 -2
  183. package/lib/components/suggester/idb-suggester.js +13 -33
  184. package/lib/components/suggester/index.js +0 -2
  185. package/lib/components/suggester/lunatic-suggester.js +13 -27
  186. package/lib/components/suggester/searching/create-searching.js +5 -18
  187. package/lib/components/suggester/searching/index.js +0 -2
  188. package/lib/components/suggester/suggester.js +19 -53
  189. package/lib/components/suggester-loader-widget/index.js +0 -2
  190. package/lib/components/suggester-loader-widget/loader-row.js +12 -39
  191. package/lib/components/suggester-loader-widget/loader.js +14 -55
  192. package/lib/components/suggester-loader-widget/progress.js +6 -13
  193. package/lib/components/suggester-loader-widget/tools/action-tool.js +5 -12
  194. package/lib/components/suggester-loader-widget/tools/index.js +0 -3
  195. package/lib/components/suggester-loader-widget/tools/tools.js +0 -4
  196. package/lib/components/suggester-loader-widget/widget-container.js +2 -11
  197. package/lib/components/suggester-loader-widget/widget.js +20 -52
  198. package/lib/components/switch/index.js +0 -2
  199. package/lib/components/switch/lunatic-switch.js +5 -17
  200. package/lib/components/switch/switch.js +6 -20
  201. package/lib/components/table/cell.js +14 -39
  202. package/lib/components/table/components/cell.js +14 -39
  203. package/lib/components/table/components/header.js +4 -11
  204. package/lib/components/table/components/row.js +7 -13
  205. package/lib/components/table/components/table.js +3 -10
  206. package/lib/components/table/index.js +0 -2
  207. package/lib/components/table/lunatic-table.js +13 -33
  208. package/lib/components/table/table-orchestrator.js +12 -20
  209. package/lib/components/textarea/index.js +0 -2
  210. package/lib/components/textarea/lunatic-textarea.js +1 -14
  211. package/lib/components/textarea/textarea.js +7 -19
  212. package/lib/constants/declarations.js +3 -1
  213. package/lib/constants/event-types.js +2 -1
  214. package/lib/constants/index.js +0 -10
  215. package/lib/constants/supported-preferences.js +0 -5
  216. package/lib/constants/variable-types.js +2 -2
  217. package/lib/i18n/build-dictionary.js +2 -10
  218. package/lib/i18n/index.js +0 -6
  219. package/lib/index.js +0 -4
  220. package/lib/stories/checkboxBoolean/checkboxBoolean.stories.js +0 -8
  221. package/lib/stories/checkboxOne/checkboxOne.stories.js +0 -8
  222. package/lib/stories/custom-mui/checkbox-boolean-mui.js +4 -12
  223. package/lib/stories/custom-mui/checkbox-group-mui.js +9 -23
  224. package/lib/stories/custom-mui/checkbox-one-mui.js +0 -4
  225. package/lib/stories/custom-mui/index.js +0 -16
  226. package/lib/stories/custom-mui/input-mui.js +7 -17
  227. package/lib/stories/custom-mui/input-number-mui.js +7 -15
  228. package/lib/stories/custom-mui/radio-mui.js +7 -23
  229. package/lib/stories/custom-mui/suggester-mui/index.js +0 -2
  230. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +54 -92
  231. package/lib/stories/custom-mui/switch-mui.js +5 -15
  232. package/lib/stories/custom-mui/table-mui.js +2 -10
  233. package/lib/stories/custom-mui/tbody-mui.js +2 -8
  234. package/lib/stories/custom-mui/td-mui.js +4 -10
  235. package/lib/stories/custom-mui/textarea-mui.js +7 -16
  236. package/lib/stories/custom-mui/th-mui.js +3 -9
  237. package/lib/stories/custom-mui/thead-mui.js +2 -8
  238. package/lib/stories/custom-mui/tr-mui.js +3 -10
  239. package/lib/stories/date-picker/datepicker.stories.js +0 -9
  240. package/lib/stories/dropdown/dropdown.stories.js +0 -9
  241. package/lib/stories/filter-description/filter-description.stories.js +0 -12
  242. package/lib/stories/input/input.stories.js +0 -9
  243. package/lib/stories/input-number/input-number.stories.js +0 -9
  244. package/lib/stories/pairwise/data.json +4 -5
  245. package/lib/stories/pairwise/links.json +81 -18
  246. package/lib/stories/pairwise/pairwise-links.stories.js +0 -9
  247. package/lib/stories/paste-questionnaire/test.stories.js +0 -11
  248. package/lib/stories/questionnaires/logement/logement.stories.js +0 -14
  249. package/lib/stories/questionnaires/recensement/data.json +12 -0
  250. package/lib/stories/questionnaires/recensement/recensement.stories.js +55 -0
  251. package/lib/stories/questionnaires/recensement/source.json +15202 -0
  252. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +0 -11
  253. package/lib/stories/questionnaires-test/controls/controls.stories.js +0 -15
  254. package/lib/stories/questionnaires-test/test.stories.js +0 -15
  255. package/lib/stories/radio/radio.stories.js +0 -8
  256. package/lib/stories/roster-for-loop/roster-for-loop.stories.js +0 -8
  257. package/lib/stories/suggester/suggester-workers.stories.js +11 -52
  258. package/lib/stories/suggester/suggester.stories.js +0 -10
  259. package/lib/stories/switch/SwitchMaterialUI.js +5 -15
  260. package/lib/stories/switch/switch.js +3 -26
  261. package/lib/stories/table/table.stories.js +0 -16
  262. package/lib/stories/utils/default-arg-types.js +0 -4
  263. package/lib/stories/utils/orchestrator.js +60 -84
  264. package/lib/stories/utils/waiting/index.js +0 -2
  265. package/lib/stories/utils/waiting/waiting.js +1 -11
  266. package/lib/use-lunatic/actions.js +8 -20
  267. package/lib/use-lunatic/commons/calculated-variables.js +15 -42
  268. package/lib/use-lunatic/commons/check-loops.js +9 -36
  269. package/lib/use-lunatic/commons/compose.js +0 -4
  270. package/lib/use-lunatic/commons/create-map-pages.js +2 -26
  271. package/lib/use-lunatic/commons/execute-condition-filter.js +0 -7
  272. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +52 -101
  273. package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +2 -26
  274. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +18 -43
  275. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +3 -38
  276. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +2 -16
  277. package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +2 -11
  278. package/lib/use-lunatic/commons/execute-expression/index.js +0 -2
  279. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +15 -43
  280. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +0 -7
  281. package/lib/use-lunatic/commons/fill-components/fill-components.js +0 -13
  282. package/lib/use-lunatic/commons/fill-components/fill-errors.js +0 -7
  283. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -7
  284. package/lib/use-lunatic/commons/fill-components/fill-management.js +0 -7
  285. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +1 -9
  286. package/lib/use-lunatic/commons/fill-components/fill-pagination.js +0 -5
  287. package/lib/use-lunatic/commons/fill-components/index.js +0 -2
  288. package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +0 -7
  289. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +22 -64
  290. package/lib/use-lunatic/commons/get-component-value/index.js +0 -2
  291. package/lib/use-lunatic/commons/get-components-from-state.js +3 -10
  292. package/lib/use-lunatic/commons/get-data.js +11 -29
  293. package/lib/use-lunatic/commons/get-errors-without-empty-value.js +2 -11
  294. package/lib/use-lunatic/commons/index.js +0 -14
  295. package/lib/use-lunatic/commons/is-First-last-page.js +1 -3
  296. package/lib/use-lunatic/commons/is-paginated-loop.js +1 -3
  297. package/lib/use-lunatic/commons/load-suggesters.js +8 -53
  298. package/lib/use-lunatic/commons/page-tag.js +10 -33
  299. package/lib/use-lunatic/commons/use-components-from-state.js +5 -18
  300. package/lib/use-lunatic/index.js +0 -2
  301. package/lib/use-lunatic/initial-state.js +0 -3
  302. package/lib/use-lunatic/reducer/commons/index.js +0 -5
  303. package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +1 -15
  304. package/lib/use-lunatic/reducer/commons/resize-array-variable.js +2 -12
  305. package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +3 -15
  306. package/lib/use-lunatic/reducer/index.js +0 -2
  307. package/lib/use-lunatic/reducer/reduce-go-next-page.js +17 -55
  308. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +25 -48
  309. package/lib/use-lunatic/reducer/reduce-go-to-page.js +4 -18
  310. package/lib/use-lunatic/reducer/reduce-handle-change/index.js +0 -2
  311. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +8 -27
  312. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +24 -40
  313. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +53 -28
  314. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +9 -32
  315. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +19 -41
  316. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +7 -19
  317. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +1 -8
  318. package/lib/use-lunatic/reducer/reduce-on-init.js +50 -96
  319. package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +0 -5
  320. package/lib/use-lunatic/reducer/reducer.js +0 -20
  321. package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +9 -21
  322. package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +7 -26
  323. package/lib/use-lunatic/reducer/validate-controls/index.js +0 -3
  324. package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +7 -20
  325. package/lib/use-lunatic/use-lunatic.js +57 -104
  326. package/lib/utils/constants/index.js +0 -10
  327. package/lib/utils/idb-tools/clear-store.js +1 -11
  328. package/lib/utils/idb-tools/create-db-opener.js +6 -19
  329. package/lib/utils/idb-tools/create-open-db.js +1 -7
  330. package/lib/utils/idb-tools/get-entity.js +0 -4
  331. package/lib/utils/idb-tools/get-idb.js +0 -2
  332. package/lib/utils/idb-tools/idb-bulk-insert.js +11 -37
  333. package/lib/utils/idb-tools/index.js +0 -11
  334. package/lib/utils/idb-tools/insert-entity.js +0 -4
  335. package/lib/utils/idb-tools/open-db.js +1 -6
  336. package/lib/utils/idb-tools/open-or-create-db.js +3 -10
  337. package/lib/utils/is-element.js +0 -2
  338. package/lib/utils/store-tools/auto-load.js +9 -50
  339. package/lib/utils/store-tools/clear-store-data.js +1 -12
  340. package/lib/utils/store-tools/clear-store-info.js +1 -12
  341. package/lib/utils/store-tools/create/create.js +1 -18
  342. package/lib/utils/store-tools/create/index.js +0 -3
  343. package/lib/utils/store-tools/create/update-store-info.js +0 -6
  344. package/lib/utils/store-tools/get-store-count.js +0 -5
  345. package/lib/utils/store-tools/index.js +0 -12
  346. package/lib/utils/store-tools/open-or-create-store.js +1 -11
  347. package/lib/utils/store-tools/use-store-index.js +4 -26
  348. package/lib/utils/suggester-workers/append-to-index/append.js +7 -23
  349. package/lib/utils/suggester-workers/append-to-index/append.worker.js +6 -10
  350. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +3 -11
  351. package/lib/utils/suggester-workers/append-to-index/index.js +0 -3
  352. package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +5 -34
  353. package/lib/utils/suggester-workers/append-to-index/store-messages.js +0 -6
  354. package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +0 -19
  355. package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +11 -40
  356. package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +0 -14
  357. package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +0 -3
  358. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +0 -14
  359. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +0 -2
  360. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +0 -5
  361. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +0 -2
  362. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +0 -9
  363. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +0 -2
  364. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +1 -3
  365. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +0 -2
  366. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +3 -9
  367. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +0 -2
  368. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +1 -21
  369. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +2 -3
  370. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +0 -3
  371. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +0 -2
  372. package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +0 -3
  373. package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +0 -3
  374. package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +0 -8
  375. package/lib/utils/suggester-workers/commons-tokenizer/index.js +0 -10
  376. package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +0 -6
  377. package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +0 -3
  378. package/lib/utils/suggester-workers/create-worker.js +1 -11
  379. package/lib/utils/suggester-workers/find-best-label/find-best-label.js +5 -26
  380. package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +9 -23
  381. package/lib/utils/suggester-workers/find-best-label/tokenize.js +5 -22
  382. package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +0 -2
  383. package/lib/utils/suggester-workers/searching/compute-score.js +0 -15
  384. package/lib/utils/suggester-workers/searching/get-db.js +1 -15
  385. package/lib/utils/suggester-workers/searching/index.js +0 -2
  386. package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +0 -5
  387. package/lib/utils/suggester-workers/searching/order/index.js +0 -8
  388. package/lib/utils/suggester-workers/searching/query-parser/index.js +0 -3
  389. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +0 -3
  390. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +0 -2
  391. package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +2 -20
  392. package/lib/utils/suggester-workers/searching/resolve-query-parser.js +1 -15
  393. package/lib/utils/suggester-workers/searching/search-in-index.js +0 -3
  394. package/lib/utils/suggester-workers/searching/searching.js +2 -39
  395. package/lib/utils/suggester-workers/searching/searching.worker.js +4 -7
  396. package/lib/utils/vtl/dataset-builder.js +0 -4
  397. package/lib/utils/vtl/index.js +0 -2
  398. package/package.json +4 -2
  399. package/lib/components/pairwise/index.js +0 -15
  400. package/lib/components/pairwise/links/orchestrator.js +0 -16
@@ -4,66 +4,55 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _reduceVariablesArray = _interopRequireDefault(require("./reduce-variables-array"));
9
-
10
8
  var _reduceVariablesSimple = _interopRequireDefault(require("./reduce-variables-simple"));
11
-
12
9
  var _reduceCleaning = _interopRequireDefault(require("./reduce-cleaning"));
13
-
14
10
  var _reduceMissing = _interopRequireDefault(require("./reduce-missing"));
15
-
16
11
  var _reduceResizing = _interopRequireDefault(require("./reduce-resizing"));
17
-
18
12
  var _reduceLinksVariable = _interopRequireDefault(require("./reduce-links-variable"));
19
-
20
13
  var _compose = _interopRequireDefault(require("../../commons/compose"));
21
-
22
14
  var _validateControls = require("../validate-controls");
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
-
26
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
-
28
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
-
30
18
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
-
32
19
  function isOnSubPage(pager) {
33
20
  var subPage = pager.subPage;
34
21
  return subPage !== undefined;
35
22
  }
23
+
36
24
  /**
37
25
  * met à jour variables qui contient les valeur collectées
38
26
  * @param {*} state
39
27
  * @param {*} action
40
28
  * @returns
41
29
  */
42
-
43
-
44
30
  function updateVariables(state, action) {
45
31
  var payload = action.payload;
46
32
  var response = payload.response,
47
- value = payload.value,
48
- _payload$args = payload.args,
49
- args = _payload$args === void 0 ? {} : _payload$args;
33
+ value = payload.value,
34
+ _payload$args = payload.args,
35
+ args = _payload$args === void 0 ? {} : _payload$args;
50
36
  var name = response.name;
51
37
  var loop = args.loop,
52
- index = args.index,
53
- length = args.length,
54
- linksIterations = args.linksIterations,
55
- paginatedLoop = args.paginatedLoop,
56
- shallowIteration = args.shallowIteration;
38
+ index = args.index,
39
+ length = args.length,
40
+ linksIterations = args.linksIterations,
41
+ symLinks = args.symLinks,
42
+ paginatedLoop = args.paginatedLoop,
43
+ shallowIteration = args.shallowIteration,
44
+ lengths = args.lengths;
57
45
  var pager = state.pager,
58
- variables = state.variables;
46
+ variables = state.variables;
59
47
  var nbIterations = pager.nbIterations,
60
- iteration = pager.iteration;
61
-
48
+ iteration = pager.iteration;
62
49
  if (linksIterations !== undefined) {
63
50
  var variablesNext = (0, _reduceLinksVariable["default"])(variables, {
64
51
  name: name,
65
52
  value: value,
66
- linksIterations: linksIterations
53
+ linksIterations: linksIterations,
54
+ symLinks: symLinks,
55
+ lengths: lengths
67
56
  });
68
57
  return _objectSpread(_objectSpread({}, state), {}, {
69
58
  variables: variablesNext
@@ -75,7 +64,6 @@ function updateVariables(state, action) {
75
64
  index: index,
76
65
  length: length
77
66
  });
78
-
79
67
  return _objectSpread(_objectSpread({}, state), {}, {
80
68
  variables: _variablesNext
81
69
  });
@@ -86,7 +74,6 @@ function updateVariables(state, action) {
86
74
  index: iteration,
87
75
  length: nbIterations
88
76
  });
89
-
90
77
  return _objectSpread(_objectSpread({}, state), {}, {
91
78
  variables: _variablesNext2
92
79
  });
@@ -95,7 +82,6 @@ function updateVariables(state, action) {
95
82
  name: name,
96
83
  value: value
97
84
  });
98
-
99
85
  if (loop) return _objectSpread(_objectSpread({}, state), {}, {
100
86
  variables: _variablesNext3,
101
87
  pager: _objectSpread(_objectSpread({}, pager), {}, {
@@ -107,36 +93,34 @@ function updateVariables(state, action) {
107
93
  });
108
94
  }
109
95
  }
96
+
110
97
  /**
111
98
  * met à jour bindings pour l'exe du VTL (en appelant la fonction fournit par createExecuteExpression)
112
99
  * @param {*} state
113
100
  * @param {*} action
114
101
  * @returns
115
102
  */
116
-
117
-
118
103
  function updateBindings(state, action) {
119
104
  var payload = action.payload;
120
- var response = payload.response,
121
- value = payload.value;
105
+ var response = payload.response;
122
106
  var name = response.name;
123
- var updateBindings = state.updateBindings;
124
- updateBindings(name, value);
107
+ var ub = state.updateBindings;
108
+ var variables = state.variables;
109
+ var variable = variables[name];
110
+ var value = variable.value;
111
+ ub(name, value);
125
112
  return state;
126
113
  }
127
-
128
114
  var reducers = (0, _compose["default"])(updateVariables, updateBindings, _reduceResizing["default"], _reduceMissing["default"], _reduceCleaning["default"]);
115
+
129
116
  /**
130
117
  *
131
118
  * @param {*} state
132
119
  * @param {*} action
133
120
  * @returns
134
121
  */
135
-
136
122
  function reduceHandleChange(state, action) {
137
123
  return reducers(state, action);
138
124
  }
139
-
140
125
  var _default = (0, _validateControls.createControlsReducer)(reduceHandleChange);
141
-
142
126
  exports["default"] = _default;
@@ -4,50 +4,75 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
7
+ var _commons = require("../commons");
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
-
10
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
-
12
10
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
11
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
15
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
-
16
16
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
-
18
17
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
-
20
18
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
-
22
19
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
23
-
24
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25
-
26
- function reduceLinksVariable(variables, _ref) {
21
+ function reduceOne(variables, _ref) {
27
22
  var name = _ref.name,
28
- value = _ref.value,
29
- linksIterations = _ref.linksIterations;
30
-
23
+ value = _ref.value,
24
+ linksIterations = _ref.linksIterations,
25
+ lengths = _ref.lengths;
31
26
  if (name in variables) {
32
27
  var variable = variables[name];
33
28
  var v = variable.value;
34
-
35
29
  var _linksIterations = _slicedToArray(linksIterations, 2),
36
- x = _linksIterations[0],
37
- y = _linksIterations[1];
38
-
39
- if (v[x][y] !== undefined) {
40
- v[x][y] = value;
41
- return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
42
- value: v
43
- })));
44
- }
45
-
46
- return variables;
30
+ x = _linksIterations[0],
31
+ y = _linksIterations[1];
32
+ var _lengths = _slicedToArray(lengths, 2),
33
+ lx = _lengths[0],
34
+ ly = _lengths[1];
35
+ var next = (0, _commons.resizeArrayVariable)(_toConsumableArray(v), lx, []);
36
+ next[x] = (0, _commons.resizeArrayVariable)(_toConsumableArray(next[x]), ly, null);
37
+ next[x][y] = value;
38
+ return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
39
+ value: next
40
+ })));
47
41
  }
48
-
49
42
  return variables;
50
43
  }
51
-
44
+ function reduceLinksVariable(variables, _ref2) {
45
+ var name = _ref2.name,
46
+ value = _ref2.value,
47
+ linksIterations = _ref2.linksIterations,
48
+ symLinks = _ref2.symLinks,
49
+ lengths = _ref2.lengths;
50
+ if (symLinks && name in symLinks) {
51
+ var symValue = symLinks[name][value];
52
+ var _linksIterations2 = _slicedToArray(linksIterations, 2),
53
+ x = _linksIterations2[0],
54
+ y = _linksIterations2[1];
55
+ var symIteration = [y, x];
56
+ if (symValue) {
57
+ return reduceOne(reduceOne(variables, {
58
+ name: name,
59
+ value: value,
60
+ linksIterations: linksIterations,
61
+ lengths: lengths
62
+ }), {
63
+ name: name,
64
+ value: symValue,
65
+ linksIterations: symIteration,
66
+ lengths: lengths
67
+ });
68
+ }
69
+ }
70
+ return reduceOne(variables, {
71
+ name: name,
72
+ value: value,
73
+ linksIterations: linksIterations,
74
+ lengths: lengths
75
+ });
76
+ }
52
77
  var _default = reduceLinksVariable;
53
78
  exports["default"] = _default;
@@ -4,73 +4,52 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _reduceCleaning = _interopRequireDefault(require("./reduce-cleaning"));
9
-
10
8
  var _excluded = ["value"];
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
-
16
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
-
18
12
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
-
20
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
-
22
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
23
-
24
15
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
25
-
26
16
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
-
28
17
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
-
30
18
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
-
32
19
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
33
-
34
20
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
-
36
21
  function buildMissingValue(state, oldValue) {
37
- var iteration = state.pager.iteration; // Root question
38
-
39
- if (iteration === undefined) return null; // Loop question
40
-
22
+ var iteration = state.pager.iteration;
23
+ // Root question
24
+ if (iteration === undefined) return null;
25
+ // Loop question
41
26
  var newValue = _toConsumableArray(oldValue);
42
-
43
27
  newValue[iteration] = null;
44
28
  return newValue;
45
29
  }
46
-
47
30
  function reduceMissing(state, action) {
48
31
  var name = action.payload.response.name;
49
32
  var missingBlock = state.missingBlock;
50
-
51
33
  if (name in missingBlock) {
52
34
  var variables = state.variables,
53
- updateBindings = state.updateBindings;
35
+ updateBindings = state.updateBindings;
54
36
  var toClean = missingBlock[name];
55
37
  var delta = toClean.reduce(function (acc, variableName) {
56
38
  var _variables$variableNa = variables[variableName],
57
- value = _variables$variableNa.value,
58
- rest = _objectWithoutProperties(_variables$variableNa, _excluded);
59
-
39
+ value = _variables$variableNa.value,
40
+ rest = _objectWithoutProperties(_variables$variableNa, _excluded);
60
41
  updateBindings(variableName, null);
61
42
  var newValue = buildMissingValue(state, value);
62
43
  return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, variableName, _objectSpread(_objectSpread({}, rest), {}, {
63
44
  value: newValue
64
45
  })));
65
46
  }, {});
66
-
67
47
  var newStateAfterMissing = _objectSpread(_objectSpread({}, state), {}, {
68
48
  variables: _objectSpread(_objectSpread({}, variables), delta)
69
- }); // If missing clean variable which is also into cleaning case,
49
+ });
50
+ // If missing clean variable which is also into cleaning case,
70
51
  // we have to handle theses cleanings
71
52
  // To check: do we have with this trick or triggering handle change action?
72
-
73
-
74
53
  var newStateAfterCleaning = toClean.reduce(function (acc, v) {
75
54
  return (0, _reduceCleaning["default"])(acc, {
76
55
  payload: {
@@ -82,9 +61,7 @@ function reduceMissing(state, action) {
82
61
  }, newStateAfterMissing);
83
62
  return newStateAfterCleaning;
84
63
  }
85
-
86
64
  return state;
87
65
  }
88
-
89
66
  var _default = reduceMissing;
90
67
  exports["default"] = _default;
@@ -4,36 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _commons = require("../../commons");
9
-
10
8
  var _commons2 = require("../commons");
11
-
12
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
-
14
10
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
-
16
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
-
18
12
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
19
-
20
13
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
21
-
22
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
-
24
15
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
-
26
16
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
-
28
17
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
-
30
18
  function reduceResizingVariables(_ref) {
31
19
  var size = _ref.size,
32
- variableArray = _ref.variableArray,
33
- variables = _ref.variables,
34
- executeExpression = _ref.executeExpression,
35
- updateBindings = _ref.updateBindings;
36
-
20
+ variableArray = _ref.variableArray,
21
+ variables = _ref.variables,
22
+ executeExpression = _ref.executeExpression,
23
+ updateBindings = _ref.updateBindings;
37
24
  if (size !== undefined) {
38
25
  var sizeValue = executeExpression((0, _commons.getCompatibleVTLExpression)(size));
39
26
  return variableArray.reduce(function (acc, v) {
@@ -45,25 +32,21 @@ function reduceResizingVariables(_ref) {
45
32
  })));
46
33
  }, {});
47
34
  }
48
-
49
35
  return {};
50
36
  }
51
-
52
37
  function reduceResizingLinksVariables(_ref2) {
53
38
  var sizeForLinksVariables = _ref2.sizeForLinksVariables,
54
- linksVariables = _ref2.linksVariables,
55
- variables = _ref2.variables,
56
- executeExpression = _ref2.executeExpression,
57
- updateBindings = _ref2.updateBindings;
58
-
39
+ linksVariables = _ref2.linksVariables,
40
+ variables = _ref2.variables,
41
+ executeExpression = _ref2.executeExpression,
42
+ updateBindings = _ref2.updateBindings;
59
43
  if (Array.isArray(sizeForLinksVariables)) {
60
44
  var _sizeForLinksVariable = sizeForLinksVariables.map(function (s) {
61
- return executeExpression((0, _commons.getCompatibleVTLExpression)(s));
62
- }),
63
- _sizeForLinksVariable2 = _slicedToArray(_sizeForLinksVariable, 2),
64
- xSize = _sizeForLinksVariable2[0],
65
- ySize = _sizeForLinksVariable2[1];
66
-
45
+ return executeExpression((0, _commons.getCompatibleVTLExpression)(s));
46
+ }),
47
+ _sizeForLinksVariable2 = _slicedToArray(_sizeForLinksVariable, 2),
48
+ xSize = _sizeForLinksVariable2[0],
49
+ ySize = _sizeForLinksVariable2[1];
67
50
  return linksVariables.reduce(function (acc, v) {
68
51
  var value = variables[v].value;
69
52
  var newValue = (0, _commons2.resizeArrayVariable)(value.map(function (i) {
@@ -75,22 +58,19 @@ function reduceResizingLinksVariables(_ref2) {
75
58
  })));
76
59
  }, {});
77
60
  }
78
-
79
61
  return {};
80
62
  }
81
-
82
63
  function reduceResizing(state, action) {
83
64
  var name = action.payload.response.name;
84
65
  var resizing = state.resizing,
85
- variables = state.variables,
86
- updateBindings = state.updateBindings;
87
-
66
+ variables = state.variables,
67
+ updateBindings = state.updateBindings;
88
68
  if (name in resizing) {
89
69
  var _resizing$name = resizing[name],
90
- size = _resizing$name.size,
91
- variableArray = _resizing$name.variables,
92
- sizeForLinksVariables = _resizing$name.sizeForLinksVariables,
93
- linksVariables = _resizing$name.linksVariables;
70
+ size = _resizing$name.size,
71
+ variableArray = _resizing$name.variables,
72
+ sizeForLinksVariables = _resizing$name.sizeForLinksVariables,
73
+ linksVariables = _resizing$name.linksVariables;
94
74
  var executeExpression = state.executeExpression;
95
75
  var newLinksVariables = reduceResizingLinksVariables({
96
76
  sizeForLinksVariables: sizeForLinksVariables,
@@ -110,9 +90,7 @@ function reduceResizing(state, action) {
110
90
  variables: _objectSpread(_objectSpread(_objectSpread({}, variables), newLinksVariables), newVariables)
111
91
  });
112
92
  }
113
-
114
93
  return state;
115
94
  }
116
-
117
95
  var _default = reduceResizing;
118
96
  exports["default"] = _default;
@@ -4,47 +4,35 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _commons = require("../commons");
9
-
10
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
-
12
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
-
14
10
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
-
16
11
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
17
-
18
12
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19
-
20
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
-
22
14
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
23
-
24
15
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
25
-
26
16
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
-
28
17
  function reduceVariablesArray(variables, _ref) {
29
18
  var name = _ref.name,
30
- value = _ref.value,
31
- index = _ref.index,
32
- length = _ref.length;
33
-
19
+ value = _ref.value,
20
+ index = _ref.index,
21
+ length = _ref.length;
34
22
  if (name in variables) {
35
23
  var variable = variables[name];
36
- var previousValue = variable.value; // validation de la valeur courante : si pas un tableau ou si la taille du tableau a changé
24
+ var previousValue = variable.value;
37
25
 
38
- var valueNext = (0, _commons.resizeArrayVariable)(_toConsumableArray(previousValue), length); // value affectation
26
+ // validation de la valeur courante : si pas un tableau ou si la taille du tableau a changé
27
+ var valueNext = (0, _commons.resizeArrayVariable)(_toConsumableArray(previousValue), length);
39
28
 
29
+ // value affectation
40
30
  valueNext[index] = value;
41
31
  return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
42
32
  value: valueNext
43
33
  })));
44
34
  }
45
-
46
35
  return variables;
47
36
  }
48
-
49
37
  var _default = reduceVariablesArray;
50
38
  exports["default"] = _default;
@@ -4,26 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
-
10
8
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
-
12
9
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
14
10
  function reduceVariablesSimple(variables, _ref) {
15
11
  var name = _ref.name,
16
- value = _ref.value;
17
-
12
+ value = _ref.value;
18
13
  if (name in variables) {
19
14
  var variable = variables[name];
20
15
  return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
21
16
  value: value
22
17
  })));
23
18
  }
24
-
25
19
  return variables;
26
20
  }
27
-
28
21
  var _default = reduceVariablesSimple;
29
22
  exports["default"] = _default;