@inseefr/lunatic 3.5.0-rc.0 → 3.5.0-rc.1

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 (392) hide show
  1. package/components/Datepicker/Datepicker.js +1 -1
  2. package/components/Datepicker/Datepicker.js.map +1 -1
  3. package/components/Duration/Duration.js +3 -2
  4. package/components/Duration/Duration.js.map +1 -1
  5. package/components/Input/Input.js +6 -3
  6. package/components/Input/Input.js.map +1 -1
  7. package/components/Input/Input.spec.js +25 -0
  8. package/components/Input/Input.spec.js.map +1 -1
  9. package/components/InputNumber/InputNumber.js +1 -1
  10. package/components/InputNumber/InputNumber.js.map +1 -1
  11. package/components/InputNumber/InputNumber.spec.js +9 -1
  12. package/components/InputNumber/InputNumber.spec.js.map +1 -1
  13. package/components/InputNumber/InputNumberThousand.d.ts +2 -1
  14. package/components/InputNumber/InputNumberThousand.js +8 -2
  15. package/components/InputNumber/InputNumberThousand.js.map +1 -1
  16. package/components/Loop/Loop.js +1 -1
  17. package/components/Loop/Loop.js.map +1 -1
  18. package/components/Loop/Loop.spec.d.ts +1 -0
  19. package/components/Loop/Loop.spec.js +39 -0
  20. package/components/Loop/Loop.spec.js.map +1 -0
  21. package/components/Roundabout/CustomRoundabout.d.ts +1 -1
  22. package/components/Roundabout/CustomRoundabout.js +4 -3
  23. package/components/Roundabout/CustomRoundabout.js.map +1 -1
  24. package/components/Roundabout/roundabout.spec.js +3 -1
  25. package/components/Roundabout/roundabout.spec.js.map +1 -1
  26. package/components/Textarea/Textarea.js +4 -1
  27. package/components/Textarea/Textarea.js.map +1 -1
  28. package/components/Textarea/Textarea.spec.js +13 -0
  29. package/components/Textarea/Textarea.spec.js.map +1 -1
  30. package/components/shared/CharactersCount/CharactersCount.d.ts +7 -0
  31. package/components/shared/CharactersCount/CharactersCount.js +20 -0
  32. package/components/shared/CharactersCount/CharactersCount.js.map +1 -0
  33. package/components/shared/CharactersCount/CharactersCount.spec.d.ts +1 -0
  34. package/components/shared/CharactersCount/CharactersCount.spec.js +28 -0
  35. package/components/shared/CharactersCount/CharactersCount.spec.js.map +1 -0
  36. package/components/shared/Label/Label.js +1 -1
  37. package/components/shared/Label/Label.js.map +1 -1
  38. package/components/shared/Label/Label.spec.js +11 -3
  39. package/components/shared/Label/Label.spec.js.map +1 -1
  40. package/components/shared/utils/getCharactersCountId.d.ts +4 -0
  41. package/components/shared/utils/getCharactersCountId.js +10 -0
  42. package/components/shared/utils/getCharactersCountId.js.map +1 -0
  43. package/components/type.d.ts +1 -0
  44. package/esm/components/Datepicker/Datepicker.js +1 -1
  45. package/esm/components/Datepicker/Datepicker.js.map +1 -1
  46. package/esm/components/Duration/Duration.js +3 -2
  47. package/esm/components/Duration/Duration.js.map +1 -1
  48. package/esm/components/Input/Input.js +6 -3
  49. package/esm/components/Input/Input.js.map +1 -1
  50. package/esm/components/Input/Input.spec.js +25 -0
  51. package/esm/components/Input/Input.spec.js.map +1 -1
  52. package/esm/components/InputNumber/InputNumber.js +1 -1
  53. package/esm/components/InputNumber/InputNumber.js.map +1 -1
  54. package/esm/components/InputNumber/InputNumber.spec.js +9 -1
  55. package/esm/components/InputNumber/InputNumber.spec.js.map +1 -1
  56. package/esm/components/InputNumber/InputNumberThousand.d.ts +2 -1
  57. package/esm/components/InputNumber/InputNumberThousand.js +8 -2
  58. package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
  59. package/esm/components/Loop/Loop.js +1 -1
  60. package/esm/components/Loop/Loop.js.map +1 -1
  61. package/esm/components/Loop/Loop.spec.d.ts +1 -0
  62. package/esm/components/Loop/Loop.spec.js +37 -0
  63. package/esm/components/Loop/Loop.spec.js.map +1 -0
  64. package/esm/components/Roundabout/CustomRoundabout.d.ts +1 -1
  65. package/esm/components/Roundabout/CustomRoundabout.js +4 -3
  66. package/esm/components/Roundabout/CustomRoundabout.js.map +1 -1
  67. package/esm/components/Roundabout/roundabout.spec.js +3 -1
  68. package/esm/components/Roundabout/roundabout.spec.js.map +1 -1
  69. package/esm/components/Textarea/Textarea.js +4 -1
  70. package/esm/components/Textarea/Textarea.js.map +1 -1
  71. package/esm/components/Textarea/Textarea.spec.js +13 -0
  72. package/esm/components/Textarea/Textarea.spec.js.map +1 -1
  73. package/esm/components/shared/CharactersCount/CharactersCount.d.ts +7 -0
  74. package/esm/components/shared/CharactersCount/CharactersCount.js +15 -0
  75. package/esm/components/shared/CharactersCount/CharactersCount.js.map +1 -0
  76. package/esm/components/shared/CharactersCount/CharactersCount.spec.d.ts +1 -0
  77. package/esm/components/shared/CharactersCount/CharactersCount.spec.js +26 -0
  78. package/esm/components/shared/CharactersCount/CharactersCount.spec.js.map +1 -0
  79. package/esm/components/shared/Label/Label.js +1 -1
  80. package/esm/components/shared/Label/Label.js.map +1 -1
  81. package/esm/components/shared/Label/Label.spec.js +11 -3
  82. package/esm/components/shared/Label/Label.spec.js.map +1 -1
  83. package/esm/components/shared/utils/getCharactersCountId.d.ts +4 -0
  84. package/esm/components/shared/utils/getCharactersCountId.js +7 -0
  85. package/esm/components/shared/utils/getCharactersCountId.js.map +1 -0
  86. package/esm/components/type.d.ts +1 -0
  87. package/esm/main.css +20 -0
  88. package/esm/main.css.map +1 -1
  89. package/esm/stories/overview/sourceWithHierarchy.json +5151 -0
  90. package/esm/tests/utils/lunatic.d.ts +0 -4
  91. package/esm/tests/utils/lunatic.js +0 -4
  92. package/esm/tests/utils/lunatic.js.map +1 -1
  93. package/esm/type.source.d.ts +6 -6
  94. package/esm/type.source.js +0 -1
  95. package/esm/type.source.js.map +1 -1
  96. package/esm/use-lunatic/commons/page.js +8 -0
  97. package/esm/use-lunatic/commons/page.js.map +1 -1
  98. package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +1 -1
  99. package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +111 -14
  100. package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
  101. package/esm/use-lunatic/commons/variables/get-questionnaire-data.js +0 -8
  102. package/esm/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -1
  103. package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +2 -2
  104. package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +5 -3
  105. package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
  106. package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +164 -8
  107. package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
  108. package/esm/use-lunatic/hooks/use-page-has-response.js +50 -35
  109. package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  110. package/esm/use-lunatic/hooks/useOverview.d.ts +1 -1
  111. package/esm/use-lunatic/hooks/useOverview.js +19 -14
  112. package/esm/use-lunatic/hooks/useOverview.js.map +1 -1
  113. package/esm/use-lunatic/hooks/useOverview.spec.d.ts +1 -0
  114. package/esm/use-lunatic/hooks/useOverview.spec.js +38 -0
  115. package/esm/use-lunatic/hooks/useOverview.spec.js.map +1 -0
  116. package/esm/use-lunatic/props/getComponentTypeProps.d.ts +1 -0
  117. package/esm/use-lunatic/props/propValue.js +18 -6
  118. package/esm/use-lunatic/props/propValue.js.map +1 -1
  119. package/esm/use-lunatic/props/propValue.spec.js +97 -2
  120. package/esm/use-lunatic/props/propValue.spec.js.map +1 -1
  121. package/esm/use-lunatic/reducer/reducerInitializer.d.ts +2 -2
  122. package/esm/use-lunatic/reducer/reducerInitializer.js +25 -32
  123. package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  124. package/esm/use-lunatic/test.utils.d.ts +2 -0
  125. package/esm/use-lunatic/test.utils.js +13 -0
  126. package/esm/use-lunatic/test.utils.js.map +1 -0
  127. package/esm/use-lunatic/type.d.ts +0 -4
  128. package/esm/use-lunatic/use-lunatic.d.ts +1 -2
  129. package/esm/use-lunatic/use-lunatic.js.map +1 -1
  130. package/esm/utils/cast.d.ts +19 -0
  131. package/esm/utils/cast.js +63 -0
  132. package/esm/utils/cast.js.map +1 -0
  133. package/esm/utils/constants/variable-status.d.ts +0 -4
  134. package/esm/utils/constants/variable-status.js +0 -4
  135. package/esm/utils/constants/variable-status.js.map +1 -1
  136. package/esm/utils/variables.spec.js +0 -8
  137. package/esm/utils/variables.spec.js.map +1 -1
  138. package/main.css +20 -0
  139. package/main.css.map +1 -1
  140. package/package.json +61 -69
  141. package/src/components/Datepicker/Datepicker.tsx +1 -1
  142. package/src/components/Datepicker/__snapshots__/Datepicker.spec.tsx.snap +2 -2
  143. package/src/components/Duration/Duration.test.tsx +52 -0
  144. package/src/components/Duration/Duration.tsx +17 -4
  145. package/src/components/Input/Input.spec.tsx +34 -0
  146. package/src/components/Input/Input.tsx +26 -18
  147. package/src/components/Input/__snapshots__/Input.spec.tsx.snap +38 -19
  148. package/src/components/InputNumber/InputNumber.spec.tsx +15 -1
  149. package/src/components/InputNumber/InputNumber.tsx +1 -0
  150. package/src/components/InputNumber/InputNumberThousand.tsx +11 -1
  151. package/src/components/Loop/Loop.spec.tsx +77 -0
  152. package/src/components/Loop/Loop.tsx +1 -1
  153. package/src/components/RosterForLoop/__snapshots__/RosterForLoop.spec.tsx.snap +42 -20
  154. package/src/components/Roundabout/CustomRoundabout.tsx +13 -4
  155. package/src/components/Roundabout/roundabout.spec.tsx +3 -0
  156. package/src/components/Textarea/Textarea.spec.tsx +18 -0
  157. package/src/components/Textarea/Textarea.tsx +21 -13
  158. package/src/components/Textarea/__snapshots__/Textarea.spec.tsx.snap +21 -11
  159. package/src/components/shared/CharactersCount/CharactersCount.spec.tsx +31 -0
  160. package/src/components/shared/CharactersCount/CharactersCount.tsx +27 -0
  161. package/src/components/shared/Label/Label.spec.tsx +15 -3
  162. package/src/components/shared/Label/Label.tsx +1 -1
  163. package/src/components/shared/utils/getCharactersCountId.test.ts +14 -0
  164. package/src/components/shared/utils/getCharactersCountId.ts +6 -0
  165. package/src/components/type.ts +1 -0
  166. package/src/css/components/Input.scss +10 -0
  167. package/src/css/components/Roundabout.scss +10 -0
  168. package/src/stories/accordion/source.json +1 -5
  169. package/src/stories/behaviour/cleaning/cleaning.stories.jsx +11 -0
  170. package/src/stories/behaviour/cleaning/loop.json +246 -0
  171. package/src/stories/behaviour/cleaning/source-loop.json +3 -15
  172. package/src/stories/behaviour/cleaning/source.json +2 -10
  173. package/src/stories/behaviour/controls/boucles-n.json +2 -10
  174. package/src/stories/behaviour/controls/loop.json +2 -10
  175. package/src/stories/behaviour/controls/roundabout.json +3 -15
  176. package/src/stories/behaviour/controls/simple-numeric.json +19 -95
  177. package/src/stories/behaviour/controls/simple.json +7 -35
  178. package/src/stories/behaviour/filter/dataLoop.json +0 -8
  179. package/src/stories/behaviour/filter/source.json +0 -12
  180. package/src/stories/behaviour/filter/sourceLoop.json +0 -12
  181. package/src/stories/behaviour/missing/source.json +12 -60
  182. package/src/stories/behaviour/others/V2_DeclarationsSimples.json +14 -70
  183. package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +5 -25
  184. package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +107 -535
  185. package/src/stories/behaviour/others/V2_TCMRallyeGames.json +33 -165
  186. package/src/stories/behaviour/others/test-dylan.json +5 -25
  187. package/src/stories/behaviour/paste/source.json +1 -5
  188. package/src/stories/behaviour/performance/performance.stories.jsx +9 -1
  189. package/src/stories/behaviour/performance/source.json +4 -20
  190. package/src/stories/behaviour/performance/srcv.json +44747 -0
  191. package/src/stories/behaviour/resizing/source-resizing-cleaning.json +2 -10
  192. package/src/stories/behaviour/resizing/source.json +5 -25
  193. package/src/stories/checkbox-boolean/source.json +1 -5
  194. package/src/stories/checkbox-group/source.json +16 -80
  195. package/src/stories/checkbox-group/sourceCondition.json +3 -15
  196. package/src/stories/checkbox-group/sourceDetail.json +18 -90
  197. package/src/stories/checkbox-group/sourceLoop.json +2 -10
  198. package/src/stories/checkbox-one/source.json +1 -5
  199. package/src/stories/checkbox-one/sourceDetail.json +2 -10
  200. package/src/stories/date-picker/source.json +1 -5
  201. package/src/stories/declaration/source.json +2 -10
  202. package/src/stories/disabled/data.json +0 -16
  203. package/src/stories/disabled/source.json +7 -35
  204. package/src/stories/dropdown/data.json +2 -10
  205. package/src/stories/dropdown/source.json +2 -10
  206. package/src/stories/duration/mois.json +1 -5
  207. package/src/stories/duration/time.json +1 -5
  208. package/src/stories/filter-description/source-options.json +3 -15
  209. package/src/stories/input/source.json +1 -5
  210. package/src/stories/input-number/input-number.stories.jsx +5 -0
  211. package/src/stories/input-number/source-big-number.json +27 -0
  212. package/src/stories/input-number/source-euro.json +2 -6
  213. package/src/stories/input-number/source.json +1 -5
  214. package/src/stories/loop/source-bloc.json +2 -10
  215. package/src/stories/loop/source-paginated.json +2 -10
  216. package/src/stories/loop/source-roster.json +2 -10
  217. package/src/stories/loop/source-with-header.json +2 -10
  218. package/src/stories/overview/dataLoop.json +24 -120
  219. package/src/stories/overview/overview.stories.jsx +9 -0
  220. package/src/stories/overview/source.json +1 -5
  221. package/src/stories/overview/sourceLoop.json +24 -120
  222. package/src/stories/overview/sourceWithHierarchy.json +164 -820
  223. package/src/stories/pairwise/source.json +5 -25
  224. package/src/stories/question/source.json +2 -10
  225. package/src/stories/questionnaires/logement/data.json +0 -1288
  226. package/src/stories/questionnaires/logement/source-sequence.json +564 -2820
  227. package/src/stories/questionnaires/logement/source-sum.json +280 -1400
  228. package/src/stories/questionnaires/logement/source.json +564 -2820
  229. package/src/stories/questionnaires/recensement/source.json +106 -530
  230. package/src/stories/questionnaires/rp/source.json +8 -40
  231. package/src/stories/questionnaires/simpsons/source.json +104 -520
  232. package/src/stories/radio/source.json +1 -5
  233. package/src/stories/radio/sourceCondition.json +2 -10
  234. package/src/stories/radio/sourceDetail.json +2 -10
  235. package/src/stories/radio/sourceHorizontal.json +1 -5
  236. package/src/stories/roundabout/data1.json +0 -12
  237. package/src/stories/roundabout/data2.json +0 -16
  238. package/src/stories/roundabout/source.json +11 -35
  239. package/src/stories/suggester/source-arbitrary-response.json +6 -30
  240. package/src/stories/suggester/source-error.json +6 -30
  241. package/src/stories/suggester/source-multiline.json +0 -16
  242. package/src/stories/suggester/source-option-responses.json +5 -25
  243. package/src/stories/suggester/source.json +7 -35
  244. package/src/stories/summary/data.json +0 -16
  245. package/src/stories/summary/source.json +7 -35
  246. package/src/stories/switch/data-forced.json +2 -10
  247. package/src/stories/switch/source.json +4 -20
  248. package/src/stories/table/source-colspan.json +8 -40
  249. package/src/stories/table/table-dynamique.json +1 -5
  250. package/src/stories/text/source-roster.json +3 -15
  251. package/src/stories/text/source-table.json +9 -45
  252. package/src/stories/textarea/source.json +1 -5
  253. package/src/stories/utils/{SchemaValidator.tsx → SchemaValidator.jsx} +1 -1
  254. package/src/stories/utils/{orchestrator.tsx → orchestrator.jsx} +9 -13
  255. package/src/stories/utils/{overview.tsx → overview.jsx} +0 -2
  256. package/src/tests/utils/lunatic.ts +0 -4
  257. package/src/type.source.ts +8 -7
  258. package/src/use-lunatic/__snapshots__/use-lunatic.test.ts.snap +0 -1159
  259. package/src/use-lunatic/commons/page.ts +10 -0
  260. package/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts +182 -24
  261. package/src/use-lunatic/commons/variables/get-questionnaire-data.ts +0 -12
  262. package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +190 -8
  263. package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +7 -4
  264. package/src/use-lunatic/hooks/use-page-has-response.test.ts +200 -0
  265. package/src/use-lunatic/hooks/use-page-has-response.ts +67 -44
  266. package/src/use-lunatic/hooks/useOverview.spec.ts +42 -0
  267. package/src/use-lunatic/hooks/useOverview.ts +41 -18
  268. package/src/use-lunatic/props/propValue.spec.ts +105 -2
  269. package/src/use-lunatic/props/propValue.ts +26 -8
  270. package/src/use-lunatic/reducer/reducerInitializer.tsx +31 -41
  271. package/src/use-lunatic/test.utils.ts +17 -0
  272. package/src/use-lunatic/type.ts +0 -4
  273. package/src/use-lunatic/use-lunatic.test.ts +2 -21
  274. package/src/use-lunatic/use-lunatic.ts +5 -4
  275. package/src/utils/cast.ts +67 -0
  276. package/src/utils/constants/variable-status.ts +0 -4
  277. package/src/utils/variables.spec.ts +0 -8
  278. package/stories/overview/sourceWithHierarchy.json +5151 -0
  279. package/tests/utils/lunatic.d.ts +0 -4
  280. package/tests/utils/lunatic.js +0 -4
  281. package/tests/utils/lunatic.js.map +1 -1
  282. package/tsconfig.build.tsbuildinfo +1 -1
  283. package/type.source.d.ts +6 -6
  284. package/type.source.js +0 -1
  285. package/type.source.js.map +1 -1
  286. package/use-lunatic/commons/page.js +8 -0
  287. package/use-lunatic/commons/page.js.map +1 -1
  288. package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +1 -1
  289. package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +111 -14
  290. package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
  291. package/use-lunatic/commons/variables/get-questionnaire-data.js +0 -8
  292. package/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -1
  293. package/use-lunatic/commons/variables/lunatic-variables-store.d.ts +2 -2
  294. package/use-lunatic/commons/variables/lunatic-variables-store.js +5 -3
  295. package/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
  296. package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +187 -8
  297. package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
  298. package/use-lunatic/hooks/use-page-has-response.js +49 -34
  299. package/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  300. package/use-lunatic/hooks/useOverview.d.ts +1 -1
  301. package/use-lunatic/hooks/useOverview.js +19 -14
  302. package/use-lunatic/hooks/useOverview.js.map +1 -1
  303. package/use-lunatic/hooks/useOverview.spec.d.ts +1 -0
  304. package/use-lunatic/hooks/useOverview.spec.js +43 -0
  305. package/use-lunatic/hooks/useOverview.spec.js.map +1 -0
  306. package/use-lunatic/props/getComponentTypeProps.d.ts +1 -0
  307. package/use-lunatic/props/propValue.js +18 -6
  308. package/use-lunatic/props/propValue.js.map +1 -1
  309. package/use-lunatic/props/propValue.spec.js +97 -2
  310. package/use-lunatic/props/propValue.spec.js.map +1 -1
  311. package/use-lunatic/reducer/reducerInitializer.d.ts +2 -2
  312. package/use-lunatic/reducer/reducerInitializer.js +25 -32
  313. package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  314. package/use-lunatic/test.utils.d.ts +2 -0
  315. package/use-lunatic/test.utils.js +17 -0
  316. package/use-lunatic/test.utils.js.map +1 -0
  317. package/use-lunatic/type.d.ts +0 -4
  318. package/use-lunatic/use-lunatic.d.ts +1 -2
  319. package/use-lunatic/use-lunatic.js.map +1 -1
  320. package/utils/cast.d.ts +19 -0
  321. package/utils/cast.js +70 -0
  322. package/utils/cast.js.map +1 -0
  323. package/utils/constants/variable-status.d.ts +0 -4
  324. package/utils/constants/variable-status.js +1 -5
  325. package/utils/constants/variable-status.js.map +1 -1
  326. package/utils/variables.spec.js +0 -8
  327. package/utils/variables.spec.js.map +1 -1
  328. package/constants/component-types.d.ts +0 -1
  329. package/constants/component-types.js +0 -5
  330. package/constants/component-types.js.map +0 -1
  331. package/constants/declarations.d.ts +0 -9
  332. package/constants/declarations.js +0 -15
  333. package/constants/declarations.js.map +0 -1
  334. package/constants/event-types.d.ts +0 -10
  335. package/constants/event-types.js +0 -16
  336. package/constants/event-types.js.map +0 -1
  337. package/constants/index.d.ts +0 -5
  338. package/constants/index.js +0 -22
  339. package/constants/index.js.map +0 -1
  340. package/constants/indexedDBStore.d.ts +0 -21
  341. package/constants/indexedDBStore.js +0 -22
  342. package/constants/indexedDBStore.js.map +0 -1
  343. package/constants/supported-preferences.d.ts +0 -1
  344. package/constants/supported-preferences.js +0 -36
  345. package/constants/supported-preferences.js.map +0 -1
  346. package/constants/value-types.d.ts +0 -5
  347. package/constants/value-types.js +0 -9
  348. package/constants/value-types.js.map +0 -1
  349. package/constants/variable-types.d.ts +0 -2
  350. package/constants/variable-types.js +0 -8
  351. package/constants/variable-types.js.map +0 -1
  352. package/esm/constants/component-types.d.ts +0 -1
  353. package/esm/constants/component-types.js +0 -2
  354. package/esm/constants/component-types.js.map +0 -1
  355. package/esm/constants/declarations.d.ts +0 -9
  356. package/esm/constants/declarations.js +0 -12
  357. package/esm/constants/declarations.js.map +0 -1
  358. package/esm/constants/event-types.d.ts +0 -10
  359. package/esm/constants/event-types.js +0 -13
  360. package/esm/constants/event-types.js.map +0 -1
  361. package/esm/constants/index.d.ts +0 -5
  362. package/esm/constants/index.js +0 -6
  363. package/esm/constants/index.js.map +0 -1
  364. package/esm/constants/indexedDBStore.d.ts +0 -21
  365. package/esm/constants/indexedDBStore.js +0 -19
  366. package/esm/constants/indexedDBStore.js.map +0 -1
  367. package/esm/constants/supported-preferences.d.ts +0 -1
  368. package/esm/constants/supported-preferences.js +0 -10
  369. package/esm/constants/supported-preferences.js.map +0 -1
  370. package/esm/constants/value-types.d.ts +0 -5
  371. package/esm/constants/value-types.js +0 -6
  372. package/esm/constants/value-types.js.map +0 -1
  373. package/esm/constants/variable-types.d.ts +0 -2
  374. package/esm/constants/variable-types.js +0 -5
  375. package/esm/constants/variable-types.js.map +0 -1
  376. package/esm/hooks/useArticulation.d.ts +0 -58
  377. package/esm/hooks/useArticulation.js +0 -81
  378. package/esm/hooks/useArticulation.js.map +0 -1
  379. package/hooks/useArticulation.d.ts +0 -58
  380. package/hooks/useArticulation.js +0 -81
  381. package/hooks/useArticulation.js.map +0 -1
  382. package/src/constants/component-types.ts +0 -1
  383. package/src/constants/declarations.ts +0 -14
  384. package/src/constants/event-types.ts +0 -13
  385. package/src/constants/index.ts +0 -5
  386. package/src/constants/indexedDBStore.ts +0 -20
  387. package/src/constants/supported-preferences.ts +0 -10
  388. package/src/constants/value-types.ts +0 -5
  389. package/src/constants/variable-types.ts +0 -4
  390. package/src/hooks/useArticulation.ts +0 -124
  391. package/src/stories/behaviour/articulation/articulation.stories.tsx +0 -105
  392. package/src/stories/behaviour/articulation/roundabout.json +0 -348
