@inseefr/lunatic 0.1.0-hackathon → 0.1.0-v2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/lib/index.js +1433 -835
  2. package/lib/index.js.map +1 -1
  3. package/package.json +11 -8
  4. package/src/components/breadcrumb/component.js +29 -29
  5. package/src/components/button/index.js +1 -1
  6. package/src/components/button/lunatic-button.js +32 -0
  7. package/src/components/checkbox/checkbox-boolean/index.js +1 -0
  8. package/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +44 -0
  9. package/src/components/checkbox/checkbox-group/checkbox-group.js +78 -0
  10. package/src/components/checkbox/checkbox-group/checkbox-option.js +46 -0
  11. package/src/components/checkbox/checkbox-group/index.js +1 -0
  12. package/src/components/checkbox/checkbox-group/lunatic-checkbox-group.js +32 -0
  13. package/src/components/checkbox/checkbox-one/index.js +1 -0
  14. package/src/components/checkbox/checkbox-one/lunatic-checkbox-one.js +7 -0
  15. package/src/components/checkbox/checkbox.scss +1 -73
  16. package/src/components/checkbox/commons/checkbox-option.js +49 -0
  17. package/src/components/checkbox/commons/index.js +1 -0
  18. package/src/components/checkbox/index.js +3 -3
  19. package/src/components/commons/components/field-container/field-container.js +28 -0
  20. package/src/components/commons/components/field-container/field-container.scss +0 -0
  21. package/src/components/commons/components/field-container/index.js +1 -0
  22. package/src/components/commons/components/fieldset.js +12 -0
  23. package/src/components/commons/components/input-container.js +30 -0
  24. package/src/components/commons/components/label.js +14 -0
  25. package/src/components/commons/components/lunatic-field.js +35 -0
  26. package/src/components/commons/create-customizable-field.js +13 -0
  27. package/src/components/commons/index.js +9 -0
  28. package/src/components/commons/use-on-handle-change.js +16 -0
  29. package/src/components/commons/use-options-keydown.js +22 -0
  30. package/src/components/commons/use-previous.js +11 -0
  31. package/src/components/component-wrapper/controls/component.js +70 -0
  32. package/src/components/component-wrapper/controls/controls.scss +6 -0
  33. package/src/components/component-wrapper/controls/index.js +1 -0
  34. package/src/components/component-wrapper/controls/validators/datepicker.js +33 -0
  35. package/src/components/component-wrapper/controls/validators/index.js +16 -0
  36. package/src/components/component-wrapper/controls/validators/input-number.js +23 -0
  37. package/src/components/{missing-wrapper → component-wrapper}/index.js +1 -1
  38. package/src/components/{missing-wrapper → component-wrapper/missing}/component.js +72 -12
  39. package/src/components/component-wrapper/missing/index.js +1 -0
  40. package/src/components/{missing-wrapper → component-wrapper/missing}/missing.scss +0 -0
  41. package/src/components/component-wrapper/wrapper.js +23 -0
  42. package/src/components/components.js +22 -18
  43. package/src/components/datepicker/datepicker.js +25 -0
  44. package/src/components/datepicker/index.js +1 -1
  45. package/src/components/datepicker/lunatic-datepicker.js +50 -0
  46. package/src/components/declarations/declaration.js +11 -0
  47. package/src/components/declarations/declarations-after-text.js +8 -0
  48. package/src/components/declarations/declarations-before-text.js +8 -0
  49. package/src/components/declarations/declarations-detachable.js +8 -0
  50. package/src/components/declarations/declarations.js +35 -0
  51. package/src/components/declarations/index.js +4 -1
  52. package/src/components/declarations/wrappers/input-declarations-wrapper.js +40 -12
  53. package/src/components/declarations/wrappers/list-declarations-wrapper.js +235 -232
  54. package/src/components/dropdown/commons/actions.js +40 -31
  55. package/src/components/dropdown/commons/components/panel.js +78 -78
  56. package/src/components/dropdown/commons/reducer.js +152 -149
  57. package/src/components/dropdown/component.js +121 -115
  58. package/src/components/dropdown/dropdown-edit/dropdown-edit.js +6 -0
  59. package/src/components/dropdown/dropdown-simple/dropdown.js +8 -1
  60. package/src/components/filter-description/component.js +48 -42
  61. package/src/components/icon/component.js +31 -33
  62. package/src/components/index.scss +5 -3
  63. package/src/components/input/index.js +1 -2
  64. package/src/components/input/input.js +45 -9
  65. package/src/components/input/input.scss +0 -6
  66. package/src/components/input/lunatic-input.js +53 -0
  67. package/src/components/input-number/index.js +1 -0
  68. package/src/components/input-number/input-number.js +38 -0
  69. package/src/components/input-number/input-number.scss +0 -0
  70. package/src/components/input-number/lunatic-input-number.js +50 -0
  71. package/src/components/loop/{component.js → _old/component.js} +1 -0
  72. package/src/components/loop/{loop.scss → _old/loop.scss} +0 -0
  73. package/src/components/loop/{wrapper.js → _old/wrapper.js} +15 -15
  74. package/src/components/loop/block-for-loop/block-for-loop-ochestrator.js +6 -0
  75. package/src/components/loop/block-for-loop/block-for-loop.js +91 -0
  76. package/src/components/loop/block-for-loop/index.js +1 -0
  77. package/src/components/loop/block-for-loop/row.js +52 -0
  78. package/src/components/loop/commons/create-loop-orchestrator.js +36 -0
  79. package/src/components/loop/commons/index.js +2 -0
  80. package/src/components/loop/commons/row-component.js +52 -0
  81. package/src/components/loop/index.js +1 -1
  82. package/src/components/loop/loop.js +78 -0
  83. package/src/components/loop/roster-for-loop/add-row-button.js +12 -0
  84. package/src/components/loop/roster-for-loop/body.js +44 -0
  85. package/src/components/loop/roster-for-loop/header.js +25 -0
  86. package/src/components/loop/roster-for-loop/html-table/table.js +11 -0
  87. package/src/components/loop/roster-for-loop/html-table/tbody.js +11 -0
  88. package/src/components/loop/roster-for-loop/html-table/td.js +14 -0
  89. package/src/components/loop/roster-for-loop/html-table/th.js +11 -0
  90. package/src/components/loop/roster-for-loop/html-table/thead.js +11 -0
  91. package/src/components/loop/roster-for-loop/html-table/tr.js +11 -0
  92. package/src/components/loop/roster-for-loop/index.js +1 -0
  93. package/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +6 -0
  94. package/src/components/loop/roster-for-loop/roster-for-loop.js +90 -0
  95. package/src/components/loop/roster-for-loop/roster-table.js +39 -0
  96. package/src/components/loop/roster-for-loop/roster.scss +42 -0
  97. package/src/components/loop/roster-for-loop/row.js +65 -0
  98. package/src/components/loop-constructor/block/component.js +2 -2
  99. package/src/components/loop-constructor/block/index.js +1 -1
  100. package/src/components/loop-constructor/index.js +1 -1
  101. package/src/components/loop-constructor/roster/component.js +2 -2
  102. package/src/components/loop-constructor/roster/index.js +1 -1
  103. package/src/components/loop-constructor/wrapper/body-component.js +6 -0
  104. package/src/components/loop-constructor/wrapper/build-components.js +33 -33
  105. package/src/components/loop-constructor/wrapper/index.js +1 -1
  106. package/src/components/modal/component.js +42 -0
  107. package/src/components/modal/index.js +1 -0
  108. package/src/components/modal/modal.scss +33 -0
  109. package/src/components/radio/index.js +1 -1
  110. package/src/components/radio/lunatic-radio-group.js +45 -0
  111. package/src/components/radio/radio-group.js +33 -0
  112. package/src/components/radio/radio-option.js +87 -0
  113. package/src/components/radio/radio.scss +52 -52
  114. package/src/components/sequence/index.js +1 -1
  115. package/src/components/sequence/sequence.js +75 -0
  116. package/src/components/subsequence/index.js +1 -1
  117. package/src/components/subsequence/subsequence.js +73 -0
  118. package/src/components/suggester/check-store.js +70 -70
  119. package/src/components/suggester/components/panel/option-container.js +11 -10
  120. package/src/components/suggester/components/panel/panel.js +20 -6
  121. package/src/components/suggester/components/selection/label.js +7 -6
  122. package/src/components/suggester/components/selection/selection.js +36 -11
  123. package/src/components/suggester/components/suggester-content.js +35 -42
  124. package/src/components/suggester/components/suggester.js +45 -26
  125. package/src/components/suggester/{components/create-on-keydown-callback.js → create-on-keydown-callback.js} +28 -28
  126. package/src/components/suggester/find-best-label/find-best-label.js +3 -1
  127. package/src/components/suggester/idb-suggester.js +2 -1
  128. package/src/components/suggester/lunatic-suggester.js +48 -96
  129. package/src/components/suggester/searching/create-searching.js +3 -1
  130. package/src/components/suggester/suggester-wrapper.js +75 -9
  131. package/src/components/switch/index.js +1 -0
  132. package/src/components/switch/lunatic-switch.js +49 -0
  133. package/src/components/switch/switch.js +72 -0
  134. package/src/components/switch/switch.scss +47 -0
  135. package/src/components/table/table.js +164 -158
  136. package/src/components/textarea/component.js +11 -5
  137. package/src/components/tooltip/response.js +58 -52
  138. package/src/stories/checkbox-boolean/data-forced.json +48 -48
  139. package/src/stories/checkbox-group/data-vtl.json +102 -102
  140. package/src/stories/cleaning/cleaning.stories.js +39 -0
  141. package/src/stories/cleaning/simple-loop.json +911 -0
  142. package/src/stories/cleaning/simpsons.json +5839 -0
  143. package/src/stories/datepicker/data.json +45 -43
  144. package/src/stories/declarations/declarations.stories.js +20 -13
  145. package/src/stories/icons/icons.stories.js +24 -16
  146. package/src/stories/loop-constructor/README.md +27 -27
  147. package/src/stories/loop-constructor/data-input-forced.json +64 -64
  148. package/src/stories/loop-constructor/data-input.json +100 -100
  149. package/src/stories/loop-constructor/data-loop-forced.json +66 -66
  150. package/src/stories/loop-constructor/data-loop-static-forced.json +66 -66
  151. package/src/stories/loop-constructor/data-loop-static.json +81 -81
  152. package/src/stories/loop-constructor/data-loop.json +81 -81
  153. package/src/stories/loop-constructor/data-roster-forced.json +68 -68
  154. package/src/stories/loop-constructor/data-roster.json +83 -83
  155. package/src/stories/loop-constructor/loop-constructor.stories.js +180 -180
  156. package/src/stories/questionnaire/logement-queen.json +23234 -0
  157. package/src/stories/questionnaire/logement.json +22068 -26812
  158. package/src/stories/questionnaire/questionnaire.stories.js +86 -29
  159. package/src/stories/questionnaire/update-external/data.json +1 -0
  160. package/src/stories/questionnaire/update-external/questionnaire.json +75 -0
  161. package/src/stories/suggester/bailleurs-sociaux-2021/fetch-bailleurs.js +12 -0
  162. package/src/stories/suggester/bailleurs-sociaux-2021/index.js +1 -0
  163. package/src/stories/suggester/data-auto.json +1 -0
  164. package/src/stories/suggester/data.json +35 -2
  165. package/src/stories/suggester/lunatic-suggester-mui.scss +27 -0
  166. package/src/stories/suggester/suggester-material-ui.js +148 -0
  167. package/src/stories/suggester/suggester-workers.stories.js +48 -1
  168. package/src/stories/suggester/suggester.stories.js +27 -1
  169. package/src/stories/switch/README.md +31 -0
  170. package/src/stories/switch/SwitchMaterialUI.js +35 -0
  171. package/src/stories/switch/data-forced.json +48 -0
  172. package/src/stories/switch/data.json +80 -0
  173. package/src/stories/switch/switch.stories.js +78 -0
  174. package/src/stories/utils/custom-lunatic.scss +28 -23
  175. package/src/stories/utils/orchestrator.js +151 -58
  176. package/src/stories/utils/waiting/index.js +1 -0
  177. package/src/stories/utils/waiting/preloader.svg +1 -0
  178. package/src/stories/utils/waiting/waiting.js +21 -0
  179. package/src/stories/utils/waiting/waiting.scss +21 -0
  180. package/src/tests/sample.spec.js +5 -0
  181. package/src/utils/icons/checkbox-checked.icon.js +25 -0
  182. package/src/utils/icons/checkbox-unchecked.icon.js +25 -0
  183. package/src/utils/icons/radio-checked.icon.js +25 -0
  184. package/src/utils/icons/radio-unchecked.icon.js +25 -0
  185. package/src/utils/lib/controls/index.js +1 -0
  186. package/src/utils/lib/controls/utils.js +146 -0
  187. package/src/utils/lib/index.js +20 -19
  188. package/src/utils/lib/pagination/navigation/shared.js +7 -4
  189. package/src/utils/lib/responses.js +9 -7
  190. package/src/utils/lib/tooltip/build-response.js +53 -41
  191. package/src/utils/store-tools/auto-load.js +2 -1
  192. package/src/utils/store-tools/create/index.js +2 -1
  193. package/src/utils/store-tools/create/update-store-info.js +26 -26
  194. package/src/utils/store-tools/index.js +7 -5
  195. package/src/utils/suggester-workers/append-to-index/create-append-task.js +3 -1
  196. package/src/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +56 -0
  197. package/src/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +56 -0
  198. package/src/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +11 -11
  199. package/src/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +10 -0
  200. package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +17 -0
  201. package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +14 -0
  202. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +12 -0
  203. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +12 -0
  204. package/src/utils/suggester-workers/commons-tokenizer/{filter-double.js → filters/filter-double.js} +0 -0
  205. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +20 -0
  206. package/src/utils/suggester-workers/commons-tokenizer/{filter-length.js → filters/filter-length.js} +0 -0
  207. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +18 -0
  208. package/src/utils/suggester-workers/commons-tokenizer/{filter-stemmer.js → filters/filter-stemmer.js} +2 -2
  209. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +12 -0
  210. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +36 -0
  211. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +12 -0
  212. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +10 -0
  213. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +12 -0
  214. package/src/utils/suggester-workers/commons-tokenizer/filters/index.js +2 -0
  215. package/src/utils/suggester-workers/commons-tokenizer/{stop-words.js → filters/stop-words.js} +0 -0
  216. package/src/utils/suggester-workers/commons-tokenizer/index.js +6 -5
  217. package/src/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +7 -3
  218. package/src/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +1 -1
  219. package/src/utils/suggester-workers/create-worker.js +55 -0
  220. package/src/utils/suggester-workers/find-best-label/tokenize.js +2 -5
  221. package/src/utils/suggester-workers/{query-parser → searching/query-parser}/index.js +0 -0
  222. package/src/utils/suggester-workers/searching/query-parser/query-parser-soft.js +7 -0
  223. package/src/utils/suggester-workers/{query-parser → searching/query-parser}/query-parser-soft.spec.js +0 -0
  224. package/src/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +34 -0
  225. package/src/utils/suggester-workers/searching/resolve-query-parser.js +2 -2
  226. package/src/utils/suggester-workers/searching/searching.js +2 -2
  227. package/src/utils/to-expose/{calculated-variables.js → _old/calculated-variables.js} +0 -0
  228. package/src/utils/to-expose/{handler.js → _old/handler.js} +22 -0
  229. package/src/utils/to-expose/{init-questionnaire.js → _old/init-questionnaire.js} +0 -0
  230. package/src/utils/to-expose/{state.js → _old/state.js} +13 -14
  231. package/src/utils/to-expose/hooks/filter-components.js +106 -106
  232. package/src/utils/to-expose/hooks/index.js +1 -1
  233. package/src/utils/to-expose/hooks/lunatic.js +68 -7
  234. package/src/utils/to-expose/hooks/use-lunatic/actions.js +23 -0
  235. package/src/utils/to-expose/hooks/use-lunatic/commons/check-loops.js +61 -0
  236. package/src/utils/to-expose/hooks/use-lunatic/commons/create-map-pages.js +69 -0
  237. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-condition-filter.js +16 -0
  238. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/create-execute-expression.js +182 -0
  239. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/create-memoizer.js +42 -0
  240. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/create-refresh-calculated.js +50 -0
  241. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/execute-expression.js +60 -0
  242. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/get-expressions-variables.js +22 -0
  243. package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/index.js +1 -0
  244. package/src/utils/to-expose/hooks/use-lunatic/commons/fill-component-expressions.js +113 -0
  245. package/src/utils/to-expose/hooks/use-lunatic/commons/fill-components.js +31 -0
  246. package/src/utils/to-expose/hooks/use-lunatic/commons/get-compatible-vtl-expression.js +14 -0
  247. package/src/utils/to-expose/hooks/use-lunatic/commons/get-component-value/get-component-value.js +161 -0
  248. package/src/utils/to-expose/hooks/use-lunatic/commons/get-component-value/index.js +1 -0
  249. package/src/utils/to-expose/hooks/use-lunatic/commons/get-components-from-state.js +24 -0
  250. package/src/utils/to-expose/hooks/use-lunatic/commons/get-page-tag.js +10 -0
  251. package/src/utils/to-expose/hooks/use-lunatic/commons/index.js +12 -0
  252. package/src/utils/to-expose/hooks/use-lunatic/commons/is-First-last-page.js +8 -0
  253. package/src/utils/to-expose/hooks/use-lunatic/commons/is-paginated-loop.js +6 -0
  254. package/src/utils/to-expose/hooks/use-lunatic/commons/load-suggesters.js +59 -0
  255. package/src/utils/to-expose/hooks/use-lunatic/commons/use-components-from-state.js +20 -0
  256. package/src/utils/to-expose/hooks/use-lunatic/index.js +1 -0
  257. package/src/utils/to-expose/hooks/use-lunatic/initial-state.js +22 -0
  258. package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/index.js +3 -0
  259. package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/is-empty-on-empty-page.js +29 -0
  260. package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/resize-array-variable.js +26 -0
  261. package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/validate-loop-condition-filter.js +20 -0
  262. package/src/utils/to-expose/hooks/use-lunatic/reducer/index.js +1 -0
  263. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-go-next-page.js +129 -0
  264. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-go-previous-page.js +131 -0
  265. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/index.js +1 -0
  266. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +69 -0
  267. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +22 -0
  268. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +13 -0
  269. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-on-init.js +166 -0
  270. package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-on-set-waiting.js +7 -0
  271. package/src/utils/to-expose/hooks/use-lunatic/reducer/reducer.js +26 -0
  272. package/src/utils/to-expose/hooks/use-lunatic/use-lunatic.js +79 -0
  273. package/src/utils/to-expose/index.js +16 -11
  274. package/src/components/button/component.js +0 -53
  275. package/src/components/checkbox/boolean.js +0 -172
  276. package/src/components/checkbox/group.js +0 -231
  277. package/src/components/checkbox/one.js +0 -11
  278. package/src/components/datepicker/component.js +0 -11
  279. package/src/components/input/input-number.js +0 -54
  280. package/src/components/missing-wrapper/wrapper.js +0 -10
  281. package/src/components/radio/component.js +0 -9
  282. package/src/components/sequence/component.js +0 -50
  283. package/src/components/subsequence/component.js +0 -49
  284. package/src/tests/components/breadcrumb.spec.js +0 -13
  285. package/src/tests/components/button.spec.js +0 -11
  286. package/src/tests/components/checkbox-boolean.spec.js +0 -45
  287. package/src/tests/components/checkbox-group.spec.js +0 -53
  288. package/src/tests/components/checkbox-one.spec.js +0 -32
  289. package/src/tests/components/datepicker.spec.js +0 -22
  290. package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +0 -67
  291. package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +0 -52
  292. package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +0 -21
  293. package/src/tests/components/declarations.spec.js +0 -46
  294. package/src/tests/components/input-number.spec.js +0 -194
  295. package/src/tests/components/input.spec.js +0 -18
  296. package/src/tests/components/loops/loop-static.json +0 -66
  297. package/src/tests/components/loops/loop.json +0 -258
  298. package/src/tests/components/loops/loop.spec.js +0 -30
  299. package/src/tests/components/loops/roster-for-loop.spec.js +0 -18
  300. package/src/tests/components/loops/roster-loop.json +0 -71
  301. package/src/tests/components/missing-wrapper.spec.js +0 -33
  302. package/src/tests/components/progress-bar.spec.js +0 -15
  303. package/src/tests/components/radio.spec.js +0 -27
  304. package/src/tests/components/sequence.spec.js +0 -9
  305. package/src/tests/components/subsequence.spec.js +0 -9
  306. package/src/tests/components/table.spec.js +0 -11
  307. package/src/tests/components/textarea.spec.js +0 -18
  308. package/src/tests/components/tooltip.spec.js +0 -25
  309. package/src/tests/setup/setupTests.js +0 -4
  310. package/src/tests/utils/lib/alphabet.spec.js +0 -36
  311. package/src/tests/utils/lib/array.spec.js +0 -22
  312. package/src/tests/utils/lib/checkbox/group.spec.js +0 -72
  313. package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
  314. package/src/tests/utils/lib/input-number.spec.js +0 -18
  315. package/src/tests/utils/lib/items-positioning.spec.js +0 -17
  316. package/src/tests/utils/lib/label-position.spec.js +0 -22
  317. package/src/tests/utils/lib/loops/bindings.spec.js +0 -75
  318. package/src/tests/utils/lib/loops/shared.spec.js +0 -82
  319. package/src/tests/utils/lib/missing/missing.spec.js +0 -74
  320. package/src/tests/utils/lib/missing/mock.js +0 -137
  321. package/src/tests/utils/lib/pagination/shared.spec.js +0 -42
  322. package/src/tests/utils/lib/responses.spec.js +0 -64
  323. package/src/tests/utils/lib/style.spec.js +0 -26
  324. package/src/tests/utils/lib/table/roster.spec.js +0 -25
  325. package/src/tests/utils/lib/tooltip/build-response.spec.js +0 -95
  326. package/src/tests/utils/lib/tooltip/content.spec.js +0 -109
  327. package/src/tests/utils/to-expose/handler/handler.spec.js +0 -94
  328. package/src/tests/utils/to-expose/handler/questionnaire.json +0 -158
  329. package/src/tests/utils/to-expose/handler/results/index.js +0 -6
  330. package/src/tests/utils/to-expose/handler/results/res-double.json +0 -158
  331. package/src/tests/utils/to-expose/handler/results/res-input-collected.json +0 -158
  332. package/src/tests/utils/to-expose/handler/results/res-input-edited.json +0 -158
  333. package/src/tests/utils/to-expose/handler/results/res-loop.json +0 -158
  334. package/src/tests/utils/to-expose/handler/results/res-matrix.json +0 -158
  335. package/src/tests/utils/to-expose/handler/results/res-responses.json +0 -158
  336. package/src/tests/utils/to-expose/hooks/use-lunatic.spec.js +0 -46
  337. package/src/tests/utils/to-expose/init-questionnaire/data.json +0 -12
  338. package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +0 -19
  339. package/src/tests/utils/to-expose/init-questionnaire/questionnaire.json +0 -148
  340. package/src/tests/utils/to-expose/init-questionnaire/result.json +0 -181
  341. package/src/tests/utils/to-expose/interpret/interpret.spec.js +0 -48
  342. package/src/tests/utils/to-expose/state/questionnaire.json +0 -61
  343. package/src/tests/utils/to-expose/state/results.js +0 -78
  344. package/src/tests/utils/to-expose/state/state.spec.js +0 -59
  345. package/src/utils/suggester-workers/commons-tokenizer/create-tokenizer.js +0 -103
  346. package/src/utils/suggester-workers/commons-tokenizer/filter-accents-to-lower.js +0 -9
  347. package/src/utils/suggester-workers/commons-tokenizer/filter-synonyms.js +0 -10
  348. package/src/utils/suggester-workers/query-parser/query-parser-soft.js +0 -7
  349. package/src/utils/suggester-workers/query-parser/query-parser-tokenized.js +0 -31
  350. package/src/utils/suggester-workers/query-parser/query-parser-tokenized.spec.js +0 -32
