@inseefr/lunatic 2.3.0 → 2.4.0

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 (1038) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +169 -22
  3. package/lib/components/button/__snapshots__/lunatic-button.spec.jsx.snap +80 -0
  4. package/lib/components/button/button.scss +24 -0
  5. package/lib/components/button/index.js +13 -0
  6. package/lib/components/button/lunatic-button.js +56 -0
  7. package/lib/components/button/lunatic-button.spec.js +87 -0
  8. package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +55 -0
  9. package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.spec.js +57 -0
  10. package/lib/components/checkbox/checkbox-boolean/index.js +13 -0
  11. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +58 -0
  12. package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +41 -0
  13. package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +51 -0
  14. package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.spec.js +44 -0
  15. package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +52 -0
  16. package/lib/components/checkbox/checkbox-group/html/checkbox-group.scss +12 -0
  17. package/lib/components/checkbox/checkbox-group/index.js +13 -0
  18. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +64 -0
  19. package/lib/components/checkbox/checkbox-one/html/checkbox-one.js +54 -0
  20. package/lib/components/checkbox/checkbox-one/html/checkbox-one.scss +19 -0
  21. package/lib/components/checkbox/checkbox-one/html/checkbox-one.spec.js +51 -0
  22. package/lib/components/checkbox/checkbox-one/index.js +13 -0
  23. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +58 -0
  24. package/lib/components/checkbox/commons/checkbox-option.js +89 -0
  25. package/lib/components/checkbox/commons/checkbox-option.scss +19 -0
  26. package/lib/components/checkbox/commons/checkbox-option.spec.js +71 -0
  27. package/lib/components/checkbox/commons/getShortcutKey.js +11 -0
  28. package/lib/components/checkbox/commons/index.js +13 -0
  29. package/lib/components/checkbox/index.js +27 -0
  30. package/lib/components/commons/build-style-object.js +25 -0
  31. package/lib/components/commons/components/combo-box/combo-box-container.js +33 -0
  32. package/lib/components/commons/components/combo-box/combo-box-container.spec.js +45 -0
  33. package/lib/components/commons/components/combo-box/combo-box-content.js +63 -0
  34. package/lib/components/commons/components/combo-box/combo-box.js +199 -0
  35. package/lib/components/commons/components/combo-box/combo-box.scss +206 -0
  36. package/lib/components/commons/components/combo-box/index.js +13 -0
  37. package/lib/components/commons/components/combo-box/panel/index.js +13 -0
  38. package/lib/components/commons/components/combo-box/panel/option-container.js +61 -0
  39. package/lib/components/commons/components/combo-box/panel/option-container.spec.js +27 -0
  40. package/lib/components/commons/components/combo-box/panel/panel-container.js +28 -0
  41. package/lib/components/commons/components/combo-box/panel/panel-container.spec.js +59 -0
  42. package/lib/components/commons/components/combo-box/panel/panel.js +63 -0
  43. package/lib/components/commons/components/combo-box/panel/panel.spec.js +93 -0
  44. package/lib/components/commons/components/combo-box/selection/__snapshots__/selection.spec.jsx.snap +81 -0
  45. package/lib/components/commons/components/combo-box/selection/delete.js +55 -0
  46. package/lib/components/commons/components/combo-box/selection/delete.spec.js +88 -0
  47. package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +29 -0
  48. package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.spec.js +57 -0
  49. package/lib/components/commons/components/combo-box/selection/index.js +13 -0
  50. package/lib/components/commons/components/combo-box/selection/input.js +56 -0
  51. package/lib/components/commons/components/combo-box/selection/label-selection.js +32 -0
  52. package/lib/components/commons/components/combo-box/selection/label-selection.spec.js +45 -0
  53. package/lib/components/commons/components/combo-box/selection/selection-container.js +39 -0
  54. package/lib/components/commons/components/combo-box/selection/selection-container.spec.js +53 -0
  55. package/lib/components/commons/components/combo-box/selection/selection.js +60 -0
  56. package/lib/components/commons/components/combo-box/selection/selection.spec.js +104 -0
  57. package/lib/components/commons/components/combo-box/state-management/actions.js +82 -0
  58. package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +16 -0
  59. package/lib/components/commons/components/combo-box/state-management/index.js +33 -0
  60. package/lib/components/commons/components/combo-box/state-management/initial-state.js +14 -0
  61. package/lib/components/commons/components/combo-box/state-management/reducer/index.js +13 -0
  62. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +20 -0
  63. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +22 -0
  64. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +21 -0
  65. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +20 -0
  66. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +38 -0
  67. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +13 -0
  68. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/keyboard-key-codes.js +18 -0
  69. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +32 -0
  70. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +32 -0
  71. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +25 -0
  72. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +21 -0
  73. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +20 -0
  74. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +25 -0
  75. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +20 -0
  76. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +40 -0
  77. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +22 -0
  78. package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +41 -0
  79. package/lib/components/commons/components/default-label-renderer.js +47 -0
  80. package/lib/components/commons/components/default-label-renderer.spec.js +43 -0
  81. package/lib/components/commons/components/default-option-renderer.js +44 -0
  82. package/lib/components/commons/components/default-option-renderer.spec.js +65 -0
  83. package/lib/components/commons/components/description.js +52 -0
  84. package/lib/components/commons/components/description.spec.js +45 -0
  85. package/lib/components/commons/components/dragger/dragger.js +95 -0
  86. package/lib/components/commons/components/dragger/dragger.scss +8 -0
  87. package/lib/components/commons/components/dragger/dragger.spec.js +80 -0
  88. package/lib/components/commons/components/dragger/index.js +13 -0
  89. package/lib/components/commons/components/errors/errors.js +53 -0
  90. package/lib/components/commons/components/errors/errors.scss +5 -0
  91. package/lib/components/commons/components/errors/errors.spec.js +40 -0
  92. package/lib/components/commons/components/errors/index.js +13 -0
  93. package/lib/components/commons/components/fab/fab.js +50 -0
  94. package/lib/components/commons/components/fab/fab.scss +32 -0
  95. package/lib/components/commons/components/fab/fab.spec.js +76 -0
  96. package/lib/components/commons/components/fab/index.js +13 -0
  97. package/lib/components/commons/components/field-container/field-container.js +41 -0
  98. package/lib/components/commons/components/field-container/filed-container.spec.js +37 -0
  99. package/lib/components/commons/components/field-container/index.js +13 -0
  100. package/lib/components/commons/components/fieldset.js +30 -0
  101. package/lib/components/commons/components/fieldset.scss +5 -0
  102. package/lib/components/commons/components/fieldset.spec.js +51 -0
  103. package/lib/components/commons/components/html-table/index.js +48 -0
  104. package/lib/components/commons/components/html-table/table.js +32 -0
  105. package/lib/components/commons/components/html-table/table.scss +27 -0
  106. package/lib/components/commons/components/html-table/table.spec.js +25 -0
  107. package/lib/components/commons/components/html-table/tbody.js +32 -0
  108. package/lib/components/commons/components/html-table/tbody.spec.js +34 -0
  109. package/lib/components/commons/components/html-table/td.js +43 -0
  110. package/lib/components/commons/components/html-table/td.spec.js +43 -0
  111. package/lib/components/commons/components/html-table/th.js +41 -0
  112. package/lib/components/commons/components/html-table/th.spec.js +46 -0
  113. package/lib/components/commons/components/html-table/thead.js +31 -0
  114. package/lib/components/commons/components/html-table/thead.spec.js +30 -0
  115. package/lib/components/commons/components/html-table/tr.js +33 -0
  116. package/lib/components/commons/components/html-table/tr.spec.js +45 -0
  117. package/lib/components/commons/components/is-network/index.js +13 -0
  118. package/lib/components/commons/components/is-network/is-network.js +53 -0
  119. package/lib/components/commons/components/is-network/is-network.spec.js +34 -0
  120. package/lib/components/commons/components/is-network/use-online-status.js +46 -0
  121. package/lib/components/commons/components/is-network/use-online-status.spec.js +45 -0
  122. package/lib/components/commons/components/label/index.js +13 -0
  123. package/lib/components/commons/components/label/label.js +35 -0
  124. package/lib/components/commons/components/label/label.scss +6 -0
  125. package/lib/components/commons/components/label/label.spec.js +78 -0
  126. package/lib/components/commons/components/lunatic-component-without-label.js +87 -0
  127. package/lib/components/commons/components/md-label/index.js +13 -0
  128. package/lib/components/commons/components/md-label/link.js +54 -0
  129. package/lib/components/commons/components/md-label/md-label.js +45 -0
  130. package/lib/components/commons/components/missing/index.js +13 -0
  131. package/lib/components/commons/components/missing/missing.js +87 -0
  132. package/lib/components/commons/components/missing/missing.scss +30 -0
  133. package/lib/components/commons/components/missing/missing.spec.js +81 -0
  134. package/lib/components/commons/components/nothing-to-display.js +16 -0
  135. package/lib/components/commons/components/nothing-to-display.spec.js +16 -0
  136. package/lib/components/commons/components/orchestrated-component.js +62 -0
  137. package/lib/components/commons/components/variable-status/img/index.js +20 -0
  138. package/lib/components/commons/components/variable-status/index.js +13 -0
  139. package/lib/components/commons/components/variable-status/variable-status.js +85 -0
  140. package/lib/components/commons/components/variable-status/variable-status.scss +39 -0
  141. package/lib/components/commons/components/variable-status/variable-status.spec.js +24 -0
  142. package/lib/components/commons/create-customizable-field.js +29 -0
  143. package/lib/components/commons/create-row-orchestrator.js +51 -0
  144. package/lib/components/commons/icons/checkbox-checked.icon.js +39 -0
  145. package/lib/components/commons/icons/checkbox-unchecked.icon.js +39 -0
  146. package/lib/components/commons/icons/closed.icon.js +36 -0
  147. package/lib/components/commons/icons/cross.icon.js +36 -0
  148. package/lib/components/commons/icons/index.js +76 -0
  149. package/lib/components/commons/icons/load.icon.js +36 -0
  150. package/lib/components/commons/icons/lunatic-icon.js +21 -0
  151. package/lib/components/commons/icons/lunatic-icon.scss +3 -0
  152. package/lib/components/commons/icons/network.icon.js +36 -0
  153. package/lib/components/commons/icons/on-drag.icon.js +36 -0
  154. package/lib/components/commons/icons/opened.icon.js +36 -0
  155. package/lib/components/commons/icons/radio-checked.icon.js +39 -0
  156. package/lib/components/commons/icons/radio-unchecked.icon.js +39 -0
  157. package/lib/components/commons/index.js +131 -0
  158. package/lib/components/commons/prop-types/declarations.js +19 -0
  159. package/lib/components/commons/prop-types/index.js +41 -0
  160. package/lib/components/commons/prop-types/lines.js +13 -0
  161. package/lib/components/commons/prop-types/options.js +13 -0
  162. package/lib/components/commons/prop-types/response.js +13 -0
  163. package/lib/components/commons/prop-types/value-type.js +14 -0
  164. package/lib/components/commons/safety-label.js +26 -0
  165. package/lib/components/commons/use-document-add-event-listener.js +84 -0
  166. package/lib/components/commons/use-on-handle-change.js +19 -0
  167. package/lib/components/commons/use-on-handle-change.spec.js +46 -0
  168. package/lib/components/commons/use-options-keydown.js +24 -0
  169. package/lib/components/commons/use-previous.js +16 -0
  170. package/lib/components/components.js +171 -0
  171. package/lib/components/datepicker/html/datepicker-container.js +18 -0
  172. package/lib/components/datepicker/html/datepicker-input.js +37 -0
  173. package/lib/components/datepicker/html/datepicker.js +69 -0
  174. package/lib/components/datepicker/html/datepicker.scss +1 -0
  175. package/lib/components/datepicker/index.js +13 -0
  176. package/lib/components/datepicker/lunatic-datepicker.js +61 -0
  177. package/lib/components/declarations/declaration.js +22 -0
  178. package/lib/components/declarations/declaration.spec.js +30 -0
  179. package/lib/components/declarations/declarations-after-text.js +25 -0
  180. package/lib/components/declarations/declarations-before-text.js +25 -0
  181. package/lib/components/declarations/declarations-detachable.js +25 -0
  182. package/lib/components/declarations/declarations.js +50 -0
  183. package/lib/components/declarations/declarations.scss +36 -0
  184. package/lib/components/declarations/declarations.spec.js +79 -0
  185. package/lib/components/declarations/index.js +43 -0
  186. package/lib/components/dropdown/html/dropdown-simple/dropdown-simple.js +39 -0
  187. package/lib/components/dropdown/html/dropdown-simple/index.js +13 -0
  188. package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +46 -0
  189. package/lib/components/dropdown/html/dropdown-simple/simple-option-renderer.js +45 -0
  190. package/lib/components/dropdown/html/dropdown-writable/dropdown-writable.js +62 -0
  191. package/lib/components/dropdown/html/dropdown-writable/filter-tools/filter-options.js +37 -0
  192. package/lib/components/dropdown/html/dropdown-writable/filter-tools/get-label.js +24 -0
  193. package/lib/components/dropdown/html/dropdown-writable/filter-tools/letters-matching.js +29 -0
  194. package/lib/components/dropdown/html/dropdown-writable/filter-tools/match.js +22 -0
  195. package/lib/components/dropdown/html/dropdown-writable/filter-tools/prepare-prefix.js +13 -0
  196. package/lib/components/dropdown/html/dropdown-writable/index.js +13 -0
  197. package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +52 -0
  198. package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +146 -0
  199. package/lib/components/dropdown/html/dropdown.js +51 -0
  200. package/lib/components/dropdown/html/dropdown.scss +41 -0
  201. package/lib/components/dropdown/index.js +13 -0
  202. package/lib/components/dropdown/lunatic-dropdown.js +75 -0
  203. package/lib/components/filter-description/component.js +22 -0
  204. package/lib/components/filter-description/component.spec.js +23 -0
  205. package/lib/components/filter-description/index.js +13 -0
  206. package/lib/components/index.js +28 -0
  207. package/lib/components/index.scss +136 -0
  208. package/lib/components/input/html/input.js +79 -0
  209. package/lib/components/input/html/input.scss +42 -0
  210. package/lib/components/input/index.js +13 -0
  211. package/lib/components/input/lunatic-input.js +57 -0
  212. package/lib/components/input-number/html/__snapshots__/inpute-number.spec.jsx.snap +92 -0
  213. package/lib/components/input-number/html/input-number-default.js +78 -0
  214. package/lib/components/input-number/html/input-number-thousand.js +54 -0
  215. package/lib/components/input-number/html/input-number.js +102 -0
  216. package/lib/components/input-number/html/input-number.scss +11 -0
  217. package/lib/components/input-number/html/inpute-number.spec.js +110 -0
  218. package/lib/components/input-number/index.js +13 -0
  219. package/lib/components/input-number/lunatic-input-number.js +64 -0
  220. package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +12 -0
  221. package/lib/components/loop/block-for-loop/block-for-loop.js +140 -0
  222. package/lib/components/loop/block-for-loop/index.js +13 -0
  223. package/lib/components/loop/block-for-loop/row.js +66 -0
  224. package/lib/components/loop/commons/get-init-length.js +16 -0
  225. package/lib/components/loop/commons/handle-row-button.js +22 -0
  226. package/lib/components/loop/commons/index.js +20 -0
  227. package/lib/components/loop/commons/row-component.js +70 -0
  228. package/lib/components/loop/index.js +13 -0
  229. package/lib/components/loop/loop.js +82 -0
  230. package/lib/components/loop/roster-for-loop/body.js +56 -0
  231. package/lib/components/loop/roster-for-loop/header.js +34 -0
  232. package/lib/components/loop/roster-for-loop/index.js +13 -0
  233. package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +12 -0
  234. package/lib/components/loop/roster-for-loop/roster-for-loop.js +124 -0
  235. package/lib/components/loop/roster-for-loop/roster-table.js +48 -0
  236. package/lib/components/loop/roster-for-loop/roster.scss +42 -0
  237. package/lib/components/loop/roster-for-loop/row.js +73 -0
  238. package/lib/components/modal-controls/close-or-skip.js +41 -0
  239. package/lib/components/modal-controls/close-or-skip.spec.js +52 -0
  240. package/lib/components/modal-controls/index.js +13 -0
  241. package/lib/components/modal-controls/modal-container.js +22 -0
  242. package/lib/components/modal-controls/modal-container.spec.js +24 -0
  243. package/lib/components/modal-controls/modal-controls.js +78 -0
  244. package/lib/components/modal-controls/modal-controls.scss +48 -0
  245. package/lib/components/modal-controls/modal-controls.spec.js +77 -0
  246. package/lib/components/pairwise-links/index.js +13 -0
  247. package/lib/components/pairwise-links/orchestrator.js +70 -0
  248. package/lib/components/pairwise-links/pairwise-links.js +65 -0
  249. package/lib/components/pairwise-links/row.js +78 -0
  250. package/lib/components/radio/html/dist/radio-group.css +12 -0
  251. package/lib/components/radio/html/radio-group-content.js +45 -0
  252. package/lib/components/radio/html/radio-group-content.spec.js +86 -0
  253. package/lib/components/radio/html/radio-group.js +67 -0
  254. package/lib/components/radio/html/radio-group.scss +21 -0
  255. package/lib/components/radio/html/radio-option.js +105 -0
  256. package/lib/components/radio/html/radio-option.spec.js +80 -0
  257. package/lib/components/radio/index.js +13 -0
  258. package/lib/components/radio/lunatic-radio-group.js +64 -0
  259. package/lib/components/radio/radio-group.js +48 -0
  260. package/lib/components/radio/radio.scss +19 -0
  261. package/lib/components/roundabout/components/roundabout-container.js +20 -0
  262. package/lib/components/roundabout/components/roundabout-container.spec.js +23 -0
  263. package/lib/components/roundabout/components/roundabout-it-button.js +80 -0
  264. package/lib/components/roundabout/components/roundabout-it-button.spec.js +102 -0
  265. package/lib/components/roundabout/components/roundabout-it-container.js +19 -0
  266. package/lib/components/roundabout/components/roundabout-it-container.spec.js +23 -0
  267. package/lib/components/roundabout/components/roundabout-it-title.js +19 -0
  268. package/lib/components/roundabout/components/roundabout-it-title.spec.js +18 -0
  269. package/lib/components/roundabout/components/roundabout-label.js +19 -0
  270. package/lib/components/roundabout/components/roundabout-label.spec.js +18 -0
  271. package/lib/components/roundabout/components/roundabout-pending.js +18 -0
  272. package/lib/components/roundabout/components/roundabout-pending.spec.js +15 -0
  273. package/lib/components/roundabout/components/roundabout.scss +16 -0
  274. package/lib/components/roundabout/index.js +13 -0
  275. package/lib/components/roundabout/lunatic-roundabout.js +62 -0
  276. package/lib/components/roundabout/redirect.js +23 -0
  277. package/lib/components/roundabout/redirect.spec.js +19 -0
  278. package/lib/components/roundabout/roundabout.js +89 -0
  279. package/lib/components/roundabout/roundabout.spec.js +71 -0
  280. package/lib/components/sequence/index.js +13 -0
  281. package/lib/components/sequence/sequence.js +37 -0
  282. package/lib/components/sequence/sequence.scss +10 -0
  283. package/lib/components/sequence/sequence.spec.js +79 -0
  284. package/lib/components/subsequence/index.js +13 -0
  285. package/lib/components/subsequence/subsequence.js +35 -0
  286. package/lib/components/subsequence/subsequence.spec.js +79 -0
  287. package/lib/components/suggester/find-best-label/find-best-label.js +55 -0
  288. package/lib/components/suggester/find-best-label/index.js +13 -0
  289. package/lib/components/suggester/html/alert-icon.svg +2 -0
  290. package/lib/components/suggester/html/default-style.scss +175 -0
  291. package/lib/components/suggester/html/notification.js +31 -0
  292. package/lib/components/suggester/html/suggester.js +142 -0
  293. package/lib/components/suggester/html/wait-icon.svg +17 -0
  294. package/lib/components/suggester/html/warn-icon.svg +1 -0
  295. package/lib/components/suggester/idb-suggester/check-store.js +107 -0
  296. package/lib/components/suggester/idb-suggester/dist/index.dev.js +12 -0
  297. package/lib/components/suggester/idb-suggester/idb-suggester.js +90 -0
  298. package/lib/components/suggester/idb-suggester/index.js +12 -0
  299. package/lib/components/suggester/idb-suggester/suggester-notification.js +61 -0
  300. package/lib/components/suggester/idb-suggester/suggester-status.js +52 -0
  301. package/lib/components/suggester/index.js +13 -0
  302. package/lib/components/suggester/lunatic-suggester.js +106 -0
  303. package/lib/components/suggester/searching/create-searching.js +73 -0
  304. package/lib/components/suggester/searching/index.js +13 -0
  305. package/lib/components/suggester-loader-widget/index.js +13 -0
  306. package/lib/components/suggester-loader-widget/loader-row.js +129 -0
  307. package/lib/components/suggester-loader-widget/loader.js +136 -0
  308. package/lib/components/suggester-loader-widget/progress.js +41 -0
  309. package/lib/components/suggester-loader-widget/tools/action-tool.js +30 -0
  310. package/lib/components/suggester-loader-widget/tools/index.js +20 -0
  311. package/lib/components/suggester-loader-widget/tools/tools.js +18 -0
  312. package/lib/components/suggester-loader-widget/widget-container.js +44 -0
  313. package/lib/components/suggester-loader-widget/widget.js +145 -0
  314. package/lib/components/suggester-loader-widget/widget.scss +176 -0
  315. package/lib/components/switch/html/switch.js +95 -0
  316. package/lib/components/switch/html/switch.scss +47 -0
  317. package/lib/components/switch/index.js +13 -0
  318. package/lib/components/switch/lunatic-switch.js +66 -0
  319. package/lib/components/table/cell.js +102 -0
  320. package/lib/components/table/header.js +40 -0
  321. package/lib/components/table/index.js +13 -0
  322. package/lib/components/table/lunatic-table.js +92 -0
  323. package/lib/components/table/row.js +43 -0
  324. package/lib/components/table/table-orchestrator.js +50 -0
  325. package/lib/components/textarea/html/textarea.js +54 -0
  326. package/lib/components/textarea/html/textarea.scss +8 -0
  327. package/lib/components/textarea/index.js +13 -0
  328. package/lib/components/textarea/lunatic-textarea.js +72 -0
  329. package/lib/components/type.js +5 -0
  330. package/lib/constants/component-types.js +8 -0
  331. package/lib/constants/declarations.js +28 -0
  332. package/lib/constants/event-types.js +29 -0
  333. package/lib/constants/index.js +60 -0
  334. package/lib/constants/supported-preferences.js +13 -0
  335. package/lib/constants/value-types.js +16 -0
  336. package/lib/constants/variable-types.js +12 -0
  337. package/lib/dist/index.dev.js +31 -0
  338. package/lib/i18n/build-dictionary.js +59 -0
  339. package/lib/i18n/dictionary.js +34 -0
  340. package/lib/i18n/index.js +28 -0
  341. package/lib/i18n/inputNumberProps.js +20 -0
  342. package/lib/index.js +28 -1767
  343. package/lib/insee.d.js +1 -0
  344. package/lib/src/components/commons/components/md-label/index.d.ts +1 -0
  345. package/lib/src/components/commons/components/md-label/link.d.ts +7 -0
  346. package/lib/src/components/commons/components/md-label/md-label.d.ts +8 -0
  347. package/lib/src/components/type.d.ts +195 -0
  348. package/lib/src/constants/component-types.d.ts +1 -0
  349. package/lib/src/constants/declarations.d.ts +9 -0
  350. package/lib/src/constants/event-types.d.ts +10 -0
  351. package/lib/src/constants/index.d.ts +5 -0
  352. package/lib/src/constants/supported-preferences.d.ts +1 -0
  353. package/lib/src/constants/value-types.d.ts +5 -0
  354. package/lib/src/constants/variable-types.d.ts +2 -0
  355. package/lib/src/i18n/build-dictionary.d.ts +24 -0
  356. package/lib/src/i18n/dictionary.d.ts +37 -0
  357. package/lib/src/i18n/index.d.ts +7 -0
  358. package/lib/src/i18n/inputNumberProps.d.ts +13 -0
  359. package/lib/src/index.d.ts +3 -0
  360. package/lib/src/type.utils.d.ts +1 -0
  361. package/lib/src/use-lunatic/actions.d.ts +289 -0
  362. package/lib/src/use-lunatic/commons/calculated-variables.d.ts +8 -0
  363. package/lib/src/use-lunatic/commons/check-loops.d.ts +3 -0
  364. package/lib/src/use-lunatic/commons/check-pager.d.ts +5 -0
  365. package/lib/src/use-lunatic/commons/compile-controls.d.ts +7 -0
  366. package/lib/src/use-lunatic/commons/compose.d.ts +3 -0
  367. package/lib/src/use-lunatic/commons/create-map-pages.d.ts +7 -0
  368. package/lib/src/use-lunatic/commons/execute-condition-filter.d.ts +3 -0
  369. package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +9 -0
  370. package/lib/src/use-lunatic/commons/execute-expression/create-memoizer.d.ts +8 -0
  371. package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +24 -0
  372. package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +11 -0
  373. package/lib/src/use-lunatic/commons/execute-expression/execute-expression.spec.d.ts +1 -0
  374. package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.d.ts +7 -0
  375. package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.spec.d.ts +1 -0
  376. package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +6 -0
  377. package/lib/src/use-lunatic/commons/execute-expression/index.d.ts +1 -0
  378. package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +9 -0
  379. package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.spec.d.ts +1 -0
  380. package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +6 -0
  381. package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +12 -0
  382. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +699 -0
  383. package/lib/src/use-lunatic/commons/fill-components/fill-management.d.ts +6 -0
  384. package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +11 -0
  385. package/lib/src/use-lunatic/commons/fill-components/fill-pagination.d.ts +9 -0
  386. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +571 -0
  387. package/lib/src/use-lunatic/commons/fill-components/index.d.ts +1 -0
  388. package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +6 -0
  389. package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +6 -0
  390. package/lib/src/use-lunatic/commons/get-component-value/index.d.ts +1 -0
  391. package/lib/src/use-lunatic/commons/get-components-from-state.d.ts +7 -0
  392. package/lib/src/use-lunatic/commons/get-data.d.ts +26 -0
  393. package/lib/src/use-lunatic/commons/get-errors-without-empty-value.d.ts +6 -0
  394. package/lib/src/use-lunatic/commons/getOverview.d.ts +19 -0
  395. package/lib/src/use-lunatic/commons/index.d.ts +13 -0
  396. package/lib/src/use-lunatic/commons/is-First-last-page.d.ts +6 -0
  397. package/lib/src/use-lunatic/commons/is-paginated-loop.d.ts +6 -0
  398. package/lib/src/use-lunatic/commons/is-roundabout.d.ts +2 -0
  399. package/lib/src/use-lunatic/commons/page-tag.d.ts +12 -0
  400. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +4 -0
  401. package/lib/src/use-lunatic/hooks/use-loop-variables.d.ts +5 -0
  402. package/lib/src/use-lunatic/index.d.ts +1 -0
  403. package/lib/src/use-lunatic/initial-state.d.ts +3 -0
  404. package/lib/src/use-lunatic/lunatic-context.d.ts +31 -0
  405. package/lib/src/use-lunatic/reducer/commons/index.d.ts +4 -0
  406. package/lib/src/use-lunatic/reducer/commons/is-empty-on-empty-page.d.ts +3 -0
  407. package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +12 -0
  408. package/lib/src/use-lunatic/reducer/commons/resize-array-variable.d.ts +5 -0
  409. package/lib/src/use-lunatic/reducer/commons/validate-condition-filter.d.ts +6 -0
  410. package/lib/src/use-lunatic/reducer/index.d.ts +1 -0
  411. package/lib/src/use-lunatic/reducer/overview/overview-on-change.d.ts +2 -0
  412. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +99 -0
  413. package/lib/src/use-lunatic/reducer/reduce-go-next-page.d.ts +4 -0
  414. package/lib/src/use-lunatic/reducer/reduce-go-previous-page.d.ts +3 -0
  415. package/lib/src/use-lunatic/reducer/reduce-go-to-page.d.ts +4 -0
  416. package/lib/src/use-lunatic/reducer/reduce-handle-change/index.d.ts +1 -0
  417. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +7 -0
  418. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.d.ts +1 -0
  419. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +4 -0
  420. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +15 -0
  421. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +7 -0
  422. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +4 -0
  423. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +14 -0
  424. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +9 -0
  425. package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +15 -0
  426. package/lib/src/use-lunatic/reducer/reduce-on-set-waiting.d.ts +4 -0
  427. package/lib/src/use-lunatic/reducer/reduce-roundabout.d.ts +99 -0
  428. package/lib/src/use-lunatic/reducer/reduce-update-state.d.ts +3 -0
  429. package/lib/src/use-lunatic/reducer/reducer.d.ts +4 -0
  430. package/lib/src/use-lunatic/reducer/validate-controls/validation-utils.d.ts +6 -0
  431. package/lib/src/use-lunatic/type-source.d.ts +281 -0
  432. package/lib/src/use-lunatic/type.d.ts +143 -0
  433. package/lib/src/use-lunatic/use-lunatic.d.ts +84 -0
  434. package/lib/src/use-lunatic/use-lunatic.test.d.ts +1 -0
  435. package/lib/src/use-lunatic/use-suggesters.d.ts +19 -0
  436. package/lib/src/utils/constants/features.d.ts +3 -0
  437. package/lib/src/utils/constants/index.d.ts +5 -0
  438. package/lib/src/utils/constants/links.d.ts +2 -0
  439. package/lib/src/utils/constants/missing.d.ts +2 -0
  440. package/lib/src/utils/constants/variable-status.d.ts +5 -0
  441. package/lib/src/utils/constants/variable-types.d.ts +1 -0
  442. package/lib/src/utils/idb-tools/clear-store.d.ts +2 -0
  443. package/lib/src/utils/idb-tools/get-idb.d.ts +2 -0
  444. package/lib/src/utils/idb-tools/insert-entity.d.ts +2 -0
  445. package/lib/src/utils/is-element.d.ts +3 -0
  446. package/lib/src/utils/is-object.d.ts +4 -0
  447. package/lib/src/utils/object.d.ts +4 -0
  448. package/lib/src/utils/store-tools/constantes.d.ts +21 -0
  449. package/lib/src/utils/store-tools/initStore.d.ts +2 -0
  450. package/lib/src/utils/store-tools/open-or-create-store.d.ts +2 -0
  451. package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +7 -0
  452. package/lib/src/utils/suggester-workers/create-worker-ts.d.ts +1 -0
  453. package/lib/src/utils/to-number.d.ts +4 -0
  454. package/lib/src/utils/vtl/dataset-builder.d.ts +5 -0
  455. package/lib/src/utils/vtl/index.d.ts +1 -0
  456. package/lib/stories/Introduction.stories.mdx +114 -0
  457. package/lib/stories/checkbox-boolean/checkboxBoolean.stories.js +34 -0
  458. package/lib/stories/checkbox-boolean/source.json +58 -0
  459. package/lib/stories/checkbox-group/checkbox-group.stories.js +34 -0
  460. package/lib/stories/checkbox-group/source.json +86 -0
  461. package/lib/stories/checkbox-one/checkboxOne.stories.js +43 -0
  462. package/lib/stories/checkbox-one/source.json +52 -0
  463. package/lib/stories/checkboxGroup/checkboxGroup.stories.js +43 -0
  464. package/lib/stories/checkboxGroup/source.json +403 -0
  465. package/lib/stories/custom-mui/checkbox-boolean-mui.js +32 -0
  466. package/lib/stories/custom-mui/checkbox-group-mui.js +68 -0
  467. package/lib/stories/custom-mui/checkbox-one-mui.js +16 -0
  468. package/lib/stories/custom-mui/index.js +111 -0
  469. package/lib/stories/custom-mui/input-mui.js +52 -0
  470. package/lib/stories/custom-mui/input-number-mui.js +40 -0
  471. package/lib/stories/custom-mui/radio-mui.js +62 -0
  472. package/lib/stories/custom-mui/suggester-mui/index.js +13 -0
  473. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +304 -0
  474. package/lib/stories/custom-mui/switch-mui.js +47 -0
  475. package/lib/stories/custom-mui/table-mui.js +28 -0
  476. package/lib/stories/custom-mui/tbody-mui.js +23 -0
  477. package/lib/stories/custom-mui/td-mui.js +25 -0
  478. package/lib/stories/custom-mui/textarea-mui.js +43 -0
  479. package/lib/stories/custom-mui/th-mui.js +24 -0
  480. package/lib/stories/custom-mui/thead-mui.js +23 -0
  481. package/lib/stories/custom-mui/tr-mui.js +33 -0
  482. package/lib/stories/date-picker/data.json +3 -0
  483. package/lib/stories/date-picker/datepicker.stories.js +38 -0
  484. package/lib/stories/date-picker/source.json +110 -0
  485. package/lib/stories/declaration/data.json +1 -0
  486. package/lib/stories/declaration/input.stories.js +36 -0
  487. package/lib/stories/declaration/source.json +74 -0
  488. package/lib/stories/dropdown/data.json +16 -0
  489. package/lib/stories/dropdown/dropdown.stories.js +39 -0
  490. package/lib/stories/dropdown/source.json +158 -0
  491. package/lib/stories/filter-description/filter-description.stories.js +50 -0
  492. package/lib/stories/filter-description/source-options.json +81 -0
  493. package/lib/stories/filter-description/source.json +11 -0
  494. package/lib/stories/input/data.json +1 -0
  495. package/lib/stories/input/input.stories.js +36 -0
  496. package/lib/stories/input/source.json +91 -0
  497. package/lib/stories/input-number/input-number.stories.js +56 -0
  498. package/lib/stories/input-number/source-euros.json +37 -0
  499. package/lib/stories/input-number/source-thansand.json +34 -0
  500. package/lib/stories/input-number/source.json +33 -0
  501. package/lib/stories/loop/block-for-loop.stories.js +41 -0
  502. package/lib/stories/loop/roster-for-loop.stories.js +34 -0
  503. package/lib/stories/loop/source-bloc.json +114 -0
  504. package/lib/stories/loop/source-roster.json +114 -0
  505. package/lib/stories/loop/source-with-header.json +127 -0
  506. package/lib/stories/overview/data.json +1 -0
  507. package/lib/stories/overview/overview.stories.js +37 -0
  508. package/lib/stories/overview/source.json +28 -0
  509. package/lib/stories/overview/sourceWithHierarchy.json +6290 -0
  510. package/lib/stories/pairwise/data.json +12 -0
  511. package/lib/stories/pairwise/links.json +270 -0
  512. package/lib/stories/pairwise/pairwise-links.stories.js +137 -0
  513. package/lib/stories/paste-questionnaire/source.json +6290 -0
  514. package/lib/stories/paste-questionnaire/test.stories.js +84 -0
  515. package/lib/stories/questionnaires/logement/data.json +2686 -0
  516. package/lib/stories/questionnaires/logement/logement.stories.js +76 -0
  517. package/lib/stories/questionnaires/logement/source-sequence.json +34181 -0
  518. package/lib/stories/questionnaires/logement/source-sum.json +34612 -0
  519. package/lib/stories/questionnaires/logement/source.json +34191 -0
  520. package/lib/stories/questionnaires/recensement/data.json +12 -0
  521. package/lib/stories/questionnaires/recensement/recensement.stories.js +52 -0
  522. package/lib/stories/questionnaires/recensement/source.json +15190 -0
  523. package/lib/stories/questionnaires/rp/data.json +5 -0
  524. package/lib/stories/questionnaires/rp/rp.stories.js +37 -0
  525. package/lib/stories/questionnaires/rp/source.json +262 -0
  526. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +553 -0
  527. package/lib/stories/questionnaires/simpsons/source.json +6296 -0
  528. package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +848 -0
  529. package/lib/stories/questionnaires-test/V2_MinMaxSum_Boucles.json +509 -0
  530. package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4091 -0
  531. package/lib/stories/questionnaires-test/V2_TCMRallyeGames.json +2892 -0
  532. package/lib/stories/questionnaires-test/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +666 -0
  533. package/lib/stories/questionnaires-test/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +1966 -0
  534. package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees2_PasPageFin.json +709 -0
  535. package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +533 -0
  536. package/lib/stories/questionnaires-test/controls/boucles-n.json +202 -0
  537. package/lib/stories/questionnaires-test/controls/controls.stories.js +97 -0
  538. package/lib/stories/questionnaires-test/test-dylan.json +558 -0
  539. package/lib/stories/questionnaires-test/test.stories.js +93 -0
  540. package/lib/stories/radio/radio.stories.js +43 -0
  541. package/lib/stories/radio/source.json +51 -0
  542. package/lib/stories/roundabout/data.json +25 -0
  543. package/lib/stories/roundabout/roundabout.stories.js +36 -0
  544. package/lib/stories/roundabout/source.json +273 -0
  545. package/lib/stories/suggester/simple.json +146 -0
  546. package/lib/stories/suggester/source.json +254 -0
  547. package/lib/stories/suggester/suggester-workers.stories.js +208 -0
  548. package/lib/stories/suggester/suggester.stories.js +84 -0
  549. package/lib/stories/switch/README.md +31 -0
  550. package/lib/stories/switch/data-forced.json +48 -0
  551. package/lib/stories/switch/source.json +80 -0
  552. package/lib/stories/switch/switch.stories.js +39 -0
  553. package/lib/stories/table/data-roster.json +1 -0
  554. package/lib/stories/table/data.json +1 -0
  555. package/lib/stories/table/source-roster.json +513 -0
  556. package/lib/stories/table/source.json +31 -0
  557. package/lib/stories/table/table-dynamique.json +67 -0
  558. package/lib/stories/table/table.stories.js +63 -0
  559. package/lib/stories/textarea/data.json +1 -0
  560. package/lib/stories/textarea/source.json +51 -0
  561. package/lib/stories/textarea/textarea.stories.js +36 -0
  562. package/lib/stories/utils/custom-lunatic.scss +28 -0
  563. package/lib/stories/utils/default-arg-types.js +22 -0
  564. package/lib/stories/utils/options.js +32 -0
  565. package/lib/stories/utils/orchestrator.js +263 -0
  566. package/lib/stories/utils/orchestrator.scss +5 -0
  567. package/lib/stories/utils/overview.js +54 -0
  568. package/lib/stories/utils/overview.scss +30 -0
  569. package/lib/stories/utils/waiting/index.js +13 -0
  570. package/lib/stories/utils/waiting/preloader.svg +1 -0
  571. package/lib/stories/utils/waiting/waiting.js +33 -0
  572. package/lib/stories/utils/waiting/waiting.scss +21 -0
  573. package/lib/tests/utils/lunatic.d.ts +11 -0
  574. package/lib/type.utils.js +5 -0
  575. package/lib/use-lunatic/actions.js +60 -0
  576. package/lib/use-lunatic/commons/calculated-variables.js +104 -0
  577. package/lib/use-lunatic/commons/check-loops.js +99 -0
  578. package/lib/use-lunatic/commons/check-pager.js +24 -0
  579. package/lib/use-lunatic/commons/compile-controls.js +72 -0
  580. package/lib/use-lunatic/commons/compose.js +20 -0
  581. package/lib/use-lunatic/commons/create-map-pages.js +81 -0
  582. package/lib/use-lunatic/commons/execute-condition-filter.js +27 -0
  583. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +268 -0
  584. package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +63 -0
  585. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +148 -0
  586. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +91 -0
  587. package/lib/use-lunatic/commons/execute-expression/execute-expression.spec.js +38 -0
  588. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +40 -0
  589. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.spec.js +31 -0
  590. package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +35 -0
  591. package/lib/use-lunatic/commons/execute-expression/index.js +13 -0
  592. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +111 -0
  593. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +42 -0
  594. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +22 -0
  595. package/lib/use-lunatic/commons/fill-components/fill-components.js +45 -0
  596. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +30 -0
  597. package/lib/use-lunatic/commons/fill-components/fill-management.js +23 -0
  598. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +35 -0
  599. package/lib/use-lunatic/commons/fill-components/fill-pagination.js +24 -0
  600. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +46 -0
  601. package/lib/use-lunatic/commons/fill-components/index.js +13 -0
  602. package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +28 -0
  603. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +176 -0
  604. package/lib/use-lunatic/commons/get-component-value/index.js +13 -0
  605. package/lib/use-lunatic/commons/get-components-from-state.js +47 -0
  606. package/lib/use-lunatic/commons/get-data.js +80 -0
  607. package/lib/use-lunatic/commons/get-errors-without-empty-value.js +25 -0
  608. package/lib/use-lunatic/commons/getOverview.js +40 -0
  609. package/lib/use-lunatic/commons/index.js +109 -0
  610. package/lib/use-lunatic/commons/is-First-last-page.js +18 -0
  611. package/lib/use-lunatic/commons/is-paginated-loop.js +11 -0
  612. package/lib/use-lunatic/commons/is-roundabout.js +10 -0
  613. package/lib/use-lunatic/commons/load-suggesters.js +158 -0
  614. package/lib/use-lunatic/commons/page-tag.js +72 -0
  615. package/lib/use-lunatic/commons/use-components-from-state.js +41 -0
  616. package/lib/use-lunatic/hooks/use-loop-variables.js +26 -0
  617. package/lib/use-lunatic/index.js +13 -0
  618. package/lib/use-lunatic/initial-state.js +49 -0
  619. package/lib/use-lunatic/lunatic-context.js +83 -0
  620. package/lib/use-lunatic/reducer/commons/index.js +44 -0
  621. package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +32 -0
  622. package/lib/use-lunatic/reducer/commons/is-loop-component.js +10 -0
  623. package/lib/use-lunatic/reducer/commons/resize-array-variable.js +32 -0
  624. package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +29 -0
  625. package/lib/use-lunatic/reducer/index.js +13 -0
  626. package/lib/use-lunatic/reducer/overview/overview-on-change.js +49 -0
  627. package/lib/use-lunatic/reducer/overview/overview-on-init.js +104 -0
  628. package/lib/use-lunatic/reducer/reduce-go-next-page.js +181 -0
  629. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +146 -0
  630. package/lib/use-lunatic/reducer/reduce-go-to-page.js +79 -0
  631. package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +926 -0
  632. package/lib/use-lunatic/reducer/reduce-handle-change/index.js +13 -0
  633. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +72 -0
  634. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.js +46 -0
  635. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +115 -0
  636. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +89 -0
  637. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +88 -0
  638. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +113 -0
  639. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +44 -0
  640. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +28 -0
  641. package/lib/use-lunatic/reducer/reduce-on-init.js +238 -0
  642. package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +21 -0
  643. package/lib/use-lunatic/reducer/reduce-roundabout.js +29 -0
  644. package/lib/use-lunatic/reducer/reduce-update-state.js +22 -0
  645. package/lib/use-lunatic/reducer/reducer.js +37 -0
  646. package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +63 -0
  647. package/lib/use-lunatic/type-source.js +24 -0
  648. package/lib/use-lunatic/type.js +5 -0
  649. package/lib/use-lunatic/use-lunatic.js +189 -0
  650. package/lib/use-lunatic/use-lunatic.test.js +168 -0
  651. package/lib/use-lunatic/use-suggesters.js +158 -0
  652. package/lib/utils/constants/alphabet.js +8 -0
  653. package/lib/utils/constants/features.js +12 -0
  654. package/lib/utils/constants/index.js +60 -0
  655. package/lib/utils/constants/links.js +10 -0
  656. package/lib/utils/constants/missing.js +10 -0
  657. package/lib/utils/constants/variable-status.js +16 -0
  658. package/lib/utils/constants/variable-types.js +8 -0
  659. package/lib/utils/idb-tools/clear-store.js +40 -0
  660. package/lib/utils/idb-tools/create-db-opener.js +47 -0
  661. package/lib/utils/idb-tools/create-open-db.js +29 -0
  662. package/lib/utils/idb-tools/get-entity.js +21 -0
  663. package/lib/utils/idb-tools/get-idb.js +13 -0
  664. package/lib/utils/idb-tools/idb-bulk-insert.js +134 -0
  665. package/lib/utils/idb-tools/index.js +64 -0
  666. package/lib/utils/idb-tools/insert-entity.js +21 -0
  667. package/lib/utils/idb-tools/open-db.js +24 -0
  668. package/lib/utils/idb-tools/open-or-create-db.js +42 -0
  669. package/lib/utils/is-element.js +10 -0
  670. package/lib/utils/is-object.js +13 -0
  671. package/lib/utils/object.js +31 -0
  672. package/lib/utils/store-tools/auto-load.js +162 -0
  673. package/lib/utils/store-tools/clear-store-data.js +33 -0
  674. package/lib/utils/store-tools/clear-store-info.js +33 -0
  675. package/lib/utils/store-tools/constantes.js +31 -0
  676. package/lib/utils/store-tools/create/create.js +51 -0
  677. package/lib/utils/store-tools/create/index.js +20 -0
  678. package/lib/utils/store-tools/create/update-store-info.js +27 -0
  679. package/lib/utils/store-tools/get-store-count.js +24 -0
  680. package/lib/utils/store-tools/index.js +54 -0
  681. package/lib/utils/store-tools/initStore.js +56 -0
  682. package/lib/utils/store-tools/open-or-create-store.js +52 -0
  683. package/lib/utils/store-tools/use-store-index.js +58 -0
  684. package/lib/utils/suggester-workers/append-to-index/append.js +78 -0
  685. package/lib/utils/suggester-workers/append-to-index/append.worker.js +33 -0
  686. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +66 -0
  687. package/lib/utils/suggester-workers/append-to-index/dist/append.worker.dev.js +37 -0
  688. package/lib/utils/suggester-workers/append-to-index/dist/create-append-task.js +69 -0
  689. package/lib/utils/suggester-workers/append-to-index/dist/index.dev.js +24 -0
  690. package/lib/utils/suggester-workers/append-to-index/index.js +20 -0
  691. package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +88 -0
  692. package/lib/utils/suggester-workers/append-to-index/store-messages.js +45 -0
  693. package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +54 -0
  694. package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +77 -0
  695. package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +36 -0
  696. package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +21 -0
  697. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +36 -0
  698. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +15 -0
  699. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +19 -0
  700. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +17 -0
  701. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +25 -0
  702. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +24 -0
  703. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +15 -0
  704. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +24 -0
  705. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +23 -0
  706. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +17 -0
  707. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +53 -0
  708. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +15 -0
  709. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +16 -0
  710. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +15 -0
  711. package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +20 -0
  712. package/lib/utils/suggester-workers/commons-tokenizer/filters/stop-words.js +9 -0
  713. package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +14 -0
  714. package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +23 -0
  715. package/lib/utils/suggester-workers/commons-tokenizer/index.js +69 -0
  716. package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +18 -0
  717. package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +12 -0
  718. package/lib/utils/suggester-workers/create-worker-ts.js +54 -0
  719. package/lib/utils/suggester-workers/create-worker.js +54 -0
  720. package/lib/utils/suggester-workers/find-best-label/find-best-label.js +63 -0
  721. package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +53 -0
  722. package/lib/utils/suggester-workers/find-best-label/index.js +1 -0
  723. package/lib/utils/suggester-workers/find-best-label/tokenize.js +45 -0
  724. package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +25 -0
  725. package/lib/utils/suggester-workers/searching/compute-score.js +36 -0
  726. package/lib/utils/suggester-workers/searching/get-db.js +48 -0
  727. package/lib/utils/suggester-workers/searching/index.js +13 -0
  728. package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +28 -0
  729. package/lib/utils/suggester-workers/searching/order/index.js +25 -0
  730. package/lib/utils/suggester-workers/searching/query-parser/index.js +20 -0
  731. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +12 -0
  732. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +27 -0
  733. package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +35 -0
  734. package/lib/utils/suggester-workers/searching/resolve-query-parser.js +57 -0
  735. package/lib/utils/suggester-workers/searching/search-in-index.js +22 -0
  736. package/lib/utils/suggester-workers/searching/searching.js +141 -0
  737. package/lib/utils/suggester-workers/searching/searching.worker.js +20 -0
  738. package/lib/utils/to-number.js +18 -0
  739. package/lib/utils/vtl/dataset-builder.js +27 -0
  740. package/lib/utils/vtl/index.js +13 -0
  741. package/package.json +164 -142
  742. package/lib/index.js.map +0 -1
  743. package/src/components/breadcrumb/breadcrumb.scss +0 -20
  744. package/src/components/breadcrumb/component.js +0 -29
  745. package/src/components/breadcrumb/index.js +0 -1
  746. package/src/components/button/button.scss +0 -24
  747. package/src/components/button/component.js +0 -25
  748. package/src/components/button/index.js +0 -1
  749. package/src/components/checkbox/boolean.js +0 -152
  750. package/src/components/checkbox/checkbox.scss +0 -71
  751. package/src/components/checkbox/group.js +0 -187
  752. package/src/components/checkbox/index.js +0 -3
  753. package/src/components/checkbox/one.js +0 -10
  754. package/src/components/components.js +0 -17
  755. package/src/components/datepicker/component.js +0 -10
  756. package/src/components/datepicker/datepicker.scss +0 -1
  757. package/src/components/datepicker/index.js +0 -1
  758. package/src/components/declarations/component.js +0 -38
  759. package/src/components/declarations/declarations.scss +0 -38
  760. package/src/components/declarations/index.js +0 -1
  761. package/src/components/declarations/wrappers/index.js +0 -3
  762. package/src/components/declarations/wrappers/input-declarations-wrapper.js +0 -229
  763. package/src/components/declarations/wrappers/list-declarations-wrapper.js +0 -203
  764. package/src/components/declarations/wrappers/simple-declarations-wrapper.js +0 -54
  765. package/src/components/dropdown/commons/actions.js +0 -56
  766. package/src/components/dropdown/commons/children-to-option.js +0 -9
  767. package/src/components/dropdown/commons/cleaner-callbacks.js +0 -58
  768. package/src/components/dropdown/commons/components/closed.icon.js +0 -24
  769. package/src/components/dropdown/commons/components/dropdown-container.js +0 -29
  770. package/src/components/dropdown/commons/components/dropdown-field.js +0 -46
  771. package/src/components/dropdown/commons/components/dropdown.js +0 -183
  772. package/src/components/dropdown/commons/components/label.js +0 -28
  773. package/src/components/dropdown/commons/components/opened.icon.js +0 -24
  774. package/src/components/dropdown/commons/components/panel.js +0 -78
  775. package/src/components/dropdown/commons/event-callbacks/index.js +0 -5
  776. package/src/components/dropdown/commons/event-callbacks/on-keydown-callback.js +0 -29
  777. package/src/components/dropdown/commons/event-callbacks/on-mousedown-callback.js +0 -11
  778. package/src/components/dropdown/commons/reducer.js +0 -149
  779. package/src/components/dropdown/commons/tools/index.js +0 -17
  780. package/src/components/dropdown/component.js +0 -125
  781. package/src/components/dropdown/dropdown-edit/cross.icon.js +0 -20
  782. package/src/components/dropdown/dropdown-edit/dropdown-edit.js +0 -190
  783. package/src/components/dropdown/dropdown-edit/icone.js +0 -33
  784. package/src/components/dropdown/dropdown-edit/index.js +0 -11
  785. package/src/components/dropdown/dropdown-edit/option.js +0 -62
  786. package/src/components/dropdown/dropdown-edit/prefix-tools.js +0 -51
  787. package/src/components/dropdown/dropdown-simple/dropdown.js +0 -155
  788. package/src/components/dropdown/dropdown-simple/index.js +0 -20
  789. package/src/components/dropdown/dropdown-simple/option.js +0 -15
  790. package/src/components/dropdown/dropdown.scss +0 -175
  791. package/src/components/dropdown/index.js +0 -1
  792. package/src/components/filter-description/component.js +0 -41
  793. package/src/components/filter-description/index.js +0 -1
  794. package/src/components/icon/assets/checkbox-checked.js +0 -16
  795. package/src/components/icon/assets/checkbox-unchecked.js +0 -16
  796. package/src/components/icon/assets/index.js +0 -4
  797. package/src/components/icon/assets/radio-checked.js +0 -16
  798. package/src/components/icon/assets/radio-unchecked.js +0 -16
  799. package/src/components/icon/component.js +0 -33
  800. package/src/components/icon/icon.scss +0 -13
  801. package/src/components/icon/index.js +0 -1
  802. package/src/components/index.js +0 -4
  803. package/src/components/index.scss +0 -141
  804. package/src/components/input/index.js +0 -2
  805. package/src/components/input/input-number.js +0 -44
  806. package/src/components/input/input.js +0 -10
  807. package/src/components/input/input.scss +0 -35
  808. package/src/components/loop/component.js +0 -105
  809. package/src/components/loop/index.js +0 -1
  810. package/src/components/loop/loop.scss +0 -11
  811. package/src/components/loop/paginated-component.js +0 -205
  812. package/src/components/loop/wrapper.js +0 -15
  813. package/src/components/loop-constructor/block/block.scss +0 -8
  814. package/src/components/loop-constructor/block/component.js +0 -8
  815. package/src/components/loop-constructor/block/index.js +0 -1
  816. package/src/components/loop-constructor/index.js +0 -1
  817. package/src/components/loop-constructor/roster/component.js +0 -7
  818. package/src/components/loop-constructor/roster/index.js +0 -1
  819. package/src/components/loop-constructor/wrapper/body-component.js +0 -118
  820. package/src/components/loop-constructor/wrapper/build-components.js +0 -33
  821. package/src/components/loop-constructor/wrapper/component.js +0 -154
  822. package/src/components/loop-constructor/wrapper/index.js +0 -1
  823. package/src/components/progress-bar/component.js +0 -28
  824. package/src/components/progress-bar/index.js +0 -1
  825. package/src/components/progress-bar/progress-bar.scss +0 -52
  826. package/src/components/radio/component.js +0 -8
  827. package/src/components/radio/index.js +0 -1
  828. package/src/components/radio/radio.scss +0 -57
  829. package/src/components/sequence/component.js +0 -41
  830. package/src/components/sequence/index.js +0 -1
  831. package/src/components/sequence/sequence.scss +0 -8
  832. package/src/components/subsequence/component.js +0 -47
  833. package/src/components/subsequence/index.js +0 -1
  834. package/src/components/suggester/component.js +0 -103
  835. package/src/components/suggester/index.js +0 -1
  836. package/src/components/table/index.js +0 -1
  837. package/src/components/table/table.js +0 -162
  838. package/src/components/table/table.scss +0 -24
  839. package/src/components/textarea/component.js +0 -10
  840. package/src/components/textarea/index.js +0 -1
  841. package/src/components/textarea/textarea.scss +0 -6
  842. package/src/components/tooltip/img/index.js +0 -4
  843. package/src/components/tooltip/index.js +0 -1
  844. package/src/components/tooltip/response.js +0 -52
  845. package/src/components/tooltip/tooltip.scss +0 -27
  846. package/src/constants/component-types.js +0 -1
  847. package/src/constants/declarations.js +0 -14
  848. package/src/constants/index.js +0 -4
  849. package/src/constants/supported-preferences.js +0 -10
  850. package/src/constants/value-types.js +0 -5
  851. package/src/constants/variable-types.js +0 -4
  852. package/src/stories/breadcrumb/README.md +0 -14
  853. package/src/stories/breadcrumb/breadcrumb.stories.js +0 -19
  854. package/src/stories/button/README.md +0 -14
  855. package/src/stories/button/button.stories.js +0 -27
  856. package/src/stories/checkbox-boolean/README.md +0 -27
  857. package/src/stories/checkbox-boolean/checkbox-boolean.stories.js +0 -30
  858. package/src/stories/checkbox-boolean/data.json +0 -48
  859. package/src/stories/checkbox-group/README.md +0 -29
  860. package/src/stories/checkbox-group/checkbox-group.stories.js +0 -35
  861. package/src/stories/checkbox-group/data-vtl.json +0 -89
  862. package/src/stories/checkbox-group/data.json +0 -89
  863. package/src/stories/checkbox-one/README.md +0 -31
  864. package/src/stories/checkbox-one/checkbox-one.stories.js +0 -32
  865. package/src/stories/checkbox-one/data-vtl.json +0 -33
  866. package/src/stories/checkbox-one/data.json +0 -33
  867. package/src/stories/datepicker/README.md +0 -31
  868. package/src/stories/datepicker/data.json +0 -28
  869. package/src/stories/datepicker/datepicker.stories.js +0 -36
  870. package/src/stories/declarations/README.md +0 -19
  871. package/src/stories/declarations/declarations.stories.js +0 -112
  872. package/src/stories/dropdown/README.md +0 -44
  873. package/src/stories/dropdown/data-naf.json +0 -6963
  874. package/src/stories/dropdown/data-props.json +0 -81
  875. package/src/stories/dropdown/data.json +0 -78
  876. package/src/stories/dropdown/dropdown.stories.js +0 -65
  877. package/src/stories/filter-description/README.md +0 -15
  878. package/src/stories/filter-description/filter-description.stories.js +0 -53
  879. package/src/stories/input/README.md +0 -33
  880. package/src/stories/input/data.json +0 -28
  881. package/src/stories/input/input.stories.js +0 -44
  882. package/src/stories/input-number/README.md +0 -37
  883. package/src/stories/input-number/data.json +0 -30
  884. package/src/stories/input-number/input-number.stories.js +0 -53
  885. package/src/stories/loop/README.md +0 -25
  886. package/src/stories/loop/loop.stories.js +0 -80
  887. package/src/stories/loop/with-loop/data-loop-deeper.json +0 -298
  888. package/src/stories/loop/with-loop/data-loop.json +0 -211
  889. package/src/stories/loop/with-loop/data-vqs.json +0 -1384
  890. package/src/stories/loop/with-loop/index.js +0 -3
  891. package/src/stories/loop/with-roster/data-loop-deeper.json +0 -298
  892. package/src/stories/loop/with-roster/data-loop.json +0 -213
  893. package/src/stories/loop/with-roster/data-vqs.json +0 -1383
  894. package/src/stories/loop/with-roster/index.js +0 -3
  895. package/src/stories/loop-constructor/README.md +0 -27
  896. package/src/stories/loop-constructor/data-input.json +0 -64
  897. package/src/stories/loop-constructor/data-loop.json +0 -66
  898. package/src/stories/loop-constructor/data-roster.json +0 -68
  899. package/src/stories/loop-constructor/loop-constructor.stories.js +0 -59
  900. package/src/stories/pagination/deeper-loop.json +0 -327
  901. package/src/stories/pagination/pagination.stories.js +0 -57
  902. package/src/stories/pagination/simple-loop.json +0 -277
  903. package/src/stories/pagination/simpsons-question.json +0 -4262
  904. package/src/stories/pagination/simpsons-sequence.json +0 -4362
  905. package/src/stories/progress-bar/README.md +0 -13
  906. package/src/stories/progress-bar/progress-bar.stories.js +0 -24
  907. package/src/stories/questionnaire/fat.json +0 -6558
  908. package/src/stories/questionnaire/questionnaire.stories.js +0 -25
  909. package/src/stories/radio/README.md +0 -31
  910. package/src/stories/radio/data-vtl.json +0 -32
  911. package/src/stories/radio/data.json +0 -32
  912. package/src/stories/radio/radio.stories.js +0 -35
  913. package/src/stories/sequence/README.md +0 -18
  914. package/src/stories/sequence/sequence.stories.js +0 -28
  915. package/src/stories/subsequence/README.md +0 -18
  916. package/src/stories/subsequence/subsequence.stories.js +0 -28
  917. package/src/stories/suggester/README.md +0 -29
  918. package/src/stories/suggester/data-vtl.json +0 -28
  919. package/src/stories/suggester/data.json +0 -28
  920. package/src/stories/suggester/suggester.stories.js +0 -38
  921. package/src/stories/table/README.md +0 -29
  922. package/src/stories/table/data-default.json +0 -19
  923. package/src/stories/table/data-one-axis-one-measure.json +0 -124
  924. package/src/stories/table/data-one-axis-two-measures.json +0 -193
  925. package/src/stories/table/data-one-hierarchical-axis.json +0 -204
  926. package/src/stories/table/data-roster.json +0 -471
  927. package/src/stories/table/data-two-axis-one-measure.json +0 -492
  928. package/src/stories/table/table.stories.js +0 -77
  929. package/src/stories/textarea/README.md +0 -33
  930. package/src/stories/textarea/data-forced.json +0 -28
  931. package/src/stories/textarea/data.json +0 -28
  932. package/src/stories/textarea/textarea.stories.js +0 -67
  933. package/src/stories/tooltip-response/README.md +0 -14
  934. package/src/stories/tooltip-response/md-link.json +0 -31
  935. package/src/stories/tooltip-response/md-tooltip.json +0 -31
  936. package/src/stories/tooltip-response/tooltip.stories.js +0 -83
  937. package/src/stories/utils/custom-lunatic.scss +0 -23
  938. package/src/stories/utils/img/arrow.png +0 -0
  939. package/src/stories/utils/img/check_box.svg +0 -1
  940. package/src/stories/utils/img/check_box_outline.svg +0 -1
  941. package/src/stories/utils/img/lunatic-logo.png +0 -0
  942. package/src/stories/utils/img/menu-down.svg +0 -1
  943. package/src/stories/utils/img/menu-up.svg +0 -1
  944. package/src/stories/utils/img/radio_button_checked.svg +0 -1
  945. package/src/stories/utils/img/radio_button_unchecked.svg +0 -1
  946. package/src/stories/utils/options.js +0 -25
  947. package/src/stories/utils/orchestrator.js +0 -83
  948. package/src/tests/components/breadcrumb.spec.js +0 -13
  949. package/src/tests/components/button.spec.js +0 -11
  950. package/src/tests/components/checkbox-boolean.spec.js +0 -45
  951. package/src/tests/components/checkbox-group.spec.js +0 -53
  952. package/src/tests/components/checkbox-one.spec.js +0 -32
  953. package/src/tests/components/datepicker.spec.js +0 -22
  954. package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +0 -67
  955. package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +0 -52
  956. package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +0 -21
  957. package/src/tests/components/declarations.spec.js +0 -46
  958. package/src/tests/components/input-number.spec.js +0 -194
  959. package/src/tests/components/input.spec.js +0 -18
  960. package/src/tests/components/progress-bar.spec.js +0 -15
  961. package/src/tests/components/radio.spec.js +0 -27
  962. package/src/tests/components/sequence.spec.js +0 -9
  963. package/src/tests/components/subsequence.spec.js +0 -9
  964. package/src/tests/components/table.spec.js +0 -11
  965. package/src/tests/components/textarea.spec.js +0 -18
  966. package/src/tests/components/tooltip.spec.js +0 -25
  967. package/src/tests/setup/setupTests.js +0 -4
  968. package/src/tests/utils/lib/alphabet.spec.js +0 -36
  969. package/src/tests/utils/lib/checkbox/group.spec.js +0 -72
  970. package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
  971. package/src/tests/utils/lib/items-positioning.spec.js +0 -17
  972. package/src/tests/utils/lib/label-position.spec.js +0 -22
  973. package/src/tests/utils/lib/loops/bindings.spec.js +0 -60
  974. package/src/tests/utils/lib/loops/shared.spec.js +0 -78
  975. package/src/tests/utils/lib/pagination/shared.spec.js +0 -42
  976. package/src/tests/utils/lib/responses.spec.js +0 -64
  977. package/src/tests/utils/lib/style.spec.js +0 -26
  978. package/src/tests/utils/lib/table/roster.spec.js +0 -25
  979. package/src/tests/utils/lib/tooltip/build-response.spec.js +0 -95
  980. package/src/tests/utils/lib/tooltip/content.spec.js +0 -109
  981. package/src/tests/utils/to-expose/handler/handler.spec.js +0 -86
  982. package/src/tests/utils/to-expose/handler/questionnaire.json +0 -154
  983. package/src/tests/utils/to-expose/handler/results/index.js +0 -6
  984. package/src/tests/utils/to-expose/handler/results/res-double.json +0 -157
  985. package/src/tests/utils/to-expose/handler/results/res-input-collected.json +0 -154
  986. package/src/tests/utils/to-expose/handler/results/res-input-edited.json +0 -157
  987. package/src/tests/utils/to-expose/handler/results/res-loop.json +0 -157
  988. package/src/tests/utils/to-expose/handler/results/res-matrix.json +0 -157
  989. package/src/tests/utils/to-expose/handler/results/res-responses.json +0 -157
  990. package/src/tests/utils/to-expose/init-questionnaire/data.json +0 -12
  991. package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +0 -19
  992. package/src/tests/utils/to-expose/init-questionnaire/questionnaire.json +0 -129
  993. package/src/tests/utils/to-expose/init-questionnaire/result.json +0 -162
  994. package/src/tests/utils/to-expose/interpret/interpret.spec.js +0 -66
  995. package/src/tests/utils/to-expose/state/questionnaire.json +0 -61
  996. package/src/tests/utils/to-expose/state/results.js +0 -78
  997. package/src/tests/utils/to-expose/state/state.spec.js +0 -59
  998. package/src/utils/lib/alphabet.js +0 -1
  999. package/src/utils/lib/checkbox/group.js +0 -21
  1000. package/src/utils/lib/checkbox/index.js +0 -1
  1001. package/src/utils/lib/decorator/index.js +0 -1
  1002. package/src/utils/lib/decorator/title-decorator.js +0 -16
  1003. package/src/utils/lib/index.js +0 -13
  1004. package/src/utils/lib/label-position.js +0 -12
  1005. package/src/utils/lib/loops/bindings.js +0 -53
  1006. package/src/utils/lib/loops/build-components.js +0 -33
  1007. package/src/utils/lib/loops/index.js +0 -3
  1008. package/src/utils/lib/loops/shared.js +0 -43
  1009. package/src/utils/lib/memo-check.js +0 -24
  1010. package/src/utils/lib/options-positioning.js +0 -9
  1011. package/src/utils/lib/pagination/flow.js +0 -2
  1012. package/src/utils/lib/pagination/index.js +0 -2
  1013. package/src/utils/lib/pagination/navigation/index.js +0 -1
  1014. package/src/utils/lib/pagination/navigation/shared.js +0 -107
  1015. package/src/utils/lib/prop-types/declarations.js +0 -22
  1016. package/src/utils/lib/prop-types/index.js +0 -5
  1017. package/src/utils/lib/prop-types/lines.js +0 -6
  1018. package/src/utils/lib/prop-types/options.js +0 -8
  1019. package/src/utils/lib/prop-types/response.js +0 -6
  1020. package/src/utils/lib/prop-types/value-type.js +0 -9
  1021. package/src/utils/lib/responses.js +0 -9
  1022. package/src/utils/lib/style.js +0 -10
  1023. package/src/utils/lib/table/index.js +0 -1
  1024. package/src/utils/lib/table/roster.js +0 -23
  1025. package/src/utils/lib/tooltip/build-response.js +0 -41
  1026. package/src/utils/lib/tooltip/content.js +0 -55
  1027. package/src/utils/lib/tooltip/index.js +0 -6
  1028. package/src/utils/to-expose/handler.js +0 -99
  1029. package/src/utils/to-expose/hook.js +0 -153
  1030. package/src/utils/to-expose/index.js +0 -11
  1031. package/src/utils/to-expose/init-questionnaire.js +0 -116
  1032. package/src/utils/to-expose/interpret/index.js +0 -1
  1033. package/src/utils/to-expose/interpret/main.js +0 -36
  1034. package/src/utils/to-expose/interpret/md.js +0 -42
  1035. package/src/utils/to-expose/interpret/vtl.js +0 -43
  1036. package/src/utils/to-expose/state.js +0 -58
  1037. /package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/edited.png +0 -0
  1038. /package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/forced.png +0 -0
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _reduceHandleChange["default"];
10
+ }
11
+ });
12
+ var _reduceHandleChange = _interopRequireDefault(require("./reduce-handle-change"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -0,0 +1,72 @@
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 _object = require("../../../utils/object");
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
+ 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."); }
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
15
+ 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; }
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
+ /**
22
+ * Reset variables to null using the cleaning definition in the source.json
23
+ */
24
+ function reduceCleaning(state, action) {
25
+ var response = action.payload.response;
26
+ var executeExpression = state.executeExpression,
27
+ cleaning = state.cleaning,
28
+ updateBindings = state.updateBindings,
29
+ variables = state.variables,
30
+ pager = state.pager;
31
+ var iteration = pager.iteration;
32
+ if (!response || !(response.name in cleaning)) {
33
+ return state;
34
+ }
35
+ var expressions = cleaning[response.name];
36
+ var cleanedVariables = (0, _object.objectMap)(expressions, function (variableName, skipExpression) {
37
+ var skipCleaning = executeExpression((0, _commons.getCompatibleVTLExpression)(skipExpression), {
38
+ iteration: iteration
39
+ });
40
+ if (skipCleaning || !(variableName in variables)) {
41
+ return null;
42
+ }
43
+ var variableRoot = variables[variableName];
44
+ var initialValue = cleanedValue(variables[variableName], iteration);
45
+ updateBindings(variableName.toString(), initialValue);
46
+ return [variableName, _objectSpread(_objectSpread({}, variableRoot), {}, {
47
+ value: initialValue
48
+ })];
49
+ });
50
+ //TODO lastReachedPage cleaning
51
+ return _objectSpread(_objectSpread({}, state), {}, {
52
+ variables: _objectSpread(_objectSpread({}, variables), cleanedVariables)
53
+ });
54
+ }
55
+ function cleanedValue(variable, iteration) {
56
+ var _initialValue$iterati;
57
+ var initialValue = null;
58
+ if (variable.variable && 'values' in variable.variable) {
59
+ var _variable$variable$va;
60
+ initialValue = (_variable$variable$va = variable.variable.values.COLLECTED) !== null && _variable$variable$va !== void 0 ? _variable$variable$va : null;
61
+ }
62
+ if (!iteration || !Array.isArray(variable.value)) {
63
+ return initialValue;
64
+ }
65
+
66
+ // Within an iteration we only want to clean the value for this specific iteration
67
+ var newValue = _toConsumableArray(variable.value);
68
+ newValue[iteration] = Array.isArray(initialValue) ? (_initialValue$iterati = initialValue[iteration]) !== null && _initialValue$iterati !== void 0 ? _initialValue$iterati : null : null;
69
+ return newValue;
70
+ }
71
+ var _default = reduceCleaning;
72
+ exports["default"] = _default;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _vitest = require("vitest");
4
+ var _lunatic = require("../../../../tests/utils/lunatic");
5
+ var _sourceCleaningLoop = _interopRequireDefault(require("./__mocks__/source-cleaning-loop.json"));
6
+ var _reduceCleaning = _interopRequireDefault(require("./reduce-cleaning"));
7
+ var _actions = require("../../actions");
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ (0, _vitest.describe)('reduceCleaning', function () {
10
+ (0, _vitest.it)('should clean variable', function () {
11
+ var state = (0, _lunatic.generateState)(_sourceCleaningLoop["default"], {
12
+ PRENOMREP: ['John', 'Jane'],
13
+ VITICI: ['1', null],
14
+ NBF: [1, 2]
15
+ });
16
+ var newState = (0, _reduceCleaning["default"])(state, {
17
+ type: _actions.ActionKind.HANDLE_CHANGE,
18
+ payload: {
19
+ response: {
20
+ name: 'PRENOMREP'
21
+ },
22
+ value: ['Jane']
23
+ }
24
+ });
25
+ (0, _vitest.expect)(newState.variables['NBF'].value).toEqual([null]);
26
+ });
27
+ (0, _vitest.it)('should clean within a loop', function () {
28
+ var state = (0, _lunatic.generateState)(_sourceCleaningLoop["default"], {
29
+ PRENOMREP: ['John', 'Jane'],
30
+ VITICI: ['1', null],
31
+ NBF: [1, 2]
32
+ }, {
33
+ initialPage: '2.2#2'
34
+ });
35
+ var newState = (0, _reduceCleaning["default"])(state, {
36
+ type: _actions.ActionKind.HANDLE_CHANGE,
37
+ payload: {
38
+ response: {
39
+ name: 'VITICI'
40
+ },
41
+ value: '1'
42
+ }
43
+ });
44
+ (0, _vitest.expect)(newState.variables['NBF'].value).toEqual([1, null]);
45
+ });
46
+ });
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _toNumber2 = require("../../../utils/to-number");
8
+ var _compose = _interopRequireDefault(require("../../commons/compose"));
9
+ var _reduceCleaning = _interopRequireDefault(require("./reduce-cleaning"));
10
+ var _reduceLinksVariable = _interopRequireDefault(require("./reduce-links-variable"));
11
+ var _reduceMissing = _interopRequireDefault(require("./reduce-missing"));
12
+ var _reduceResizing = _interopRequireDefault(require("./reduce-resizing"));
13
+ var _reduceVariablesArray = _interopRequireDefault(require("./reduce-variables-array"));
14
+ var _reduceVariablesSimple = _interopRequireDefault(require("./reduce-variables-simple"));
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
+ 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); }
17
+ 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; }
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+ 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; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
+ 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); }
22
+ function isOnSubPage(pager) {
23
+ var subPage = pager.subPage;
24
+ return subPage !== undefined;
25
+ }
26
+
27
+ /**
28
+ * Met à jour les variables collectés
29
+ */
30
+ function updateVariables(state, action) {
31
+ var payload = action.payload;
32
+ var response = payload.response,
33
+ value = payload.value,
34
+ _payload$args = payload.args,
35
+ args = _payload$args === void 0 ? {} : _payload$args;
36
+ var name = response.name;
37
+ var loop = args.loop,
38
+ index = args.index,
39
+ length = args.length,
40
+ linksIterations = args.linksIterations,
41
+ symLinks = args.symLinks,
42
+ paginatedLoop = args.paginatedLoop,
43
+ shallowIteration = args.shallowIteration,
44
+ lengths = args.lengths;
45
+ var pager = state.pager,
46
+ variables = state.variables;
47
+ if (linksIterations !== undefined) {
48
+ var variablesNext = (0, _reduceLinksVariable["default"])(variables, {
49
+ name: name,
50
+ value: typeof value === 'string' ? value : '',
51
+ linksIterations: linksIterations,
52
+ symLinks: symLinks,
53
+ lengths: lengths
54
+ });
55
+ return _objectSpread(_objectSpread({}, state), {}, {
56
+ variables: variablesNext
57
+ });
58
+ } else if (loop && paginatedLoop && index && length) {
59
+ var _variablesNext = (0, _reduceVariablesArray["default"])(variables, {
60
+ name: name,
61
+ value: value,
62
+ index: index,
63
+ length: length
64
+ });
65
+ return _objectSpread(_objectSpread({}, state), {}, {
66
+ variables: _variablesNext
67
+ });
68
+ } else if (isOnSubPage(pager)) {
69
+ var _variablesNext2 = (0, _reduceVariablesArray["default"])(variables, {
70
+ name: name,
71
+ value: value,
72
+ index: pager.iteration,
73
+ length: pager.nbIterations
74
+ });
75
+ return _objectSpread(_objectSpread({}, state), {}, {
76
+ variables: _variablesNext2
77
+ });
78
+ } else {
79
+ var _toNumber;
80
+ var _variablesNext3 = (0, _reduceVariablesSimple["default"])(variables, {
81
+ name: name,
82
+ value: value
83
+ });
84
+ if (loop) return _objectSpread(_objectSpread({}, state), {}, {
85
+ variables: _variablesNext3,
86
+ pager: _objectSpread(_objectSpread({}, pager), {}, {
87
+ shallowIteration: (_toNumber = (0, _toNumber2.toNumber)(shallowIteration)) !== null && _toNumber !== void 0 ? _toNumber : undefined
88
+ })
89
+ });
90
+ return _objectSpread(_objectSpread({}, state), {}, {
91
+ variables: _variablesNext3
92
+ });
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Met à jour les bindings (maps des valeurs)
98
+ */
99
+ function updateBindings(state, action) {
100
+ var payload = action.payload;
101
+ var response = payload.response;
102
+ var name = response.name;
103
+ var ub = state.updateBindings;
104
+ var variables = state.variables;
105
+ var variable = variables[name];
106
+ var value = variable.value;
107
+ ub(name, value);
108
+ return state;
109
+ }
110
+ var reducers = (0, _compose["default"])(updateVariables, updateBindings, _reduceResizing["default"], _reduceMissing["default"], _reduceCleaning["default"]);
111
+ function reduceHandleChange(state, action) {
112
+ return reducers(state, action);
113
+ }
114
+ var _default = reduceHandleChange;
115
+ exports["default"] = _default;
@@ -0,0 +1,89 @@
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
+ 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."); }
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 _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; }
22
+ 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; } }
23
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
+ function reduceOne(variables, _ref) {
25
+ var name = _ref.name,
26
+ value = _ref.value,
27
+ linksIterations = _ref.linksIterations,
28
+ lengths = _ref.lengths;
29
+ if (name in variables && linksIterations && lengths) {
30
+ var variable = variables[name];
31
+ var v = variable.value;
32
+ var _linksIterations = _slicedToArray(linksIterations, 2),
33
+ x = _linksIterations[0],
34
+ y = _linksIterations[1];
35
+ var _lengths = _slicedToArray(lengths, 2),
36
+ lx = _lengths[0],
37
+ ly = _lengths[1];
38
+ if (Array.isArray(v)) {
39
+ var next = (0, _commons.resizeArrayVariable)(_toConsumableArray(v), lx, []);
40
+ next[x] = (0, _commons.resizeArrayVariable)(_toConsumableArray(next[x]), ly, null);
41
+ next[x][y] = value;
42
+ return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
43
+ value: next
44
+ })));
45
+ }
46
+ }
47
+ return variables;
48
+ }
49
+
50
+ /**
51
+ * Update the link variable in pair wise situation
52
+ *
53
+ * If person1 is "parent" of person2 we have to update person2 as a "child" of person1
54
+ */
55
+ function reduceLinksVariable(variables, _ref2) {
56
+ var name = _ref2.name,
57
+ value = _ref2.value,
58
+ linksIterations = _ref2.linksIterations,
59
+ symLinks = _ref2.symLinks,
60
+ lengths = _ref2.lengths;
61
+ if (symLinks && name in symLinks && linksIterations) {
62
+ var symValue = symLinks[name][value];
63
+ var _linksIterations2 = _slicedToArray(linksIterations, 2),
64
+ x = _linksIterations2[0],
65
+ y = _linksIterations2[1];
66
+ var symIteration = [y, x];
67
+ if (symValue) {
68
+ return reduceOne(reduceOne(variables, {
69
+ name: name,
70
+ value: value,
71
+ linksIterations: linksIterations,
72
+ lengths: lengths
73
+ }), {
74
+ name: name,
75
+ value: symValue,
76
+ linksIterations: symIteration,
77
+ lengths: lengths
78
+ });
79
+ }
80
+ }
81
+ return reduceOne(variables, {
82
+ name: name,
83
+ value: value,
84
+ linksIterations: linksIterations,
85
+ lengths: lengths
86
+ });
87
+ }
88
+ var _default = reduceLinksVariable;
89
+ exports["default"] = _default;
@@ -0,0 +1,88 @@
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 _actions = require("../../actions");
10
+ var _excluded = ["value"];
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ 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; }
13
+ 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; }
14
+ 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; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
+ 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); }
17
+ 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; }
18
+ 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; }
19
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
20
+ 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."); }
21
+ 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); }
22
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
23
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
24
+ 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; }
25
+ /**
26
+ * Find the new value for a variable from the state
27
+ *
28
+ * If we are in a loop we only want to null the value corresponding to the iteration
29
+ */
30
+ function buildMissingValue(state, oldValue) {
31
+ var iteration = state.pager.iteration;
32
+ // The question is a root question
33
+ if (iteration === undefined) {
34
+ return null;
35
+ }
36
+
37
+ // We are in an iteration
38
+ // If the value is not an array, do nothing
39
+ if (!Array.isArray(oldValue)) {
40
+ return oldValue;
41
+ }
42
+ // Otherwise, null the value for the iteration
43
+ var newValue = _toConsumableArray(oldValue);
44
+ newValue[iteration] = null;
45
+ return newValue;
46
+ }
47
+
48
+ /**
49
+ * Update value for missing variables
50
+ */
51
+ function reduceMissing(state, action) {
52
+ var name = action.payload.response.name;
53
+ var missingBlock = state.missingBlock;
54
+ if (name in missingBlock) {
55
+ var variables = state.variables,
56
+ updateBindings = state.updateBindings;
57
+ var toClean = missingBlock[name];
58
+ var delta = toClean.reduce(function (acc, variableName) {
59
+ var _variables$variableNa = variables[variableName],
60
+ value = _variables$variableNa.value,
61
+ rest = _objectWithoutProperties(_variables$variableNa, _excluded);
62
+ updateBindings(variableName, null);
63
+ var newValue = buildMissingValue(state, value);
64
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, variableName, _objectSpread(_objectSpread({}, rest), {}, {
65
+ value: newValue
66
+ })));
67
+ }, {});
68
+ var newStateAfterMissing = _objectSpread(_objectSpread({}, state), {}, {
69
+ variables: _objectSpread(_objectSpread({}, variables), delta)
70
+ });
71
+ // If missing clean variable which is also into cleaning case,
72
+ // we have to handle theses cleanings
73
+ // To check: do we have with this trick or triggering handle change action?
74
+ return toClean.reduce(function (acc, v) {
75
+ return (0, _reduceCleaning["default"])(acc, {
76
+ type: _actions.ActionKind.HANDLE_CHANGE,
77
+ payload: _objectSpread(_objectSpread({}, action.payload), {}, {
78
+ response: {
79
+ name: v
80
+ }
81
+ })
82
+ });
83
+ }, newStateAfterMissing);
84
+ }
85
+ return state;
86
+ }
87
+ var _default = reduceMissing;
88
+ exports["default"] = _default;
@@ -0,0 +1,113 @@
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 refillValue(size, precSize, value) {
22
+ if (precSize > size) {
23
+ return new Array(size).fill(null);
24
+ }
25
+ return (0, _commons2.resizeArrayVariable)(value, size, null);
26
+ }
27
+ function reduceResizingVariables(_ref) {
28
+ var size = _ref.size,
29
+ variableArray = _ref.variableArray,
30
+ variables = _ref.variables,
31
+ executeExpression = _ref.executeExpression,
32
+ updateBindings = _ref.updateBindings;
33
+ if (size === undefined) {
34
+ return {};
35
+ }
36
+ var sizeValue = executeExpression((0, _commons.getCompatibleVTLExpression)(size));
37
+ return variableArray.reduce(function (acc, v) {
38
+ if (v in variables) {
39
+ var value = variables[v].value;
40
+ var precSize = Array.isArray(value) ? value.length : 0;
41
+ var newValue = refillValue(sizeValue, precSize, value);
42
+ updateBindings(v, newValue);
43
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, v, _objectSpread(_objectSpread({}, variables[v]), {}, {
44
+ value: newValue
45
+ })));
46
+ }
47
+ return acc;
48
+ }, {});
49
+ }
50
+ function reduceResizingLinksVariables(_ref2) {
51
+ var sizeForLinksVariables = _ref2.sizeForLinksVariables,
52
+ linksVariables = _ref2.linksVariables,
53
+ variables = _ref2.variables,
54
+ executeExpression = _ref2.executeExpression,
55
+ updateBindings = _ref2.updateBindings;
56
+ if (Array.isArray(sizeForLinksVariables) && linksVariables) {
57
+ var _sizeForLinksVariable = sizeForLinksVariables.map(function (s) {
58
+ return executeExpression((0, _commons.getCompatibleVTLExpression)(s));
59
+ }),
60
+ _sizeForLinksVariable2 = _slicedToArray(_sizeForLinksVariable, 2),
61
+ xSize = _sizeForLinksVariable2[0],
62
+ ySize = _sizeForLinksVariable2[1];
63
+ return linksVariables.reduce(function (acc, v) {
64
+ var value = variables[v].value;
65
+ // The value is not an array, skip it
66
+ if (!Array.isArray(value)) {
67
+ return acc;
68
+ }
69
+ var newValue = (0, _commons2.resizeArrayVariable)(value.map(function (i) {
70
+ return (0, _commons2.resizeArrayVariable)(i, ySize, null);
71
+ }), xSize, new Array(ySize).fill(null));
72
+ updateBindings(v, newValue);
73
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, v, _objectSpread(_objectSpread({}, variables[v]), {}, {
74
+ value: newValue
75
+ })));
76
+ }, {});
77
+ }
78
+ return {};
79
+ }
80
+ function reduceResizing(state, action) {
81
+ var name = action.payload.response.name;
82
+ var resizing = state.resizing,
83
+ variables = state.variables,
84
+ updateBindings = state.updateBindings;
85
+ if (name in resizing) {
86
+ var _resizing$name = resizing[name],
87
+ size = _resizing$name.size,
88
+ variableArray = _resizing$name.variables,
89
+ sizeForLinksVariables = _resizing$name.sizeForLinksVariables,
90
+ linksVariables = _resizing$name.linksVariables;
91
+ var executeExpression = state.executeExpression;
92
+ var newLinksVariables = reduceResizingLinksVariables({
93
+ sizeForLinksVariables: sizeForLinksVariables,
94
+ linksVariables: linksVariables,
95
+ variables: variables,
96
+ executeExpression: executeExpression,
97
+ updateBindings: updateBindings
98
+ });
99
+ var newVariables = reduceResizingVariables({
100
+ size: size,
101
+ variableArray: variableArray,
102
+ variables: variables,
103
+ executeExpression: executeExpression,
104
+ updateBindings: updateBindings
105
+ });
106
+ return _objectSpread(_objectSpread({}, state), {}, {
107
+ variables: _objectSpread(_objectSpread(_objectSpread({}, variables), newLinksVariables), newVariables)
108
+ });
109
+ }
110
+ return state;
111
+ }
112
+ var _default = reduceResizing;
113
+ exports["default"] = _default;
@@ -0,0 +1,44 @@
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
+ /**
21
+ * Inject the value at a specific index (and resize the value if necessary)
22
+ */
23
+ function reduceVariablesArray(variables, args) {
24
+ var name = args.name,
25
+ value = args.value,
26
+ index = args.index,
27
+ length = args.length;
28
+ if (name in variables) {
29
+ var variable = variables[name];
30
+ var previousValue = variable.value;
31
+
32
+ // Ensure the value is an array of corresponding size
33
+ var valueNext = _toConsumableArray((0, _commons.resizeArrayVariable)(previousValue, length));
34
+
35
+ // Inject the new value at the corresponding index
36
+ valueNext[index] = value;
37
+ return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
38
+ value: valueNext
39
+ })));
40
+ }
41
+ return variables;
42
+ }
43
+ var _default = reduceVariablesArray;
44
+ exports["default"] = _default;
@@ -0,0 +1,28 @@
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
+ /**
14
+ * Add the value for the variable in the corresponding variable object
15
+ */
16
+ function reduceVariablesSimple(variables, _ref) {
17
+ var name = _ref.name,
18
+ value = _ref.value;
19
+ if (name in variables) {
20
+ var variable = variables[name];
21
+ return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
22
+ value: value
23
+ })));
24
+ }
25
+ return variables;
26
+ }
27
+ var _default = reduceVariablesSimple;
28
+ exports["default"] = _default;