@inseefr/lunatic 0.2.62 → 0.3.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 (547) hide show
  1. package/README.md +11 -3
  2. package/lib/index.js +2961 -3143
  3. package/lib/index.js.map +1 -1
  4. package/package.json +109 -55
  5. package/src/components/button/button.scss +9 -11
  6. package/src/components/button/index.js +1 -1
  7. package/src/components/button/lunatic-button.js +48 -0
  8. package/src/components/checkbox/checkbox-boolean/checkbox-boolean.js +18 -0
  9. package/src/components/checkbox/checkbox-boolean/index.js +1 -0
  10. package/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +30 -0
  11. package/src/components/checkbox/checkbox-group/checkbox-group.js +84 -0
  12. package/src/components/checkbox/checkbox-group/checkbox-option.js +45 -0
  13. package/src/components/checkbox/checkbox-group/index.js +1 -0
  14. package/src/components/checkbox/checkbox-group/lunatic-checkbox-group.js +27 -0
  15. package/src/components/checkbox/checkbox-one/index.js +1 -0
  16. package/src/components/checkbox/checkbox-one/lunatic-checkbox-one.js +7 -0
  17. package/src/components/checkbox/checkbox.scss +1 -39
  18. package/src/components/checkbox/commons/checkbox-option.js +55 -0
  19. package/src/components/checkbox/commons/index.js +1 -0
  20. package/src/components/checkbox/index.js +3 -3
  21. package/src/{utils/lib/style.js → components/commons/build-style-object.js} +4 -2
  22. package/src/components/commons/components/combo-box/combo-box-container.js +31 -0
  23. package/src/components/commons/components/combo-box/combo-box-content.js +57 -0
  24. package/src/components/commons/components/combo-box/combo-box.js +189 -0
  25. package/src/components/commons/components/combo-box/combo-box.scss +218 -0
  26. package/src/components/commons/components/combo-box/index.js +2 -0
  27. package/src/components/commons/components/combo-box/panel/index.js +1 -0
  28. package/src/components/commons/components/combo-box/panel/option-container.js +63 -0
  29. package/src/components/commons/components/combo-box/panel/panel-container.js +20 -0
  30. package/src/components/commons/components/combo-box/panel/panel.js +58 -0
  31. package/src/components/commons/components/combo-box/selection/delete.js +40 -0
  32. package/src/components/commons/components/combo-box/selection/displayLabelOrInput.js +23 -0
  33. package/src/components/commons/components/combo-box/selection/index.js +1 -0
  34. package/src/components/commons/components/combo-box/selection/input.js +55 -0
  35. package/src/components/commons/components/combo-box/selection/label.js +29 -0
  36. package/src/components/commons/components/combo-box/selection/selection-container.js +32 -0
  37. package/src/components/commons/components/combo-box/selection/selection.js +63 -0
  38. package/src/components/commons/components/combo-box/state-management/actions.js +29 -0
  39. package/src/components/commons/components/combo-box/state-management/combo-box-context.js +8 -0
  40. package/src/components/commons/components/combo-box/state-management/index.js +4 -0
  41. package/src/components/commons/components/combo-box/state-management/initial-state.js +8 -0
  42. package/src/components/commons/components/combo-box/state-management/reducer/index.js +1 -0
  43. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +5 -0
  44. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +8 -0
  45. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +10 -0
  46. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +5 -0
  47. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +23 -0
  48. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +1 -0
  49. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/keyboard-key-codes.js +11 -0
  50. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +22 -0
  51. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +22 -0
  52. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +13 -0
  53. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +6 -0
  54. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +5 -0
  55. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +13 -0
  56. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +5 -0
  57. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +34 -0
  58. package/src/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +8 -0
  59. package/src/components/commons/components/combo-box/state-management/reducer/reducer.js +32 -0
  60. package/src/components/commons/components/create-lunatic-component/create-lunatic-component.js +58 -0
  61. package/src/components/commons/components/create-lunatic-component/index.js +5 -0
  62. package/src/components/commons/components/default-label-renderer.js +31 -0
  63. package/src/components/commons/components/default-option-renderer.js +27 -0
  64. package/src/components/commons/components/dragger/dragger.js +64 -0
  65. package/src/components/commons/components/dragger/dragger.scss +8 -0
  66. package/src/components/commons/components/dragger/index.js +1 -0
  67. package/src/components/commons/components/fab/fab.js +50 -0
  68. package/src/components/commons/components/fab/fab.scss +32 -0
  69. package/src/components/commons/components/fab/index.js +1 -0
  70. package/src/components/commons/components/field-container/field-container.js +28 -0
  71. package/src/components/commons/components/field-container/field-container.scss +0 -0
  72. package/src/components/commons/components/field-container/index.js +1 -0
  73. package/src/components/commons/components/fieldset.js +14 -0
  74. package/src/components/commons/components/html-table/index.js +6 -0
  75. package/src/components/commons/components/html-table/table.js +26 -0
  76. package/src/components/commons/components/html-table/tbody.js +26 -0
  77. package/src/components/commons/components/html-table/td.js +33 -0
  78. package/src/components/commons/components/html-table/th.js +33 -0
  79. package/src/components/commons/components/html-table/thead.js +26 -0
  80. package/src/components/commons/components/html-table/tr.js +27 -0
  81. package/src/components/commons/components/is-network/index.js +1 -0
  82. package/src/components/commons/components/is-network/is-network.js +39 -0
  83. package/src/components/commons/components/is-network/use-online-status.js +51 -0
  84. package/src/components/commons/components/label.js +15 -0
  85. package/src/components/commons/components/lunatic-component.js +54 -0
  86. package/src/components/commons/components/lunatic-fieldset-component.js +45 -0
  87. package/src/components/commons/components/md-label/index.js +1 -0
  88. package/src/components/commons/components/md-label/link.js +54 -0
  89. package/src/components/commons/components/md-label/md-label.js +21 -0
  90. package/src/components/commons/components/missing/index.js +1 -0
  91. package/src/components/commons/components/missing/missing.js +81 -0
  92. package/src/components/commons/components/missing/missing.scss +30 -0
  93. package/src/components/commons/components/nothing-to-display.js +7 -0
  94. package/src/components/commons/components/orchestrated-component.js +49 -0
  95. package/src/components/{tooltip → commons/components/variable-status}/img/edited.png +0 -0
  96. package/src/components/{tooltip → commons/components/variable-status}/img/forced.png +0 -0
  97. package/src/components/{tooltip → commons/components/variable-status}/img/index.js +0 -0
  98. package/src/components/commons/components/variable-status/index.js +1 -0
  99. package/src/components/commons/components/variable-status/variable-status.js +54 -0
  100. package/src/components/commons/components/variable-status/variable-status.scss +39 -0
  101. package/src/components/commons/create-customizable-field.js +18 -0
  102. package/src/components/commons/create-row-orchestrator.js +48 -0
  103. package/src/components/commons/icons/checkbox-checked.icon.js +25 -0
  104. package/src/components/commons/icons/checkbox-unchecked.icon.js +25 -0
  105. package/src/components/commons/icons/closed.icon.js +24 -0
  106. package/src/components/commons/icons/cross.icon.js +24 -0
  107. package/src/components/commons/icons/index.js +10 -0
  108. package/src/components/commons/icons/load.icon.js +24 -0
  109. package/src/components/commons/icons/lunatic-icon.js +9 -0
  110. package/src/components/commons/icons/lunatic-icon.scss +4 -0
  111. package/src/components/commons/icons/network.icon.js +24 -0
  112. package/src/components/commons/icons/on-drag.icon.js +24 -0
  113. package/src/components/commons/icons/opened.icon.js +24 -0
  114. package/src/components/commons/icons/radio-checked.icon.js +25 -0
  115. package/src/components/commons/icons/radio-unchecked.icon.js +25 -0
  116. package/src/components/commons/index.js +18 -0
  117. package/src/{utils/lib → components/commons}/prop-types/declarations.js +1 -1
  118. package/src/{utils/lib → components/commons}/prop-types/index.js +0 -0
  119. package/src/components/commons/prop-types/lines.js +6 -0
  120. package/src/{utils/lib → components/commons}/prop-types/options.js +0 -0
  121. package/src/{utils/lib/prop-types/lines.js → components/commons/prop-types/response.js} +2 -2
  122. package/src/components/commons/prop-types/value-type.js +10 -0
  123. package/src/components/commons/safety-label.js +25 -0
  124. package/src/components/commons/use-document-add-event-listener.js +63 -0
  125. package/src/components/commons/use-on-handle-change.js +16 -0
  126. package/src/components/commons/use-options-keydown.js +22 -0
  127. package/src/components/commons/use-previous.js +11 -0
  128. package/src/components/components.js +11 -5
  129. package/src/components/datepicker/datepicker.js +27 -0
  130. package/src/components/datepicker/datepicker.scss +1 -16
  131. package/src/components/datepicker/index.js +1 -1
  132. package/src/components/datepicker/lunatic-datepicker.js +7 -0
  133. package/src/components/declarations/declaration.js +17 -0
  134. package/src/components/declarations/declarations-after-text.js +8 -0
  135. package/src/components/declarations/declarations-before-text.js +8 -0
  136. package/src/components/declarations/declarations-detachable.js +8 -0
  137. package/src/components/declarations/declarations.js +39 -0
  138. package/src/components/declarations/declarations.scss +29 -27
  139. package/src/components/declarations/index.js +4 -1
  140. package/src/components/dropdown/dropdown-simple/dropdown-simple.js +33 -0
  141. package/src/components/dropdown/dropdown-simple/index.js +1 -0
  142. package/src/components/dropdown/dropdown-simple/simple-label-renderer.js +31 -0
  143. package/src/components/dropdown/dropdown-simple/simple-option-renderer.js +27 -0
  144. package/src/components/dropdown/dropdown-writable/dropdown-writable.js +49 -0
  145. package/src/components/dropdown/dropdown-writable/filter-tools/filter-options.js +20 -0
  146. package/src/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +16 -0
  147. package/src/components/dropdown/dropdown-writable/filter-tools/match.js +18 -0
  148. package/src/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +9 -0
  149. package/src/components/dropdown/dropdown-writable/index.js +1 -0
  150. package/src/components/dropdown/dropdown-writable/writable-label-renderer.js +31 -0
  151. package/src/components/dropdown/dropdown-writable/writable-option-renderer.js +84 -0
  152. package/src/components/dropdown/dropdown.js +46 -0
  153. package/src/components/dropdown/dropdown.scss +38 -13
  154. package/src/components/dropdown/index.js +1 -1
  155. package/src/components/dropdown/lunatic-dropdown.js +55 -0
  156. package/src/components/filter-description/component.js +14 -0
  157. package/src/components/{breadcrumb → filter-description}/index.js +0 -0
  158. package/src/components/index.js +1 -2
  159. package/src/components/index.scss +113 -49
  160. package/src/components/input/index.js +1 -2
  161. package/src/components/input/input.js +40 -110
  162. package/src/components/input/input.scss +27 -23
  163. package/src/components/input/lunatic-input.js +13 -0
  164. package/src/components/input-number/index.js +1 -0
  165. package/src/components/input-number/input-number.js +40 -0
  166. package/src/components/input-number/input-number.scss +0 -0
  167. package/src/components/input-number/lunatic-input-number.js +8 -0
  168. package/src/components/loop/block-for-loop/block-for-loop-ochestrator.js +6 -0
  169. package/src/components/loop/block-for-loop/block-for-loop.js +93 -0
  170. package/src/components/loop/block-for-loop/index.js +1 -0
  171. package/src/components/loop/block-for-loop/row.js +58 -0
  172. package/src/components/loop/commons/index.js +2 -0
  173. package/src/components/loop/commons/row-component.js +52 -0
  174. package/src/components/loop/index.js +1 -0
  175. package/src/components/loop/loop.js +81 -0
  176. package/src/components/loop/roster-for-loop/add-row-button.js +12 -0
  177. package/src/components/loop/roster-for-loop/body.js +46 -0
  178. package/src/components/loop/roster-for-loop/header.js +28 -0
  179. package/src/components/loop/roster-for-loop/index.js +1 -0
  180. package/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +6 -0
  181. package/src/components/loop/roster-for-loop/roster-for-loop.js +92 -0
  182. package/src/components/loop/roster-for-loop/roster-table.js +43 -0
  183. package/src/components/loop/roster-for-loop/roster.scss +42 -0
  184. package/src/components/loop/roster-for-loop/row.js +67 -0
  185. package/src/components/modal-controls/close-or-skip.js +25 -0
  186. package/src/components/modal-controls/index.js +1 -0
  187. package/src/components/modal-controls/modal-container.js +13 -0
  188. package/src/components/modal-controls/modal-controls.js +42 -0
  189. package/src/components/modal-controls/modal-controls.scss +63 -0
  190. package/src/components/pairwise/block/index.js +1 -0
  191. package/src/components/pairwise/block/pairwise-block.js +5 -0
  192. package/src/components/pairwise/index.js +2 -0
  193. package/src/components/pairwise/links/index.js +1 -0
  194. package/src/components/pairwise/links/links-orchestrator.js +6 -0
  195. package/src/components/pairwise/links/pairwise-links.js +58 -0
  196. package/src/components/pairwise/links/row.js +59 -0
  197. package/src/components/radio/index.js +1 -1
  198. package/src/components/radio/lunatic-radio-group.js +23 -0
  199. package/src/components/radio/radio-group.js +34 -0
  200. package/src/components/radio/radio-option.js +89 -0
  201. package/src/components/radio/radio.scss +55 -20
  202. package/src/components/sequence/index.js +1 -1
  203. package/src/components/sequence/sequence.js +23 -0
  204. package/src/components/sequence/sequence.scss +9 -14
  205. package/src/components/subsequence/index.js +1 -1
  206. package/src/components/subsequence/subsequence.js +25 -0
  207. package/src/components/suggester/check-store.js +70 -0
  208. package/src/components/suggester/default-style.scss +125 -0
  209. package/src/components/suggester/find-best-label/find-best-label.js +51 -0
  210. package/src/components/suggester/find-best-label/index.js +1 -0
  211. package/src/components/suggester/idb-suggester.js +69 -0
  212. package/src/components/suggester/index.js +1 -0
  213. package/src/components/suggester/lunatic-suggester.js +73 -0
  214. package/src/components/suggester/searching/create-searching.js +49 -0
  215. package/src/components/suggester/searching/index.js +1 -0
  216. package/src/components/suggester/suggester.js +117 -0
  217. package/src/components/suggester-loader-widget/index.js +1 -0
  218. package/src/components/suggester-loader-widget/loader-row.js +101 -0
  219. package/src/components/suggester-loader-widget/loader.js +67 -0
  220. package/src/components/suggester-loader-widget/progress.js +25 -0
  221. package/src/components/suggester-loader-widget/tools/action-tool.js +20 -0
  222. package/src/components/suggester-loader-widget/tools/index.js +2 -0
  223. package/src/components/suggester-loader-widget/tools/tools.js +7 -0
  224. package/src/components/suggester-loader-widget/widget-container.js +35 -0
  225. package/src/components/suggester-loader-widget/widget.js +123 -0
  226. package/src/components/suggester-loader-widget/widget.scss +176 -0
  227. package/src/components/switch/index.js +1 -0
  228. package/src/components/switch/lunatic-switch.js +36 -0
  229. package/src/components/switch/switch.js +73 -0
  230. package/src/components/switch/switch.scss +47 -0
  231. package/src/components/table/cell.js +83 -0
  232. package/src/components/table/components/cell.js +83 -0
  233. package/src/components/table/components/header.js +36 -0
  234. package/src/components/table/components/row.js +38 -0
  235. package/src/components/table/components/table.js +21 -0
  236. package/src/components/table/components/table.scss +26 -0
  237. package/src/components/table/index.js +1 -1
  238. package/src/components/table/lunatic-table.js +60 -0
  239. package/src/components/table/table-orchestrator.js +44 -0
  240. package/src/components/textarea/index.js +1 -1
  241. package/src/components/textarea/lunatic-textarea.js +23 -0
  242. package/src/components/textarea/textarea.js +41 -0
  243. package/src/components/textarea/textarea.scss +5 -13
  244. package/src/constants/component-types.js +1 -0
  245. package/src/{utils/constants.js → constants/declarations.js} +0 -0
  246. package/src/constants/event-types.js +13 -0
  247. package/src/constants/index.js +5 -0
  248. package/src/constants/supported-preferences.js +10 -0
  249. package/src/constants/value-types.js +5 -0
  250. package/src/constants/variable-types.js +4 -0
  251. package/src/i18n/build-dictionary.js +43 -0
  252. package/src/i18n/dictionary.js +7 -0
  253. package/src/i18n/index.js +7 -0
  254. package/src/stories/Introduction.stories.mdx +114 -0
  255. package/src/stories/custom-mui/checkbox-boolean-mui.js +23 -0
  256. package/src/stories/custom-mui/checkbox-group-mui.js +63 -0
  257. package/src/stories/custom-mui/checkbox-one-mui.js +7 -0
  258. package/src/stories/custom-mui/index.js +15 -0
  259. package/src/stories/custom-mui/input-mui.js +50 -0
  260. package/src/stories/custom-mui/input-number-mui.js +36 -0
  261. package/src/stories/custom-mui/radio-mui.js +39 -0
  262. package/src/stories/custom-mui/suggester-mui/index.js +1 -0
  263. package/src/stories/custom-mui/suggester-mui/suggester-mui.js +285 -0
  264. package/src/stories/custom-mui/switch-mui.js +29 -0
  265. package/src/stories/custom-mui/table-mui.js +20 -0
  266. package/src/stories/custom-mui/tbody-mui.js +16 -0
  267. package/src/stories/custom-mui/td-mui.js +16 -0
  268. package/src/stories/custom-mui/textarea-mui.js +38 -0
  269. package/src/stories/custom-mui/th-mui.js +16 -0
  270. package/src/stories/custom-mui/thead-mui.js +16 -0
  271. package/src/stories/custom-mui/tr-mui.js +27 -0
  272. package/src/stories/input/data.json +5 -0
  273. package/src/stories/input/input.stories.js +12 -82
  274. package/src/stories/input/source.json +28 -0
  275. package/src/stories/pairwise/block/block.json +3 -0
  276. package/src/stories/pairwise/block/pairwise-block.stories.js +17 -0
  277. package/src/stories/pairwise/links/data.json +12 -0
  278. package/src/stories/pairwise/links/links.json +164 -0
  279. package/src/stories/pairwise/links/pairwise-links.stories.js +18 -0
  280. package/src/stories/questionnaires/logement/data.json +2691 -0
  281. package/src/stories/questionnaires/logement/logement.stories.js +45 -0
  282. package/src/stories/questionnaires/logement/source-sequence.json +29291 -0
  283. package/src/stories/questionnaires/logement/source.json +33450 -0
  284. package/src/stories/questionnaires/simpsons/simpsons.stories.js +34 -0
  285. package/src/stories/questionnaires/simpsons/source.json +6290 -0
  286. package/src/stories/suggester/source.json +234 -0
  287. package/src/stories/suggester/suggester.stories.js +40 -0
  288. package/src/stories/switch/README.md +31 -0
  289. package/src/stories/switch/SwitchMaterialUI.js +35 -0
  290. package/src/stories/switch/data-forced.json +48 -0
  291. package/src/stories/switch/data.json +80 -0
  292. package/src/stories/switch/switch.js +72 -0
  293. package/src/stories/utils/custom-lunatic.scss +28 -0
  294. package/src/stories/utils/default-arg-types.js +29 -0
  295. package/src/stories/utils/options.js +25 -0
  296. package/src/stories/utils/orchestrator.js +130 -0
  297. package/src/stories/utils/waiting/index.js +1 -0
  298. package/src/stories/utils/waiting/preloader.svg +1 -0
  299. package/src/stories/utils/waiting/waiting.js +21 -0
  300. package/src/stories/utils/waiting/waiting.scss +21 -0
  301. package/src/tests/sample.spec.js +5 -0
  302. package/src/use-lunatic/actions.js +44 -0
  303. package/src/use-lunatic/commons/check-loops.js +61 -0
  304. package/src/use-lunatic/commons/create-map-pages.js +69 -0
  305. package/src/use-lunatic/commons/execute-condition-filter.js +16 -0
  306. package/src/use-lunatic/commons/execute-expression/create-execute-expression.js +187 -0
  307. package/src/use-lunatic/commons/execute-expression/create-memoizer.js +42 -0
  308. package/src/use-lunatic/commons/execute-expression/create-refresh-calculated.js +98 -0
  309. package/src/use-lunatic/commons/execute-expression/execute-expression.js +69 -0
  310. package/src/use-lunatic/commons/execute-expression/get-expressions-variables.js +22 -0
  311. package/src/use-lunatic/commons/execute-expression/get-safety-expression.js +19 -0
  312. package/src/use-lunatic/commons/execute-expression/index.js +1 -0
  313. package/src/use-lunatic/commons/fill-components/fill-component-expressions.js +129 -0
  314. package/src/use-lunatic/commons/fill-components/fill-component-value.js +8 -0
  315. package/src/use-lunatic/commons/fill-components/fill-components.js +32 -0
  316. package/src/use-lunatic/commons/fill-components/fill-errors.js +13 -0
  317. package/src/use-lunatic/commons/fill-components/fill-from-state.js +6 -0
  318. package/src/use-lunatic/commons/fill-components/fill-missing-response.js +22 -0
  319. package/src/use-lunatic/commons/fill-components/fill-pagination.js +8 -0
  320. package/src/use-lunatic/commons/fill-components/index.js +1 -0
  321. package/src/use-lunatic/commons/get-compatible-vtl-expression.js +16 -0
  322. package/src/use-lunatic/commons/get-component-value/get-component-value.js +118 -0
  323. package/src/use-lunatic/commons/get-component-value/index.js +1 -0
  324. package/src/use-lunatic/commons/get-components-from-state.js +24 -0
  325. package/src/use-lunatic/commons/get-page-tag.js +10 -0
  326. package/src/use-lunatic/commons/index.js +12 -0
  327. package/src/use-lunatic/commons/is-First-last-page.js +8 -0
  328. package/src/use-lunatic/commons/is-paginated-loop.js +6 -0
  329. package/src/use-lunatic/commons/load-suggesters.js +59 -0
  330. package/src/use-lunatic/commons/use-components-from-state.js +20 -0
  331. package/src/use-lunatic/index.js +1 -0
  332. package/src/use-lunatic/initial-state.js +31 -0
  333. package/src/use-lunatic/reducer/commons/Insee.code-workspace +47 -0
  334. package/src/use-lunatic/reducer/commons/index.js +3 -0
  335. package/src/use-lunatic/reducer/commons/is-empty-on-empty-page.js +29 -0
  336. package/src/use-lunatic/reducer/commons/resize-array-variable.js +28 -0
  337. package/src/use-lunatic/reducer/commons/validate-condition-filter.js +20 -0
  338. package/src/use-lunatic/reducer/index.js +1 -0
  339. package/src/use-lunatic/reducer/reduce-go-next-page.js +135 -0
  340. package/src/use-lunatic/reducer/reduce-go-previous-page.js +133 -0
  341. package/src/use-lunatic/reducer/reduce-handle-change/index.js +1 -0
  342. package/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +44 -0
  343. package/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +89 -0
  344. package/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +18 -0
  345. package/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +47 -0
  346. package/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +91 -0
  347. package/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +22 -0
  348. package/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +13 -0
  349. package/src/use-lunatic/reducer/reduce-on-init.js +183 -0
  350. package/src/use-lunatic/reducer/reduce-on-set-waiting.js +7 -0
  351. package/src/use-lunatic/reducer/reducer.js +26 -0
  352. package/src/use-lunatic/reducer/validate-controls/create-validate-reducer.js +86 -0
  353. package/src/use-lunatic/reducer/validate-controls/index.js +1 -0
  354. package/src/use-lunatic/use-lunatic.js +155 -0
  355. package/src/utils/constants/features.js +3 -0
  356. package/src/utils/constants/index.js +5 -0
  357. package/src/utils/constants/links.js +2 -0
  358. package/src/utils/constants/missing.js +2 -0
  359. package/src/utils/constants/variable-status.js +5 -0
  360. package/src/utils/constants/variable-types.js +1 -0
  361. package/src/utils/idb-tools/clear-store.js +16 -0
  362. package/src/utils/idb-tools/create-db-opener.js +43 -0
  363. package/src/utils/idb-tools/create-open-db.js +25 -0
  364. package/src/utils/idb-tools/get-entity.js +15 -0
  365. package/src/utils/idb-tools/get-idb.js +12 -0
  366. package/src/utils/idb-tools/idb-bulk-insert.js +96 -0
  367. package/src/utils/idb-tools/index.js +10 -0
  368. package/src/utils/idb-tools/insert-entity.js +15 -0
  369. package/src/utils/idb-tools/open-db.js +13 -0
  370. package/src/utils/idb-tools/open-or-create-db.js +34 -0
  371. package/src/utils/is-element.js +7 -0
  372. package/src/utils/store-tools/auto-load.js +74 -0
  373. package/src/utils/store-tools/clear-store-data.js +8 -0
  374. package/src/utils/store-tools/clear-store-info.js +8 -0
  375. package/src/utils/store-tools/constantes.js +20 -0
  376. package/src/utils/store-tools/create/create.js +19 -0
  377. package/src/utils/store-tools/create/index.js +2 -0
  378. package/src/utils/store-tools/create/update-store-info.js +26 -0
  379. package/src/utils/store-tools/get-store-count.js +22 -0
  380. package/src/utils/store-tools/index.js +7 -0
  381. package/src/utils/store-tools/open-or-create-store.js +47 -0
  382. package/src/utils/store-tools/use-store-index.js +24 -0
  383. package/src/utils/suggester-workers/append-to-index/append.js +25 -0
  384. package/src/utils/suggester-workers/append-to-index/append.worker.js +16 -0
  385. package/src/utils/suggester-workers/append-to-index/create-append-task.js +45 -0
  386. package/src/utils/suggester-workers/append-to-index/index.js +2 -0
  387. package/src/utils/suggester-workers/append-to-index/prepare-entities.js +61 -0
  388. package/src/utils/suggester-workers/append-to-index/store-messages.js +21 -0
  389. package/src/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +56 -0
  390. package/src/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +56 -0
  391. package/src/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +17 -0
  392. package/src/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +10 -0
  393. package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +17 -0
  394. package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +14 -0
  395. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +12 -0
  396. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +12 -0
  397. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +12 -0
  398. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +20 -0
  399. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +7 -0
  400. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +18 -0
  401. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +13 -0
  402. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +12 -0
  403. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +36 -0
  404. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +12 -0
  405. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +10 -0
  406. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +12 -0
  407. package/src/utils/suggester-workers/commons-tokenizer/filters/index.js +2 -0
  408. package/src/utils/suggester-workers/commons-tokenizer/filters/stop-words.js +118 -0
  409. package/src/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +8 -0
  410. package/src/utils/suggester-workers/commons-tokenizer/get-stemmer.js +18 -0
  411. package/src/utils/suggester-workers/commons-tokenizer/index.js +9 -0
  412. package/src/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +13 -0
  413. package/src/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +7 -0
  414. package/src/utils/suggester-workers/create-worker.js +55 -0
  415. package/src/utils/suggester-workers/find-best-label/find-best-label.js +39 -0
  416. package/src/utils/suggester-workers/find-best-label/find-best-label.worker.js +40 -0
  417. package/src/utils/suggester-workers/find-best-label/index.js +0 -0
  418. package/src/utils/suggester-workers/find-best-label/tokenize.js +30 -0
  419. package/src/utils/suggester-workers/find-best-label/tokenize.spec.js +19 -0
  420. package/src/utils/suggester-workers/searching/compute-score.js +33 -0
  421. package/src/utils/suggester-workers/searching/get-db.js +18 -0
  422. package/src/utils/suggester-workers/searching/index.js +1 -0
  423. package/src/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +20 -0
  424. package/src/utils/suggester-workers/searching/order/index.js +19 -0
  425. package/src/utils/suggester-workers/searching/query-parser/index.js +2 -0
  426. package/src/utils/suggester-workers/searching/query-parser/query-parser-soft.js +7 -0
  427. package/src/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +24 -0
  428. package/src/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +34 -0
  429. package/src/utils/suggester-workers/searching/resolve-query-parser.js +27 -0
  430. package/src/utils/suggester-workers/searching/search-in-index.js +17 -0
  431. package/src/utils/suggester-workers/searching/searching.js +70 -0
  432. package/src/utils/suggester-workers/searching/searching.worker.js +11 -0
  433. package/src/utils/vtl/dataset-builder.js +17 -0
  434. package/src/utils/vtl/index.js +1 -0
  435. package/src/components/breadcrumb/breadcrumb.scss +0 -22
  436. package/src/components/breadcrumb/component.js +0 -29
  437. package/src/components/button/component.js +0 -25
  438. package/src/components/checkbox/boolean.js +0 -100
  439. package/src/components/checkbox/group.js +0 -128
  440. package/src/components/checkbox/one.js +0 -132
  441. package/src/components/datepicker/component.js +0 -113
  442. package/src/components/declarations/component.js +0 -33
  443. package/src/components/dropdown/component.js +0 -100
  444. package/src/components/dropdown/shared/option.component.js +0 -77
  445. package/src/components/dropdown/shared/select-base.component.js +0 -148
  446. package/src/components/dropdown/shared/select-container.component.js +0 -59
  447. package/src/components/dropdown/shared/select-panel.component.js +0 -202
  448. package/src/components/dropdown/simple/index.js +0 -10
  449. package/src/components/dropdown/simple/prop-types.js +0 -14
  450. package/src/components/dropdown/simple/simple-select-list.component.js +0 -31
  451. package/src/components/dropdown/simple/simple-select-nested.component.js +0 -70
  452. package/src/components/dropdown/simple/simple-select.scss +0 -84
  453. package/src/components/dropdown/writable/index.js +0 -1
  454. package/src/components/dropdown/writable/writable-select.component.js +0 -98
  455. package/src/components/dropdown/writable/writable-select.scss +0 -113
  456. package/src/components/input/input-number.js +0 -171
  457. package/src/components/progress-bar/component.js +0 -28
  458. package/src/components/progress-bar/index.js +0 -1
  459. package/src/components/progress-bar/progress-bar.scss +0 -54
  460. package/src/components/radio/component.js +0 -136
  461. package/src/components/sequence/component.js +0 -43
  462. package/src/components/subsequence/component.js +0 -43
  463. package/src/components/subsequence/subsequence.scss +0 -15
  464. package/src/components/table/table.js +0 -133
  465. package/src/components/table/table.scss +0 -23
  466. package/src/components/textarea/component.js +0 -117
  467. package/src/components/tooltip/index.js +0 -1
  468. package/src/components/tooltip/response.js +0 -42
  469. package/src/components/tooltip/tooltip.scss +0 -35
  470. package/src/stories/breadcrumb/README.md +0 -14
  471. package/src/stories/breadcrumb/breadcrumb.stories.js +0 -35
  472. package/src/stories/button/README.md +0 -14
  473. package/src/stories/button/button.stories.js +0 -63
  474. package/src/stories/checkbox-boolean/README.md +0 -25
  475. package/src/stories/checkbox-boolean/checkbox-boolean.stories.js +0 -49
  476. package/src/stories/checkbox-group/README.md +0 -28
  477. package/src/stories/checkbox-group/checkbox-group.stories.js +0 -122
  478. package/src/stories/checkbox-one/README.md +0 -30
  479. package/src/stories/checkbox-one/checkbox-one.stories.js +0 -112
  480. package/src/stories/datepicker/README.md +0 -27
  481. package/src/stories/datepicker/datepicker.stories.js +0 -82
  482. package/src/stories/declarations/README.md +0 -17
  483. package/src/stories/declarations/declarations.stories.js +0 -61
  484. package/src/stories/dropdown/README.md +0 -29
  485. package/src/stories/dropdown/dropdown.stories.js +0 -70
  486. package/src/stories/input/README.md +0 -28
  487. package/src/stories/input-number/README.md +0 -31
  488. package/src/stories/input-number/input-number.stories.js +0 -95
  489. package/src/stories/progress-bar/README.md +0 -13
  490. package/src/stories/progress-bar/progress-bar.stories.js +0 -24
  491. package/src/stories/radio/README.md +0 -30
  492. package/src/stories/radio/radio.stories.js +0 -110
  493. package/src/stories/sequence/README.md +0 -16
  494. package/src/stories/sequence/sequence.stories.js +0 -46
  495. package/src/stories/subsequence/README.md +0 -16
  496. package/src/stories/subsequence/subsequence.stories.js +0 -46
  497. package/src/stories/table/README.md +0 -23
  498. package/src/stories/table/table.stories.js +0 -1021
  499. package/src/stories/textarea/README.md +0 -29
  500. package/src/stories/textarea/textarea.stories.js +0 -85
  501. package/src/stories/tooltip-response/README.md +0 -14
  502. package/src/stories/tooltip-response/tooltip.stories.js +0 -43
  503. package/src/tests/components/breadcrumb.spec.js +0 -13
  504. package/src/tests/components/button.spec.js +0 -11
  505. package/src/tests/components/checkbox-boolean.spec.js +0 -22
  506. package/src/tests/components/checkbox-group.spec.js +0 -17
  507. package/src/tests/components/checkbox-one.spec.js +0 -17
  508. package/src/tests/components/datepicker.spec.js +0 -42
  509. package/src/tests/components/declarations.spec.js +0 -46
  510. package/src/tests/components/dropdown.spec.js +0 -20
  511. package/src/tests/components/input-number.spec.js +0 -85
  512. package/src/tests/components/input.spec.js +0 -38
  513. package/src/tests/components/progress-bar.spec.js +0 -15
  514. package/src/tests/components/radio.spec.js +0 -21
  515. package/src/tests/components/sequence.spec.js +0 -9
  516. package/src/tests/components/subsequence.spec.js +0 -9
  517. package/src/tests/components/table.spec.js +0 -11
  518. package/src/tests/components/textarea.spec.js +0 -38
  519. package/src/tests/setup/setupTests.js +0 -4
  520. package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
  521. package/src/tests/utils/lib/items-positioning.spec.js +0 -17
  522. package/src/tests/utils/lib/label-position.spec.js +0 -19
  523. package/src/tests/utils/lib/responses.spec.js +0 -68
  524. package/src/tests/utils/lib/style.spec.js +0 -26
  525. package/src/tests/utils/lib/table/roster.spec.js +0 -25
  526. package/src/tests/utils/lib/tooltip/build-response.spec.js +0 -50
  527. package/src/tests/utils/to-expose/handler.spec.js +0 -184
  528. package/src/tests/utils/to-expose/init-questionnaire.spec.js +0 -10
  529. package/src/tests/utils/to-expose/state.spec.js +0 -251
  530. package/src/utils/lib/alphabet.js +0 -1
  531. package/src/utils/lib/decorator/index.js +0 -1
  532. package/src/utils/lib/decorator/title-decorator.js +0 -18
  533. package/src/utils/lib/index.js +0 -9
  534. package/src/utils/lib/label-position.js +0 -12
  535. package/src/utils/lib/options-positioning.js +0 -9
  536. package/src/utils/lib/prop-types/response.js +0 -15
  537. package/src/utils/lib/prop-types/value-type.js +0 -9
  538. package/src/utils/lib/responses.js +0 -9
  539. package/src/utils/lib/table/index.js +0 -1
  540. package/src/utils/lib/table/roster.js +0 -21
  541. package/src/utils/lib/tooltip/build-response.js +0 -11
  542. package/src/utils/lib/tooltip/content.js +0 -46
  543. package/src/utils/lib/tooltip/index.js +0 -2
  544. package/src/utils/to-expose/handler.js +0 -104
  545. package/src/utils/to-expose/index.js +0 -3
  546. package/src/utils/to-expose/init-questionnaire.js +0 -47
  547. package/src/utils/to-expose/state.js +0 -75
