@inseefr/lunatic 2.0.0-rc9 → 2.0.0-v2test

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 (731) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +25 -22
  3. package/lib/components/button/button.scss +24 -0
  4. package/lib/components/button/index.js +13 -0
  5. package/lib/components/button/lunatic-button.js +52 -0
  6. package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +29 -0
  7. package/lib/components/checkbox/checkbox-boolean/index.js +13 -0
  8. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +40 -0
  9. package/lib/components/checkbox/checkbox-group/checkbox-group.js +84 -0
  10. package/lib/components/checkbox/checkbox-group/checkbox.scss +4 -0
  11. package/lib/components/checkbox/checkbox-group/index.js +13 -0
  12. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +35 -0
  13. package/lib/components/checkbox/checkbox-one/index.js +13 -0
  14. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +27 -0
  15. package/lib/components/checkbox/commons/checkbox-option.js +55 -0
  16. package/lib/components/checkbox/commons/checkbox-option.scss +3 -0
  17. package/lib/components/checkbox/commons/index.js +13 -0
  18. package/lib/components/checkbox/index.js +27 -0
  19. package/lib/components/commons/build-style-object.js +25 -0
  20. package/lib/components/commons/components/combo-box/combo-box-container.js +31 -0
  21. package/lib/components/commons/components/combo-box/combo-box-content.js +60 -0
  22. package/lib/components/commons/components/combo-box/combo-box.js +190 -0
  23. package/lib/components/commons/components/combo-box/combo-box.scss +205 -0
  24. package/lib/components/commons/components/combo-box/index.js +13 -0
  25. package/lib/components/commons/components/combo-box/panel/index.js +13 -0
  26. package/lib/components/commons/components/combo-box/panel/option-container.js +62 -0
  27. package/lib/components/commons/components/combo-box/panel/panel-container.js +26 -0
  28. package/lib/components/commons/components/combo-box/panel/panel.js +61 -0
  29. package/lib/components/commons/components/combo-box/selection/delete.js +53 -0
  30. package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +22 -0
  31. package/lib/components/commons/components/combo-box/selection/index.js +13 -0
  32. package/lib/components/commons/components/combo-box/selection/input.js +55 -0
  33. package/lib/components/commons/components/combo-box/selection/label-selection.js +32 -0
  34. package/lib/components/commons/components/combo-box/selection/selection-container.js +35 -0
  35. package/lib/components/commons/components/combo-box/selection/selection.js +61 -0
  36. package/lib/components/commons/components/combo-box/state-management/actions.js +82 -0
  37. package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +16 -0
  38. package/lib/components/commons/components/combo-box/state-management/index.js +33 -0
  39. package/lib/components/commons/components/combo-box/state-management/initial-state.js +14 -0
  40. package/lib/components/commons/components/combo-box/state-management/reducer/index.js +13 -0
  41. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +20 -0
  42. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +22 -0
  43. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +21 -0
  44. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +20 -0
  45. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +40 -0
  46. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +13 -0
  47. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/keyboard-key-codes.js +18 -0
  48. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +32 -0
  49. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +32 -0
  50. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +25 -0
  51. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +21 -0
  52. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +20 -0
  53. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +25 -0
  54. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +20 -0
  55. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +40 -0
  56. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +22 -0
  57. package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +41 -0
  58. package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +64 -0
  59. package/lib/components/commons/components/create-lunatic-component/index.js +11 -0
  60. package/lib/components/commons/components/default-label-renderer.js +44 -0
  61. package/lib/components/commons/components/default-option-renderer.js +36 -0
  62. package/lib/components/commons/components/dragger/dragger.js +92 -0
  63. package/lib/components/commons/components/dragger/dragger.scss +8 -0
  64. package/lib/components/commons/components/dragger/index.js +13 -0
  65. package/lib/components/commons/components/errors/errors.js +41 -0
  66. package/lib/components/commons/components/errors/errors.scss +5 -0
  67. package/lib/components/commons/components/errors/index.js +13 -0
  68. package/lib/components/commons/components/fab/fab.js +48 -0
  69. package/lib/components/commons/components/fab/fab.scss +32 -0
  70. package/lib/components/commons/components/fab/index.js +13 -0
  71. package/lib/components/commons/components/field-container/field-container.js +39 -0
  72. package/lib/components/commons/components/field-container/field-container.scss +0 -0
  73. package/lib/components/commons/components/field-container/index.js +13 -0
  74. package/lib/components/commons/components/fieldset.js +18 -0
  75. package/lib/components/commons/components/fieldset.scss +5 -0
  76. package/lib/components/commons/components/html-table/index.js +48 -0
  77. package/lib/components/commons/components/html-table/table.js +29 -0
  78. package/lib/components/commons/components/html-table/tbody.js +29 -0
  79. package/lib/components/commons/components/html-table/td.js +41 -0
  80. package/lib/components/commons/components/html-table/th.js +39 -0
  81. package/lib/components/commons/components/html-table/thead.js +29 -0
  82. package/lib/components/commons/components/html-table/tr.js +31 -0
  83. package/lib/components/commons/components/is-network/index.js +13 -0
  84. package/lib/components/commons/components/is-network/is-network.js +51 -0
  85. package/lib/components/commons/components/is-network/use-online-status.js +46 -0
  86. package/lib/components/commons/components/label.js +27 -0
  87. package/lib/components/commons/components/lunatic-component.js +55 -0
  88. package/lib/components/commons/components/lunatic-fieldset-component.js +49 -0
  89. package/lib/components/commons/components/md-label/index.js +13 -0
  90. package/lib/components/commons/components/md-label/link.js +51 -0
  91. package/lib/components/commons/components/md-label/md-label.js +44 -0
  92. package/lib/components/commons/components/missing/index.js +13 -0
  93. package/lib/components/commons/components/missing/missing.js +76 -0
  94. package/lib/components/commons/components/missing/missing.scss +30 -0
  95. package/lib/components/commons/components/nothing-to-display.js +13 -0
  96. package/lib/components/commons/components/orchestrated-component.js +59 -0
  97. package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/edited.png +0 -0
  98. package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/forced.png +0 -0
  99. package/lib/components/commons/components/variable-status/img/index.js +20 -0
  100. package/lib/components/commons/components/variable-status/index.js +13 -0
  101. package/lib/components/commons/components/variable-status/variable-status.js +78 -0
  102. package/lib/components/commons/components/variable-status/variable-status.scss +39 -0
  103. package/lib/components/commons/create-customizable-field.js +26 -0
  104. package/lib/components/commons/create-row-orchestrator.js +53 -0
  105. package/lib/components/commons/icons/checkbox-checked.icon.js +36 -0
  106. package/lib/components/commons/icons/checkbox-unchecked.icon.js +36 -0
  107. package/lib/components/commons/icons/closed.icon.js +33 -0
  108. package/lib/components/commons/icons/cross.icon.js +33 -0
  109. package/lib/components/commons/icons/index.js +76 -0
  110. package/lib/components/commons/icons/load.icon.js +33 -0
  111. package/lib/components/commons/icons/lunatic-icon.js +19 -0
  112. package/lib/components/commons/icons/lunatic-icon.scss +3 -0
  113. package/lib/components/commons/icons/network.icon.js +33 -0
  114. package/lib/components/commons/icons/on-drag.icon.js +33 -0
  115. package/lib/components/commons/icons/opened.icon.js +33 -0
  116. package/lib/components/commons/icons/radio-checked.icon.js +36 -0
  117. package/lib/components/commons/icons/radio-unchecked.icon.js +36 -0
  118. package/lib/components/commons/index.js +138 -0
  119. package/lib/components/commons/prop-types/declarations.js +19 -0
  120. package/lib/components/commons/prop-types/index.js +41 -0
  121. package/lib/components/commons/prop-types/lines.js +13 -0
  122. package/lib/components/commons/prop-types/options.js +13 -0
  123. package/lib/components/commons/prop-types/response.js +13 -0
  124. package/lib/components/commons/prop-types/value-type.js +14 -0
  125. package/lib/components/commons/safety-label.js +26 -0
  126. package/lib/components/commons/use-document-add-event-listener.js +84 -0
  127. package/lib/components/commons/use-on-handle-change.js +19 -0
  128. package/lib/components/commons/use-options-keydown.js +24 -0
  129. package/lib/components/commons/use-previous.js +16 -0
  130. package/lib/components/components.js +163 -0
  131. package/lib/components/datepicker/datepicker.js +45 -0
  132. package/lib/components/datepicker/datepicker.scss +1 -0
  133. package/lib/components/datepicker/index.js +13 -0
  134. package/lib/components/datepicker/lunatic-datepicker.js +27 -0
  135. package/lib/components/declarations/declaration.js +19 -0
  136. package/lib/components/declarations/declarations-after-text.js +20 -0
  137. package/lib/components/declarations/declarations-before-text.js +20 -0
  138. package/lib/components/declarations/declarations-detachable.js +20 -0
  139. package/lib/components/declarations/declarations.js +51 -0
  140. package/lib/components/declarations/declarations.scss +36 -0
  141. package/lib/components/declarations/index.js +43 -0
  142. package/lib/components/dropdown/dropdown-simple/dropdown-simple.js +36 -0
  143. package/lib/components/dropdown/dropdown-simple/index.js +13 -0
  144. package/lib/components/dropdown/dropdown-simple/simple-label-renderer.js +43 -0
  145. package/lib/components/dropdown/dropdown-simple/simple-option-renderer.js +35 -0
  146. package/lib/components/dropdown/dropdown-writable/dropdown-writable.js +59 -0
  147. package/lib/components/dropdown/dropdown-writable/filter-tools/filter-options.js +36 -0
  148. package/lib/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +29 -0
  149. package/lib/components/dropdown/dropdown-writable/filter-tools/match.js +22 -0
  150. package/lib/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +13 -0
  151. package/lib/components/dropdown/dropdown-writable/index.js +13 -0
  152. package/lib/components/dropdown/dropdown-writable/writable-label-renderer.js +43 -0
  153. package/lib/components/dropdown/dropdown-writable/writable-option-renderer.js +136 -0
  154. package/lib/components/dropdown/dropdown.js +47 -0
  155. package/lib/components/dropdown/dropdown.scss +41 -0
  156. package/lib/components/dropdown/index.js +13 -0
  157. package/lib/components/dropdown/lunatic-dropdown.js +53 -0
  158. package/lib/components/filter-description/component.js +20 -0
  159. package/lib/components/filter-description/index.js +13 -0
  160. package/lib/components/index.js +28 -0
  161. package/lib/components/index.scss +136 -0
  162. package/lib/components/input/index.js +13 -0
  163. package/lib/components/input/input.js +49 -0
  164. package/lib/components/input/input.scss +32 -0
  165. package/lib/components/input/lunatic-input.js +30 -0
  166. package/lib/components/input-number/index.js +13 -0
  167. package/lib/components/input-number/input-number.js +51 -0
  168. package/lib/components/input-number/input-number.scss +7 -0
  169. package/lib/components/input-number/lunatic-input-number.js +26 -0
  170. package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +12 -0
  171. package/lib/components/loop/block-for-loop/block-for-loop.js +140 -0
  172. package/lib/components/loop/block-for-loop/index.js +13 -0
  173. package/lib/components/loop/block-for-loop/row.js +68 -0
  174. package/lib/components/loop/commons/get-init-length.js +16 -0
  175. package/lib/components/loop/commons/handle-row-button.js +20 -0
  176. package/lib/components/loop/commons/index.js +20 -0
  177. package/lib/components/loop/commons/row-component.js +65 -0
  178. package/lib/components/loop/index.js +13 -0
  179. package/lib/components/loop/loop.js +84 -0
  180. package/lib/components/loop/roster-for-loop/body.js +57 -0
  181. package/lib/components/loop/roster-for-loop/header.js +35 -0
  182. package/lib/components/loop/roster-for-loop/index.js +13 -0
  183. package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +12 -0
  184. package/lib/components/loop/roster-for-loop/roster-for-loop.js +124 -0
  185. package/lib/components/loop/roster-for-loop/roster-table.js +50 -0
  186. package/lib/components/loop/roster-for-loop/roster.scss +42 -0
  187. package/lib/components/loop/roster-for-loop/row.js +75 -0
  188. package/lib/components/modal-controls/close-or-skip.js +40 -0
  189. package/lib/components/modal-controls/index.js +13 -0
  190. package/lib/components/modal-controls/modal-container.js +19 -0
  191. package/lib/components/modal-controls/modal-controls.js +71 -0
  192. package/lib/components/modal-controls/modal-controls.scss +48 -0
  193. package/lib/components/pairwise-links/index.js +13 -0
  194. package/lib/components/pairwise-links/orchestrator.js +72 -0
  195. package/lib/components/pairwise-links/pairwise-links.js +68 -0
  196. package/lib/components/pairwise-links/row.js +80 -0
  197. package/lib/components/radio/index.js +13 -0
  198. package/lib/components/radio/lunatic-radio-group.js +37 -0
  199. package/lib/components/radio/radio-group.js +41 -0
  200. package/lib/components/radio/radio-option.js +80 -0
  201. package/lib/components/radio/radio.scss +66 -0
  202. package/lib/components/sequence/index.js +13 -0
  203. package/lib/components/sequence/sequence.js +33 -0
  204. package/lib/components/sequence/sequence.scss +10 -0
  205. package/lib/components/subsequence/index.js +13 -0
  206. package/lib/components/subsequence/subsequence.js +31 -0
  207. package/lib/components/suggester/check-store.js +115 -0
  208. package/lib/components/suggester/default-style.scss +125 -0
  209. package/lib/components/suggester/find-best-label/find-best-label.js +55 -0
  210. package/lib/components/suggester/find-best-label/index.js +13 -0
  211. package/lib/components/suggester/idb-suggester.js +75 -0
  212. package/lib/components/suggester/index.js +13 -0
  213. package/lib/components/suggester/lunatic-suggester.js +80 -0
  214. package/lib/components/suggester/searching/create-searching.js +75 -0
  215. package/lib/components/suggester/searching/index.js +13 -0
  216. package/lib/components/suggester/suggester.js +138 -0
  217. package/lib/components/suggester-loader-widget/index.js +13 -0
  218. package/lib/components/suggester-loader-widget/loader-row.js +123 -0
  219. package/lib/components/suggester-loader-widget/loader.js +139 -0
  220. package/lib/components/suggester-loader-widget/progress.js +38 -0
  221. package/lib/components/suggester-loader-widget/tools/action-tool.js +28 -0
  222. package/lib/components/suggester-loader-widget/tools/index.js +20 -0
  223. package/lib/components/suggester-loader-widget/tools/tools.js +16 -0
  224. package/lib/components/suggester-loader-widget/widget-container.js +39 -0
  225. package/lib/components/suggester-loader-widget/widget.js +140 -0
  226. package/lib/components/suggester-loader-widget/widget.scss +176 -0
  227. package/lib/components/switch/index.js +13 -0
  228. package/lib/components/switch/lunatic-switch.js +47 -0
  229. package/lib/components/switch/switch.js +78 -0
  230. package/lib/components/switch/switch.scss +47 -0
  231. package/lib/components/table/cell.js +88 -0
  232. package/lib/components/table/components/cell.js +88 -0
  233. package/lib/components/table/components/header.js +41 -0
  234. package/lib/components/table/components/row.js +41 -0
  235. package/lib/components/table/components/table.js +31 -0
  236. package/lib/components/table/components/table.scss +27 -0
  237. package/lib/components/table/index.js +13 -0
  238. package/lib/components/table/lunatic-table.js +77 -0
  239. package/lib/components/table/table-orchestrator.js +47 -0
  240. package/lib/components/textarea/index.js +13 -0
  241. package/lib/components/textarea/lunatic-textarea.js +39 -0
  242. package/lib/components/textarea/textarea.js +42 -0
  243. package/lib/components/textarea/textarea.scss +8 -0
  244. package/lib/constants/component-types.js +8 -0
  245. package/lib/constants/declarations.js +28 -0
  246. package/lib/constants/event-types.js +29 -0
  247. package/lib/constants/index.js +60 -0
  248. package/lib/constants/supported-preferences.js +13 -0
  249. package/lib/constants/value-types.js +16 -0
  250. package/lib/constants/variable-types.js +12 -0
  251. package/lib/i18n/build-dictionary.js +50 -0
  252. package/lib/i18n/dictionary.js +34 -0
  253. package/lib/i18n/index.js +13 -0
  254. package/lib/index.js +21 -4040
  255. package/lib/stories/Introduction.stories.mdx +114 -0
  256. package/lib/stories/checkboxBoolean/checkboxBoolean.stories.js +27 -0
  257. package/lib/stories/checkboxBoolean/source.json +36 -0
  258. package/lib/stories/checkboxOne/checkboxOne.stories.js +27 -0
  259. package/lib/stories/checkboxOne/source.json +36 -0
  260. package/lib/stories/custom-mui/checkbox-boolean-mui.js +31 -0
  261. package/lib/stories/custom-mui/checkbox-group-mui.js +66 -0
  262. package/lib/stories/custom-mui/checkbox-one-mui.js +13 -0
  263. package/lib/stories/custom-mui/index.js +111 -0
  264. package/lib/stories/custom-mui/input-mui.js +51 -0
  265. package/lib/stories/custom-mui/input-number-mui.js +39 -0
  266. package/lib/stories/custom-mui/radio-mui.js +59 -0
  267. package/lib/stories/custom-mui/suggester-mui/index.js +13 -0
  268. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +290 -0
  269. package/lib/stories/custom-mui/switch-mui.js +41 -0
  270. package/lib/stories/custom-mui/table-mui.js +25 -0
  271. package/lib/stories/custom-mui/tbody-mui.js +21 -0
  272. package/lib/stories/custom-mui/td-mui.js +23 -0
  273. package/lib/stories/custom-mui/textarea-mui.js +42 -0
  274. package/lib/stories/custom-mui/th-mui.js +22 -0
  275. package/lib/stories/custom-mui/thead-mui.js +21 -0
  276. package/lib/stories/custom-mui/tr-mui.js +31 -0
  277. package/lib/stories/date-picker/data.json +3 -0
  278. package/lib/stories/date-picker/datepicker.stories.js +31 -0
  279. package/lib/stories/date-picker/source.json +91 -0
  280. package/lib/stories/dropdown/data.json +16 -0
  281. package/lib/stories/dropdown/dropdown.stories.js +32 -0
  282. package/lib/stories/dropdown/source.json +122 -0
  283. package/lib/stories/filter-description/filter-description.stories.js +49 -0
  284. package/lib/stories/filter-description/source-options.json +81 -0
  285. package/lib/stories/filter-description/source.json +11 -0
  286. package/lib/stories/input/data.json +1 -0
  287. package/lib/stories/input/input.stories.js +29 -0
  288. package/lib/stories/input/source.json +28 -0
  289. package/lib/stories/input-number/input-number.stories.js +34 -0
  290. package/lib/stories/input-number/source-euros.json +38 -0
  291. package/lib/stories/input-number/source.json +37 -0
  292. package/lib/stories/pairwise/data.json +12 -0
  293. package/lib/stories/pairwise/links.json +270 -0
  294. package/lib/stories/pairwise/pairwise-links.stories.js +30 -0
  295. package/lib/stories/paste-questionnaire/source.json +6290 -0
  296. package/lib/stories/paste-questionnaire/test.stories.js +83 -0
  297. package/lib/stories/questionnaires/logement/data.json +2686 -0
  298. package/lib/stories/questionnaires/logement/logement.stories.js +75 -0
  299. package/lib/stories/questionnaires/logement/source-sequence.json +34181 -0
  300. package/lib/stories/questionnaires/logement/source-sum.json +34612 -0
  301. package/lib/stories/questionnaires/logement/source.json +34191 -0
  302. package/lib/stories/questionnaires/recensement/data.json +12 -0
  303. package/lib/stories/questionnaires/recensement/recensement.stories.js +58 -0
  304. package/lib/stories/questionnaires/recensement/source.json +15202 -0
  305. package/lib/stories/questionnaires/rp/data.json +5 -0
  306. package/lib/stories/questionnaires/rp/rp.stories.js +36 -0
  307. package/lib/stories/questionnaires/rp/source.json +262 -0
  308. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +63 -0
  309. package/lib/stories/questionnaires/simpsons/source.json +6290 -0
  310. package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +848 -0
  311. package/lib/stories/questionnaires-test/V2_MinMaxSum_Boucles.json +509 -0
  312. package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4091 -0
  313. package/lib/stories/questionnaires-test/V2_TCMRallyeGames.json +2892 -0
  314. package/lib/stories/questionnaires-test/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +666 -0
  315. package/lib/stories/questionnaires-test/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +1957 -0
  316. package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees2_PasPageFin.json +709 -0
  317. package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +533 -0
  318. package/lib/stories/questionnaires-test/controls/boucles-n.json +202 -0
  319. package/lib/stories/questionnaires-test/controls/controls.stories.js +96 -0
  320. package/lib/stories/questionnaires-test/test-dylan.json +558 -0
  321. package/lib/stories/questionnaires-test/test.stories.js +92 -0
  322. package/lib/stories/radio/radio.stories.js +27 -0
  323. package/lib/stories/radio/source.json +36 -0
  324. package/lib/stories/roster-for-loop/roster-for-loop.stories.js +34 -0
  325. package/lib/stories/roster-for-loop/source-with-header.json +127 -0
  326. package/lib/stories/roster-for-loop/source.json +114 -0
  327. package/lib/stories/suggester/source.json +234 -0
  328. package/lib/stories/suggester/suggester-workers.stories.js +201 -0
  329. package/lib/stories/suggester/suggester.stories.js +49 -0
  330. package/{src/stories/checkbox-one → lib/stories/switch}/README.md +31 -31
  331. package/lib/stories/switch/SwitchMaterialUI.js +41 -0
  332. package/{src/stories/checkbox-boolean/data.json → lib/stories/switch/data-forced.json} +48 -48
  333. package/lib/stories/switch/data.json +80 -0
  334. package/lib/stories/switch/switch.js +85 -0
  335. package/lib/stories/table/data-roster.json +1 -0
  336. package/lib/stories/table/data.json +1 -0
  337. package/{src/stories/table/data-roster.json → lib/stories/table/source-roster.json} +504 -461
  338. package/{src/stories/table/data-default.json → lib/stories/table/source.json} +19 -19
  339. package/lib/stories/table/table-dynamique.json +67 -0
  340. package/lib/stories/table/table.stories.js +57 -0
  341. package/lib/stories/utils/custom-lunatic.scss +28 -0
  342. package/lib/stories/utils/default-arg-types.js +22 -0
  343. package/lib/stories/utils/options.js +32 -0
  344. package/lib/stories/utils/orchestrator.js +165 -0
  345. package/lib/stories/utils/waiting/index.js +13 -0
  346. package/lib/stories/utils/waiting/preloader.svg +1 -0
  347. package/lib/stories/utils/waiting/waiting.js +30 -0
  348. package/lib/stories/utils/waiting/waiting.scss +21 -0
  349. package/lib/tests/sample.spec.js +7 -0
  350. package/lib/use-lunatic/actions.js +90 -0
  351. package/lib/use-lunatic/commons/calculated-variables.js +100 -0
  352. package/lib/use-lunatic/commons/check-loops.js +87 -0
  353. package/lib/use-lunatic/commons/compose.js +24 -0
  354. package/lib/use-lunatic/commons/create-map-pages.js +87 -0
  355. package/lib/use-lunatic/commons/execute-condition-filter.js +27 -0
  356. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +265 -0
  357. package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +57 -0
  358. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +138 -0
  359. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +87 -0
  360. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +37 -0
  361. package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +30 -0
  362. package/lib/use-lunatic/commons/execute-expression/index.js +13 -0
  363. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +123 -0
  364. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +22 -0
  365. package/lib/use-lunatic/commons/fill-components/fill-components.js +34 -0
  366. package/lib/use-lunatic/commons/fill-components/fill-errors.js +27 -0
  367. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +24 -0
  368. package/lib/use-lunatic/commons/fill-components/fill-management.js +23 -0
  369. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +32 -0
  370. package/lib/use-lunatic/commons/fill-components/fill-pagination.js +21 -0
  371. package/lib/use-lunatic/commons/fill-components/index.js +13 -0
  372. package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +25 -0
  373. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +177 -0
  374. package/lib/use-lunatic/commons/get-component-value/index.js +13 -0
  375. package/lib/use-lunatic/commons/get-components-from-state.js +40 -0
  376. package/lib/use-lunatic/commons/get-data.js +75 -0
  377. package/lib/use-lunatic/commons/get-errors-without-empty-value.js +22 -0
  378. package/lib/use-lunatic/commons/index.js +109 -0
  379. package/lib/use-lunatic/commons/is-First-last-page.js +18 -0
  380. package/lib/use-lunatic/commons/is-paginated-loop.js +13 -0
  381. package/lib/use-lunatic/commons/load-suggesters.js +154 -0
  382. package/lib/use-lunatic/commons/page-tag.js +64 -0
  383. package/lib/use-lunatic/commons/use-components-from-state.js +41 -0
  384. package/lib/use-lunatic/index.js +13 -0
  385. package/lib/use-lunatic/initial-state.js +41 -0
  386. package/lib/use-lunatic/reducer/commons/index.js +36 -0
  387. package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +35 -0
  388. package/lib/use-lunatic/reducer/commons/resize-array-variable.js +38 -0
  389. package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +29 -0
  390. package/lib/use-lunatic/reducer/index.js +13 -0
  391. package/lib/use-lunatic/reducer/reduce-go-next-page.js +183 -0
  392. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +145 -0
  393. package/lib/use-lunatic/reducer/reduce-go-to-page.js +50 -0
  394. package/lib/use-lunatic/reducer/reduce-handle-change/index.js +13 -0
  395. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +61 -0
  396. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +129 -0
  397. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +81 -0
  398. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +70 -0
  399. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +99 -0
  400. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +41 -0
  401. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +25 -0
  402. package/lib/use-lunatic/reducer/reduce-on-init.js +225 -0
  403. package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +21 -0
  404. package/lib/use-lunatic/reducer/reducer.js +38 -0
  405. package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +60 -0
  406. package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +84 -0
  407. package/lib/use-lunatic/reducer/validate-controls/index.js +20 -0
  408. package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +60 -0
  409. package/lib/use-lunatic/use-lunatic.js +170 -0
  410. package/lib/utils/constants/features.js +12 -0
  411. package/lib/utils/constants/index.js +60 -0
  412. package/lib/utils/constants/links.js +10 -0
  413. package/lib/utils/constants/missing.js +10 -0
  414. package/lib/utils/constants/variable-status.js +16 -0
  415. package/lib/utils/constants/variable-types.js +8 -0
  416. package/lib/utils/idb-tools/clear-store.js +42 -0
  417. package/lib/utils/idb-tools/create-db-opener.js +47 -0
  418. package/lib/utils/idb-tools/create-open-db.js +29 -0
  419. package/lib/utils/idb-tools/get-entity.js +21 -0
  420. package/lib/utils/idb-tools/get-idb.js +13 -0
  421. package/lib/utils/idb-tools/idb-bulk-insert.js +134 -0
  422. package/lib/utils/idb-tools/index.js +64 -0
  423. package/lib/utils/idb-tools/insert-entity.js +21 -0
  424. package/lib/utils/idb-tools/open-db.js +24 -0
  425. package/lib/utils/idb-tools/open-or-create-db.js +42 -0
  426. package/lib/utils/is-element.js +10 -0
  427. package/lib/utils/store-tools/auto-load.js +168 -0
  428. package/lib/utils/store-tools/clear-store-data.js +35 -0
  429. package/lib/utils/store-tools/clear-store-info.js +35 -0
  430. package/lib/utils/store-tools/constantes.js +31 -0
  431. package/lib/utils/store-tools/create/create.js +53 -0
  432. package/lib/utils/store-tools/create/index.js +20 -0
  433. package/lib/utils/store-tools/create/update-store-info.js +27 -0
  434. package/lib/utils/store-tools/get-store-count.js +24 -0
  435. package/lib/utils/store-tools/index.js +54 -0
  436. package/lib/utils/store-tools/open-or-create-store.js +50 -0
  437. package/lib/utils/store-tools/use-store-index.js +60 -0
  438. package/lib/utils/suggester-workers/append-to-index/append.js +80 -0
  439. package/lib/utils/suggester-workers/append-to-index/append.worker.js +27 -0
  440. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +58 -0
  441. package/lib/utils/suggester-workers/append-to-index/index.js +20 -0
  442. package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +88 -0
  443. package/lib/utils/suggester-workers/append-to-index/store-messages.js +45 -0
  444. package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +54 -0
  445. package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +77 -0
  446. package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +36 -0
  447. package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +21 -0
  448. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +36 -0
  449. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +14 -0
  450. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +19 -0
  451. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +16 -0
  452. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +25 -0
  453. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +23 -0
  454. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +15 -0
  455. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +23 -0
  456. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +23 -0
  457. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +16 -0
  458. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +53 -0
  459. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +14 -0
  460. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +16 -0
  461. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +14 -0
  462. package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +20 -0
  463. package/lib/utils/suggester-workers/commons-tokenizer/filters/stop-words.js +9 -0
  464. package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +14 -0
  465. package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +23 -0
  466. package/lib/utils/suggester-workers/commons-tokenizer/index.js +69 -0
  467. package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +18 -0
  468. package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +12 -0
  469. package/lib/utils/suggester-workers/create-worker.js +54 -0
  470. package/lib/utils/suggester-workers/find-best-label/find-best-label.js +63 -0
  471. package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +53 -0
  472. package/lib/utils/suggester-workers/find-best-label/index.js +1 -0
  473. package/lib/utils/suggester-workers/find-best-label/tokenize.js +45 -0
  474. package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +24 -0
  475. package/lib/utils/suggester-workers/searching/compute-score.js +51 -0
  476. package/lib/utils/suggester-workers/searching/get-db.js +50 -0
  477. package/lib/utils/suggester-workers/searching/index.js +13 -0
  478. package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +28 -0
  479. package/lib/utils/suggester-workers/searching/order/index.js +25 -0
  480. package/lib/utils/suggester-workers/searching/query-parser/index.js +20 -0
  481. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +12 -0
  482. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +26 -0
  483. package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +35 -0
  484. package/lib/utils/suggester-workers/searching/resolve-query-parser.js +59 -0
  485. package/lib/utils/suggester-workers/searching/search-in-index.js +22 -0
  486. package/lib/utils/suggester-workers/searching/searching.js +135 -0
  487. package/lib/utils/suggester-workers/searching/searching.worker.js +20 -0
  488. package/lib/utils/vtl/dataset-builder.js +24 -0
  489. package/lib/utils/vtl/index.js +13 -0
  490. package/package.json +163 -140
  491. package/lib/index.js.map +0 -1
  492. package/src/components/breadcrumb/breadcrumb.scss +0 -22
  493. package/src/components/breadcrumb/component.js +0 -29
  494. package/src/components/breadcrumb/index.js +0 -1
  495. package/src/components/button/button.scss +0 -26
  496. package/src/components/button/component.js +0 -25
  497. package/src/components/button/index.js +0 -1
  498. package/src/components/checkbox/boolean.js +0 -139
  499. package/src/components/checkbox/checkbox.scss +0 -43
  500. package/src/components/checkbox/group.js +0 -168
  501. package/src/components/checkbox/index.js +0 -3
  502. package/src/components/checkbox/one.js +0 -27
  503. package/src/components/components.js +0 -15
  504. package/src/components/datepicker/component.js +0 -10
  505. package/src/components/datepicker/datepicker.scss +0 -16
  506. package/src/components/datepicker/index.js +0 -1
  507. package/src/components/declarations/component.js +0 -38
  508. package/src/components/declarations/declarations.scss +0 -34
  509. package/src/components/declarations/index.js +0 -1
  510. package/src/components/declarations/wrappers/index.js +0 -3
  511. package/src/components/declarations/wrappers/input-declarations-wrapper.js +0 -162
  512. package/src/components/declarations/wrappers/list-declarations-wrapper.js +0 -159
  513. package/src/components/declarations/wrappers/simple-declarations-wrapper.js +0 -54
  514. package/src/components/dropdown/commons/actions.js +0 -56
  515. package/src/components/dropdown/commons/children-to-option.js +0 -9
  516. package/src/components/dropdown/commons/cleaner-callbacks.js +0 -58
  517. package/src/components/dropdown/commons/components/closed.icon.js +0 -24
  518. package/src/components/dropdown/commons/components/dropdown-container.js +0 -169
  519. package/src/components/dropdown/commons/components/label.js +0 -21
  520. package/src/components/dropdown/commons/components/opened.icon.js +0 -24
  521. package/src/components/dropdown/commons/components/panel.js +0 -78
  522. package/src/components/dropdown/commons/event-callbacks/index.js +0 -5
  523. package/src/components/dropdown/commons/event-callbacks/on-keydown-callback.js +0 -30
  524. package/src/components/dropdown/commons/event-callbacks/on-mousedown-callback.js +0 -11
  525. package/src/components/dropdown/commons/reducer.js +0 -149
  526. package/src/components/dropdown/commons/tools/index.js +0 -17
  527. package/src/components/dropdown/component.js +0 -117
  528. package/src/components/dropdown/dropdown-edit/cross.icon.js +0 -20
  529. package/src/components/dropdown/dropdown-edit/dropdown-edit.js +0 -174
  530. package/src/components/dropdown/dropdown-edit/icone.js +0 -33
  531. package/src/components/dropdown/dropdown-edit/index.js +0 -11
  532. package/src/components/dropdown/dropdown-edit/option.js +0 -62
  533. package/src/components/dropdown/dropdown-edit/prefix-tools.js +0 -51
  534. package/src/components/dropdown/dropdown-simple/dropdown.js +0 -155
  535. package/src/components/dropdown/dropdown-simple/index.js +0 -20
  536. package/src/components/dropdown/dropdown-simple/option.js +0 -15
  537. package/src/components/dropdown/dropdown.scss +0 -183
  538. package/src/components/dropdown/index.js +0 -1
  539. package/src/components/filter-description/component.js +0 -41
  540. package/src/components/filter-description/index.js +0 -1
  541. package/src/components/index.js +0 -4
  542. package/src/components/index.scss +0 -76
  543. package/src/components/input/index.js +0 -2
  544. package/src/components/input/input-number.js +0 -228
  545. package/src/components/input/input.js +0 -10
  546. package/src/components/input/input.scss +0 -27
  547. package/src/components/loops/index.js +0 -2
  548. package/src/components/loops/loop/build-components.js +0 -33
  549. package/src/components/loops/loop/component.js +0 -88
  550. package/src/components/loops/loop/index.js +0 -1
  551. package/src/components/loops/loop/loop.scss +0 -17
  552. package/src/components/loops/roster/build-components.js +0 -26
  553. package/src/components/loops/roster/component.js +0 -199
  554. package/src/components/loops/roster/index.js +0 -1
  555. package/src/components/progress-bar/component.js +0 -28
  556. package/src/components/progress-bar/index.js +0 -1
  557. package/src/components/progress-bar/progress-bar.scss +0 -54
  558. package/src/components/radio/component.js +0 -8
  559. package/src/components/radio/index.js +0 -1
  560. package/src/components/radio/radio.scss +0 -24
  561. package/src/components/sequence/component.js +0 -41
  562. package/src/components/sequence/index.js +0 -1
  563. package/src/components/sequence/sequence.scss +0 -15
  564. package/src/components/subsequence/component.js +0 -48
  565. package/src/components/subsequence/index.js +0 -1
  566. package/src/components/subsequence/subsequence.scss +0 -15
  567. package/src/components/table/index.js +0 -1
  568. package/src/components/table/table.js +0 -160
  569. package/src/components/table/table.scss +0 -23
  570. package/src/components/textarea/component.js +0 -10
  571. package/src/components/textarea/index.js +0 -1
  572. package/src/components/textarea/textarea.scss +0 -16
  573. package/src/components/tooltip/img/index.js +0 -4
  574. package/src/components/tooltip/index.js +0 -1
  575. package/src/components/tooltip/response.js +0 -42
  576. package/src/components/tooltip/tooltip.scss +0 -35
  577. package/src/constants/component-types.js +0 -1
  578. package/src/constants/declarations.js +0 -14
  579. package/src/constants/index.js +0 -4
  580. package/src/constants/supported-preferences.js +0 -10
  581. package/src/constants/value-types.js +0 -5
  582. package/src/constants/variable-types.js +0 -4
  583. package/src/stories/breadcrumb/README.md +0 -14
  584. package/src/stories/breadcrumb/breadcrumb.stories.js +0 -33
  585. package/src/stories/button/README.md +0 -14
  586. package/src/stories/button/button.stories.js +0 -63
  587. package/src/stories/checkbox-boolean/README.md +0 -27
  588. package/src/stories/checkbox-boolean/checkbox-boolean.stories.js +0 -33
  589. package/src/stories/checkbox-group/README.md +0 -29
  590. package/src/stories/checkbox-group/checkbox-group.stories.js +0 -81
  591. package/src/stories/checkbox-group/data-vtl.json +0 -89
  592. package/src/stories/checkbox-group/data.json +0 -89
  593. package/src/stories/checkbox-one/checkbox-one.stories.js +0 -77
  594. package/src/stories/checkbox-one/data-vtl.json +0 -33
  595. package/src/stories/checkbox-one/data.json +0 -33
  596. package/src/stories/datepicker/README.md +0 -31
  597. package/src/stories/datepicker/data.json +0 -28
  598. package/src/stories/datepicker/datepicker.stories.js +0 -65
  599. package/src/stories/declarations/README.md +0 -19
  600. package/src/stories/declarations/declarations.stories.js +0 -112
  601. package/src/stories/dropdown/README.md +0 -44
  602. package/src/stories/dropdown/data-naf.json +0 -6963
  603. package/src/stories/dropdown/data-props.json +0 -81
  604. package/src/stories/dropdown/data.json +0 -78
  605. package/src/stories/dropdown/dropdown.stories.js +0 -65
  606. package/src/stories/filter-description/README.md +0 -15
  607. package/src/stories/filter-description/filter-description.stories.js +0 -70
  608. package/src/stories/input/README.md +0 -33
  609. package/src/stories/input/data.json +0 -28
  610. package/src/stories/input/input.stories.js +0 -67
  611. package/src/stories/input-number/README.md +0 -37
  612. package/src/stories/input-number/data.json +0 -30
  613. package/src/stories/input-number/input-number.stories.js +0 -75
  614. package/src/stories/loops/README.md +0 -29
  615. package/src/stories/loops/custom-lunatic.scss +0 -786
  616. package/src/stories/loops/data-loop-deeper.json +0 -298
  617. package/src/stories/loops/data-loop.json +0 -213
  618. package/src/stories/loops/data-roster.json +0 -69
  619. package/src/stories/loops/img/arrow.png +0 -0
  620. package/src/stories/loops/img/check_box.svg +0 -1
  621. package/src/stories/loops/img/check_box_outline.svg +0 -1
  622. package/src/stories/loops/img/lunatic-logo.png +0 -0
  623. package/src/stories/loops/img/menu-down.svg +0 -1
  624. package/src/stories/loops/img/menu-up.svg +0 -1
  625. package/src/stories/loops/img/radio_button_checked.svg +0 -1
  626. package/src/stories/loops/img/radio_button_unchecked.svg +0 -1
  627. package/src/stories/loops/loop.stories.js +0 -56
  628. package/src/stories/loops/vqs.json +0 -846
  629. package/src/stories/progress-bar/README.md +0 -13
  630. package/src/stories/progress-bar/progress-bar.stories.js +0 -24
  631. package/src/stories/radio/README.md +0 -31
  632. package/src/stories/radio/data-vtl.json +0 -32
  633. package/src/stories/radio/data.json +0 -32
  634. package/src/stories/radio/radio.stories.js +0 -81
  635. package/src/stories/sequence/README.md +0 -18
  636. package/src/stories/sequence/sequence.stories.js +0 -58
  637. package/src/stories/subsequence/README.md +0 -18
  638. package/src/stories/subsequence/subsequence.stories.js +0 -58
  639. package/src/stories/table/README.md +0 -29
  640. package/src/stories/table/data-one-axis-one-measure.json +0 -124
  641. package/src/stories/table/data-one-axis-two-measures.json +0 -193
  642. package/src/stories/table/data-one-hierarchical-axis.json +0 -204
  643. package/src/stories/table/data-two-axis-one-measure.json +0 -492
  644. package/src/stories/table/table.stories.js +0 -77
  645. package/src/stories/textarea/README.md +0 -33
  646. package/src/stories/textarea/data.json +0 -28
  647. package/src/stories/textarea/textarea.stories.js +0 -67
  648. package/src/stories/tooltip-response/README.md +0 -14
  649. package/src/stories/tooltip-response/tooltip.stories.js +0 -43
  650. package/src/stories/utils/options.js +0 -21
  651. package/src/stories/utils/orchestrator.js +0 -52
  652. package/src/tests/components/breadcrumb.spec.js +0 -13
  653. package/src/tests/components/button.spec.js +0 -11
  654. package/src/tests/components/checkbox-boolean.spec.js +0 -40
  655. package/src/tests/components/checkbox-group.spec.js +0 -48
  656. package/src/tests/components/checkbox-one.spec.js +0 -32
  657. package/src/tests/components/datepicker.spec.js +0 -22
  658. package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +0 -65
  659. package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +0 -47
  660. package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +0 -21
  661. package/src/tests/components/declarations.spec.js +0 -46
  662. package/src/tests/components/input-number.spec.js +0 -173
  663. package/src/tests/components/input.spec.js +0 -18
  664. package/src/tests/components/progress-bar.spec.js +0 -15
  665. package/src/tests/components/radio.spec.js +0 -27
  666. package/src/tests/components/sequence.spec.js +0 -9
  667. package/src/tests/components/subsequence.spec.js +0 -9
  668. package/src/tests/components/table.spec.js +0 -11
  669. package/src/tests/components/textarea.spec.js +0 -18
  670. package/src/tests/components/tooltip.spec.js +0 -25
  671. package/src/tests/setup/setupTests.js +0 -4
  672. package/src/tests/utils/lib/alphabet.spec.js +0 -36
  673. package/src/tests/utils/lib/checkbox/group.spec.js +0 -72
  674. package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
  675. package/src/tests/utils/lib/items-positioning.spec.js +0 -17
  676. package/src/tests/utils/lib/label-position.spec.js +0 -22
  677. package/src/tests/utils/lib/loops/bindings.spec.js +0 -60
  678. package/src/tests/utils/lib/loops/shared.spec.js +0 -77
  679. package/src/tests/utils/lib/responses.spec.js +0 -58
  680. package/src/tests/utils/lib/style.spec.js +0 -26
  681. package/src/tests/utils/lib/table/roster.spec.js +0 -25
  682. package/src/tests/utils/lib/tooltip/build-response.spec.js +0 -95
  683. package/src/tests/utils/lib/tooltip/content.spec.js +0 -109
  684. package/src/tests/utils/to-expose/handler/handler.spec.js +0 -86
  685. package/src/tests/utils/to-expose/handler/questionnaire.json +0 -154
  686. package/src/tests/utils/to-expose/handler/results/index.js +0 -6
  687. package/src/tests/utils/to-expose/handler/results/res-double.json +0 -157
  688. package/src/tests/utils/to-expose/handler/results/res-input-collected.json +0 -154
  689. package/src/tests/utils/to-expose/handler/results/res-input-edited.json +0 -157
  690. package/src/tests/utils/to-expose/handler/results/res-loop.json +0 -157
  691. package/src/tests/utils/to-expose/handler/results/res-matrix.json +0 -157
  692. package/src/tests/utils/to-expose/handler/results/res-responses.json +0 -157
  693. package/src/tests/utils/to-expose/init-questionnaire/data.json +0 -12
  694. package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +0 -19
  695. package/src/tests/utils/to-expose/init-questionnaire/questionnaire.json +0 -129
  696. package/src/tests/utils/to-expose/init-questionnaire/result.json +0 -162
  697. package/src/tests/utils/to-expose/interpret.spec.js +0 -42
  698. package/src/tests/utils/to-expose/state/questionnaire.json +0 -61
  699. package/src/tests/utils/to-expose/state/results.js +0 -78
  700. package/src/tests/utils/to-expose/state/state.spec.js +0 -59
  701. package/src/utils/lib/alphabet.js +0 -1
  702. package/src/utils/lib/checkbox/group.js +0 -21
  703. package/src/utils/lib/checkbox/index.js +0 -1
  704. package/src/utils/lib/decorator/index.js +0 -1
  705. package/src/utils/lib/decorator/title-decorator.js +0 -16
  706. package/src/utils/lib/index.js +0 -12
  707. package/src/utils/lib/label-position.js +0 -12
  708. package/src/utils/lib/loops/bindings.js +0 -47
  709. package/src/utils/lib/loops/index.js +0 -2
  710. package/src/utils/lib/loops/shared.js +0 -43
  711. package/src/utils/lib/memo-check.js +0 -24
  712. package/src/utils/lib/options-positioning.js +0 -9
  713. package/src/utils/lib/prop-types/declarations.js +0 -22
  714. package/src/utils/lib/prop-types/index.js +0 -5
  715. package/src/utils/lib/prop-types/lines.js +0 -6
  716. package/src/utils/lib/prop-types/options.js +0 -8
  717. package/src/utils/lib/prop-types/response.js +0 -6
  718. package/src/utils/lib/prop-types/value-type.js +0 -9
  719. package/src/utils/lib/responses.js +0 -9
  720. package/src/utils/lib/style.js +0 -10
  721. package/src/utils/lib/table/index.js +0 -1
  722. package/src/utils/lib/table/roster.js +0 -18
  723. package/src/utils/lib/tooltip/build-response.js +0 -23
  724. package/src/utils/lib/tooltip/content.js +0 -52
  725. package/src/utils/lib/tooltip/index.js +0 -5
  726. package/src/utils/to-expose/handler.js +0 -99
  727. package/src/utils/to-expose/hook.js +0 -55
  728. package/src/utils/to-expose/index.js +0 -10
  729. package/src/utils/to-expose/init-questionnaire.js +0 -114
  730. package/src/utils/to-expose/interpret.js +0 -32
  731. package/src/utils/to-expose/state.js +0 -58
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _reduceCleaning = _interopRequireDefault(require("./reduce-cleaning"));
9
+ var _excluded = ["value"];
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ 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
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ 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; }
17
+ 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; }
18
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
19
+ 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."); }
20
+ 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
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
22
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
+ 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; }
24
+ function buildMissingValue(state, oldValue) {
25
+ var iteration = state.pager.iteration;
26
+ // Root question
27
+ if (iteration === undefined) return null;
28
+ // Loop question
29
+ var newValue = _toConsumableArray(oldValue);
30
+ newValue[iteration] = null;
31
+ return newValue;
32
+ }
33
+ function reduceMissing(state, action) {
34
+ var name = action.payload.response.name;
35
+ var missingBlock = state.missingBlock;
36
+ if (name in missingBlock) {
37
+ var variables = state.variables,
38
+ updateBindings = state.updateBindings;
39
+ var toClean = missingBlock[name];
40
+ var delta = toClean.reduce(function (acc, variableName) {
41
+ var _variables$variableNa = variables[variableName],
42
+ value = _variables$variableNa.value,
43
+ rest = _objectWithoutProperties(_variables$variableNa, _excluded);
44
+ updateBindings(variableName, null);
45
+ var newValue = buildMissingValue(state, value);
46
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, variableName, _objectSpread(_objectSpread({}, rest), {}, {
47
+ value: newValue
48
+ })));
49
+ }, {});
50
+ var newStateAfterMissing = _objectSpread(_objectSpread({}, state), {}, {
51
+ variables: _objectSpread(_objectSpread({}, variables), delta)
52
+ });
53
+ // If missing clean variable which is also into cleaning case,
54
+ // we have to handle theses cleanings
55
+ // To check: do we have with this trick or triggering handle change action?
56
+ var newStateAfterCleaning = toClean.reduce(function (acc, v) {
57
+ return (0, _reduceCleaning["default"])(acc, {
58
+ payload: {
59
+ response: {
60
+ name: v
61
+ }
62
+ }
63
+ });
64
+ }, newStateAfterMissing);
65
+ return newStateAfterCleaning;
66
+ }
67
+ return state;
68
+ }
69
+ var _default = reduceMissing;
70
+ exports["default"] = _default;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _commons = require("../../commons");
8
+ var _commons2 = require("../commons");
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ 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); }
13
+ 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; }
14
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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; }
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; }
18
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
21
+ function reduceResizingVariables(_ref) {
22
+ var size = _ref.size,
23
+ variableArray = _ref.variableArray,
24
+ variables = _ref.variables,
25
+ executeExpression = _ref.executeExpression,
26
+ updateBindings = _ref.updateBindings;
27
+ if (size !== undefined) {
28
+ var sizeValue = executeExpression((0, _commons.getCompatibleVTLExpression)(size));
29
+ return variableArray.reduce(function (acc, v) {
30
+ var value = variables[v].value;
31
+ var newValue = (0, _commons2.resizeArrayVariable)(value, sizeValue, null);
32
+ updateBindings(v, newValue);
33
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, v, _objectSpread(_objectSpread({}, variables[v]), {}, {
34
+ value: newValue
35
+ })));
36
+ }, {});
37
+ }
38
+ return {};
39
+ }
40
+ function reduceResizingLinksVariables(_ref2) {
41
+ var sizeForLinksVariables = _ref2.sizeForLinksVariables,
42
+ linksVariables = _ref2.linksVariables,
43
+ variables = _ref2.variables,
44
+ executeExpression = _ref2.executeExpression,
45
+ updateBindings = _ref2.updateBindings;
46
+ if (Array.isArray(sizeForLinksVariables)) {
47
+ var _sizeForLinksVariable = sizeForLinksVariables.map(function (s) {
48
+ return executeExpression((0, _commons.getCompatibleVTLExpression)(s));
49
+ }),
50
+ _sizeForLinksVariable2 = _slicedToArray(_sizeForLinksVariable, 2),
51
+ xSize = _sizeForLinksVariable2[0],
52
+ ySize = _sizeForLinksVariable2[1];
53
+ return linksVariables.reduce(function (acc, v) {
54
+ var value = variables[v].value;
55
+ var newValue = (0, _commons2.resizeArrayVariable)(value.map(function (i) {
56
+ return (0, _commons2.resizeArrayVariable)(i, ySize, null);
57
+ }), xSize, new Array(ySize).fill(null));
58
+ updateBindings(v, newValue);
59
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, v, _objectSpread(_objectSpread({}, variables[v]), {}, {
60
+ value: newValue
61
+ })));
62
+ }, {});
63
+ }
64
+ return {};
65
+ }
66
+ function reduceResizing(state, action) {
67
+ var name = action.payload.response.name;
68
+ var resizing = state.resizing,
69
+ variables = state.variables,
70
+ updateBindings = state.updateBindings;
71
+ if (name in resizing) {
72
+ var _resizing$name = resizing[name],
73
+ size = _resizing$name.size,
74
+ variableArray = _resizing$name.variables,
75
+ sizeForLinksVariables = _resizing$name.sizeForLinksVariables,
76
+ linksVariables = _resizing$name.linksVariables;
77
+ var executeExpression = state.executeExpression;
78
+ var newLinksVariables = reduceResizingLinksVariables({
79
+ sizeForLinksVariables: sizeForLinksVariables,
80
+ linksVariables: linksVariables,
81
+ variables: variables,
82
+ executeExpression: executeExpression,
83
+ updateBindings: updateBindings
84
+ });
85
+ var newVariables = reduceResizingVariables({
86
+ size: size,
87
+ variableArray: variableArray,
88
+ variables: variables,
89
+ executeExpression: executeExpression,
90
+ updateBindings: updateBindings
91
+ });
92
+ return _objectSpread(_objectSpread({}, state), {}, {
93
+ variables: _objectSpread(_objectSpread(_objectSpread({}, variables), newLinksVariables), newVariables)
94
+ });
95
+ }
96
+ return state;
97
+ }
98
+ var _default = reduceResizing;
99
+ exports["default"] = _default;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _commons = require("../commons");
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
+ 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."); }
16
+ 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
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
+ 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; }
20
+ function reduceVariablesArray(variables, _ref) {
21
+ var name = _ref.name,
22
+ value = _ref.value,
23
+ index = _ref.index,
24
+ length = _ref.length;
25
+ if (name in variables) {
26
+ var variable = variables[name];
27
+ var previousValue = variable.value;
28
+
29
+ // validation de la valeur courante : si pas un tableau ou si la taille du tableau a changé
30
+ var valueNext = (0, _commons.resizeArrayVariable)(_toConsumableArray(previousValue), length);
31
+
32
+ // value affectation
33
+ valueNext[index] = value;
34
+ return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
35
+ value: valueNext
36
+ })));
37
+ }
38
+ return variables;
39
+ }
40
+ var _default = reduceVariablesArray;
41
+ exports["default"] = _default;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
+ 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
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function reduceVariablesSimple(variables, _ref) {
14
+ var name = _ref.name,
15
+ value = _ref.value;
16
+ if (name in variables) {
17
+ var variable = variables[name];
18
+ return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
19
+ value: value
20
+ })));
21
+ }
22
+ return variables;
23
+ }
24
+ var _default = reduceVariablesSimple;
25
+ exports["default"] = _default;
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _commons = require("../commons");
8
+ var _pageTag = require("../commons/page-tag");
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
+ 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."); }
16
+ 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
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
+ 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; }
20
+ 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; }
21
+ 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; }
22
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
+ /* à bouger d'ici */
26
+
27
+ function getInitalValueFromCollected(variable) {
28
+ var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29
+ var values = variable.values,
30
+ name = variable.name;
31
+ var fromData;
32
+ if (name in data) {
33
+ var _data$name = data[name],
34
+ COLLECTED = _data$name.COLLECTED,
35
+ FORCED = _data$name.FORCED;
36
+ fromData = COLLECTED || FORCED;
37
+ }
38
+ if (values) {
39
+ var _COLLECTED = values.COLLECTED,
40
+ _FORCED = values.FORCED;
41
+ return fromData || _FORCED || _COLLECTED;
42
+ }
43
+ return undefined;
44
+ }
45
+ function getInitialValueFromExternal(variable) {
46
+ var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47
+ var name = variable.name;
48
+ if (name in data) {
49
+ return data[name];
50
+ }
51
+ return undefined;
52
+ }
53
+ function getInitialValue(variable) {
54
+ var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
55
+ var COLLECTED = data.COLLECTED,
56
+ EXTERNAL = data.EXTERNAL,
57
+ CALCULATED = data.CALCULATED;
58
+ var variableType = variable.variableType;
59
+ switch (variableType) {
60
+ case 'COLLECTED':
61
+ return getInitalValueFromCollected(variable, COLLECTED);
62
+ case 'EXTERNAL':
63
+ return getInitialValueFromExternal(variable, EXTERNAL);
64
+ case 'CALCULATED':
65
+ return getInitialValueFromExternal(variable, CALCULATED);
66
+ default:
67
+ return null;
68
+ }
69
+ }
70
+ function appendToArrayMap(map, key, entry) {
71
+ if (key in map) {
72
+ return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, [].concat(_toConsumableArray(map[key]), [entry])));
73
+ }
74
+ return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, [entry]));
75
+ }
76
+ function appendToObjectMap(map, key, object) {
77
+ if (key in map) {
78
+ return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, _objectSpread(_objectSpread({}, map[key]), object)));
79
+ }
80
+ return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, object));
81
+ }
82
+
83
+ /**
84
+ *
85
+ * @param {*} source
86
+ * @param {*} data
87
+ * @returns
88
+ */
89
+ function createVariables(source, data) {
90
+ var _source$variables = source.variables,
91
+ variables = _source$variables === void 0 ? [] : _source$variables;
92
+ var _variables$reduce = variables.reduce(function (_ref, variable) {
93
+ var _ref2 = _slicedToArray(_ref, 2),
94
+ mapType = _ref2[0],
95
+ mapVar = _ref2[1];
96
+ var type = variable.variableType,
97
+ name = variable.name;
98
+ return [appendToArrayMap(mapType, type, variable), appendToObjectMap(mapVar, name, {
99
+ variable: variable,
100
+ type: type,
101
+ value: getInitialValue(variable, data)
102
+ })];
103
+ }, [{}, {}]),
104
+ _variables$reduce2 = _slicedToArray(_variables$reduce, 2),
105
+ mapVariablesTypes = _variables$reduce2[0],
106
+ mapVariables = _variables$reduce2[1];
107
+ //
108
+ var _mapVariablesTypes$CA = mapVariablesTypes.CALCULATED,
109
+ CALCULATED = _mapVariablesTypes$CA === void 0 ? [] : _mapVariablesTypes$CA;
110
+ CALCULATED.forEach(function (calculated) {
111
+ var _calculated$bindingDe = calculated.bindingDependencies,
112
+ bindingDependencies = _calculated$bindingDe === void 0 ? [] : _calculated$bindingDe;
113
+ bindingDependencies.forEach(function (name) {
114
+ if (name in mapVariables) {
115
+ var variable = mapVariables[name];
116
+ var CalculatedLinked = variable.CalculatedLinked;
117
+ if (CalculatedLinked) {
118
+ CalculatedLinked.push(calculated);
119
+ } else {
120
+ variable.CalculatedLinked = [calculated];
121
+ }
122
+ }
123
+ });
124
+ });
125
+ return mapVariables;
126
+ }
127
+ /* */
128
+
129
+ function checkInLoop(state, initialPager) {
130
+ var pager = state.pager,
131
+ pages = state.pages,
132
+ executeExpression = state.executeExpression;
133
+ var page = pager.page;
134
+ if (page in pages) {
135
+ var _pages$page = pages[page],
136
+ isLoop = _pages$page.isLoop,
137
+ subPages = _pages$page.subPages,
138
+ iterations = _pages$page.iterations,
139
+ loopDependencies = _pages$page.loopDependencies;
140
+ if (isLoop) {
141
+ return _objectSpread(_objectSpread({}, state), {}, {
142
+ isInLoop: true,
143
+ pager: _objectSpread(_objectSpread({}, pager), {}, {
144
+ subPage: initialPager.subPage || 0,
145
+ nbSubPages: subPages.length,
146
+ iteration: initialPager.iteration || 0,
147
+ nbIterations: executeExpression(iterations, {
148
+ iteration: undefined,
149
+ bindingDependencies: loopDependencies
150
+ })
151
+ })
152
+ });
153
+ }
154
+ }
155
+ return state;
156
+ }
157
+ function reduceOnInit(state, action) {
158
+ var payload = action.payload;
159
+ var source = payload.source,
160
+ data = payload.data,
161
+ initialPage = payload.initialPage,
162
+ features = payload.features,
163
+ handleChange = payload.handleChange,
164
+ preferences = payload.preferences,
165
+ savingType = payload.savingType,
166
+ management = payload.management,
167
+ activeControls = payload.activeControls;
168
+ if (source && data) {
169
+ var variables = createVariables(source, data); // map des variables
170
+ var _createExecuteExpress = (0, _commons.createExecuteExpression)(variables, features),
171
+ _createExecuteExpress2 = _slicedToArray(_createExecuteExpress, 4),
172
+ executeExpression = _createExecuteExpress2[0],
173
+ updateBindings = _createExecuteExpress2[1],
174
+ setLoopBindings = _createExecuteExpress2[2],
175
+ resetLoopBindings = _createExecuteExpress2[3];
176
+ var pages = (0, _commons.checkLoops)((0, _commons.createMapPages)(source));
177
+ var maxPage = source.maxPage,
178
+ _source$cleaning = source.cleaning,
179
+ cleaning = _source$cleaning === void 0 ? {} : _source$cleaning,
180
+ _source$missingBlock = source.missingBlock,
181
+ missingBlock = _source$missingBlock === void 0 ? {} : _source$missingBlock,
182
+ _source$resizing = source.resizing,
183
+ resizing = _source$resizing === void 0 ? {} : _source$resizing;
184
+ var initialPager = (0, _pageTag.getPagerFromPageTag)(initialPage);
185
+ if (!initialPager) {
186
+ initialPager = {
187
+ page: 1
188
+ };
189
+ }
190
+ var pager = {
191
+ page: initialPager.page,
192
+ maxPage: maxPage,
193
+ subPage: undefined,
194
+ nbSubPages: undefined,
195
+ iteration: undefined,
196
+ nbIterations: undefined,
197
+ lastReachedPage: initialPage
198
+ };
199
+ var _isFirstLastPage = (0, _commons.isFirstLastPage)(pager),
200
+ isFirstPage = _isFirstLastPage.isFirstPage,
201
+ isLastPage = _isFirstLastPage.isLastPage;
202
+ return checkInLoop(_objectSpread(_objectSpread({}, state), {}, {
203
+ cleaning: cleaning,
204
+ missingBlock: missingBlock,
205
+ resizing: resizing,
206
+ variables: variables,
207
+ pages: pages,
208
+ isFirstPage: isFirstPage,
209
+ isLastPage: isLastPage,
210
+ pager: pager,
211
+ executeExpression: executeExpression,
212
+ updateBindings: updateBindings,
213
+ setLoopBindings: setLoopBindings,
214
+ resetLoopBindings: resetLoopBindings,
215
+ handleChange: handleChange,
216
+ preferences: preferences,
217
+ management: management,
218
+ savingType: savingType,
219
+ activeControls: activeControls
220
+ }), initialPager);
221
+ }
222
+ return state;
223
+ }
224
+ var _default = reduceOnInit;
225
+ exports["default"] = _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
+ 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
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function reduceOnSetWaiting(state, action) {
14
+ var payload = action.payload;
15
+ var status = payload.status;
16
+ return _objectSpread(_objectSpread({}, state), {}, {
17
+ waiting: status
18
+ });
19
+ }
20
+ var _default = reduceOnSetWaiting;
21
+ exports["default"] = _default;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _reduceOnInit = _interopRequireDefault(require("./reduce-on-init"));
9
+ var _reduceGoPreviousPage = _interopRequireDefault(require("./reduce-go-previous-page"));
10
+ var _reduceGoNextPage = _interopRequireDefault(require("./reduce-go-next-page"));
11
+ var _reduceGoToPage = _interopRequireDefault(require("./reduce-go-to-page"));
12
+ var _reduceHandleChange = _interopRequireDefault(require("./reduce-handle-change"));
13
+ var _reduceOnSetWaiting = _interopRequireDefault(require("./reduce-on-set-waiting"));
14
+ var actions = _interopRequireWildcard(require("../actions"));
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
+ function reducer(state, action) {
19
+ var type = action.type;
20
+ switch (type) {
21
+ case actions.ON_INIT:
22
+ return (0, _reduceOnInit["default"])(state, action);
23
+ case actions.GO_PREVIOUS_PAGE:
24
+ return (0, _reduceGoPreviousPage["default"])(state, action);
25
+ case actions.GO_NEXT_PAGE:
26
+ return (0, _reduceGoNextPage["default"])(state, action);
27
+ case actions.GO_TO_PAGE:
28
+ return (0, _reduceGoToPage["default"])(state, action);
29
+ case actions.HANDLE_CHANGE:
30
+ return (0, _reduceHandleChange["default"])(state, action);
31
+ case actions.ON_SET_WAITING:
32
+ return (0, _reduceOnSetWaiting["default"])(state, action);
33
+ default:
34
+ return state;
35
+ }
36
+ }
37
+ var _default = reducer;
38
+ exports["default"] = _default;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _validationUtils = require("./validation-utils");
8
+ var _commons = require("../../commons");
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+ 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
+ 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; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ function validateComponents(state, components) {
16
+ var pager = state.pager;
17
+ return components.reduce(function (errors, component) {
18
+ var controls = component.controls,
19
+ componentType = component.componentType,
20
+ id = component.id;
21
+ if (Array.isArray(controls)) {
22
+ var componentErrors = (0, _validationUtils.resolveComponentControls)(state, controls);
23
+ var shallowIteration = pager.shallowIteration;
24
+ var idC = shallowIteration !== undefined ? "".concat(id, "-").concat(shallowIteration) : id;
25
+ return _objectSpread(_objectSpread({}, errors), {}, _defineProperty({}, idC, componentErrors));
26
+ }
27
+ //Thanks to init which split basic Loops, we only go into unPaginatedLoops
28
+ if (['Loop', 'RosterForLoop'].includes(componentType)) {
29
+ var _components = component.components;
30
+ var recurs = validateComponents(state, _components);
31
+ return _objectSpread(_objectSpread(_objectSpread({}, (state.errors || {})[(0, _commons.getPageTag)(pager)] || {}), errors), recurs);
32
+ }
33
+ // If no error we remove the possible previous errors
34
+ return {};
35
+ }, {});
36
+ }
37
+ function createControlsReducer(reducer) {
38
+ // Nothing to init
39
+ return function (state, action) {
40
+ var activeControls = state.activeControls;
41
+ var updatedState = reducer(state, action);
42
+ if (!activeControls || state.pager.lastReachedPage !== updatedState.pager.lastReachedPage)
43
+ //if no active controls or is the first time we reach the page
44
+ return _objectSpread(_objectSpread({}, updatedState), {}, {
45
+ currentErrors: undefined
46
+ });
47
+ var components = (0, _commons.getComponentsFromState)(updatedState);
48
+ var pager = updatedState.pager;
49
+ var _state$errors = state.errors,
50
+ errors = _state$errors === void 0 ? {} : _state$errors;
51
+ var pageTag = (0, _commons.getPageTag)(pager);
52
+ var e = _objectSpread(_objectSpread({}, errors), {}, _defineProperty({}, pageTag, validateComponents(updatedState, components)));
53
+ return _objectSpread(_objectSpread({}, updatedState), {}, {
54
+ errors: e,
55
+ currentErrors: e[pageTag]
56
+ });
57
+ };
58
+ }
59
+ var _default = createControlsReducer;
60
+ exports["default"] = _default;