@@ -1,8 +1,8 @@
1
1
  import { useState, useEffect, useCallback } from 'react';
2
2
  import { mergeQuestionnaireAndData } from '../init-questionnaire';
3
3
  import { getBindings } from '../state';
4
- import { updateQuestionnaire } from '../handler';
5
- import { getPage, FLOW_NEXT, FLOW_PREVIOUS } from '../../lib';
4
+ import { updateQuestionnaire, updateExternals } from '../handler';
5
+ import { getPage, FLOW_NEXT, FLOW_PREVIOUS, getControls } from '../../lib';
6
6
  import { COLLECTED } from '../../../constants';
7
7
  import { useFilterComponents } from './filter-components';
8
8
  import { loadSuggesters } from '../../store-tools/auto-load';
@@ -16,7 +16,8 @@ const useLunatic = (
16
16
  features = ['VTL'],
17
17
  management = false,
18
18
  pagination = false,
19
- initialPage = '1',
19
+ modalForControls = false,
20
+ initialPage = '16',
20
21
  logFunction = null,
21
22
  autoSuggesterLoading = false,
22
23
  suggesterFetcher,
@@ -32,6 +33,9 @@ const useLunatic = (
32
33
  const [page, setPage] = useState(initialPage);
33
34
 
34
35
  const [todo, setTodo] = useState({});
36
+ const [todoExternals, setTodoExternals] = useState({});
37
+
38
+ const [modalContent, setModalContent] = useState(null);
35
39
 
36
40
  const components = useFilterComponents({
37
41
  questionnaire,
@@ -40,7 +44,7 @@ const useLunatic = (
40
44
  features: featuresWithoutMD,
41
45
  page,
42
46
  pagination,
43
- todo,
47
+ todo: { ...todo, ...todoExternals },
44
48
  });
45
49
 
46
50
  const { suggesters: suggestersToLoad } = source;
@@ -54,6 +58,7 @@ const useLunatic = (
54
58
  ) {
55
59
  const s = suggestersToLoad.reduce(function (current, storeInfo) {
56
60
  const { name } = storeInfo;
61
+ if (!suggesters[name]) return current;
57
62
  return {
58
63
  ...current,
59
64
  [name]: {
@@ -92,7 +97,17 @@ const useLunatic = (
92
97
  flow: FLOW_NEXT,
93
98
  management,
94
99
  });
95
- setPage(nextPage);
100
+ if (modalForControls) {
101
+ const controls = getControls({
102
+ page,
103
+ features: featuresWithoutMD,
104
+ components,
105
+ bindings,
106
+ preferences,
107
+ });
108
+ if (controls.length > 0) setModalContent({ page: nextPage, controls });
109
+ else setPage(nextPage);
110
+ } else setPage(nextPage);
96
111
  }
97
112
  };
98
113
 
@@ -109,7 +124,18 @@ const useLunatic = (
109
124
  flow: FLOW_PREVIOUS,
110
125
  management,
111
126
  });
112
- setPage(previousPage);
127
+ if (modalForControls) {
128
+ const controls = getControls({
129
+ page,
130
+ features: featuresWithoutMD,
131
+ components,
132
+ bindings,
133
+ preferences,
134
+ });
135
+ if (controls.length > 0)
136
+ setModalContent({ page: previousPage, controls });
137
+ else setPage(previousPage);
138
+ } else setPage(previousPage);
113
139
  }
114
140
  };
115
141
 
@@ -143,6 +169,10 @@ const useLunatic = (
143
169
  setTodo((t) => ({ ...t, ...updatedValue }));
144
170
  }, []);
145
171
 
172
+ const handleExternals = useCallback((externals) => {
173
+ setTodoExternals((t) => ({ ...t, ...externals }));
174
+ }, []);
175
+
146
176
  // Assume we only want to handle source update
147
177
  useEffect(() => {
148
178
  setQuestionnaire(mergeQuestionnaireAndData(source)(data));
@@ -168,10 +198,41 @@ const useLunatic = (
168
198
  management,
169
199
  ]);
170
200
 
201
+ useEffect(() => {
202
+ if (Object.keys(todoExternals).length !== 0) {
203
+ const newQ = updateExternals(questionnaire)(logFunction)(todoExternals);
204
+ setQuestionnaire(newQ);
205
+ setTodoExternals({});
206
+ }
207
+ }, [todoExternals, logFunction, questionnaire]);
208
+
209
+ const cancelModal = () => {
210
+ setModalContent(null);
211
+ };
212
+
213
+ const validateModal = () => {
214
+ setPage(modalContent.page);
215
+ setModalContent(null);
216
+ };
217
+
218
+ const componentsToDiplay =
219
+ pagination && modalContent
220
+ ? [
221
+ {
222
+ componentType: 'Modal',
223
+ controls: modalContent.controls,
224
+ validateModal,
225
+ cancelModal,
226
+ },
227
+ ...components,
228
+ ]
229
+ : components;
230
+
171
231
  return {
172
232
  questionnaire,
173
233
  handleChange,
174
- components,
234
+ handleExternals,
235
+ components: componentsToDiplay,
175
236
  bindings,
176
237
  pagination: {
177
238
  page,
@@ -0,0 +1,23 @@
1
+ export const GO_NEXT_PAGE = 'use-lunatic/go-next';
2
+ export const goNextPage = () => ({ type: GO_NEXT_PAGE });
3
+
4
+ export const GO_PREVIOUS_PAGE = 'use-lunatic/go-previous';
5
+ export const goPreviousPage = () => ({ type: GO_PREVIOUS_PAGE });
6
+
7
+ export const ON_INIT = 'use-lunatic/on-init';
8
+ export const onInit = ({ data, source, initialPage, features }) => ({
9
+ type: ON_INIT,
10
+ payload: { data, source, initialPage, features },
11
+ });
12
+
13
+ export const HANDLE_CHANGE = 'use-lunatic/handle-change';
14
+ export const handleChange = (response, value, args) => ({
15
+ type: HANDLE_CHANGE,
16
+ payload: { response, value, args },
17
+ });
18
+
19
+ export const ON_SET_WAITING = 'use-lunatic/on-set-waiting';
20
+ export const onSetWaiting = (status) => ({
21
+ type: ON_SET_WAITING,
22
+ payload: { status },
23
+ });
@@ -0,0 +1,61 @@
1
+ import isPaginatedLoop from './is-paginated-loop';
2
+
3
+ function extractSubPages(component, previous = []) {
4
+ const { components } = component;
5
+ return components.reduce(function (pages, component) {
6
+ const { page } = component;
7
+
8
+ if (page && pages.indexOf(page) === -1) {
9
+ return [...pages, page];
10
+ }
11
+ return pages;
12
+ }, previous);
13
+ }
14
+
15
+ function extractLoop(components) {
16
+ return components.reduce(
17
+ function ({ isLoop, subPages, iterations, loopDependencies }, component) {
18
+ const currentIsLoop = isPaginatedLoop(component);
19
+ if (currentIsLoop) {
20
+ return {
21
+ isLoop: true,
22
+ subPages: extractSubPages(component, subPages),
23
+ iterations: iterations || component.iterations,
24
+ loopDependencies: loopDependencies || component.loopDependencies,
25
+ };
26
+ }
27
+ return { isLoop, subPages, iterations };
28
+ },
29
+ {
30
+ isLoop: false,
31
+ subPages: undefined,
32
+ iterations: undefined,
33
+ loopDependencies: undefined,
34
+ }
35
+ );
36
+ }
37
+
38
+ function checkLoops(pages) {
39
+ return Object.entries(pages).reduce(function (map, current) {
40
+ const [number, content] = current;
41
+ if (number !== 'unpaged') {
42
+ const { components } = content;
43
+ const { isLoop, subPages, iterations, loopDependencies } =
44
+ extractLoop(components);
45
+
46
+ return {
47
+ ...map,
48
+ [number]: {
49
+ ...content,
50
+ isLoop,
51
+ subPages,
52
+ iterations,
53
+ loopDependencies,
54
+ },
55
+ };
56
+ }
57
+ return map;
58
+ }, {});
59
+ }
60
+
61
+ export default checkLoops;
@@ -0,0 +1,69 @@
1
+ import isPaginatedLoop from './is-paginated-loop';
2
+
3
+ function isUnpaginated(questionnaire) {
4
+ const { maxPage } = questionnaire;
5
+ return maxPage === undefined;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @param {*} component: object
11
+ * @param {*} page: string
12
+ * @param {*} map Map<page,{ components: Array<component>, isLoop: boolean, subPages: Array<page> }>
13
+ * @returns
14
+ */
15
+ function mergeComponent(component, page, map) {
16
+ if (!page) {
17
+ return { ...map, unpaged: [...map.unpaged, component] };
18
+ }
19
+ if (page in map) {
20
+ const current = map[page];
21
+ const { components } = current;
22
+ return {
23
+ ...map,
24
+ [page]: { ...current, components: [...components, component] },
25
+ };
26
+ }
27
+ return { ...map, [page]: { components: [component] } };
28
+ }
29
+
30
+ function mergeNestedComponents(components, map) {
31
+ return components.reduce(function (current, component) {
32
+ const { page } = component;
33
+ if (page) {
34
+ return mergeComponent(component, page, current);
35
+ }
36
+
37
+ return current;
38
+ }, map);
39
+ }
40
+ /**
41
+ *
42
+ * @param {*} components
43
+ * @returns
44
+ */
45
+ function createPages(questionnaire) {
46
+ const { components } = questionnaire;
47
+ if (isUnpaginated(questionnaire)) {
48
+ return { 1: { components } }; // no page -> one page ;)
49
+ }
50
+ const map = components.reduce(
51
+ function (current, component) {
52
+ const { components, page } = component;
53
+ if (isPaginatedLoop(component)) {
54
+ return mergeComponent(
55
+ component,
56
+ page,
57
+ mergeNestedComponents(components, current)
58
+ );
59
+ }
60
+
61
+ return mergeComponent(component, page, current);
62
+ },
63
+ { unpaged: [] }
64
+ );
65
+
66
+ return map;
67
+ }
68
+
69
+ export default createPages;
@@ -0,0 +1,16 @@
1
+ import getCompatibleVTLExpression from './get-compatible-vtl-expression';
2
+
3
+ function executeConditionFilter(filter, execute, iteration) {
4
+ if (filter && typeof execute === 'function') {
5
+ const { value } = filter;
6
+
7
+ function logging(...args) {
8
+ console.warn(args);
9
+ console.warn('executeConditionFilter:', filter);
10
+ }
11
+ return execute(getCompatibleVTLExpression(value), { iteration, logging });
12
+ }
13
+ return undefined;
14
+ }
15
+
16
+ export default executeConditionFilter;
@@ -0,0 +1,182 @@
1
+ import executeExpression from './execute-expression';
2
+ import getExpressionVariables from './get-expressions-variables';
3
+ import createMemoizer from './create-memoizer';
4
+ import createRefreshCalculated from './create-refresh-calculated';
5
+
6
+ function validateExpression(expObject) {
7
+ if (typeof expObject === 'object') {
8
+ const { type } = expObject;
9
+ if (type === 'VTL|MD') {
10
+ return expObject;
11
+ }
12
+ }
13
+ throw new Error(`Non-VTL compatible expression : ${expObject}`);
14
+ }
15
+
16
+ function getVtlCompatibleValue(value) {
17
+ if (value === undefined) {
18
+ return null;
19
+ }
20
+ if (Array.isArray(value)) {
21
+ return {
22
+ dataStructure: { result: {} },
23
+ dataPoints: {
24
+ result: value,
25
+ },
26
+ };
27
+ }
28
+
29
+ return value;
30
+ }
31
+
32
+ function createBindings(variables) {
33
+ return Object.entries(variables).reduce(function (
34
+ bindings,
35
+ [name, { value }]
36
+ ) {
37
+ return { ...bindings, [name]: value };
38
+ },
39
+ {});
40
+ }
41
+
42
+ /**
43
+ *
44
+ * @param {*} variables
45
+ * @returns
46
+ */
47
+ function createExecuteExpression(variables, features) {
48
+ // on aimerait map d'expression, avec les bindings
49
+ const bindings = createBindings(variables);
50
+ const tokensMap = new Map();
51
+ const collectedUpdated = new Map();
52
+ const [memoize, getMemoizedValue] = createMemoizer();
53
+ const [refreshCalculated, setToRefreshCalculated] = createRefreshCalculated({
54
+ variables,
55
+ execute,
56
+ bindings,
57
+ });
58
+
59
+ /**
60
+ *
61
+ * @param {*} name
62
+ * @param {*} value
63
+ */
64
+ function updateBindings(name, value) {
65
+ // update des bindings
66
+ if (name in bindings) {
67
+ bindings[name] = value;
68
+ collectedUpdated.set(name, []);
69
+ }
70
+ // enrichissement des variables à rafraîchir
71
+ const { CalculatedLinked = [] } = variables[name];
72
+
73
+ CalculatedLinked.forEach(function (variable) {
74
+ const { name } = variable;
75
+ setToRefreshCalculated(name, variable);
76
+ });
77
+ }
78
+
79
+ function getVariablesAndCach(expression) {
80
+ if (tokensMap.has(expression)) {
81
+ return tokensMap.get(expression);
82
+ }
83
+ const tokens = getExpressionVariables(expression, variables);
84
+ tokensMap.set(expression, tokens);
85
+ return tokens;
86
+ }
87
+
88
+ /**/
89
+ function collecteVariables(dependencies) {
90
+ if (Array.isArray(dependencies)) {
91
+ return dependencies.reduce(function (map, name) {
92
+ if (name in variables) {
93
+ const data = variables[name];
94
+ const { variable, type } = data;
95
+ if (!(name in map)) {
96
+ if (type === 'CALCULATED') {
97
+ const { expression } = variable;
98
+ const subDependencies = getVariablesAndCach(expression);
99
+
100
+ return {
101
+ ...map,
102
+ [name]: { ...variable },
103
+ ...collecteVariables(subDependencies),
104
+ };
105
+ }
106
+
107
+ return { ...map, [name]: { ...variable } };
108
+ }
109
+ } else {
110
+ throw new Error(`Unknown variable ${name}`);
111
+ }
112
+ return map;
113
+ }, {});
114
+ }
115
+ return {};
116
+ }
117
+
118
+ function resolveUseContext(name, { iteration }) {
119
+ const value = bindings[name];
120
+ if (iteration !== undefined && Array.isArray(value)) {
121
+ if (iteration < value.length) {
122
+ return value[iteration];
123
+ }
124
+ return null;
125
+ }
126
+ return getVtlCompatibleValue(value);
127
+ }
128
+
129
+ function fillVariablesValues(map, { iteration }) {
130
+ return Object.entries(map).reduce(function (sub, [name, _]) {
131
+ return {
132
+ ...sub,
133
+ [name]: resolveUseContext(name, { iteration }),
134
+ };
135
+ }, {});
136
+ }
137
+
138
+ /**
139
+ *
140
+ * @param {*} vtlObject
141
+ * @param {*} args
142
+ * @returns
143
+ */
144
+ function execute(expObject, args) {
145
+ const { value: expression } = validateExpression(expObject);
146
+ const { iteration, logging } = args;
147
+ const bindingDependencies = getVariablesAndCach(expression);
148
+
149
+ function loggingDefault(_, bindings, e) {
150
+ if (process.env.NODE_ENV === 'development') {
151
+ console.warn(`VTL error : ${expression}`, { ...args }, { bindings });
152
+ console.warn(e);
153
+ }
154
+ }
155
+
156
+ const vtlBindings = refreshCalculated(
157
+ fillVariablesValues(collecteVariables(bindingDependencies), {
158
+ iteration,
159
+ }),
160
+ { rootExpression: expression, iteration }
161
+ );
162
+
163
+ const memoized = getMemoizedValue(expression, vtlBindings);
164
+
165
+ if (!memoized) {
166
+ const result = executeExpression(
167
+ vtlBindings,
168
+ expression,
169
+ features,
170
+ logging || loggingDefault
171
+ );
172
+ memoize(expression, vtlBindings, result);
173
+
174
+ return result;
175
+ }
176
+ return memoized;
177
+ }
178
+
179
+ return [execute, updateBindings];
180
+ }
181
+
182
+ export default createExecuteExpression;
@@ -0,0 +1,42 @@
1
+ import objectHash from 'object-hash';
2
+
3
+ function createMemoizer() {
4
+ const expresionsMap = new Map();
5
+
6
+ function refillBindings(bindings) {
7
+ return Object.entries(bindings).reduce(function (map, [key, value]) {
8
+ const dataPointsValue = value?.result;
9
+ if (dataPointsValue) {
10
+ return { ...map, [key]: dataPointsValue };
11
+ }
12
+ return { ...map, [key]: value };
13
+ }, {});
14
+ }
15
+
16
+ function memoize(expression, bindings, value) {
17
+ const refill = refillBindings(bindings);
18
+ const hash = objectHash(refill);
19
+ let map = expresionsMap.get(expression);
20
+
21
+ if (!map) {
22
+ map = new Map();
23
+ expresionsMap.set(expression, map);
24
+ }
25
+ map.set(hash, value);
26
+ }
27
+
28
+ function getMemoizedValue(expression, bindings) {
29
+ let map = expresionsMap.get(expression);
30
+ if (map) {
31
+ const refill = refillBindings(bindings);
32
+ const hash = objectHash(refill);
33
+
34
+ return map.get(hash);
35
+ }
36
+ return undefined;
37
+ }
38
+
39
+ return [memoize, getMemoizedValue];
40
+ }
41
+
42
+ export default createMemoizer;
@@ -0,0 +1,50 @@
1
+ function createRefreshCalculated({ variables, execute, bindings }) {
2
+ const toRefreshVariables = new Map(); // variables calculées dépendantes d'une variable modifiée.
3
+
4
+ // à l'init, on y colle toutes les variables de calcul
5
+ Object.values(variables).forEach(function ({ variable }) {
6
+ const { variableType, name } = variable;
7
+ if (variableType === 'CALCULATED') {
8
+ toRefreshVariables.set(name, variable);
9
+ }
10
+ });
11
+
12
+ function refreshCalculated(map, { rootExpression, iteration }) {
13
+ return Object.entries(map).reduce(function (sub, [name, current]) {
14
+ const { variable, type } = variables[name];
15
+
16
+ if (type === 'CALCULATED' && toRefreshVariables.has(name)) {
17
+ const { expression, shapeFrom } = variable;
18
+
19
+ function logging(expression, bindings, e) {
20
+ if (process.env.NODE_ENV === 'development') {
21
+ console.warn(
22
+ `VTL error when refreshing calculated variable ${name} : ${expression}`,
23
+ { bindings }
24
+ );
25
+ console.warn(`root expression : ${rootExpression}`);
26
+ console.warn(e);
27
+ }
28
+ }
29
+
30
+ const value = execute(expression, {
31
+ logging,
32
+ iteration: shapeFrom ? iteration : undefined,
33
+ });
34
+ bindings[name] = value;
35
+ toRefreshVariables.delete(name);
36
+
37
+ return { ...sub, [name]: value };
38
+ }
39
+ return { ...sub, [name]: current };
40
+ }, {});
41
+ }
42
+
43
+ function setToRefreshCalculated(name, variable) {
44
+ toRefreshVariables.set(name, variable);
45
+ }
46
+
47
+ return [refreshCalculated, setToRefreshCalculated];
48
+ }
49
+
50
+ export default createRefreshCalculated;
@@ -0,0 +1,60 @@
1
+ import { interpret } from '@inseefr/trevas';
2
+
3
+ function isDataSet(result) {
4
+ return result && typeof result === 'object' && result.dataPoints;
5
+ }
6
+
7
+ function extractDataSetResult(dataSet) {
8
+ const { dataPoints } = dataSet;
9
+ if (dataPoints) {
10
+ const { result } = dataPoints;
11
+ return result;
12
+ }
13
+ return undefined;
14
+ }
15
+
16
+ function executeVtl(expression, vtlBindings) {
17
+ const result = interpret(expression, vtlBindings);
18
+ if (isDataSet(result)) {
19
+ return extractDataSetResult(result);
20
+ }
21
+ if (result === null) {
22
+ return null;
23
+ }
24
+ if (typeof result === 'object') {
25
+ return expression;
26
+ }
27
+
28
+ return result;
29
+ }
30
+
31
+ function loggingDefault(expression, bindings, e) {
32
+ if (process.env.NODE_ENV === 'development') {
33
+ console.warn(`VTL error : ${expression}`, bindings);
34
+ console.warn(e);
35
+ }
36
+ }
37
+
38
+ function executeExpression(
39
+ vtlBindings,
40
+ expression,
41
+ features /* VTL, MD */,
42
+ logging = loggingDefault
43
+ ) {
44
+ if (expression) {
45
+ try {
46
+ if (features.includes('VTL')) {
47
+ return executeVtl(expression, vtlBindings);
48
+ }
49
+ return expression;
50
+ } catch (e) {
51
+ // expression en erreur ou simple chaîne de caractère
52
+ logging(expression, vtlBindings, e);
53
+ return expression;
54
+ }
55
+ // TODO MD only for labels, not for filtering
56
+ }
57
+ return '';
58
+ }
59
+
60
+ export default executeExpression;
@@ -0,0 +1,22 @@
1
+ import { VtlLexer } from '@inseefr/vtl-2.0-antlr-tools';
2
+ import antlr4 from 'antlr4';
3
+
4
+ function getExpressionVariables(expression, variables) {
5
+ try {
6
+ const chars = new antlr4.InputStream(expression);
7
+ const lexer = new VtlLexer(chars);
8
+ return lexer.getAllTokens().reduce(function (array, { start, stop, type }) {
9
+ if (type === 234) {
10
+ const token = expression.substr(start, stop - start + 1);
11
+ if (array.indexOf(token) === -1 && token in variables) {
12
+ return [...array, token];
13
+ }
14
+ }
15
+ return array;
16
+ }, []);
17
+ } catch (e) {
18
+ return [];
19
+ }
20
+ }
21
+
22
+ export default getExpressionVariables;
@@ -0,0 +1 @@
1
+ export { default } from './create-execute-expression';