@@ -1,1021 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { withReadme } from 'storybook-readme';
4
- import { Table } from 'components';
5
- import readme from './README.md';
6
- import { titleDecorator } from 'utils/lib';
7
- import { boolean } from '@storybook/addon-knobs/react';
8
-
9
- const defaultProps = {
10
- handleChange: console.log,
11
- preferences: ['COLLECTED', 'FORCED', 'EDITED'],
12
- };
13
-
14
- const stories = storiesOf('Table', module)
15
- .addDecorator(withReadme(readme))
16
- .addDecorator(Component => {
17
- const WrappedComponent = titleDecorator(Component);
18
- return <WrappedComponent title="<Table />" />;
19
- });
20
-
21
- stories.addWithJSX('Default', () => (
22
- <Table
23
- id="default"
24
- label="Label of my default table"
25
- handleChange={console.log}
26
- cells={[
27
- [
28
- { label: '' },
29
- { label: 'Header 1', headerCell: true },
30
- { label: 'Header 2', headerCell: true },
31
- ],
32
- [{ label: 'Line 1' }, { label: 'Cell 11' }, { label: 'Cell 12' }],
33
- [{ label: 'Line 2' }, { label: 'Cell 21' }, { label: 'Cell 22' }],
34
- [{ label: 'Line 3' }, { label: 'Cell 31' }, { label: 'Cell 32' }],
35
- ]}
36
- />
37
- ));
38
-
39
- stories.addWithJSX('OneAxisOneMeasure', () => (
40
- <Table
41
- {...defaultProps}
42
- id="one-axis"
43
- label="Have you ever visited these countries?"
44
- cells={[
45
- [
46
- { value: '1', label: 'Belgium' },
47
- {
48
- id: 'a',
49
- componentType: 'Radio',
50
- options: [{ value: '1', label: 'Yes' }, { value: '0', label: 'No' }],
51
- response: {
52
- name: 'RADIO_A',
53
- valueState: [
54
- { valueType: 'COLLECTED', value: '1' },
55
- { valueType: 'FORCED', value: '0' },
56
- ],
57
- },
58
- },
59
- ],
60
- [
61
- { value: '2', label: 'France' },
62
- {
63
- id: 'b',
64
- componentType: 'Radio',
65
- options: [{ value: '1', label: 'Yes' }, { value: '0', label: 'No' }],
66
- response: {
67
- name: 'RADIO_B',
68
- valueState: [
69
- { valueType: 'COLLECTED', value: '0' },
70
- { valueType: 'FORCED', value: '1' },
71
- ],
72
- },
73
- },
74
- ],
75
- [
76
- { value: '3', label: 'Italy' },
77
- {
78
- id: 'c',
79
- componentType: 'Radio',
80
- options: [{ value: '1', label: 'Yes' }, { value: '0', label: 'No' }],
81
- response: {
82
- name: 'RADIO_C',
83
- valueState: [
84
- { valueType: 'COLLECTED', value: '1' },
85
- { valueType: 'FORCED', value: '0' },
86
- { valueType: 'EDITED', value: '1' },
87
- ],
88
- },
89
- },
90
- ],
91
- [
92
- { value: '4', label: 'Spain' },
93
- {
94
- id: 'd',
95
- componentType: 'Radio',
96
- options: [{ value: '1', label: 'Yes' }, { value: '0', label: 'No' }],
97
- response: {
98
- name: 'RADIO_D',
99
- valueState: [
100
- { valueType: 'COLLECTED', value: '1' },
101
- { valueType: 'FORCED', value: null },
102
- ],
103
- },
104
- },
105
- ],
106
- ]}
107
- tooltip={boolean('Tooltip', false)}
108
- />
109
- ));
110
-
111
- stories.addWithJSX('OneAxisTwoMeasures', () => (
112
- <Table
113
- {...defaultProps}
114
- id="one-axis-two-measures"
115
- label="Birth informations"
116
- cells={[
117
- [
118
- { label: '' },
119
- { label: 'Date', headerCell: true },
120
- { label: 'Place', headerCell: true },
121
- ],
122
- [
123
- { value: '1', label: 'Marco' },
124
- {
125
- id: 'a-datepicker',
126
- componentType: 'Datepicker',
127
- response: {
128
- name: 'DATEPICKER_A',
129
- valueState: [
130
- { valueType: 'COLLECTED', value: '1998-07-12' },
131
- { valueType: 'FORCED', value: null },
132
- ],
133
- },
134
- },
135
- {
136
- id: 'a-dropdown',
137
- componentType: 'Dropdown',
138
- options: [
139
- { value: 'belgium', label: 'Belgium' },
140
- { value: 'france', label: 'France' },
141
- { value: 'italy', label: 'Italy' },
142
- { value: 'netherland', label: 'Netherland' },
143
- { value: 'spain', label: 'Spain' },
144
- { value: 'sweden', label: 'Sweden' },
145
- ],
146
- response: {
147
- name: 'DROPDOWN_A',
148
- valueState: [
149
- { valueType: 'COLLECTED', value: 'italy' },
150
- { valueType: 'FORCED', value: 'france' },
151
- { valueType: 'EDITED', value: 'italy' },
152
- ],
153
- },
154
- },
155
- ],
156
- [
157
- { value: '2', label: 'Kyllian' },
158
- {
159
- id: 'b-datepicker',
160
- componentType: 'Datepicker',
161
- response: {
162
- name: 'DATEPICKER_B',
163
- valueState: [
164
- { valueType: 'COLLECTED', value: '1998-07-12' },
165
- { valueType: 'FORCED', value: '2018-07-15' },
166
- ],
167
- },
168
- },
169
- {
170
- id: 'b-dropdown',
171
- componentType: 'Dropdown',
172
- options: [
173
- { value: 'belgium', label: 'Belgium' },
174
- { value: 'france', label: 'France' },
175
- { value: 'italy', label: 'Italy' },
176
- { value: 'netherland', label: 'Netherland' },
177
- { value: 'spain', label: 'Spain' },
178
- { value: 'sweden', label: 'Sweden' },
179
- ],
180
- response: {
181
- name: 'DROPDOWN_B',
182
- valueState: [
183
- { valueType: 'COLLECTED', value: 'belgium' },
184
- { valueType: 'FORCED', value: 'france' },
185
- ],
186
- },
187
- },
188
- ],
189
- ]}
190
- tooltip={boolean('Tooltip', false)}
191
- />
192
- ));
193
-
194
- stories.addWithJSX('OneHierarchicalAxis', () => (
195
- <Table
196
- {...defaultProps}
197
- id="one-hierarchical-axis"
198
- label="Hierarchical table"
199
- cells={[
200
- [{ label: '', colspan: '2' }, { label: 'Percentage', headerCell: true }],
201
- [
202
- { value: 'A', label: 'A', rowspan: '2' },
203
- { value: 'A1', label: 'A1' },
204
- {
205
- id: 'a1',
206
- componentType: 'InputNumber',
207
- min: 0,
208
- max: 100,
209
- response: {
210
- name: 'INPUT_NUMBER_1',
211
- valueState: [
212
- { valueType: 'COLLECTED', value: '1' },
213
- { valueType: 'FORCED', value: '2' },
214
- { valueType: 'EDITED', value: '3' },
215
- ],
216
- },
217
- },
218
- ],
219
- [
220
- { value: 'A2', label: 'A2' },
221
- {
222
- id: 'a2',
223
- componentType: 'InputNumber',
224
- min: 0,
225
- max: 100,
226
- response: {
227
- name: 'INPUT_NUMBER_2',
228
- valueState: [
229
- { valueType: 'COLLECTED', value: '1' },
230
- { valueType: 'FORCED', value: null },
231
- { valueType: 'EDITED', value: null },
232
- ],
233
- },
234
- },
235
- ],
236
- [
237
- { value: 'B', label: 'B', rowspan: '3' },
238
- { value: 'B1', label: 'B1' },
239
- {
240
- id: 'b1',
241
- componentType: 'InputNumber',
242
- min: 0,
243
- max: 100,
244
- response: {
245
- name: 'INPUT_NUMBER_3',
246
- valueState: [
247
- { valueType: 'COLLECTED', value: null },
248
- { valueType: 'FORCED', value: null },
249
- { valueType: 'EDITED', value: null },
250
- ],
251
- },
252
- },
253
- ],
254
- [
255
- { value: 'B2', label: 'B2' },
256
- {
257
- id: 'b2',
258
- componentType: 'InputNumber',
259
- min: 0,
260
- max: 100,
261
- response: {
262
- name: 'INPUT_NUMBER_4',
263
- valueState: [
264
- { valueType: 'COLLECTED', value: '1' },
265
- { valueType: 'FORCED', value: null },
266
- { valueType: 'EDITED', value: '3' },
267
- ],
268
- },
269
- },
270
- ],
271
- [
272
- { value: 'B3', label: 'B3' },
273
- {
274
- id: 'B3',
275
- componentType: 'InputNumber',
276
- min: 0,
277
- max: 100,
278
- response: {
279
- name: 'INPUT_NUMBER_5',
280
- valueState: [
281
- { valueType: 'COLLECTED', value: '1' },
282
- { valueType: 'FORCED', value: '2' },
283
- { valueType: 'EDITED', value: null },
284
- ],
285
- },
286
- },
287
- ],
288
- [
289
- { value: 'other', label: 'Other', colspan: '2' },
290
- {
291
- id: 'other',
292
- componentType: 'InputNumber',
293
- min: 0,
294
- max: 100,
295
- response: {
296
- name: 'INPUT_NUMBER_6',
297
- valueState: [
298
- { valueType: 'COLLECTED', value: null },
299
- { valueType: 'FORCED', value: null },
300
- { valueType: 'EDITED', value: null },
301
- ],
302
- },
303
- },
304
- ],
305
- ]}
306
- tooltip={boolean('Tooltip', false)}
307
- />
308
- ));
309
-
310
- stories.addWithJSX('TwoAxisOneMeasure', () => (
311
- <Table
312
- {...defaultProps}
313
- id="two-axis"
314
- label="What dimensions do you value and in which countries"
315
- cells={[
316
- [
317
- { label: '' },
318
- { value: '1', label: 'Population', headerCell: true },
319
- { value: '2', label: 'Monuments', headerCell: true },
320
- { value: '3', label: 'Climate', headerCell: true },
321
- { value: '4', label: 'Gastronomy', headerCell: true },
322
- ],
323
- [
324
- { value: '1', label: 'Belgium' },
325
- {
326
- id: '11',
327
- componentType: 'CheckboxBoolean',
328
- response: {
329
- name: 'CHECKBOX_BOOLEAN_11',
330
- valueState: [
331
- { valueType: 'COLLECTED', value: true },
332
- { valueType: 'FORCED', value: null },
333
- { valueType: 'EDITED', value: null },
334
- ],
335
- },
336
- },
337
- {
338
- id: '12',
339
- componentType: 'CheckboxBoolean',
340
- response: {
341
- name: 'CHECKBOX_BOOLEAN_12',
342
- valueState: [
343
- { valueType: 'COLLECTED', value: false },
344
- { valueType: 'FORCED', value: null },
345
- { valueType: 'EDITED', value: null },
346
- ],
347
- },
348
- },
349
- {
350
- id: '13',
351
- componentType: 'CheckboxBoolean',
352
- response: {
353
- name: 'CHECKBOX_BOOLEAN_13',
354
- valueState: [
355
- { valueType: 'COLLECTED', value: false },
356
- { valueType: 'FORCED', value: true },
357
- { valueType: 'EDITED', value: false },
358
- ],
359
- },
360
- },
361
- {
362
- id: '14',
363
- componentType: 'CheckboxBoolean',
364
- response: {
365
- name: 'CHECKBOX_BOOLEAN_14',
366
- valueState: [
367
- { valueType: 'COLLECTED', value: null },
368
- { valueType: 'FORCED', value: null },
369
- { valueType: 'EDITED', value: null },
370
- ],
371
- },
372
- },
373
- ],
374
- [
375
- { value: '2', label: 'France' },
376
- {
377
- id: '21',
378
- componentType: 'CheckboxBoolean',
379
- response: {
380
- name: 'CHECKBOX_BOOLEAN_21',
381
- valueState: [
382
- { valueType: 'COLLECTED', value: null },
383
- { valueType: 'FORCED', value: null },
384
- { valueType: 'EDITED', value: null },
385
- ],
386
- },
387
- },
388
- {
389
- id: '22',
390
- componentType: 'CheckboxBoolean',
391
- response: {
392
- name: 'CHECKBOX_BOOLEAN_22',
393
- valueState: [
394
- { valueType: 'COLLECTED', value: false },
395
- { valueType: 'FORCED', value: true },
396
- { valueType: 'EDITED', value: null },
397
- ],
398
- },
399
- },
400
- {
401
- id: '23',
402
- componentType: 'CheckboxBoolean',
403
- response: {
404
- name: 'CHECKBOX_BOOLEAN_23',
405
- valueState: [
406
- { valueType: 'COLLECTED', value: null },
407
- { valueType: 'FORCED', value: null },
408
- { valueType: 'EDITED', value: null },
409
- ],
410
- },
411
- },
412
- {
413
- id: '24',
414
- componentType: 'CheckboxBoolean',
415
- response: {
416
- name: 'CHECKBOX_BOOLEAN_24',
417
- valueState: [
418
- { valueType: 'COLLECTED', value: null },
419
- { valueType: 'FORCED', value: null },
420
- { valueType: 'EDITED', value: null },
421
- ],
422
- },
423
- },
424
- ],
425
- [
426
- { value: '3', label: 'Italy' },
427
- {
428
- id: '31',
429
- componentType: 'CheckboxBoolean',
430
- response: {
431
- name: 'CHECKBOX_BOOLEAN_31',
432
- valueState: [
433
- { valueType: 'COLLECTED', value: false },
434
- { valueType: 'FORCED', value: null },
435
- { valueType: 'EDITED', value: null },
436
- ],
437
- },
438
- },
439
- {
440
- id: '32',
441
- componentType: 'CheckboxBoolean',
442
- response: {
443
- name: 'CHECKBOX_BOOLEAN_32',
444
- valueState: [
445
- { valueType: 'COLLECTED', value: false },
446
- { valueType: 'FORCED', value: true },
447
- { valueType: 'EDITED', value: false },
448
- ],
449
- },
450
- },
451
- {
452
- id: '33',
453
- componentType: 'CheckboxBoolean',
454
- response: {
455
- name: 'CHECKBOX_BOOLEAN_33',
456
- valueState: [
457
- { valueType: 'COLLECTED', value: null },
458
- { valueType: 'FORCED', value: true },
459
- { valueType: 'EDITED', value: false },
460
- ],
461
- },
462
- },
463
- {
464
- id: '34',
465
- componentType: 'CheckboxBoolean',
466
- response: {
467
- name: 'CHECKBOX_BOOLEAN_34',
468
- valueState: [
469
- { valueType: 'COLLECTED', value: null },
470
- { valueType: 'FORCED', value: true },
471
- { valueType: 'EDITED', value: null },
472
- ],
473
- },
474
- },
475
- ],
476
- [
477
- { value: '4', label: 'Spain' },
478
- {
479
- id: '41',
480
- componentType: 'CheckboxBoolean',
481
- response: {
482
- name: 'CHECKBOX_BOOLEAN_41',
483
- valueState: [
484
- { valueType: 'COLLECTED', value: false },
485
- { valueType: 'FORCED', value: null },
486
- { valueType: 'EDITED', value: null },
487
- ],
488
- },
489
- },
490
- {
491
- id: '42',
492
- componentType: 'CheckboxBoolean',
493
- response: {
494
- name: 'CHECKBOX_BOOLEAN_42',
495
- valueState: [
496
- { valueType: 'COLLECTED', value: false },
497
- { valueType: 'FORCED', value: true },
498
- { valueType: 'EDITED', value: null },
499
- ],
500
- },
501
- },
502
- {
503
- id: '43',
504
- componentType: 'CheckboxBoolean',
505
- response: {
506
- name: 'CHECKBOX_BOOLEAN_43',
507
- valueState: [
508
- { valueType: 'COLLECTED', value: false },
509
- { valueType: 'FORCED', value: true },
510
- { valueType: 'EDITED', value: false },
511
- ],
512
- },
513
- },
514
- {
515
- id: '44',
516
- componentType: 'CheckboxBoolean',
517
- response: {
518
- name: 'CHECKBOX_BOOLEAN_44',
519
- valueState: [
520
- { valueType: 'COLLECTED', value: false },
521
- { valueType: 'FORCED', value: null },
522
- { valueType: 'EDITED', value: null },
523
- ],
524
- },
525
- },
526
- ],
527
- ]}
528
- tooltip={boolean('Tooltip', false)}
529
- />
530
- ));
531
-
532
- stories.addWithJSX('Roster', () => (
533
- <Table
534
- {...defaultProps}
535
- id="roster"
536
- label="Family composition"
537
- lines={{ min: 1, max: 9 }}
538
- cells={[
539
- [
540
- { label: 'Sex', headerCell: true },
541
- { label: 'First name', headerCell: true },
542
- { label: 'Last name', headerCell: true },
543
- { label: 'Age', headerCell: true },
544
- ],
545
- [
546
- {
547
- id: '11',
548
- componentType: 'CheckboxOne',
549
- options: [
550
- { value: '1', label: 'Man' },
551
- { value: '2', label: 'Woman' },
552
- ],
553
- response: {
554
- name: 'CHECKBOX_ONE_11',
555
- valueState: [
556
- { valueType: 'COLLECTED', value: '1' },
557
- { valueType: 'FORCED', value: '2' },
558
- { valueType: 'EDITED', value: '1' },
559
- ],
560
- },
561
- },
562
- {
563
- id: '12',
564
- componentType: 'Input',
565
- response: {
566
- name: 'INPUT_12',
567
- valueState: [
568
- { valueType: 'COLLECTED', value: null },
569
- { valueType: 'FORCED', value: 'My forced input' },
570
- ],
571
- },
572
- },
573
- {
574
- id: '13',
575
- componentType: 'Input',
576
- response: {
577
- name: 'INPUT_13',
578
- valueState: [
579
- { valueType: 'COLLECTED', value: 'My collected input' },
580
- { valueType: 'FORCED', value: 'My forced input' },
581
- { valueType: 'EDITED', value: 'My edited input' },
582
- ],
583
- },
584
- },
585
- {
586
- id: '14',
587
- componentType: 'InputNumber',
588
- response: {
589
- name: 'INPUT_NUMBER_14',
590
- valueState: [
591
- { valueType: 'COLLECTED', value: '1' },
592
- { valueType: 'FORCED', value: '2' },
593
- ],
594
- },
595
- },
596
- ],
597
- [
598
- {
599
- id: '21',
600
- componentType: 'CheckboxOne',
601
- options: [
602
- { value: '1', label: 'Man' },
603
- { value: '2', label: 'Woman' },
604
- ],
605
- response: {
606
- name: 'CHECKBOX_ONE_21',
607
- valueState: [
608
- { valueType: 'COLLECTED', value: '1' },
609
- { valueType: 'FORCED', value: '2' },
610
- { valueType: 'EDITED', value: null },
611
- ],
612
- },
613
- },
614
- {
615
- id: '22',
616
- componentType: 'Input',
617
- response: {
618
- name: 'INPUT_22',
619
- valueState: [
620
- { valueType: 'COLLECTED', value: null },
621
- { valueType: 'FORCED', value: null },
622
- { valueType: 'EDITED', value: null },
623
- ],
624
- },
625
- },
626
- {
627
- id: '23',
628
- componentType: 'Input',
629
- response: {
630
- name: 'INPUT_23',
631
- valueState: [
632
- { valueType: 'COLLECTED', value: null },
633
- { valueType: 'FORCED', value: 'My forced input' },
634
- ],
635
- },
636
- },
637
- {
638
- id: '24',
639
- componentType: 'InputNumber',
640
- response: {
641
- name: 'INPUT_NUMBER_24',
642
- valueState: [{ valueType: 'COLLECTED', value: '1' }],
643
- },
644
- },
645
- ],
646
- [
647
- {
648
- id: '31',
649
- componentType: 'CheckboxOne',
650
- options: [
651
- { value: '1', label: 'Man' },
652
- { value: '2', label: 'Woman' },
653
- ],
654
- response: {
655
- name: 'CHECKBOX_ONE_31',
656
- valueState: [
657
- { valueType: 'COLLECTED', value: null },
658
- { valueType: 'FORCED', value: null },
659
- { valueType: 'EDITED', value: null },
660
- ],
661
- },
662
- },
663
- {
664
- id: '32',
665
- componentType: 'Input',
666
- response: {
667
- name: 'INPUT_32',
668
- valueState: [
669
- { valueType: 'COLLECTED', value: null },
670
- { valueType: 'FORCED', value: null },
671
- { valueType: 'EDITED', value: 'My edited input' },
672
- ],
673
- },
674
- },
675
- {
676
- id: '33',
677
- componentType: 'Input',
678
- response: {
679
- name: 'INPUT_33',
680
- valueState: [
681
- { valueType: 'COLLECTED', value: null },
682
- { valueType: 'FORCED', value: null },
683
- ],
684
- },
685
- },
686
- {
687
- id: '34',
688
- componentType: 'InputNumber',
689
- response: {
690
- name: 'INPUT_NUMBER_34',
691
- valueState: [
692
- { valueType: 'COLLECTED', value: '1' },
693
- { valueType: 'FORCED', value: '2' },
694
- { valueType: 'EDITED', value: '3' },
695
- ],
696
- },
697
- },
698
- ],
699
- [
700
- {
701
- id: '41',
702
- componentType: 'CheckboxOne',
703
- options: [
704
- { value: '1', label: 'Man' },
705
- { value: '2', label: 'Woman' },
706
- ],
707
- response: {
708
- name: 'CHECKBOX_ONE_11',
709
- valueState: [
710
- { valueType: 'COLLECTED', value: null },
711
- { valueType: 'FORCED', value: null },
712
- { valueType: 'EDITED', value: null },
713
- ],
714
- },
715
- },
716
- {
717
- id: '42',
718
- componentType: 'Input',
719
- response: {
720
- name: 'INPUT_42',
721
- valueState: [
722
- { valueType: 'COLLECTED', value: null },
723
- { valueType: 'FORCED', value: null },
724
- ],
725
- },
726
- },
727
- {
728
- id: '43',
729
- componentType: 'Input',
730
- response: {
731
- name: 'INPUT_43',
732
- valueState: [
733
- { valueType: 'COLLECTED', value: null },
734
- { valueType: 'FORCED', value: null },
735
- { valueType: 'EDITED', value: null },
736
- ],
737
- },
738
- },
739
- {
740
- id: '44',
741
- componentType: 'InputNumber',
742
- response: {
743
- name: 'INPUT_NUMBER_44',
744
- valueState: [
745
- { valueType: 'COLLECTED', value: null },
746
- { valueType: 'FORCED', value: null },
747
- { valueType: 'EDITED', value: null },
748
- ],
749
- },
750
- },
751
- ],
752
- [
753
- {
754
- id: '51',
755
- componentType: 'CheckboxOne',
756
- options: [
757
- { value: '1', label: 'Man' },
758
- { value: '2', label: 'Woman' },
759
- ],
760
- response: {
761
- name: 'CHECKBOX_ONE_51',
762
- valueState: [
763
- { valueType: 'COLLECTED', value: null },
764
- { valueType: 'FORCED', value: null },
765
- { valueType: 'EDITED', value: null },
766
- ],
767
- },
768
- },
769
- {
770
- id: '52',
771
- componentType: 'Input',
772
- response: {
773
- name: 'INPUT_52',
774
- valueState: [
775
- { valueType: 'COLLECTED', value: null },
776
- { valueType: 'FORCED', value: null },
777
- { valueType: 'EDITED', value: null },
778
- ],
779
- },
780
- },
781
- {
782
- id: '53',
783
- componentType: 'Input',
784
- response: {
785
- name: 'INPUT_53',
786
- valueState: [
787
- { valueType: 'COLLECTED', value: null },
788
- { valueType: 'FORCED', value: null },
789
- { valueType: 'EDITED', value: null },
790
- ],
791
- },
792
- },
793
- {
794
- id: '54',
795
- componentType: 'InputNumber',
796
- response: {
797
- name: 'INPUT_NUMBER_54',
798
- valueState: [
799
- { valueType: 'COLLECTED', value: null },
800
- { valueType: 'FORCED', value: null },
801
- { valueType: 'EDITED', value: null },
802
- ],
803
- },
804
- },
805
- ],
806
- [
807
- {
808
- id: '61',
809
- componentType: 'CheckboxOne',
810
- options: [
811
- { value: '1', label: 'Man' },
812
- { value: '2', label: 'Woman' },
813
- ],
814
- response: {
815
- name: 'CHECKBOX_ONE_61',
816
- valueState: [
817
- { valueType: 'COLLECTED', value: null },
818
- { valueType: 'FORCED', value: null },
819
- { valueType: 'EDITED', value: null },
820
- ],
821
- },
822
- },
823
- {
824
- id: '62',
825
- componentType: 'Input',
826
- response: {
827
- name: 'INPUT_62',
828
- valueState: [
829
- { valueType: 'COLLECTED', value: null },
830
- { valueType: 'FORCED', value: null },
831
- ],
832
- },
833
- },
834
- {
835
- id: '63',
836
- componentType: 'Input',
837
- response: {
838
- name: 'INPUT_63',
839
- valueState: [
840
- { valueType: 'COLLECTED', value: null },
841
- { valueType: 'FORCED', value: null },
842
- { valueType: 'EDITED', value: null },
843
- ],
844
- },
845
- },
846
- {
847
- id: '64',
848
- componentType: 'InputNumber',
849
- response: {
850
- name: 'INPUT_NUMBER_64',
851
- valueState: [
852
- { valueType: 'COLLECTED', value: null },
853
- { valueType: 'FORCED', value: null },
854
- { valueType: 'EDITED', value: null },
855
- ],
856
- },
857
- },
858
- ],
859
- [
860
- {
861
- id: '71',
862
- componentType: 'CheckboxOne',
863
- options: [
864
- { value: '1', label: 'Man' },
865
- { value: '2', label: 'Woman' },
866
- ],
867
- response: {
868
- name: 'CHECKBOX_ONE_71',
869
- valueState: [
870
- { valueType: 'COLLECTED', value: null },
871
- { valueType: 'FORCED', value: null },
872
- { valueType: 'EDITED', value: null },
873
- ],
874
- },
875
- },
876
- {
877
- id: '72',
878
- componentType: 'Input',
879
- response: {
880
- name: 'INPUT_72',
881
- valueState: [
882
- { valueType: 'COLLECTED', value: null },
883
- { valueType: 'FORCED', value: null },
884
- ],
885
- },
886
- },
887
- {
888
- id: '73',
889
- componentType: 'Input',
890
- response: {
891
- name: 'INPUT_73',
892
- valueState: [
893
- { valueType: 'COLLECTED', value: null },
894
- { valueType: 'FORCED', value: null },
895
- { valueType: 'EDITED', value: null },
896
- ],
897
- },
898
- },
899
- {
900
- id: '74',
901
- componentType: 'InputNumber',
902
- response: {
903
- name: 'INPUT_NUMBER_74',
904
- valueState: [
905
- { valueType: 'COLLECTED', value: null },
906
- { valueType: 'FORCED', value: null },
907
- { valueType: 'EDITED', value: null },
908
- ],
909
- },
910
- },
911
- ],
912
- [
913
- {
914
- id: '81',
915
- componentType: 'CheckboxOne',
916
- options: [
917
- { value: '1', label: 'Man' },
918
- { value: '2', label: 'Woman' },
919
- ],
920
- response: {
921
- name: 'CHECKBOX_ONE_81',
922
- valueState: [
923
- { valueType: 'COLLECTED', value: null },
924
- { valueType: 'FORCED', value: null },
925
- { valueType: 'EDITED', value: null },
926
- ],
927
- },
928
- },
929
- {
930
- id: '82',
931
- componentType: 'Input',
932
- response: {
933
- name: 'INPUT_82',
934
- valueState: [
935
- { valueType: 'COLLECTED', value: null },
936
- { valueType: 'FORCED', value: null },
937
- { valueType: 'EDITED', value: null },
938
- ],
939
- },
940
- },
941
- {
942
- id: '83',
943
- componentType: 'Input',
944
- response: {
945
- name: 'INPUT_83',
946
- valueState: [
947
- { valueType: 'COLLECTED', value: null },
948
- { valueType: 'FORCED', value: null },
949
- ],
950
- },
951
- },
952
- {
953
- id: '84',
954
- componentType: 'InputNumber',
955
- response: {
956
- name: 'INPUT_NUMBER_84',
957
- valueState: [
958
- { valueType: 'COLLECTED', value: null },
959
- { valueType: 'FORCED', value: null },
960
- { valueType: 'EDITED', value: null },
961
- ],
962
- },
963
- },
964
- ],
965
- [
966
- {
967
- id: '91',
968
- componentType: 'CheckboxOne',
969
- options: [
970
- { value: '1', label: 'Man' },
971
- { value: '2', label: 'Woman' },
972
- ],
973
- response: {
974
- name: 'CHECKBOX_ONE_91',
975
- valueState: [
976
- { valueType: 'COLLECTED', value: null },
977
- { valueType: 'FORCED', value: null },
978
- { valueType: 'EDITED', value: null },
979
- ],
980
- },
981
- },
982
- {
983
- id: '92',
984
- componentType: 'Input',
985
- response: {
986
- name: 'INPUT_92',
987
- valueState: [
988
- { valueType: 'COLLECTED', value: null },
989
- { valueType: 'FORCED', value: null },
990
- { valueType: 'EDITED', value: null },
991
- ],
992
- },
993
- },
994
- {
995
- id: '93',
996
- componentType: 'Input',
997
- response: {
998
- name: 'INPUT_93',
999
- valueState: [
1000
- { valueType: 'COLLECTED', value: null },
1001
- { valueType: 'FORCED', value: null },
1002
- ],
1003
- },
1004
- },
1005
- {
1006
- id: '94',
1007
- componentType: 'InputNumber',
1008
- response: {
1009
- name: 'INPUT_NUMBER_94',
1010
- valueState: [
1011
- { valueType: 'COLLECTED', value: null },
1012
- { valueType: 'FORCED', value: null },
1013
- { valueType: 'EDITED', value: null },
1014
- ],
1015
- },
1016
- },
1017
- ],
1018
- ]}
1019
- tooltip={boolean('Tooltip', false)}
1020
- />
1021
- ));