@@ -113,7 +113,7 @@ describe('InputNumber', () => {
113
113
  expect(unit).toHaveTextContent('kg');
114
114
  });
115
115
 
116
- it('should display the input value from the start', () => {
116
+ it('should display input value from the start when user leave input', () => {
117
117
  const setSelectionRangeMock = vi.fn();
118
118
  const { container } = render(
119
119
  <InputNumber
@@ -132,4 +132,18 @@ describe('InputNumber', () => {
132
132
  });
133
133
  expect(setSelectionRangeMock).toHaveBeenCalledWith(0, 0);
134
134
  });
135
+
136
+ it('should have the proper title', async () => {
137
+ const { getByTitle } = render(
138
+ <InputNumber {...baseProps} value={100000} unit="€" />
139
+ );
140
+ expect(getByTitle((content) => content.includes('€'))).toBeInTheDocument();
141
+ });
142
+
143
+ it('should have the proper title when equal to 0', async () => {
144
+ const { getByTitle } = render(
145
+ <InputNumber {...baseProps} value={0} unit="€" />
146
+ );
147
+ expect(getByTitle('0 €')).toBeInTheDocument();
148
+ });
135
149
  });
@@ -74,6 +74,7 @@ export const CustomInputNumber = slottableComponent<CustomProps>(
74
74
  max={max}
75
75
  decimals={decimals}
76
76
  invalid={!!errors}
77
+ unit={unit}
77
78
  />
78
79
  {unit && <span>{unit}</span>}
79
80
  <ComponentErrors errors={errors} />
@@ -18,6 +18,7 @@ type Props = {
18
18
  max?: number;
19
19
  decimals?: number;
20
20
  invalid?: boolean;
21
+ unit?: string;
21
22
  };
22
23
 
23
24
  export const InputNumberThousand = ({
@@ -31,6 +32,7 @@ export const InputNumberThousand = ({
31
32
  max,
32
33
  decimals,
33
34
  invalid,
35
+ unit,
34
36
  }: Props) => {
35
37
  const handleChange = useCallback<OnValueChange>(
36
38
  function (e) {
@@ -49,13 +51,21 @@ export const InputNumberThousand = ({
49
51
  },
50
52
  [max]
51
53
  );
54
+
55
+ // we want to display the user input and its unit on hover
56
+ let title;
57
+ if (value !== undefined && value !== null) {
58
+ const unitTitle = unit ? ` ${unit}` : '';
59
+ title = `${value.toLocaleString()}${unitTitle}`;
60
+ }
61
+
52
62
  return (
53
63
  <NumericFormat
54
64
  id={id}
55
65
  className={classNames({ disabled })}
56
66
  onValueChange={handleChange}
57
67
  value={value ?? ''}
58
- title={value ? value.toString() : ''}
68
+ title={title}
59
69
  aria-labelledby={labelId}
60
70
  disabled={disabled}
61
71
  readOnly={readOnly}
@@ -0,0 +1,77 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { Loop } from './Loop';
4
+ import type { LunaticComponentProps } from '../type';
5
+
6
+ describe('Loop', () => {
7
+ const mockOnChange = vi.fn();
8
+
9
+ beforeEach(() => {
10
+ mockOnChange.mockClear();
11
+ });
12
+
13
+ const getComponents = (iteration: number) => [
14
+ {
15
+ componentType: 'Input',
16
+ maxLength: 249,
17
+ id: 'nameId',
18
+ response: {
19
+ name: 'name',
20
+ },
21
+ iteration: iteration,
22
+ value: 'Jonathan Doe',
23
+ } as LunaticComponentProps<'Input'>,
24
+ ];
25
+
26
+ it('render the right number of lines by default', () => {
27
+ render(
28
+ <Loop
29
+ value={{ name: ['John Doe', 'Jane Doe'] }}
30
+ handleChanges={mockOnChange}
31
+ label="Ceci est un test"
32
+ id="table"
33
+ lines={{ min: 4, max: 10 }}
34
+ iterations={2}
35
+ getComponents={getComponents}
36
+ executeExpression={() => null as any}
37
+ />
38
+ );
39
+ expect(screen.getAllByRole('textbox')).toHaveLength(4);
40
+ });
41
+
42
+ it('disables the remove row button when the minimum number of rows is reached', () => {
43
+ render(
44
+ <Loop
45
+ value={{ name: ['John Doe', 'Jane Doe', 'Alice', 'Bob'] }}
46
+ handleChanges={mockOnChange}
47
+ label="Ceci est un test"
48
+ id="table"
49
+ lines={{ min: 4, max: 10 }}
50
+ iterations={4}
51
+ getComponents={getComponents}
52
+ executeExpression={() => null as any}
53
+ />
54
+ );
55
+
56
+ const Button = screen.getByRole('button', { name: /remove/i });
57
+ expect(Button).toBeDisabled();
58
+ });
59
+
60
+ it('enables the add row button when the maximum number of rows is not reached', () => {
61
+ render(
62
+ <Loop
63
+ value={{ name: ['John Doe', 'Jane Doe', 'Alice'] }}
64
+ handleChanges={mockOnChange}
65
+ label="Ceci est un test"
66
+ id="table"
67
+ lines={{ min: 2, max: 10 }}
68
+ iterations={3}
69
+ getComponents={getComponents}
70
+ executeExpression={() => null as any}
71
+ />
72
+ );
73
+
74
+ const Button = screen.getByRole('button', { name: /add/i });
75
+ expect(Button).not.toBeDisabled();
76
+ });
77
+ });
@@ -60,7 +60,7 @@ export function Loop({
60
60
  {...props}
61
61
  errors={getComponentErrors(errors, props.id)}
62
62
  addRow={nbRows === max ? undefined : addRow}
63
- removeRow={nbRows === 1 ? undefined : removeRow}
63
+ removeRow={nbRows === 1 || nbRows === min ? undefined : removeRow}
64
64
  canControlRows={min !== max && Number.isFinite(max)}
65
65
  >
66
66
  {times(nbRows, (n) => (
@@ -31,16 +31,27 @@ exports[`RosterForLoop > renders the right number of columns 1`] = `
31
31
  <div
32
32
  class="lunatic-input"
33
33
  >
34
- <input
35
- aria-invalid="false"
36
- aria-labelledby="label-jrc3ye5q-QOP-lo6tcvvx-0"
37
- autocomplete="off"
38
- id="jrc3ye5q-QOP-lo6tcvvx-0"
39
- maxlength="249"
40
- title="azeaze"
41
- type="text"
42
- value="azeaze"
43
- />
34
+ <div
35
+ class="field-with-count"
36
+ >
37
+ <input
38
+ aria-describedby="characters-count-jrc3ye5q-QOP-lo6tcvvx-0"
39
+ aria-invalid="false"
40
+ aria-labelledby="label-jrc3ye5q-QOP-lo6tcvvx-0"
41
+ autocomplete="off"
42
+ id="jrc3ye5q-QOP-lo6tcvvx-0"
43
+ maxlength="249"
44
+ title="azeaze"
45
+ type="text"
46
+ value="azeaze"
47
+ />
48
+ <span
49
+ class="characters-count"
50
+ id="characters-count-jrc3ye5q-QOP-lo6tcvvx-0"
51
+ >
52
+ 6/249
53
+ </span>
54
+ </div>
44
55
  </div>
45
56
  </div>
46
57
  </div>
@@ -61,16 +72,27 @@ exports[`RosterForLoop > renders the right number of columns 1`] = `
61
72
  <div
62
73
  class="lunatic-input"
63
74
  >
64
- <input
65
- aria-invalid="false"
66
- aria-labelledby="label-jrc3ye5q-QOP-lo6tcvvx-1"
67
- autocomplete="off"
68
- id="jrc3ye5q-QOP-lo6tcvvx-1"
69
- maxlength="249"
70
- title="azeaze"
71
- type="text"
72
- value="azeaze"
73
- />
75
+ <div
76
+ class="field-with-count"
77
+ >
78
+ <input
79
+ aria-describedby="characters-count-jrc3ye5q-QOP-lo6tcvvx-1"
80
+ aria-invalid="false"
81
+ aria-labelledby="label-jrc3ye5q-QOP-lo6tcvvx-1"
82
+ autocomplete="off"
83
+ id="jrc3ye5q-QOP-lo6tcvvx-1"
84
+ maxlength="249"
85
+ title="azeaze"
86
+ type="text"
87
+ value="azeaze"
88
+ />
89
+ <span
90
+ class="characters-count"
91
+ id="characters-count-jrc3ye5q-QOP-lo6tcvvx-1"
92
+ >
93
+ 6/249
94
+ </span>
95
+ </div>
74
96
  </div>
75
97
  </div>
76
98
  </div>
@@ -1,12 +1,13 @@
1
1
  import { slottableComponent } from '../shared/HOC/slottableComponent';
2
2
  import type { LunaticComponentProps } from '../type';
3
- import { Label } from '../shared/Label/Label';
4
3
  import type { ItemOf } from '../../type.utils';
5
4
  import { Button } from '../shared/Button/Button';
6
5
  import classnames from 'classnames';
7
6
  import { ComponentErrors } from '../shared/ComponentErrors/ComponentErrors';
8
7
  import type { LunaticError } from '../../use-lunatic/type';
9
8
  import type { ReactNode } from 'react';
9
+ import { Declarations } from '../shared/Declarations/Declarations';
10
+ import { LabelDescription } from '../shared/LabelDescription';
10
11
 
11
12
  type PropsItem = ItemOf<LunaticComponentProps<'Roundabout'>['items']> & {
12
13
  onClick: () => void;
@@ -60,7 +61,7 @@ function RoundaboutItem({
60
61
 
61
62
  type Props = Pick<
62
63
  LunaticComponentProps<'Roundabout'>,
63
- 'label' | 'locked' | 'id'
64
+ 'declarations' | 'description' | 'label' | 'locked' | 'id'
64
65
  > & {
65
66
  goToIteration: (v: number) => void;
66
67
  errors?: LunaticError[];
@@ -75,10 +76,18 @@ type Props = Pick<
75
76
 
76
77
  export const CustomRoundabout = slottableComponent<Props>(
77
78
  'Roundabout',
78
- ({ items, goToIteration, label, locked }) => {
79
+ ({ declarations, description, id, items, goToIteration, label, locked }) => {
79
80
  return (
80
81
  <div className="lunatic-roundabout">
81
- <Label>{label}</Label>
82
+ <div id={`roundabout-${id}`} className="lunatic-roundabout__label">
83
+ {label}
84
+ </div>
85
+ <LabelDescription value={description} />
86
+ <Declarations
87
+ type="AFTER_QUESTION_TEXT"
88
+ declarations={declarations}
89
+ id={id}
90
+ />
82
91
  <div className="lunatic-roundabout__items">
83
92
  {items.map((item, k) => (
84
93
  <RoundaboutItem
@@ -24,6 +24,7 @@ describe('Roundabout', () => {
24
24
  },
25
25
  ];
26
26
  const label = 'My Roundabout';
27
+ const description = 'Roundabout description';
27
28
 
28
29
  it('renders the roundabout correctly', () => {
29
30
  const { getByText } = render(
@@ -32,6 +33,7 @@ describe('Roundabout', () => {
32
33
  items={items}
33
34
  goToIteration={mockGoToIteration}
34
35
  locked={false}
36
+ description={description}
35
37
  />
36
38
  );
37
39
 
@@ -41,6 +43,7 @@ describe('Roundabout', () => {
41
43
  expect(getByText('Complété')).toBeInTheDocument();
42
44
  expect(getByText('Modifier')).toBeInTheDocument();
43
45
  expect(getByText('Commencer')).toBeInTheDocument();
46
+ expect(getByText('Roundabout description')).toBeInTheDocument();
44
47
  });
45
48
 
46
49
  it('calls the goToIteration function when a button is clicked', () => {
@@ -1,6 +1,11 @@
1
1
  import { render } from '@testing-library/react';
2
2
  import { beforeEach, describe, expect, it, vi } from 'vitest';
3
3
  import { Textarea } from './Textarea';
4
+ import { CharactersCount } from '../shared/CharactersCount/CharactersCount';
5
+
6
+ vi.mock('../shared/CharactersCount/CharactersCount', () => ({
7
+ CharactersCount: vi.fn(),
8
+ }));
4
9
 
5
10
  describe('Textarea', () => {
6
11
  const mockOnChange = vi.fn();
@@ -22,6 +27,19 @@ describe('Textarea', () => {
22
27
  expect(container).toMatchSnapshot();
23
28
  });
24
29
 
30
+ it('calls CharactersCount component with correct props', () => {
31
+ const props = { ...baseProps, maxLength: 30 };
32
+ render(<Textarea {...props} />);
33
+ expect(CharactersCount).toHaveBeenCalledWith(
34
+ {
35
+ id: props.id,
36
+ maxLength: props.maxLength,
37
+ value: props.value,
38
+ },
39
+ {}
40
+ );
41
+ });
42
+
25
43
  it('should handle readOnly', () => {
26
44
  const { container } = render(
27
45
  <Textarea
@@ -7,6 +7,8 @@ import {
7
7
  import { slottableComponent } from '../shared/HOC/slottableComponent';
8
8
  import { Declarations } from '../shared/Declarations/Declarations';
9
9
  import type { LunaticError } from '../../use-lunatic/type';
10
+ import { CharactersCount } from '../shared/CharactersCount/CharactersCount';
11
+ import { getCharactersCountId } from '../shared/utils/getCharactersCountId';
10
12
 
11
13
  export function Textarea({
12
14
  handleChanges,
@@ -51,6 +53,7 @@ export const CustomTextarea = slottableComponent<CustomProps>(
51
53
  placeHolder,
52
54
  } = props;
53
55
  const labelId = `label-${id}`;
56
+ const charactersCountId = getCharactersCountId(id, maxLength);
54
57
 
55
58
  return (
56
59
  <div className="lunatic-textarea">
@@ -62,19 +65,24 @@ export const CustomTextarea = slottableComponent<CustomProps>(
62
65
  declarations={declarations}
63
66
  id={id}
64
67
  />
65
- <textarea
66
- required={required}
67
- disabled={disabled}
68
- id={id}
69
- rows={rows}
70
- maxLength={maxLength}
71
- cols={cols}
72
- onChange={(e) => onChange(e.target.value)}
73
- value={value ?? ''}
74
- placeholder={placeHolder}
75
- readOnly={readOnly}
76
- aria-invalid={!!errors}
77
- />
68
+ <div className="field-with-count">
69
+ <textarea
70
+ required={required}
71
+ disabled={disabled}
72
+ id={id}
73
+ aria-labelledby={labelId}
74
+ aria-describedby={maxLength ? charactersCountId : undefined}
75
+ rows={rows}
76
+ maxLength={maxLength}
77
+ cols={cols}
78
+ onChange={(e) => onChange(e.target.value)}
79
+ value={value ?? ''}
80
+ placeholder={placeHolder}
81
+ readOnly={readOnly}
82
+ aria-invalid={!!errors}
83
+ />
84
+ <CharactersCount id={id} maxLength={maxLength} value={value} />
85
+ </div>
78
86
  <ComponentErrors errors={errors} />
79
87
  </div>
80
88
  );
@@ -5,12 +5,17 @@ exports[`Textarea > renders without crashing 1`] = `
5
5
  <div
6
6
  class="lunatic-textarea"
7
7
  >
8
- <textarea
9
- aria-invalid="false"
10
- id="input"
8
+ <div
9
+ class="field-with-count"
11
10
  >
12
- input
13
- </textarea>
11
+ <textarea
12
+ aria-invalid="false"
13
+ aria-labelledby="label-input"
14
+ id="input"
15
+ >
16
+ input
17
+ </textarea>
18
+ </div>
14
19
  </div>
15
20
  </div>
16
21
  `;
@@ -20,13 +25,18 @@ exports[`Textarea > should handle readOnly 1`] = `
20
25
  <div
21
26
  class="lunatic-textarea"
22
27
  >
23
- <textarea
24
- aria-invalid="false"
25
- id="textarea"
26
- readonly=""
28
+ <div
29
+ class="field-with-count"
27
30
  >
28
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
29
- </textarea>
31
+ <textarea
32
+ aria-invalid="false"
33
+ aria-labelledby="label-textarea"
34
+ id="textarea"
35
+ readonly=""
36
+ >
37
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
38
+ </textarea>
39
+ </div>
30
40
  </div>
31
41
  </div>
32
42
  `;
@@ -0,0 +1,31 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { CharactersCount } from './CharactersCount';
3
+ import { render } from '@testing-library/react';
4
+
5
+ describe('CharactersCount', () => {
6
+ const defaultProps = {
7
+ id: 'test-id',
8
+ maxLength: 20,
9
+ value: 'Hello',
10
+ };
11
+
12
+ it('renders correctly characters count if there is a maximum length', () => {
13
+ const { getByText } = render(<CharactersCount {...defaultProps} />);
14
+
15
+ expect(getByText('5/20')).toBeInTheDocument();
16
+ });
17
+
18
+ it('should apply the max-length-reached class when limit is reached', () => {
19
+ const props = { ...defaultProps, maxLength: 5 };
20
+ const { getByText } = render(<CharactersCount {...props} />);
21
+
22
+ expect(getByText('5/5')).toHaveClass('max-length-reached');
23
+ });
24
+
25
+ it('should not render anything when maxLength is not provided', () => {
26
+ const props = { ...defaultProps, maxLength: undefined };
27
+ const { container } = render(<CharactersCount {...props} />);
28
+
29
+ expect(container.firstChild).toBeNull();
30
+ });
31
+ });
@@ -0,0 +1,27 @@
1
+ import classNames from 'classnames';
2
+ import { getCharactersCountId } from '../utils/getCharactersCountId';
3
+
4
+ type Props = {
5
+ id: string;
6
+ maxLength?: number;
7
+ value?: string | null;
8
+ };
9
+
10
+ export function CharactersCount({ id, maxLength, value }: Readonly<Props>) {
11
+ if (!maxLength) return null;
12
+
13
+ const currentLength = value?.length ?? 0;
14
+ const charactersCountId = getCharactersCountId(id, maxLength);
15
+ const hasReachedMaxLength = currentLength === maxLength;
16
+
17
+ return (
18
+ <span
19
+ id={charactersCountId}
20
+ className={classNames('characters-count', {
21
+ 'max-length-reached': hasReachedMaxLength,
22
+ })}
23
+ >
24
+ {`${currentLength}/${maxLength}`}
25
+ </span>
26
+ );
27
+ }
@@ -3,9 +3,9 @@ import { Label } from './Label';
3
3
  import { describe, it, expect } from 'vitest';
4
4
 
5
5
  describe('Label', () => {
6
- it('renders null when children is falsy', () => {
6
+ it('renders null when children and description are falsy', () => {
7
7
  const { container } = render(
8
- <Label htmlFor="input" id="label" description="This is a label">
8
+ <Label htmlFor="input" id="label">
9
9
  {null}
10
10
  </Label>
11
11
  );
@@ -34,8 +34,20 @@ describe('Label', () => {
34
34
 
35
35
  const label = getByText('Name');
36
36
  expect(label).toBeInTheDocument();
37
- expect(label.parentNode).toHaveAttribute('for', 'kze792d8');
37
+ expect(label.closest('label')).toHaveAttribute('for', 'kze792d8');
38
38
  const description = queryByText('This is a label');
39
39
  expect(description).not.toBeInTheDocument();
40
40
  });
41
+
42
+ it('renders a label with description and no label', () => {
43
+ const { container, queryByText } = render(
44
+ <Label htmlFor="kze792d8" id="label" description="This is a label" />
45
+ );
46
+
47
+ const label = container.querySelector('label');
48
+ expect(label).toBeInTheDocument();
49
+ expect(label).toHaveAttribute('for', 'kze792d8');
50
+ const description = queryByText('This is a label');
51
+ expect(description).toBeInTheDocument();
52
+ });
41
53
  });
@@ -27,7 +27,7 @@ function LunaticLabel({
27
27
  style,
28
28
  description,
29
29
  }: Props) {
30
- if (!children) {
30
+ if (!children && !description) {
31
31
  return null;
32
32
  }
33
33
  return (
@@ -0,0 +1,14 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { getCharactersCountId } from './getCharactersCountId';
3
+
4
+ describe('getCharacterCountId', () => {
5
+ it('should return the correct ID when maxLength is provided', () => {
6
+ expect(getCharactersCountId('test-id', 100)).toBe(
7
+ 'characters-count-test-id'
8
+ );
9
+ });
10
+
11
+ it('should return undefined when maxLength is not provided', () => {
12
+ expect(getCharactersCountId('test-id')).toBeUndefined();
13
+ });
14
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get the correct id for characters count div, used for both input and textarea.
3
+ */
4
+ export function getCharactersCountId(id: string, maxLength?: number) {
5
+ return maxLength ? `characters-count-${id}` : undefined;
6
+ }
@@ -126,6 +126,7 @@ export type ComponentPropsByType = {
126
126
  components: LunaticComponentProps[];
127
127
  componentType?: 'Question';
128
128
  iteration?: number;
129
+ value: Record<string, unknown>;
129
130
  };
130
131
  RosterForLoop: LunaticBaseProps<unknown> &
131
132
  LunaticExtraProps & {
@@ -43,3 +43,13 @@
43
43
  }
44
44
  }
45
45
  }
46
+
47
+ .characters-count {
48
+ display: block;
49
+ font-size: 12px;
50
+ padding-top: 0.3rem;
51
+ }
52
+
53
+ .max-length-reached {
54
+ color: red;
55
+ }
@@ -1,3 +1,13 @@
1
+ .lunatic-roundabout__label {
2
+ color: var(--color-primary-dark);
3
+ background-color: var(--color-primary-contrast-text);
4
+ border: 0;
5
+ padding: 0;
6
+ font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
7
+ font-weight: bold;
8
+ margin-bottom: 0.375rem;
9
+ }
10
+
1
11
  .lunatic-roundabout__items {
2
12
  margin-top: 1rem;
3
13
  display: flex;
@@ -37,11 +37,7 @@
37
37
  "name": "NOM",
38
38
  "componentRef": "name",
39
39
  "values": {
40
- "PREVIOUS": null,
41
- "COLLECTED": null,
42
- "FORCED": null,
43
- "EDITED": null,
44
- "INPUTTED": null
40
+ "COLLECTED": null
45
41
  }
46
42
  }
47
43
  ]
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import Orchestrator from '../../utils/orchestrator';
3
3
  import source from './source.json';
4
4
  import sourceLoop from './source-loop.json';
5
+ import sourceLoop2 from './loop.json';
5
6
  import defaultArgTypes from '../../utils/default-arg-types';
6
7
 
7
8
  const stories = {
@@ -56,3 +57,13 @@ Loop.args = {
56
57
  pagination: true,
57
58
  source: sourceLoop,
58
59
  };
60
+
61
+ export const Loop2 = Template.bind({});
62
+ Loop2.args = {
63
+ id: 'cleaning-loop-2',
64
+ pagination: true,
65
+ source: sourceLoop2,
66
+ data: {
67
+ COLLECTED: { PRENOM: { COLLECTED: ['Laurent', 'Alain', 'toto'] } },
68
+ },
69
+ };