@inseefr/lunatic 2.7.20 → 3.0.0-rc.5

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 (792) hide show
  1. package/lib/components/{commons/components/orchestrated-component.js → CheckboxBoolean/CheckboxBoolean.js} +49 -24
  2. package/lib/components/{checkbox/checkbox-boolean/html/checkbox-boolean.spec.js → CheckboxBoolean/CheckboxBoolean.spec.js} +25 -14
  3. package/lib/components/CheckboxGroup/CheckboxGroup.js +50 -0
  4. package/lib/components/CheckboxGroup/CheckboxGroup.scss +13 -0
  5. package/lib/components/{declarations/declarations-after-text.js → CheckboxGroup/CustomCheckboxGroup.js} +33 -11
  6. package/lib/components/{checkbox/checkbox-group/html/checkbox-group-content.spec.js → CheckboxGroup/CustomCheckboxGroup.spec.js} +2 -3
  7. package/lib/components/CheckboxOne/CheckboxOne.js +39 -0
  8. package/lib/components/{checkbox/checkbox-one/html/checkbox-one.spec.js → CheckboxOne/CheckboxOne.spec.js} +14 -7
  9. package/lib/components/{datepicker/html/datepicker.js → Datepicker/Datepicker.js} +51 -25
  10. package/lib/components/Datepicker/Datepicker.spec.js +92 -0
  11. package/lib/components/{datepicker/html/__snapshots__/datepicker.spec.tsx.snap → Datepicker/__snapshots__/Datepicker.spec.tsx.snap} +0 -63
  12. package/lib/components/Dropdown/Dropdown.js +80 -0
  13. package/lib/{stories/modal/modal.stories.js → components/Dropdown/Dropdown.spec.js} +40 -23
  14. package/lib/components/{dropdown/html/dropdown-writable/dropdown-writable.js → Dropdown/DropdownWritable.js} +10 -12
  15. package/lib/components/{dropdown/html/__snapshots__/dropdown.spec.tsx.snap → Dropdown/__snapshots__/Dropdown.spec.tsx.snap} +3 -3
  16. package/lib/components/Dropdown/helpers.js +94 -0
  17. package/lib/components/{dropdown/html/dropdown-simple/simple-label-renderer.js → Dropdown/renderer/SimpleLabelRenderer.js} +2 -3
  18. package/lib/components/{dropdown/html/dropdown-simple/simple-option-renderer.js → Dropdown/renderer/SimpleOptionRenderer.js} +2 -4
  19. package/lib/components/{dropdown/html/dropdown-writable/writable-label-renderer.js → Dropdown/renderer/WritableLabelRenderer.js} +2 -3
  20. package/lib/components/{dropdown/html/dropdown-writable/writable-option-renderer.js → Dropdown/renderer/WritableOptionRenderer.js} +6 -9
  21. package/lib/components/{duration/durationInput.js → Duration/Duration.js} +43 -15
  22. package/lib/components/{filter-description/component.js → FilterDescription/FilterDescription.js} +3 -5
  23. package/lib/components/{filter-description/component.spec.js → FilterDescription/FilterDescription.spec.js} +3 -5
  24. package/lib/components/Input/Input.js +80 -0
  25. package/lib/components/{input/html/input.spec.js → Input/Input.spec.js} +26 -23
  26. package/lib/components/InputNumber/InputNumber.js +81 -0
  27. package/lib/components/{input-number/html/input-number.spec.js → InputNumber/InputNumber.spec.js} +40 -46
  28. package/lib/components/{input-number/html/input-number-thousand.js → InputNumber/InputNumberThousand.js} +4 -5
  29. package/lib/components/{input-number/html/__snapshots__/input-number.spec.tsx.snap → InputNumber/__snapshots__/InputNumber.spec.tsx.snap} +3 -5
  30. package/lib/components/{loop/block-for-loop.js → Loop/Loop.js} +59 -40
  31. package/lib/components/{lunatic-components.js → LunaticComponents.js} +62 -42
  32. package/lib/components/{pairwise-links/pairwise-links.js → PairwiseLinks/PairwiseLinks.js} +11 -14
  33. package/lib/components/{component-set/lunatic-component-set.js → Question/Question.js} +37 -39
  34. package/lib/components/Radio/Radio.js +41 -0
  35. package/lib/components/{loop/roster-for-loop/roster-for-loop.js → RosterForLoop/RosterForLoop.js} +28 -54
  36. package/lib/components/{loop/roster-for-loop/roster-for-loop.spec.js → RosterForLoop/RosterForLoop.spec.js} +2 -2
  37. package/lib/components/{roundabout/roundabout.js → Roundabout/CustomRoundabout.js} +12 -18
  38. package/lib/components/{roundabout/lunatic-roundabout.js → Roundabout/Roundabout.js} +7 -8
  39. package/lib/components/{roundabout/components/roundabout-it-button.js → Roundabout/RoundaboutItButton.js} +40 -41
  40. package/lib/components/{roundabout/components/roundabout-it-button.spec.js → Roundabout/RoundaboutItButton.spec.js} +10 -11
  41. package/lib/components/{roundabout/redirect.js → Roundabout/RoundaboutRedirect.js} +3 -4
  42. package/lib/components/Roundabout/extra.js +44 -0
  43. package/lib/components/{roundabout → Roundabout}/redirect.spec.js +3 -5
  44. package/lib/components/{roundabout → Roundabout}/roundabout.spec.js +4 -4
  45. package/lib/components/Sequence/Sequence.js +33 -0
  46. package/lib/components/Subsequence/Subsequence.js +27 -0
  47. package/lib/components/{subsequence/subsequence.spec.js → Subsequence/Subsequence.spec.js} +7 -28
  48. package/lib/components/{suggester/html/suggester.js → Suggester/CustomSuggester.js} +9 -10
  49. package/lib/components/Suggester/Suggester.js +77 -0
  50. package/lib/components/{suggester/html/default-style.scss → Suggester/Suggester.scss} +3 -3
  51. package/lib/components/{suggester/idb-suggester/suggester-notification.js → Suggester/SuggesterNotification.js} +16 -16
  52. package/lib/components/{suggester/idb-suggester/suggester-status.js → Suggester/SuggesterStatus.js} +5 -7
  53. package/lib/components/{suggester/searching/create-searching.js → Suggester/helpers.js} +4 -5
  54. package/lib/components/{summary/lunatic-summary.js → Summary/Summary.js} +72 -59
  55. package/lib/components/Switch/Switch.js +107 -0
  56. package/lib/components/Table/Table.js +65 -0
  57. package/lib/components/Textarea/Textarea.js +80 -0
  58. package/lib/components/Textarea/Textarea.spec.js +46 -0
  59. package/lib/components/library.js +53 -0
  60. package/lib/components/{button/lunatic-button.js → shared/Button/Button.js} +7 -7
  61. package/lib/components/{button/lunatic-button.spec.js → shared/Button/Button.spec.js} +10 -12
  62. package/lib/components/{commons/components/fab/fab.js → shared/Button/IconButton.js} +5 -6
  63. package/lib/components/{commons/components/fab/fab.scss → shared/Button/IconButton.scss} +1 -0
  64. package/lib/components/{commons/components/fab/fab.spec.js → shared/Button/IconButton.spec.js} +9 -9
  65. package/lib/components/{checkbox/commons/checkbox-option.js → shared/Checkbox/CheckboxOption.js} +9 -8
  66. package/lib/components/{checkbox/commons/checkbox-option.spec.js → shared/Checkbox/CheckboxOption.spec.js} +6 -7
  67. package/lib/components/{commons/components/combo-box/combo-box.js → shared/Combobox/Combobox.js} +26 -26
  68. package/lib/components/{commons/components/combo-box/combo-box.stories.js → shared/Combobox/Combobox.stories.js} +4 -5
  69. package/lib/components/{commons/components/combo-box/combo-box-container.js → shared/Combobox/ComboboxContainer.js} +6 -7
  70. package/lib/components/{commons/components/combo-box/combo-box-container.spec.js → shared/Combobox/ComboboxContainer.spec.js} +6 -8
  71. package/lib/components/{commons/components/combo-box/combo-box-content.js → shared/Combobox/ComboboxContent.js} +11 -13
  72. package/lib/components/{commons/components/combo-box/combo-box-content-box.js → shared/Combobox/ComboboxContentBox.js} +4 -6
  73. package/lib/components/{commons/components/combo-box/panel/combo-box-option.js → shared/Combobox/Panel/ComboboxOption.js} +4 -5
  74. package/lib/components/{commons/components/combo-box/panel/combo-box-option.spec.js → shared/Combobox/Panel/ComboboxOption.spec.js} +6 -8
  75. package/lib/components/{commons/components/combo-box/panel/option-container.js → shared/Combobox/Panel/ComboboxOptionContainer.js} +2 -2
  76. package/lib/components/{commons/components/combo-box/panel/option-container.spec.js → shared/Combobox/Panel/ComboboxOptionContainer.spec.js} +2 -2
  77. package/lib/components/{commons/components/combo-box/panel/panel.js → shared/Combobox/Panel/ComboboxPanel.js} +11 -9
  78. package/lib/components/{commons/components/combo-box/panel/panel.spec.js → shared/Combobox/Panel/ComboboxPanel.spec.js} +5 -5
  79. package/lib/components/{commons/components/combo-box/panel/panel-container.js → shared/Combobox/Panel/ComboboxPanelContainer.js} +4 -5
  80. package/lib/components/{commons/components/combo-box/panel/panel-container.spec.js → shared/Combobox/Panel/ComboboxPanelContainer.spec.js} +7 -8
  81. package/lib/components/{commons/components/combo-box/selection/clear-button.js → shared/Combobox/Selection/ComboboxClearButton.js} +8 -8
  82. package/lib/components/{commons/components/combo-box/selection/clear-button.spec.js → shared/Combobox/Selection/ComboboxClearButton.spec.js} +9 -9
  83. package/lib/components/{commons/components/combo-box/selection/input.js → shared/Combobox/Selection/ComboboxInput.js} +4 -4
  84. package/lib/components/{commons/components/combo-box/selection/combo-box-label-selection.js → shared/Combobox/Selection/ComboboxLabelSelection.js} +8 -11
  85. package/lib/components/{commons/components/combo-box/selection/combo-box-label-selection.spec.js → shared/Combobox/Selection/ComboboxLabelSelection.spec.js} +5 -7
  86. package/lib/components/shared/Combobox/Selection/ComboboxSelection.js +68 -0
  87. package/lib/components/{commons/components/combo-box/selection/selection.spec.js → shared/Combobox/Selection/ComboboxSelection.spec.js} +7 -7
  88. package/lib/components/{commons/components/combo-box/selection/__snapshots__/selection.spec.tsx.snap → shared/Combobox/Selection/__snapshots__/ComboboxSelection.spec.tsx.snap} +1 -9
  89. package/lib/components/shared/Combobox/index.js +1 -0
  90. package/lib/components/{commons/components/errors/errors.js → shared/ComponentErrors/ComponentErrors.js} +9 -8
  91. package/lib/components/shared/ComponentErrors/ComponentErrors.spec.js +44 -0
  92. package/lib/components/{commons/components/lunatic-component-without-label.js → shared/ComponentWrapper.js} +41 -32
  93. package/lib/components/shared/Declarations/Declarations.js +47 -0
  94. package/lib/components/{declarations/declarations.spec.js → shared/Declarations/Declarations.spec.js} +7 -8
  95. package/lib/components/shared/Fieldset/Fieldset.js +44 -0
  96. package/lib/components/shared/Fieldset/Fieldset.spec.js +37 -0
  97. package/lib/components/{commons/create-customizable-field.js → shared/HOC/slottableComponent.js} +38 -15
  98. package/lib/components/{commons/icons → shared/Icons}/index.js +4 -4
  99. package/lib/components/shared/Label/Label.js +36 -0
  100. package/lib/components/shared/Label/Label.spec.js +45 -0
  101. package/lib/components/shared/LabelDescription.js +21 -0
  102. package/lib/components/{commons/components/md-label/md-label.js → shared/MDLabel/MDLabel.js} +6 -7
  103. package/lib/components/{commons/components/md-label/md-label.spec.js → shared/MDLabel/MDLabel.spec.js} +8 -8
  104. package/lib/components/{commons/components/md-label/link.js → shared/MDLabel/MDLabelLink.js} +11 -7
  105. package/lib/components/{commons/components/md-label/router-link.js → shared/MDLabel/RouterLink.js} +4 -6
  106. package/lib/components/shared/MDLabel/generateUniqueId.js +1 -0
  107. package/lib/components/{commons/components/missing/missing.js → shared/Missing/Missing.js} +16 -19
  108. package/lib/components/{commons/components/missing/missing.spec.js → shared/Missing/Missing.spec.js} +4 -4
  109. package/lib/components/{modal-controls/modal-controls.js → shared/ModalControls/ModalControls.js} +46 -34
  110. package/lib/components/{modal-controls/modal-controls.spec.js → shared/ModalControls/ModalControls.spec.js} +4 -5
  111. package/lib/components/{suggester/html/notification.js → shared/Notification.js} +4 -4
  112. package/lib/components/shared/Radio/RadioGroup.js +68 -0
  113. package/lib/components/{radio/html/radio-option.js → shared/Radio/RadioOption.js} +11 -10
  114. package/lib/components/{radio/html/radio-option.spec.js → shared/Radio/RadioOption.spec.js} +9 -10
  115. package/lib/components/{commons/components/html-table/table.js → shared/Table/Table.js} +5 -5
  116. package/lib/components/{commons/components/html-table/table.spec.js → shared/Table/Table.spec.js} +3 -3
  117. package/lib/components/{table/table-header.js → shared/Table/TableHeader.js} +6 -4
  118. package/lib/components/{commons/components/html-table/tbody.js → shared/Table/Tbody.js} +4 -4
  119. package/lib/components/{commons/components/html-table/tbody.spec.js → shared/Table/Tbody.spec.js} +3 -3
  120. package/lib/components/{commons/components/html-table/td.js → shared/Table/Td.js} +4 -4
  121. package/lib/components/{commons/components/html-table/td.spec.js → shared/Table/Td.spec.js} +2 -2
  122. package/lib/components/{commons/components/html-table/th.js → shared/Table/Th.js} +4 -4
  123. package/lib/components/{commons/components/html-table/th.spec.js → shared/Table/Th.spec.js} +3 -3
  124. package/lib/components/{commons/components/html-table/thead.js → shared/Table/Thead.js} +4 -4
  125. package/lib/components/{commons/components/html-table/thead.spec.js → shared/Table/Thead.spec.js} +3 -3
  126. package/lib/components/{commons/components/html-table/tr.js → shared/Table/Tr.js} +4 -4
  127. package/lib/components/{commons/components/html-table/tr.spec.js → shared/Table/Tr.spec.js} +3 -3
  128. package/lib/components/{commons/components/html-table → shared/Table}/index.js +19 -12
  129. package/lib/components/{commons/components/variable-status/variable-status.js → shared/VariableStatus/VariableStatus.js} +9 -24
  130. package/lib/components/{commons/components/variable-status/variable-status.scss → shared/VariableStatus/VariableStatus.scss} +1 -1
  131. package/lib/components/{commons/components/variable-status/variable-status.spec.js → shared/VariableStatus/VariableStatus.spec.js} +3 -3
  132. package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.js +4 -3
  133. package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/is-network.js +2 -2
  134. package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader-row.js +5 -5
  135. package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader.js +3 -3
  136. package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget.js +5 -5
  137. package/lib/{utils/store-tools/constantes.js → constants/indexedDBStore.js} +2 -2
  138. package/lib/{components/commons/use-document-add-event-listener.js → hooks/useDocumentEvent.js} +3 -3
  139. package/lib/{components/commons/use-options-keydown.js → hooks/useListKeyboardHandler.js} +6 -4
  140. package/lib/{components/suggester/idb-suggester/check-store.js → hooks/useSuggesterInfo.js} +24 -69
  141. package/lib/index.js +24 -25
  142. package/lib/src/components/CheckboxBoolean/CheckboxBoolean.d.ts +11 -0
  143. package/lib/src/components/CheckboxGroup/CheckboxGroup.d.ts +11 -0
  144. package/lib/src/components/CheckboxGroup/CustomCheckboxGroup.d.ts +13 -0
  145. package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +6 -0
  146. package/lib/src/components/Datepicker/Datepicker.d.ts +11 -0
  147. package/lib/src/components/Dropdown/Dropdown.d.ts +11 -0
  148. package/lib/src/components/Dropdown/DropdownWritable.d.ts +17 -0
  149. package/lib/src/components/Dropdown/helpers.d.ts +19 -0
  150. package/lib/src/components/Dropdown/renderer/SimpleLabelRenderer.d.ts +8 -0
  151. package/lib/src/components/Dropdown/renderer/SimpleOptionRenderer.d.ts +7 -0
  152. package/lib/src/components/Dropdown/renderer/WritableLabelRenderer.d.ts +8 -0
  153. package/lib/src/components/Dropdown/renderer/WritableOptionRenderer.d.ts +8 -0
  154. package/lib/src/components/Duration/Duration.d.ts +11 -0
  155. package/lib/src/components/FilterDescription/FilterDescription.d.ts +7 -0
  156. package/lib/src/components/Input/Input.d.ts +11 -0
  157. package/lib/src/components/InputNumber/InputNumber.d.ts +11 -0
  158. package/lib/src/components/{input-number/html/input-number-thousand.d.ts → InputNumber/InputNumberThousand.d.ts} +2 -2
  159. package/lib/src/components/Loop/Loop.d.ts +15 -0
  160. package/lib/src/components/{lunatic-components.d.ts → LunaticComponents.d.ts} +4 -2
  161. package/lib/src/components/Question/Question.d.ts +9 -0
  162. package/lib/src/components/{radio/lunatic-radio-group.d.ts → Radio/Radio.d.ts} +1 -2
  163. package/lib/src/components/RosterForLoop/RosterForLoop.d.ts +6 -0
  164. package/lib/src/components/{roundabout/roundabout.d.ts → Roundabout/CustomRoundabout.d.ts} +2 -2
  165. package/lib/src/components/Roundabout/Roundabout.d.ts +6 -0
  166. package/lib/src/components/{roundabout/components/roundabout-it-button.d.ts → Roundabout/RoundaboutItButton.d.ts} +2 -2
  167. package/lib/src/components/Roundabout/RoundaboutRedirect.d.ts +6 -0
  168. package/lib/src/components/Roundabout/extra.d.ts +14 -0
  169. package/lib/src/components/Sequence/Sequence.d.ts +3 -0
  170. package/lib/src/components/Subsequence/Subsequence.d.ts +2 -0
  171. package/lib/src/components/{suggester/html/suggester.d.ts → Suggester/CustomSuggester.d.ts} +6 -7
  172. package/lib/src/components/Suggester/Suggester.d.ts +3 -0
  173. package/lib/src/components/{suggester/idb-suggester/suggester-notification.d.ts → Suggester/SuggesterNotification.d.ts} +3 -3
  174. package/lib/src/components/{suggester/idb-suggester/suggester-status.d.ts → Suggester/SuggesterStatus.d.ts} +1 -1
  175. package/lib/src/components/Suggester/helpers.d.ts +6 -0
  176. package/lib/src/components/Summary/Summary.d.ts +25 -0
  177. package/lib/src/components/Switch/Switch.d.ts +19 -0
  178. package/lib/src/components/Table/Table.d.ts +2 -0
  179. package/lib/src/components/Textarea/Textarea.d.ts +11 -0
  180. package/lib/src/components/library.d.ts +94 -0
  181. package/lib/src/components/{button/lunatic-button.d.ts → shared/Button/Button.d.ts} +3 -3
  182. package/lib/src/components/shared/Button/IconButton.d.ts +7 -0
  183. package/lib/src/components/{checkbox/commons/checkbox-option.d.ts → shared/Checkbox/CheckboxOption.d.ts} +2 -3
  184. package/lib/src/components/shared/Combobox/Combobox.d.ts +21 -0
  185. package/lib/src/components/shared/Combobox/Combobox.stories.d.ts +6 -0
  186. package/lib/src/components/{commons/components/combo-box/combo-box-container.d.ts → shared/Combobox/ComboboxContainer.d.ts} +3 -3
  187. package/lib/src/components/{commons/components/combo-box/combo-box-content.d.ts → shared/Combobox/ComboboxContent.d.ts} +2 -2
  188. package/lib/src/components/shared/Combobox/ComboboxContentBox.d.ts +7 -0
  189. package/lib/src/components/shared/Combobox/ComboboxType.d.ts +50 -0
  190. package/lib/src/components/shared/Combobox/Panel/ComboboxOption.d.ts +8 -0
  191. package/lib/src/components/{commons/components/combo-box/panel/option-container.d.ts → shared/Combobox/Panel/ComboboxOptionContainer.d.ts} +1 -1
  192. package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.d.ts +5 -0
  193. package/lib/src/components/{commons/components/combo-box/panel/panel-container.d.ts → shared/Combobox/Panel/ComboboxPanelContainer.d.ts} +2 -2
  194. package/lib/src/components/{commons/components/combo-box/selection/clear-button.d.ts → shared/Combobox/Selection/ComboboxClearButton.d.ts} +1 -1
  195. package/lib/src/components/{commons/components/combo-box/selection/input.d.ts → shared/Combobox/Selection/ComboboxInput.d.ts} +1 -2
  196. package/lib/src/components/shared/Combobox/Selection/ComboboxLabelSelection.d.ts +11 -0
  197. package/lib/src/components/shared/Combobox/Selection/ComboboxSelection.d.ts +6 -0
  198. package/lib/src/components/shared/Combobox/index.d.ts +0 -0
  199. package/lib/src/components/shared/ComponentErrors/ComponentErrors.d.ts +15 -0
  200. package/lib/src/components/shared/ComponentWrapper.d.ts +26 -0
  201. package/lib/src/components/shared/Declarations/Declarations.d.ts +17 -0
  202. package/lib/src/components/shared/Fieldset/Fieldset.d.ts +10 -0
  203. package/lib/src/components/shared/HOC/slottableComponent.d.ts +101 -0
  204. package/lib/src/components/shared/Icons/index.d.ts +10 -0
  205. package/lib/src/components/shared/Label/Label.d.ts +11 -0
  206. package/lib/src/components/shared/LabelDescription.d.ts +7 -0
  207. package/lib/src/components/{commons/components/md-label/md-label.d.ts → shared/MDLabel/MDLabel.d.ts} +2 -2
  208. package/lib/src/components/shared/MDLabel/MDLabelLink.d.ts +8 -0
  209. package/lib/src/components/{commons/components/md-label/router-link.d.ts → shared/MDLabel/RouterLink.d.ts} +2 -2
  210. package/lib/src/components/shared/MDLabel/generateUniqueId.d.ts +0 -0
  211. package/lib/src/components/{commons/components/missing/missing.d.ts → shared/Missing/Missing.d.ts} +4 -4
  212. package/lib/src/components/shared/ModalControls/ModalControls.d.ts +11 -0
  213. package/lib/src/components/{suggester/html/notification.d.ts → shared/Notification.d.ts} +2 -2
  214. package/lib/src/components/{radio/html/radio-group.d.ts → shared/Radio/RadioGroup.d.ts} +3 -3
  215. package/lib/src/components/{radio/html/radio-option.d.ts → shared/Radio/RadioOption.d.ts} +1 -2
  216. package/lib/src/components/{commons/components/html-table/table.d.ts → shared/Table/Table.d.ts} +2 -2
  217. package/lib/src/components/shared/Table/TableHeader.d.ts +2 -0
  218. package/lib/src/components/{commons/components/html-table/tbody.d.ts → shared/Table/Tbody.d.ts} +1 -1
  219. package/lib/src/components/{commons/components/html-table/td.d.ts → shared/Table/Td.d.ts} +1 -1
  220. package/lib/src/components/{commons/components/html-table/th.d.ts → shared/Table/Th.d.ts} +1 -1
  221. package/lib/src/components/{commons/components/html-table/thead.d.ts → shared/Table/Thead.d.ts} +1 -1
  222. package/lib/src/components/{commons/components/html-table/tr.d.ts → shared/Table/Tr.d.ts} +1 -1
  223. package/lib/src/components/shared/Table/index.d.ts +7 -0
  224. package/lib/src/components/shared/VariableStatus/VariableStatus.d.ts +7 -0
  225. package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader-row.d.ts +1 -1
  226. package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader.d.ts +1 -1
  227. package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget.d.ts +1 -1
  228. package/lib/src/components/type.d.ts +15 -34
  229. package/lib/src/{utils/store-tools/constantes.d.ts → constants/indexedDBStore.d.ts} +2 -2
  230. package/lib/src/hooks/useDocumentEvent.d.ts +2 -0
  231. package/lib/src/{components/commons/use-options-keydown.d.ts → hooks/useListKeyboardHandler.d.ts} +4 -2
  232. package/lib/src/hooks/useSuggesterInfo.d.ts +9 -0
  233. package/lib/src/i18n/index.d.ts +2 -2
  234. package/lib/src/i18n/inputNumberProps.d.ts +1 -1
  235. package/lib/src/index.d.ts +5 -3
  236. package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +18 -65
  237. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -111
  238. package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +16 -24
  239. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +4 -148
  240. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
  241. package/lib/src/use-lunatic/lunatic-context.d.ts +1 -4
  242. package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -5
  243. package/lib/src/use-lunatic/type-source.d.ts +1 -12
  244. package/lib/src/use-lunatic/use-lunatic.d.ts +36 -75
  245. package/lib/src/utils/store-tools/index.d.ts +1 -1
  246. package/lib/stories/behaviour/others/test.stories.js +1 -1
  247. package/lib/stories/{question-information/question-information.stories.js → behaviour/slots.stories.js} +35 -3
  248. package/lib/stories/checkbox-group/checkbox-group.stories.js +1 -6
  249. package/lib/stories/checkbox-group/sourceLoop.json +1 -1
  250. package/lib/stories/date-picker/datepicker.stories.js +2 -3
  251. package/lib/stories/disabled/source.json +1 -1
  252. package/lib/stories/loop/loop.stories.js +1 -1
  253. package/lib/stories/loop/roster-for-loop.stories.js +1 -1
  254. package/lib/stories/markdown/markdown.stories.js +1 -1
  255. package/lib/stories/pairwise/pairwise-links.stories.js +1 -9
  256. package/lib/stories/questionnaires/recensement/source.json +2 -2
  257. package/lib/stories/sequence/sequence.stories.js +1 -1
  258. package/lib/stories/suggester/source.json +326 -182
  259. package/lib/stories/suggester/suggester-workers.stories.js +5 -5
  260. package/lib/stories/suggester/suggester.stories.js +1 -22
  261. package/lib/stories/switch/switch.stories.js +1 -6
  262. package/lib/stories/table/table.stories.js +1 -11
  263. package/lib/stories/utils/orchestrator.js +28 -29
  264. package/lib/stories/utils/referentiel.js +5 -14
  265. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +0 -1
  266. package/lib/use-lunatic/commons/page.js +0 -5
  267. package/lib/use-lunatic/lunatic-context.js +2 -10
  268. package/lib/use-lunatic/reducer/reduce-on-init.js +2 -2
  269. package/lib/use-lunatic/replace-component-sequence.js +2 -3
  270. package/lib/use-lunatic/use-lunatic.js +1 -4
  271. package/lib/use-lunatic/use-lunatic.test.js +4 -30
  272. package/lib/utils/idb-tools/open-or-create-db.js +4 -4
  273. package/lib/utils/store-tools/clear-store-data.js +2 -2
  274. package/lib/utils/store-tools/clear-store-info.js +2 -2
  275. package/lib/utils/store-tools/create/create.js +2 -2
  276. package/lib/utils/store-tools/create/update-store-info.js +3 -3
  277. package/lib/utils/store-tools/get-store-count.js +3 -3
  278. package/lib/utils/store-tools/index.js +1 -1
  279. package/lib/utils/store-tools/initStore.js +4 -4
  280. package/lib/utils/store-tools/open-or-create-store.js +4 -4
  281. package/lib/utils/suggester-workers/append-to-index/append.js +2 -2
  282. package/lib/utils/suggester-workers/searching/search-in-index.js +2 -2
  283. package/lib/utils/suggester-workers/searching/searching.js +5 -5
  284. package/package.json +2 -5
  285. package/workers-release/lunatic-append-worker-0.3.0.js +1 -1
  286. package/workers-release/lunatic-append-worker-0.3.0.js.LICENSE.txt +0 -10
  287. package/workers-release/lunatic-search-worker-0.3.0.js +1 -1
  288. package/workers-release/lunatic-search-worker-0.3.0.js.LICENSE.txt +0 -10
  289. package/lib/components/button/index.js +0 -13
  290. package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +0 -34
  291. package/lib/components/checkbox/checkbox-boolean/index.js +0 -13
  292. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +0 -58
  293. package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -34
  294. package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +0 -41
  295. package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +0 -33
  296. package/lib/components/checkbox/checkbox-group/html/checkbox-group.scss +0 -12
  297. package/lib/components/checkbox/checkbox-group/index.js +0 -13
  298. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +0 -71
  299. package/lib/components/checkbox/checkbox-one/html/checkbox-one.js +0 -34
  300. package/lib/components/checkbox/checkbox-one/index.js +0 -13
  301. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +0 -61
  302. package/lib/components/checkbox/commons/index.js +0 -13
  303. package/lib/components/checkbox/index.js +0 -27
  304. package/lib/components/commons/components/combo-box/index.js +0 -13
  305. package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +0 -56
  306. package/lib/components/commons/components/combo-box/selection/LabelOrInput.spec.js +0 -21
  307. package/lib/components/commons/components/combo-box/selection/label-selection.js +0 -30
  308. package/lib/components/commons/components/combo-box/selection/label-selection.spec.js +0 -41
  309. package/lib/components/commons/components/combo-box/selection/selection-container.js +0 -36
  310. package/lib/components/commons/components/combo-box/selection/selection-container.spec.js +0 -52
  311. package/lib/components/commons/components/combo-box/selection/selection.js +0 -53
  312. package/lib/components/commons/components/description.js +0 -52
  313. package/lib/components/commons/components/description.spec.js +0 -45
  314. package/lib/components/commons/components/errors/errors.spec.js +0 -45
  315. package/lib/components/commons/components/errors/index.js +0 -13
  316. package/lib/components/commons/components/fab/index.js +0 -13
  317. package/lib/components/commons/components/field-container/field-container.js +0 -26
  318. package/lib/components/commons/components/field-container/filed-container.spec.js +0 -37
  319. package/lib/components/commons/components/field-container/index.js +0 -13
  320. package/lib/components/commons/components/fieldset.js +0 -28
  321. package/lib/components/commons/components/fieldset.spec.js +0 -51
  322. package/lib/components/commons/components/label/index.js +0 -13
  323. package/lib/components/commons/components/label/label.js +0 -34
  324. package/lib/components/commons/components/label/label.spec.js +0 -77
  325. package/lib/components/commons/components/lunatic-component-with-label.js +0 -66
  326. package/lib/components/commons/components/md-label/generateUniqueId.js +0 -11
  327. package/lib/components/commons/components/md-label/index.js +0 -13
  328. package/lib/components/commons/components/missing/index.js +0 -13
  329. package/lib/components/commons/components/nothing-to-display.js +0 -15
  330. package/lib/components/commons/components/nothing-to-display.spec.js +0 -15
  331. package/lib/components/commons/components/variable-status/img/index.js +0 -20
  332. package/lib/components/commons/components/variable-status/index.js +0 -13
  333. package/lib/components/commons/index.js +0 -96
  334. package/lib/components/commons/safety-label.js +0 -24
  335. package/lib/components/commons/use-on-handle-change.js +0 -18
  336. package/lib/components/commons/use-on-handle-change.spec.js +0 -50
  337. package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +0 -126
  338. package/lib/components/component-set/html/component-set-legend.js +0 -28
  339. package/lib/components/component-set/html/component-set-wrapper.js +0 -15
  340. package/lib/components/component-set/html/component-set.js +0 -28
  341. package/lib/components/component-set/html/component-set.spec.js +0 -91
  342. package/lib/components/datepicker/html/datepicker.spec.js +0 -86
  343. package/lib/components/datepicker/index.js +0 -13
  344. package/lib/components/datepicker/lunatic-datepicker.js +0 -63
  345. package/lib/components/declarations/declaration.js +0 -21
  346. package/lib/components/declarations/declaration.spec.js +0 -30
  347. package/lib/components/declarations/declarations-before-text.js +0 -23
  348. package/lib/components/declarations/declarations-detachable.js +0 -23
  349. package/lib/components/declarations/declarations.js +0 -42
  350. package/lib/components/declarations/index.js +0 -43
  351. package/lib/components/dropdown/html/dropdown-simple/dropdown-simple.js +0 -39
  352. package/lib/components/dropdown/html/dropdown-simple/index.js +0 -13
  353. package/lib/components/dropdown/html/dropdown-writable/filter-tools/filter-options.js +0 -28
  354. package/lib/components/dropdown/html/dropdown-writable/filter-tools/filter-options.spec.js +0 -106
  355. package/lib/components/dropdown/html/dropdown-writable/filter-tools/get-label.js +0 -24
  356. package/lib/components/dropdown/html/dropdown-writable/filter-tools/letters-matching.js +0 -28
  357. package/lib/components/dropdown/html/dropdown-writable/filter-tools/match.js +0 -21
  358. package/lib/components/dropdown/html/dropdown-writable/filter-tools/prepare-prefix.js +0 -15
  359. package/lib/components/dropdown/html/dropdown-writable/index.js +0 -13
  360. package/lib/components/dropdown/html/dropdown.js +0 -52
  361. package/lib/components/dropdown/html/dropdown.spec.js +0 -48
  362. package/lib/components/dropdown/index.js +0 -13
  363. package/lib/components/dropdown/lunatic-dropdown.js +0 -62
  364. package/lib/components/duration/duration.js +0 -53
  365. package/lib/components/duration/index.js +0 -13
  366. package/lib/components/filter-description/index.js +0 -13
  367. package/lib/components/index.js +0 -223
  368. package/lib/components/input/html/input.js +0 -57
  369. package/lib/components/input/index.js +0 -13
  370. package/lib/components/input/lunatic-input.js +0 -59
  371. package/lib/components/input-number/html/input-number.js +0 -58
  372. package/lib/components/input-number/index.js +0 -13
  373. package/lib/components/input-number/lunatic-input-number.js +0 -63
  374. package/lib/components/loop/loop-button.js +0 -19
  375. package/lib/components/loop/loop-header.js +0 -30
  376. package/lib/components/loop/loop.js +0 -36
  377. package/lib/components/modal/html/modal.js +0 -59
  378. package/lib/components/modal/html/modal.scss +0 -26
  379. package/lib/components/modal/index.js +0 -13
  380. package/lib/components/modal/lunatic-modal.js +0 -61
  381. package/lib/components/modal-controls/close-or-skip.js +0 -38
  382. package/lib/components/modal-controls/close-or-skip.spec.js +0 -36
  383. package/lib/components/modal-controls/index.js +0 -13
  384. package/lib/components/modal-controls/modal-container.js +0 -21
  385. package/lib/components/modal-controls/modal-container.spec.js +0 -23
  386. package/lib/components/question/Question.js +0 -49
  387. package/lib/components/question/index.js +0 -16
  388. package/lib/components/question-explication/html/question-explication.js +0 -51
  389. package/lib/components/question-explication/html/question-explication.scss +0 -35
  390. package/lib/components/question-explication/index.js +0 -13
  391. package/lib/components/question-explication/lunatic-question-explication.js +0 -31
  392. package/lib/components/question-explication/question-explication.spec.js +0 -49
  393. package/lib/components/questions/index.js +0 -20
  394. package/lib/components/questions/question-context.js +0 -34
  395. package/lib/components/questions/question-context.scss +0 -10
  396. package/lib/components/questions/question-information.js +0 -34
  397. package/lib/components/questions/question-information.scss +0 -19
  398. package/lib/components/radio/html/radio-group-content.js +0 -53
  399. package/lib/components/radio/html/radio-group-content.spec.js +0 -99
  400. package/lib/components/radio/html/radio-group.js +0 -45
  401. package/lib/components/radio/index.js +0 -13
  402. package/lib/components/radio/lunatic-radio-group.js +0 -66
  403. package/lib/components/roundabout/components/roundabout-container.js +0 -19
  404. package/lib/components/roundabout/components/roundabout-container.spec.js +0 -23
  405. package/lib/components/roundabout/components/roundabout-it-container.js +0 -18
  406. package/lib/components/roundabout/components/roundabout-it-container.spec.js +0 -23
  407. package/lib/components/roundabout/components/roundabout-it-title.js +0 -16
  408. package/lib/components/roundabout/components/roundabout-it-title.spec.js +0 -18
  409. package/lib/components/roundabout/components/roundabout-label.js +0 -16
  410. package/lib/components/roundabout/components/roundabout-label.spec.js +0 -18
  411. package/lib/components/roundabout/components/roundabout-pending.js +0 -17
  412. package/lib/components/roundabout/components/roundabout-pending.spec.js +0 -15
  413. package/lib/components/roundabout/index.js +0 -13
  414. package/lib/components/sequence/html/sequence.js +0 -28
  415. package/lib/components/sequence/index.js +0 -13
  416. package/lib/components/sequence/lunatic-sequence.js +0 -30
  417. package/lib/components/sequence/sequence.spec.js +0 -75
  418. package/lib/components/subsequence/index.js +0 -13
  419. package/lib/components/subsequence/subsequence.js +0 -32
  420. package/lib/components/suggester/find-best-label/find-best-label.js +0 -49
  421. package/lib/components/suggester/find-best-label/index.js +0 -13
  422. package/lib/components/suggester/idb-suggester/idb-suggester.js +0 -72
  423. package/lib/components/suggester/idb-suggester/index.js +0 -12
  424. package/lib/components/suggester/index.js +0 -13
  425. package/lib/components/suggester/lunatic-suggester.js +0 -70
  426. package/lib/components/suggester/searching/index.js +0 -13
  427. package/lib/components/summary/html/summary-container.js +0 -14
  428. package/lib/components/summary/html/summary-responses.js +0 -56
  429. package/lib/components/summary/html/summary-title.js +0 -19
  430. package/lib/components/summary/index.js +0 -12
  431. package/lib/components/switch/html/switch.js +0 -71
  432. package/lib/components/switch/index.js +0 -13
  433. package/lib/components/switch/lunatic-switch.js +0 -63
  434. package/lib/components/table/lunatic-table.js +0 -72
  435. package/lib/components/textarea/html/textarea.js +0 -54
  436. package/lib/components/textarea/html/textarea.spec.js +0 -38
  437. package/lib/components/textarea/index.js +0 -13
  438. package/lib/components/textarea/lunatic-textarea.js +0 -77
  439. package/lib/src/components/button/index.d.ts +0 -1
  440. package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +0 -13
  441. package/lib/src/components/checkbox/checkbox-boolean/index.d.ts +0 -1
  442. package/lib/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.d.ts +0 -8
  443. package/lib/src/components/checkbox/checkbox-group/checkbox-group-content.d.ts +0 -8
  444. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +0 -9
  445. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +0 -14
  446. package/lib/src/components/checkbox/checkbox-group/index.d.ts +0 -1
  447. package/lib/src/components/checkbox/checkbox-group/lunatic-checkbox-group.d.ts +0 -11
  448. package/lib/src/components/checkbox/checkbox-one/html/checkbox-one.d.ts +0 -5
  449. package/lib/src/components/checkbox/checkbox-one/index.d.ts +0 -1
  450. package/lib/src/components/checkbox/checkbox-one/lunatic-checkbox-one.d.ts +0 -3
  451. package/lib/src/components/checkbox/commons/index.d.ts +0 -1
  452. package/lib/src/components/checkbox/index.d.ts +0 -3
  453. package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +0 -8
  454. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +0 -23
  455. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +0 -6
  456. package/lib/src/components/commons/components/combo-box/combo-box.type.d.ts +0 -8
  457. package/lib/src/components/commons/components/combo-box/index.d.ts +0 -1
  458. package/lib/src/components/commons/components/combo-box/panel/combo-box-option.d.ts +0 -8
  459. package/lib/src/components/commons/components/combo-box/panel/panel.d.ts +0 -20
  460. package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +0 -18
  461. package/lib/src/components/commons/components/combo-box/selection/combo-box-label-selection.d.ts +0 -11
  462. package/lib/src/components/commons/components/combo-box/selection/label-selection.d.ts +0 -21
  463. package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +0 -11
  464. package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +0 -13
  465. package/lib/src/components/commons/components/description.d.ts +0 -22
  466. package/lib/src/components/commons/components/errors/errors.d.ts +0 -11
  467. package/lib/src/components/commons/components/errors/index.d.ts +0 -1
  468. package/lib/src/components/commons/components/fab/fab.d.ts +0 -7
  469. package/lib/src/components/commons/components/fab/index.d.ts +0 -1
  470. package/lib/src/components/commons/components/field-container/field-container.d.ts +0 -6
  471. package/lib/src/components/commons/components/field-container/index.d.ts +0 -1
  472. package/lib/src/components/commons/components/fieldset.d.ts +0 -13
  473. package/lib/src/components/commons/components/html-table/index.d.ts +0 -6
  474. package/lib/src/components/commons/components/label/index.d.ts +0 -1
  475. package/lib/src/components/commons/components/label/label.d.ts +0 -14
  476. package/lib/src/components/commons/components/lunatic-component-with-label.d.ts +0 -12
  477. package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +0 -12
  478. package/lib/src/components/commons/components/md-label/generateUniqueId.d.ts +0 -1
  479. package/lib/src/components/commons/components/md-label/index.d.ts +0 -1
  480. package/lib/src/components/commons/components/md-label/link.d.ts +0 -7
  481. package/lib/src/components/commons/components/missing/index.d.ts +0 -1
  482. package/lib/src/components/commons/components/nothing-to-display.d.ts +0 -2
  483. package/lib/src/components/commons/components/orchestrated-component.d.ts +0 -8
  484. package/lib/src/components/commons/components/variable-status/img/index.d.ts +0 -2
  485. package/lib/src/components/commons/components/variable-status/index.d.ts +0 -1
  486. package/lib/src/components/commons/components/variable-status/variable-status.d.ts +0 -16
  487. package/lib/src/components/commons/create-customizable-field.d.ts +0 -3
  488. package/lib/src/components/commons/icons/index.d.ts +0 -10
  489. package/lib/src/components/commons/index.d.ts +0 -13
  490. package/lib/src/components/commons/safety-label.d.ts +0 -3
  491. package/lib/src/components/commons/use-document-add-event-listener.d.ts +0 -2
  492. package/lib/src/components/commons/use-on-handle-change.d.ts +0 -12
  493. package/lib/src/components/component-set/html/component-set-legend.d.ts +0 -8
  494. package/lib/src/components/component-set/html/component-set-wrapper.d.ts +0 -6
  495. package/lib/src/components/component-set/html/component-set.d.ts +0 -10
  496. package/lib/src/components/component-set/lunatic-component-set.d.ts +0 -3
  497. package/lib/src/components/datepicker/html/datepicker.d.ts +0 -18
  498. package/lib/src/components/datepicker/index.d.ts +0 -1
  499. package/lib/src/components/datepicker/lunatic-datepicker.d.ts +0 -10
  500. package/lib/src/components/declarations/declaration.d.ts +0 -6
  501. package/lib/src/components/declarations/declarations-after-text.d.ts +0 -4
  502. package/lib/src/components/declarations/declarations-before-text.d.ts +0 -4
  503. package/lib/src/components/declarations/declarations-detachable.d.ts +0 -4
  504. package/lib/src/components/declarations/declarations.d.ts +0 -15
  505. package/lib/src/components/declarations/index.d.ts +0 -4
  506. package/lib/src/components/dropdown/html/dropdown-simple/dropdown-simple.d.ts +0 -3
  507. package/lib/src/components/dropdown/html/dropdown-simple/index.d.ts +0 -1
  508. package/lib/src/components/dropdown/html/dropdown-simple/simple-label-renderer.d.ts +0 -8
  509. package/lib/src/components/dropdown/html/dropdown-simple/simple-option-renderer.d.ts +0 -7
  510. package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +0 -17
  511. package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/filter-options.d.ts +0 -6
  512. package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/get-label.d.ts +0 -9
  513. package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/letters-matching.d.ts +0 -2
  514. package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/match.d.ts +0 -2
  515. package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/prepare-prefix.d.ts +0 -2
  516. package/lib/src/components/dropdown/html/dropdown-writable/index.d.ts +0 -1
  517. package/lib/src/components/dropdown/html/dropdown-writable/writable-label-renderer.d.ts +0 -8
  518. package/lib/src/components/dropdown/html/dropdown-writable/writable-option-renderer.d.ts +0 -8
  519. package/lib/src/components/dropdown/html/dropdown.d.ts +0 -12
  520. package/lib/src/components/dropdown/html/dropdown.spec.d.ts +0 -1
  521. package/lib/src/components/dropdown/index.d.ts +0 -1
  522. package/lib/src/components/dropdown/lunatic-dropdown.d.ts +0 -3
  523. package/lib/src/components/duration/duration.d.ts +0 -4
  524. package/lib/src/components/duration/durationInput.d.ts +0 -11
  525. package/lib/src/components/duration/index.d.ts +0 -1
  526. package/lib/src/components/filter-description/component.d.ts +0 -7
  527. package/lib/src/components/filter-description/component.spec.d.ts +0 -1
  528. package/lib/src/components/filter-description/index.d.ts +0 -1
  529. package/lib/src/components/index.d.ts +0 -31
  530. package/lib/src/components/input/html/input.d.ts +0 -17
  531. package/lib/src/components/input/html/input.spec.d.ts +0 -1
  532. package/lib/src/components/input/index.d.ts +0 -1
  533. package/lib/src/components/input/lunatic-input.d.ts +0 -3
  534. package/lib/src/components/input-number/html/input-number.d.ts +0 -20
  535. package/lib/src/components/input-number/html/input-number.spec.d.ts +0 -1
  536. package/lib/src/components/input-number/index.d.ts +0 -1
  537. package/lib/src/components/input-number/lunatic-input-number.d.ts +0 -3
  538. package/lib/src/components/loop/block-for-loop.d.ts +0 -22
  539. package/lib/src/components/loop/loop-button.d.ts +0 -7
  540. package/lib/src/components/loop/loop-header.d.ts +0 -9
  541. package/lib/src/components/loop/loop.d.ts +0 -2
  542. package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +0 -23
  543. package/lib/src/components/loop/roster-for-loop/roster-for-loop.spec.d.ts +0 -1
  544. package/lib/src/components/modal/html/modal.d.ts +0 -11
  545. package/lib/src/components/modal/index.d.ts +0 -1
  546. package/lib/src/components/modal/lunatic-modal.d.ts +0 -3
  547. package/lib/src/components/modal-controls/close-or-skip.d.ts +0 -8
  548. package/lib/src/components/modal-controls/close-or-skip.spec.d.ts +0 -1
  549. package/lib/src/components/modal-controls/index.d.ts +0 -1
  550. package/lib/src/components/modal-controls/modal-container.d.ts +0 -3
  551. package/lib/src/components/modal-controls/modal-container.spec.d.ts +0 -1
  552. package/lib/src/components/modal-controls/modal-controls.d.ts +0 -11
  553. package/lib/src/components/modal-controls/modal-controls.spec.d.ts +0 -1
  554. package/lib/src/components/question/Question.d.ts +0 -7
  555. package/lib/src/components/question/index.d.ts +0 -1
  556. package/lib/src/components/question-explication/html/question-explication.d.ts +0 -7
  557. package/lib/src/components/question-explication/index.d.ts +0 -1
  558. package/lib/src/components/question-explication/lunatic-question-explication.d.ts +0 -3
  559. package/lib/src/components/question-explication/question-explication.spec.d.ts +0 -1
  560. package/lib/src/components/questions/index.d.ts +0 -2
  561. package/lib/src/components/questions/question-context.d.ts +0 -4
  562. package/lib/src/components/questions/question-information.d.ts +0 -4
  563. package/lib/src/components/radio/html/radio-group-content.d.ts +0 -19
  564. package/lib/src/components/radio/html/radio-group-content.spec.d.ts +0 -1
  565. package/lib/src/components/radio/html/radio-option.spec.d.ts +0 -1
  566. package/lib/src/components/radio/index.d.ts +0 -1
  567. package/lib/src/components/roundabout/components/roundabout-container.d.ts +0 -6
  568. package/lib/src/components/roundabout/components/roundabout-container.spec.d.ts +0 -1
  569. package/lib/src/components/roundabout/components/roundabout-it-button.spec.d.ts +0 -1
  570. package/lib/src/components/roundabout/components/roundabout-it-container.d.ts +0 -5
  571. package/lib/src/components/roundabout/components/roundabout-it-container.spec.d.ts +0 -1
  572. package/lib/src/components/roundabout/components/roundabout-it-title.d.ts +0 -5
  573. package/lib/src/components/roundabout/components/roundabout-it-title.spec.d.ts +0 -1
  574. package/lib/src/components/roundabout/components/roundabout-label.d.ts +0 -5
  575. package/lib/src/components/roundabout/components/roundabout-label.spec.d.ts +0 -1
  576. package/lib/src/components/roundabout/components/roundabout-pending.d.ts +0 -3
  577. package/lib/src/components/roundabout/components/roundabout-pending.spec.d.ts +0 -1
  578. package/lib/src/components/roundabout/index.d.ts +0 -1
  579. package/lib/src/components/roundabout/lunatic-roundabout.d.ts +0 -6
  580. package/lib/src/components/roundabout/redirect.d.ts +0 -6
  581. package/lib/src/components/sequence/html/sequence.d.ts +0 -5
  582. package/lib/src/components/sequence/index.d.ts +0 -1
  583. package/lib/src/components/sequence/lunatic-sequence.d.ts +0 -3
  584. package/lib/src/components/sequence/sequence.spec.d.ts +0 -1
  585. package/lib/src/components/subsequence/index.d.ts +0 -1
  586. package/lib/src/components/subsequence/subsequence.d.ts +0 -3
  587. package/lib/src/components/subsequence/subsequence.spec.d.ts +0 -1
  588. package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +0 -2
  589. package/lib/src/components/suggester/find-best-label/index.d.ts +0 -1
  590. package/lib/src/components/suggester/idb-suggester/check-store.d.ts +0 -11
  591. package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +0 -9
  592. package/lib/src/components/suggester/idb-suggester/index.d.ts +0 -1
  593. package/lib/src/components/suggester/index.d.ts +0 -1
  594. package/lib/src/components/suggester/lunatic-suggester.d.ts +0 -3
  595. package/lib/src/components/suggester/searching/create-searching.d.ts +0 -7
  596. package/lib/src/components/suggester/searching/index.d.ts +0 -1
  597. package/lib/src/components/summary/html/summary-container.d.ts +0 -2
  598. package/lib/src/components/summary/html/summary-responses.d.ts +0 -14
  599. package/lib/src/components/summary/html/summary-title.d.ts +0 -5
  600. package/lib/src/components/summary/index.d.ts +0 -1
  601. package/lib/src/components/summary/lunatic-summary.d.ts +0 -8
  602. package/lib/src/components/switch/html/switch.d.ts +0 -18
  603. package/lib/src/components/switch/index.d.ts +0 -1
  604. package/lib/src/components/switch/lunatic-switch.d.ts +0 -3
  605. package/lib/src/components/table/lunatic-table.d.ts +0 -3
  606. package/lib/src/components/table/table-header.d.ts +0 -11
  607. package/lib/src/components/textarea/html/textarea.d.ts +0 -19
  608. package/lib/src/components/textarea/html/textarea.spec.d.ts +0 -1
  609. package/lib/src/components/textarea/index.d.ts +0 -1
  610. package/lib/src/components/textarea/lunatic-textarea.d.ts +0 -18
  611. package/lib/src/use-lunatic/reducer/reduce-go-next-page.spec.d.ts +0 -1
  612. package/lib/src/use-lunatic/reducer/reduce-go-previous-page.spec.d.ts +0 -1
  613. package/lib/stories/checkbox-group/sourceComponentset.json +0 -424
  614. package/lib/stories/component-set/component-set.stories.js +0 -53
  615. package/lib/stories/component-set/data-loop.json +0 -18
  616. package/lib/stories/component-set/data-roundabout.json +0 -25
  617. package/lib/stories/component-set/data.json +0 -25
  618. package/lib/stories/component-set/source-loop.json +0 -308
  619. package/lib/stories/component-set/source-roundabout.json +0 -434
  620. package/lib/stories/component-set/source.json +0 -113
  621. package/lib/stories/custom-mui/checkbox-boolean-mui.js +0 -31
  622. package/lib/stories/custom-mui/checkbox-group-mui.js +0 -67
  623. package/lib/stories/custom-mui/checkbox-one-mui.js +0 -15
  624. package/lib/stories/custom-mui/index.js +0 -111
  625. package/lib/stories/custom-mui/input-mui.js +0 -51
  626. package/lib/stories/custom-mui/input-number-mui.js +0 -39
  627. package/lib/stories/custom-mui/radio-mui.js +0 -61
  628. package/lib/stories/custom-mui/suggester-mui/index.js +0 -13
  629. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +0 -301
  630. package/lib/stories/custom-mui/switch-mui.js +0 -46
  631. package/lib/stories/custom-mui/table-mui.js +0 -27
  632. package/lib/stories/custom-mui/tbody-mui.js +0 -22
  633. package/lib/stories/custom-mui/td-mui.js +0 -24
  634. package/lib/stories/custom-mui/textarea-mui.js +0 -42
  635. package/lib/stories/custom-mui/th-mui.js +0 -23
  636. package/lib/stories/custom-mui/thead-mui.js +0 -22
  637. package/lib/stories/custom-mui/tr-mui.js +0 -32
  638. package/lib/stories/modal/source.json +0 -97
  639. package/lib/stories/pairwise/source-componentset.json +0 -292
  640. package/lib/stories/question-context/question-context.stories.js +0 -31
  641. package/lib/stories/question-context/source.json +0 -13
  642. package/lib/stories/question-explication/question-explication.stories.js +0 -31
  643. package/lib/stories/question-explication/source.json +0 -17
  644. package/lib/stories/question-information/source.json +0 -14
  645. package/lib/stories/suggester/simple.json +0 -168
  646. package/lib/stories/suggester/source-component-set.json +0 -67
  647. package/lib/tests/utils/lunatic.d.ts +0 -25
  648. package/lib/use-lunatic/reducer/reduce-go-next-page.spec.js +0 -13
  649. package/lib/use-lunatic/reducer/reduce-go-previous-page.spec.js +0 -14
  650. /package/lib/components/{checkbox/checkbox-one/html/checkbox-one.scss → CheckboxOne/CheckboxOne.scss} +0 -0
  651. /package/lib/components/{datepicker/html/datepicker.scss → Datepicker/Datepicker.scss} +0 -0
  652. /package/lib/components/{datepicker/html → Datepicker}/DatepickerField.js +0 -0
  653. /package/lib/components/{dropdown/html/dropdown.scss → Dropdown/Dropdown.scss} +0 -0
  654. /package/lib/components/{duration/duration.scss → Duration/Duration.scss} +0 -0
  655. /package/lib/components/{duration → Duration}/durationUtils.js +0 -0
  656. /package/lib/components/{duration → Duration}/formatDuration.js +0 -0
  657. /package/lib/components/{duration → Duration}/formatDuration.spec.js +0 -0
  658. /package/lib/components/{duration → Duration}/getDurationFromValue.js +0 -0
  659. /package/lib/components/{input/html/input.scss → Input/Input.scss} +0 -0
  660. /package/lib/components/{input/html/__snapshots__/input.spec.tsx.snap → Input/__snapshots__/Input.spec.tsx.snap} +0 -0
  661. /package/lib/components/{input-number/html/input-number.scss → InputNumber/InputNumber.scss} +0 -0
  662. /package/lib/components/{loop → Loop}/constant.js +0 -0
  663. /package/lib/components/{radio/radio.scss → Radio/Radio.scss} +0 -0
  664. /package/lib/components/{loop/roster-for-loop/roster.scss → RosterForLoop/RosterForLoop.scss} +0 -0
  665. /package/lib/components/{loop/roster-for-loop/__snapshots__/roster-for-loop.spec.tsx.snap → RosterForLoop/__snapshots__/RosterForLoop.spec.tsx.snap} +0 -0
  666. /package/lib/components/{roundabout/components/roundabout.scss → Roundabout/Roundabout.scss} +0 -0
  667. /package/lib/components/{sequence/html/sequence.scss → Sequence/Sequence.scss} +0 -0
  668. /package/lib/components/{suggester/html → Suggester/icons}/alert-icon.svg +0 -0
  669. /package/lib/components/{suggester/html → Suggester/icons}/wait-icon.svg +0 -0
  670. /package/lib/components/{suggester/html → Suggester/icons}/warn-icon.svg +0 -0
  671. /package/lib/components/{switch/html → Switch}/switch.scss +0 -0
  672. /package/lib/components/{textarea/html/textarea.scss → Textarea/Textarea.scss} +0 -0
  673. /package/lib/components/{textarea/html/__snapshots__/textarea.spec.tsx.snap → Textarea/__snapshots__/Textarea.spec.tsx.snap} +0 -0
  674. /package/lib/components/{button/button.scss → shared/Button/Button.scss} +0 -0
  675. /package/lib/components/{button/__snapshots__/lunatic-button.spec.tsx.snap → shared/Button/__snapshots__/Button.spec.tsx.snap} +0 -0
  676. /package/lib/components/{checkbox/commons/checkbox-option.scss → shared/Checkbox/CheckboxOption.scss} +0 -0
  677. /package/lib/components/{checkbox/commons → shared/Checkbox}/getShortcutKey.js +0 -0
  678. /package/lib/components/{commons/components/combo-box/combo-box.scss → shared/Combobox/Combobox.scss} +0 -0
  679. /package/lib/components/{commons/components/combo-box/combo-box.type.js → shared/Combobox/ComboboxType.js} +0 -0
  680. /package/lib/components/{commons/components/combo-box/keyboard-key-codes.js → shared/Combobox/constants.js} +0 -0
  681. /package/lib/components/{commons/components/errors/errors.scss → shared/ComponentErrors/ComponentErrors.scss} +0 -0
  682. /package/lib/components/{declarations/declarations.scss → shared/Declarations/Declarations.scss} +0 -0
  683. /package/lib/components/{commons/components/fieldset.scss → shared/Fieldset/Fieldset.scss} +0 -0
  684. /package/lib/components/{commons/icons → shared/Icons}/checkbox-checked-icon.js +0 -0
  685. /package/lib/components/{commons/icons → shared/Icons}/checkbox-unchecked-icon.js +0 -0
  686. /package/lib/components/{commons/icons → shared/Icons}/closed-icon.js +0 -0
  687. /package/lib/components/{commons/icons → shared/Icons}/cross-icon.js +0 -0
  688. /package/lib/components/{commons/icons → shared/Icons}/icon-props.js +0 -0
  689. /package/lib/components/{commons/icons → shared/Icons}/load-icon.js +0 -0
  690. /package/lib/components/{commons/icons → shared/Icons}/lunatic-icon.js +0 -0
  691. /package/lib/components/{commons/icons → shared/Icons}/lunatic-icon.scss +0 -0
  692. /package/lib/components/{commons/icons → shared/Icons}/network-icon.js +0 -0
  693. /package/lib/components/{commons/icons → shared/Icons}/on-drag-icon.js +0 -0
  694. /package/lib/components/{commons/icons → shared/Icons}/opened-icon.js +0 -0
  695. /package/lib/components/{commons/icons → shared/Icons}/radio-checked-icon.js +0 -0
  696. /package/lib/components/{commons/icons → shared/Icons}/radio-unchecked-icon.js +0 -0
  697. /package/lib/components/{commons/components/label/label.scss → shared/Label/Label.scss} +0 -0
  698. /package/lib/components/{commons/components/missing/missing.scss → shared/Missing/Missing.scss} +0 -0
  699. /package/lib/components/{modal-controls/modal-controls.scss → shared/ModalControls/ModalControls.scss} +0 -0
  700. /package/lib/components/{radio/html/radio-group.scss → shared/Radio/RadioGroup.scss} +0 -0
  701. /package/lib/components/{commons/components/html-table/table.scss → shared/Table/Table.scss} +0 -0
  702. /package/lib/components/{commons/components/variable-status/img → shared/VariableStatus/icons}/edited.png +0 -0
  703. /package/lib/components/{commons/components/variable-status/img → shared/VariableStatus/icons}/forced.png +0 -0
  704. /package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.scss +0 -0
  705. /package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.spec.js +0 -0
  706. /package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/index.js +0 -0
  707. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/index.js +0 -0
  708. /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/index.js +0 -0
  709. /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/is-network.spec.js +0 -0
  710. /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/use-online-status.js +0 -0
  711. /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/use-online-status.spec.js +0 -0
  712. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/progress.js +0 -0
  713. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/action-tool.js +0 -0
  714. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/index.js +0 -0
  715. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/tools.js +0 -0
  716. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget-container.js +0 -0
  717. /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget.scss +0 -0
  718. /package/lib/src/components/{button/lunatic-button.spec.d.ts → CheckboxBoolean/CheckboxBoolean.spec.d.ts} +0 -0
  719. /package/lib/src/components/{checkbox/checkbox-boolean/html/checkbox-boolean.spec.d.ts → CheckboxGroup/CustomCheckboxGroup.spec.d.ts} +0 -0
  720. /package/lib/src/components/{checkbox/checkbox-group/html/checkbox-group-content.spec.d.ts → CheckboxOne/CheckboxOne.spec.d.ts} +0 -0
  721. /package/lib/src/components/{checkbox/checkbox-one/html/checkbox-one.spec.d.ts → Datepicker/Datepicker.spec.d.ts} +0 -0
  722. /package/lib/src/components/{datepicker/html → Datepicker}/DatepickerField.d.ts +0 -0
  723. /package/lib/src/components/{checkbox/commons/checkbox-option.spec.d.ts → Dropdown/Dropdown.spec.d.ts} +0 -0
  724. /package/lib/src/components/{duration → Duration}/durationUtils.d.ts +0 -0
  725. /package/lib/src/components/{duration → Duration}/formatDuration.d.ts +0 -0
  726. /package/lib/src/components/{duration → Duration}/formatDuration.spec.d.ts +0 -0
  727. /package/lib/src/components/{duration → Duration}/getDurationFromValue.d.ts +0 -0
  728. /package/lib/src/components/{commons/components/combo-box/combo-box-container.spec.d.ts → FilterDescription/FilterDescription.spec.d.ts} +0 -0
  729. /package/lib/src/components/{commons/components/combo-box/panel/combo-box-option.spec.d.ts → Input/Input.spec.d.ts} +0 -0
  730. /package/lib/src/components/{commons/components/combo-box/panel/option-container.spec.d.ts → InputNumber/InputNumber.spec.d.ts} +0 -0
  731. /package/lib/src/components/{loop → Loop}/constant.d.ts +0 -0
  732. /package/lib/src/components/{pairwise-links/pairwise-links.d.ts → PairwiseLinks/PairwiseLinks.d.ts} +0 -0
  733. /package/lib/src/components/{commons/components/combo-box/panel/panel-container.spec.d.ts → RosterForLoop/RosterForLoop.spec.d.ts} +0 -0
  734. /package/lib/src/components/{commons/components/combo-box/panel/panel.spec.d.ts → Roundabout/RoundaboutItButton.spec.d.ts} +0 -0
  735. /package/lib/src/components/{roundabout → Roundabout}/redirect.spec.d.ts +0 -0
  736. /package/lib/src/components/{roundabout → Roundabout}/roundabout.spec.d.ts +0 -0
  737. /package/lib/src/components/{commons/components/combo-box/selection/LabelOrInput.spec.d.ts → Subsequence/Subsequence.spec.d.ts} +0 -0
  738. /package/lib/src/components/{commons/components/combo-box/selection/clear-button.spec.d.ts → Textarea/Textarea.spec.d.ts} +0 -0
  739. /package/lib/src/components/{commons/components/combo-box/selection/combo-box-label-selection.spec.d.ts → shared/Button/Button.spec.d.ts} +0 -0
  740. /package/lib/src/components/{commons/components/combo-box/selection/label-selection.spec.d.ts → shared/Button/IconButton.spec.d.ts} +0 -0
  741. /package/lib/src/components/{commons/components/combo-box/selection/selection-container.spec.d.ts → shared/Checkbox/CheckboxOption.spec.d.ts} +0 -0
  742. /package/lib/src/components/{checkbox/commons → shared/Checkbox}/getShortcutKey.d.ts +0 -0
  743. /package/lib/src/components/{commons/components/combo-box/selection/selection.spec.d.ts → shared/Combobox/ComboboxContainer.spec.d.ts} +0 -0
  744. /package/lib/src/components/{commons/components/description.spec.d.ts → shared/Combobox/Panel/ComboboxOption.spec.d.ts} +0 -0
  745. /package/lib/src/components/{commons/components/dragger/dragger.spec.d.ts → shared/Combobox/Panel/ComboboxOptionContainer.spec.d.ts} +0 -0
  746. /package/lib/src/components/{commons/components/errors/errors.spec.d.ts → shared/Combobox/Panel/ComboboxPanel.spec.d.ts} +0 -0
  747. /package/lib/src/components/{commons/components/fab/fab.spec.d.ts → shared/Combobox/Panel/ComboboxPanelContainer.spec.d.ts} +0 -0
  748. /package/lib/src/components/{commons/components/field-container/filed-container.spec.d.ts → shared/Combobox/Selection/ComboboxClearButton.spec.d.ts} +0 -0
  749. /package/lib/src/components/{commons/components/fieldset.spec.d.ts → shared/Combobox/Selection/ComboboxLabelSelection.spec.d.ts} +0 -0
  750. /package/lib/src/components/{commons/components/html-table/table.spec.d.ts → shared/Combobox/Selection/ComboboxSelection.spec.d.ts} +0 -0
  751. /package/lib/src/components/{commons/components/combo-box/keyboard-key-codes.d.ts → shared/Combobox/constants.d.ts} +0 -0
  752. /package/lib/src/components/{commons/components/html-table/tbody.spec.d.ts → shared/ComponentErrors/ComponentErrors.spec.d.ts} +0 -0
  753. /package/lib/src/components/{commons/components/html-table/td.spec.d.ts → shared/Declarations/Declarations.spec.d.ts} +0 -0
  754. /package/lib/src/components/{commons/components/html-table/th.spec.d.ts → shared/Fieldset/Fieldset.spec.d.ts} +0 -0
  755. /package/lib/src/components/{commons/icons → shared/Icons}/checkbox-checked-icon.d.ts +0 -0
  756. /package/lib/src/components/{commons/icons → shared/Icons}/checkbox-unchecked-icon.d.ts +0 -0
  757. /package/lib/src/components/{commons/icons → shared/Icons}/closed-icon.d.ts +0 -0
  758. /package/lib/src/components/{commons/icons → shared/Icons}/cross-icon.d.ts +0 -0
  759. /package/lib/src/components/{commons/icons → shared/Icons}/icon-props.d.ts +0 -0
  760. /package/lib/src/components/{commons/icons → shared/Icons}/load-icon.d.ts +0 -0
  761. /package/lib/src/components/{commons/icons → shared/Icons}/lunatic-icon.d.ts +0 -0
  762. /package/lib/src/components/{commons/icons → shared/Icons}/network-icon.d.ts +0 -0
  763. /package/lib/src/components/{commons/icons → shared/Icons}/on-drag-icon.d.ts +0 -0
  764. /package/lib/src/components/{commons/icons → shared/Icons}/opened-icon.d.ts +0 -0
  765. /package/lib/src/components/{commons/icons → shared/Icons}/radio-checked-icon.d.ts +0 -0
  766. /package/lib/src/components/{commons/icons → shared/Icons}/radio-unchecked-icon.d.ts +0 -0
  767. /package/lib/src/components/{commons/components/html-table/thead.spec.d.ts → shared/Label/Label.spec.d.ts} +0 -0
  768. /package/lib/src/components/{commons/components/html-table/tr.spec.d.ts → shared/MDLabel/MDLabel.spec.d.ts} +0 -0
  769. /package/lib/src/components/{commons/components/is-network/is-network.spec.d.ts → shared/Missing/Missing.spec.d.ts} +0 -0
  770. /package/lib/src/components/{commons/components/is-network/use-online-status.spec.d.ts → shared/ModalControls/ModalControls.spec.d.ts} +0 -0
  771. /package/lib/src/components/{commons/components/label/label.spec.d.ts → shared/Radio/RadioOption.spec.d.ts} +0 -0
  772. /package/lib/src/components/{commons/components/md-label/md-label.spec.d.ts → shared/Table/Table.spec.d.ts} +0 -0
  773. /package/lib/src/components/{commons/components/missing/missing.spec.d.ts → shared/Table/Tbody.spec.d.ts} +0 -0
  774. /package/lib/src/components/{commons/components/nothing-to-display.spec.d.ts → shared/Table/Td.spec.d.ts} +0 -0
  775. /package/lib/src/components/{commons/components/variable-status/variable-status.spec.d.ts → shared/Table/Th.spec.d.ts} +0 -0
  776. /package/lib/src/components/{commons/use-on-handle-change.spec.d.ts → shared/Table/Thead.spec.d.ts} +0 -0
  777. /package/lib/src/components/{component-set/html/component-set.spec.d.ts → shared/Table/Tr.spec.d.ts} +0 -0
  778. /package/lib/src/components/{datepicker/html/datepicker.spec.d.ts → shared/VariableStatus/VariableStatus.spec.d.ts} +0 -0
  779. /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.d.ts +0 -0
  780. /package/lib/src/components/{declarations/declaration.spec.d.ts → shared/suggester-loader-widget/dragger/dragger.spec.d.ts} +0 -0
  781. /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/dragger/index.d.ts +0 -0
  782. /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/index.d.ts +0 -0
  783. /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/is-network/index.d.ts +0 -0
  784. /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/is-network/is-network.d.ts +0 -0
  785. /package/lib/src/components/{declarations/declarations.spec.d.ts → shared/suggester-loader-widget/is-network/is-network.spec.d.ts} +0 -0
  786. /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/is-network/use-online-status.d.ts +0 -0
  787. /package/lib/src/components/{dropdown/html/dropdown-writable/filter-tools/filter-options.spec.d.ts → shared/suggester-loader-widget/is-network/use-online-status.spec.d.ts} +0 -0
  788. /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/progress.d.ts +0 -0
  789. /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/action-tool.d.ts +0 -0
  790. /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/index.d.ts +0 -0
  791. /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/tools.d.ts +0 -0
  792. /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget-container.d.ts +0 -0
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _react = _interopRequireDefault(require("react"));
4
- var _react2 = require("@testing-library/react");
5
- var _comboBoxLabelSelection = _interopRequireDefault(require("./combo-box-label-selection"));
3
+ var _react = require("@testing-library/react");
4
+ var _ComboboxLabelSelection = require("./ComboboxLabelSelection");
6
5
  var _vitest = require("vitest");
7
6
  var _jsxRuntime = require("react/jsx-runtime");
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
7
  (0, _vitest.describe)('DefaultLabelRenderer', function () {
10
8
  (0, _vitest.describe)('DefaultLabelRenderer', function () {
11
9
  var option = {
@@ -14,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
14
12
  label: 'Label'
15
13
  };
16
14
  (0, _vitest.it)('should render with selected option', function () {
17
- var _render = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxLabelSelection["default"], {
15
+ var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxLabelSelection.ComboboxLabelSelection, {
18
16
  option: option,
19
17
  placeholder: "Select an option"
20
18
  })),
@@ -23,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
23
21
  (0, _vitest.expect)(getByText(expectedContent)).toBeInTheDocument();
24
22
  });
25
23
  (0, _vitest.it)('should render with placeholder', function () {
26
- var _render2 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxLabelSelection["default"], {
24
+ var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxLabelSelection.ComboboxLabelSelection, {
27
25
  option: null,
28
26
  placeholder: "Select an option"
29
27
  })),
@@ -31,7 +29,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
31
29
  (0, _vitest.expect)(getByText('Select an option')).toBeInTheDocument();
32
30
  });
33
31
  (0, _vitest.it)('should render with search value', function () {
34
- var _render3 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxLabelSelection["default"], {
32
+ var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxLabelSelection.ComboboxLabelSelection, {
35
33
  option: null,
36
34
  search: "Search value",
37
35
  placeholder: "Select an option"
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ComboboxSelection = ComboboxSelection;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _ComboboxLabelSelection = require("./ComboboxLabelSelection");
9
+ var _ComboboxInput = require("./ComboboxInput");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ /**
13
+ * Label displayed when a value is selected in the ComboBox
14
+ * This label can either be an input (when editable or expanded) or a simple span
15
+ */
16
+ function ComboboxSelection(_ref) {
17
+ var labelRenderer = _ref.labelRenderer,
18
+ placeholder = _ref.placeholder,
19
+ search = _ref.search,
20
+ expanded = _ref.expanded,
21
+ disabled = _ref.disabled,
22
+ readOnly = _ref.readOnly,
23
+ focused = _ref.focused,
24
+ _onChange = _ref.onChange,
25
+ selectedIndex = _ref.selectedIndex,
26
+ options = _ref.options,
27
+ editable = _ref.editable,
28
+ labelId = _ref.labelId,
29
+ id = _ref.id,
30
+ classNamePrefix = _ref.classNamePrefix,
31
+ invalid = _ref.invalid;
32
+ var showLabel = !editable || !expanded;
33
+ var selectedOption = selectedIndex !== undefined ? options[selectedIndex] : undefined;
34
+ var LabelSelectionComponent = labelRenderer !== null && labelRenderer !== void 0 ? labelRenderer : _ComboboxLabelSelection.ComboboxLabelSelection;
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
36
+ id: id,
37
+ className: (0, _classnames["default"])("".concat(classNamePrefix !== null && classNamePrefix !== void 0 ? classNamePrefix : 'lunatic', "-combo-box-selection"), {
38
+ focused: focused,
39
+ disabled: disabled
40
+ }),
41
+ role: "combobox",
42
+ "aria-controls": 'todo',
43
+ "aria-haspopup": "listbox",
44
+ "aria-expanded": expanded,
45
+ "aria-autocomplete": "list",
46
+ "aria-owns": id,
47
+ "aria-labelledby": labelId,
48
+ children: showLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelSelectionComponent, {
49
+ option: selectedOption,
50
+ placeholder: placeholder,
51
+ search: search,
52
+ disabled: disabled,
53
+ readOnly: readOnly
54
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxInput.ComboboxInput, {
55
+ invalid: invalid,
56
+ id: "combobox-input-".concat(id),
57
+ className: "lunatic-combo-box-input",
58
+ onChange: function onChange(e) {
59
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
60
+ },
61
+ value: search,
62
+ placeholder: placeholder,
63
+ disabled: disabled,
64
+ readOnly: readOnly,
65
+ focused: focused
66
+ })
67
+ });
68
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _react = require("@testing-library/react");
4
- var _selection = require("./selection");
4
+ var _ComboboxSelection = require("./ComboboxSelection");
5
5
  var _vitest = require("vitest");
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
7
  var options = [{
@@ -16,14 +16,14 @@ var options = [{
16
16
  }];
17
17
  (0, _vitest.describe)('Selection component', function () {
18
18
  (0, _vitest.it)('should render correctly with default props', function () {
19
- var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
19
+ var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
20
20
  options: options
21
21
  })),
22
22
  container = _render.container;
23
23
  (0, _vitest.expect)(container.firstChild).toMatchSnapshot();
24
24
  });
25
25
  (0, _vitest.it)('should render correctly when it is editable', function () {
26
- var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
26
+ var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
27
27
  options: options,
28
28
  editable: true
29
29
  })),
@@ -31,7 +31,7 @@ var options = [{
31
31
  (0, _vitest.expect)(container.firstChild).toMatchSnapshot();
32
32
  });
33
33
  (0, _vitest.it)('should render correctly when it is expanded', function () {
34
- var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
34
+ var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
35
35
  options: options,
36
36
  expanded: true
37
37
  })),
@@ -39,7 +39,7 @@ var options = [{
39
39
  (0, _vitest.expect)(container.firstChild).toMatchSnapshot();
40
40
  });
41
41
  (0, _vitest.it)('should render correctly when it is disabled', function () {
42
- var _render4 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
42
+ var _render4 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
43
43
  options: options,
44
44
  disabled: true,
45
45
  placeholder: "hello!"
@@ -48,7 +48,7 @@ var options = [{
48
48
  (0, _vitest.expect)(container.firstChild).toMatchSnapshot();
49
49
  });
50
50
  (0, _vitest.it)('should render the selected option when there is a selection', function () {
51
- var _render5 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
51
+ var _render5 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
52
52
  options: options,
53
53
  selectedIndex: 0,
54
54
  expanded: false
@@ -57,7 +57,7 @@ var options = [{
57
57
  (0, _vitest.expect)(getByText('apple - Apple')).toBeInTheDocument();
58
58
  });
59
59
  (0, _vitest.it)('should not render the input when it is not editable', function () {
60
- var _render6 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
60
+ var _render6 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
61
61
  options: options,
62
62
  placeholder: "Search fruits",
63
63
  editable: false
@@ -5,9 +5,7 @@ exports[`Selection component > should render correctly when it is disabled 1`] =
5
5
  aria-autocomplete="list"
6
6
  aria-controls="todo"
7
7
  aria-haspopup="listbox"
8
- aria-owns="idUndefined"
9
- class="lunatic-combo-box-selection"
10
- id="idUndefined"
8
+ class="lunatic-combo-box-selection disabled"
11
9
  role="combobox"
12
10
  >
13
11
  <div
@@ -27,9 +25,7 @@ exports[`Selection component > should render correctly when it is editable 1`] =
27
25
  aria-autocomplete="list"
28
26
  aria-controls="todo"
29
27
  aria-haspopup="listbox"
30
- aria-owns="idUndefined"
31
28
  class="lunatic-combo-box-selection"
32
- id="idUndefined"
33
29
  role="combobox"
34
30
  >
35
31
  <div
@@ -48,9 +44,7 @@ exports[`Selection component > should render correctly when it is expanded 1`] =
48
44
  aria-controls="todo"
49
45
  aria-expanded="true"
50
46
  aria-haspopup="listbox"
51
- aria-owns="idUndefined"
52
47
  class="lunatic-combo-box-selection"
53
- id="idUndefined"
54
48
  role="combobox"
55
49
  >
56
50
  <div
@@ -68,9 +62,7 @@ exports[`Selection component > should render correctly with default props 1`] =
68
62
  aria-autocomplete="list"
69
63
  aria-controls="todo"
70
64
  aria-haspopup="listbox"
71
- aria-owns="idUndefined"
72
65
  class="lunatic-combo-box-selection"
73
- id="idUndefined"
74
66
  role="combobox"
75
67
  >
76
68
  <div
@@ -0,0 +1 @@
1
+ "use strict";
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.ComponentErrors = ComponentErrors;
7
7
  exports.getComponentErrors = getComponentErrors;
8
- require("./errors.scss");
8
+ require("./ComponentErrors.scss");
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -16,14 +16,16 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  /**
17
17
  * Display a list of error as simple red text
18
18
  */
19
- function Errors(_ref) {
20
- var errors = _ref.errors;
21
- if (!errors) {
19
+ function ComponentErrors(_ref) {
20
+ var errors = _ref.errors,
21
+ componentId = _ref.componentId;
22
+ var componentErrors = Array.isArray(errors) ? errors : getComponentErrors(errors, componentId);
23
+ if (!componentErrors) {
22
24
  return null;
23
25
  }
24
26
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
25
27
  className: "lunatic-errors",
26
- children: errors.map(function (_ref2) {
28
+ children: componentErrors.map(function (_ref2) {
27
29
  var id = _ref2.id,
28
30
  errorMessage = _ref2.errorMessage;
29
31
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -46,5 +48,4 @@ function getComponentErrors(errors, componentId) {
46
48
  return activeErrors[1];
47
49
  }
48
50
  return undefined;
49
- }
50
- var _default = exports["default"] = Errors;
51
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ var _react = require("@testing-library/react");
4
+ var _vitest = require("vitest");
5
+ var _ComponentErrors = require("./ComponentErrors");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ (0, _vitest.describe)('Errors component', function () {
8
+ var errors = {
9
+ id1: [{
10
+ id: 'error1',
11
+ errorMessage: 'Error 1 message',
12
+ criticality: 'ERROR',
13
+ typeOfControl: 'CONSISTENCY'
14
+ }],
15
+ id2: [{
16
+ id: 'error2',
17
+ errorMessage: 'Error 2 message',
18
+ criticality: 'ERROR',
19
+ typeOfControl: 'CONSISTENCY'
20
+ }, {
21
+ id: 'error3',
22
+ errorMessage: 'Error 3 message',
23
+ criticality: 'ERROR',
24
+ typeOfControl: 'CONSISTENCY'
25
+ }]
26
+ };
27
+ (0, _vitest.it)('renders null when no active errors', function () {
28
+ var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComponentErrors.ComponentErrors, {
29
+ errors: errors,
30
+ componentId: "id3"
31
+ })),
32
+ container = _render.container;
33
+ (0, _vitest.expect)(container.firstChild).toBeNull();
34
+ });
35
+ (0, _vitest.it)('renders active errors', function () {
36
+ var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComponentErrors.ComponentErrors, {
37
+ errors: errors,
38
+ componentId: "id2"
39
+ })),
40
+ getByText = _render2.getByText;
41
+ (0, _vitest.expect)(getByText('Error 2 message')).toBeInTheDocument();
42
+ (0, _vitest.expect)(getByText('Error 3 message')).toBeInTheDocument();
43
+ });
44
+ });
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
7
- var _declarations = require("../../declarations");
8
- var _fieldContainer = _interopRequireDefault(require("./field-container"));
9
- var _missing = _interopRequireDefault(require("./missing"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _variableStatus = _interopRequireDefault(require("./variable-status"));
6
+ exports.ComponentWrapper = ComponentWrapper;
7
+ var _Missing = require("./Missing/Missing");
8
+ var _VariableStatus = require("./VariableStatus/VariableStatus");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _Declarations = require("./Declarations/Declarations");
11
+ var _function = require("../../utils/function");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
14
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -17,43 +17,52 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
17
17
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
18
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
19
19
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
- function LunaticComponent(props) {
20
+ /**
21
+ * Wrapper around Lunatic components, handle Declarations and missing buttons
22
+ *
23
+ * ## The structure :
24
+ *
25
+ * |--------------------------|
26
+ * | DeclarationBefore |
27
+ * |__________________________|
28
+ * |--------------------------|
29
+ * | Component |
30
+ * |__________________________|
31
+ * |--------------------------|
32
+ * | Missing Buttons |
33
+ * |__________________________|
34
+ */
35
+ function ComponentWrapper(props) {
21
36
  var id = props.id,
22
37
  declarations = props.declarations,
23
38
  children = props.children,
24
39
  management = props.management,
25
- description = props.description,
26
40
  handleChange = props.handleChange;
27
41
  var content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
28
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations.DeclarationsBeforeText, {
42
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Declarations.Declarations, {
43
+ type: "BEFORE_QUESTION_TEXT",
29
44
  declarations: declarations,
30
45
  id: id
31
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_fieldContainer["default"], {
32
- children: /*#__PURE__*/_react["default"].cloneElement(children, {
33
- description: getDescription({
34
- declarations: declarations,
35
- description: description
36
- })
37
- })
38
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations.DeclarationsDetachable, {
46
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
47
+ className: "field-container",
48
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
49
+ className: (0, _classnames["default"])({
50
+ 'field-with-tooltip': management,
51
+ field: !management
52
+ }),
53
+ children: children
54
+ }), management && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
55
+ className: "tooltip"
56
+ })]
57
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Declarations.Declarations, {
58
+ type: "DETACHABLE",
39
59
  declarations: declarations,
40
60
  id: id
41
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_missing["default"], _objectSpread(_objectSpread({}, props), {}, {
42
- handleChange: handleChange
61
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Missing.Missing, _objectSpread(_objectSpread({}, props), {}, {
62
+ handleChange: handleChange !== null && handleChange !== void 0 ? handleChange : _function.voidFunction
43
63
  }))]
44
64
  });
45
- return management ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_variableStatus["default"], {
65
+ return management ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariableStatus.VariableStatus, {
46
66
  children: content
47
67
  }) : content;
48
- }
49
- function getDescription(_ref) {
50
- var declarations = _ref.declarations,
51
- description = _ref.description;
52
- if (Array.isArray(declarations)) {
53
- return declarations.filter(function (declaration) {
54
- return declaration.position === _declarations.DECLARATION_POSITIONS.after;
55
- });
56
- }
57
- return description;
58
- }
59
- var _default = exports["default"] = LunaticComponent;
68
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Declarations = exports.Declaration = void 0;
7
+ var _slottableComponent = require("../HOC/slottableComponent");
8
+ require("./Declarations.scss");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ var Declaration = exports.Declaration = (0, _slottableComponent.slottableComponent)('Declaration', function (_ref) {
13
+ var children = _ref.children,
14
+ type = _ref.type;
15
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
16
+ "data-testid": "declaration",
17
+ className: (0, _classnames["default"])('declaration-lunatic', "declaration-".concat(type.toLowerCase())),
18
+ children: children
19
+ });
20
+ });
21
+ function LunaticDeclarations(_ref2) {
22
+ var _declarations$filter;
23
+ var id = _ref2.id,
24
+ _ref2$type = _ref2.type,
25
+ type = _ref2$type === void 0 ? 'AFTER_QUESTION_TEXT' : _ref2$type,
26
+ declarations = _ref2.declarations;
27
+ var filtered = (_declarations$filter = declarations === null || declarations === void 0 ? void 0 : declarations.filter(function (d) {
28
+ return d.position === type;
29
+ })) !== null && _declarations$filter !== void 0 ? _declarations$filter : [];
30
+ if (filtered.length === 0) {
31
+ return null;
32
+ }
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
34
+ id: "declarations-".concat(id, "-").concat(type),
35
+ className: "declarations-lunatic",
36
+ children: filtered.map(function (_ref3) {
37
+ var id = _ref3.id,
38
+ label = _ref3.label,
39
+ declarationType = _ref3.declarationType;
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Declaration, {
41
+ type: declarationType,
42
+ children: label
43
+ }, id);
44
+ })
45
+ });
46
+ }
47
+ var Declarations = exports.Declarations = (0, _slottableComponent.slottableComponent)('Declarations', LunaticDeclarations);
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _declarations = _interopRequireDefault(require("./declarations"));
3
+ var _Declarations = require("./Declarations");
4
4
  var _react = require("@testing-library/react");
5
5
  var _vitest = require("vitest");
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
7
  var declarations = [{
9
8
  id: '1',
10
9
  label: 'Declaration 1',
@@ -22,11 +21,11 @@ var declarations = [{
22
21
  position: 'DETACHABLE'
23
22
  }];
24
23
  (0, _vitest.describe)('Declarations component', function () {
25
- (0, _vitest.it)('renders correctly with filtered declarations', function () {
24
+ (0, _vitest.it)('renders correctly with filtered Declarations', function () {
26
25
  var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
27
26
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
28
27
  "data-testid": "declarations-1-AFTER_QUESTION_TEXT"
29
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations["default"], {
28
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Declarations.Declarations, {
30
29
  id: "1",
31
30
  type: "AFTER_QUESTION_TEXT",
32
31
  declarations: declarations
@@ -41,7 +40,7 @@ var declarations = [{
41
40
  (0, _vitest.expect)(declarationElement).toHaveClass('declaration-lunatic');
42
41
  (0, _vitest.expect)(declarationElement).toHaveClass('declaration-after');
43
42
  });
44
- (0, _vitest.it)('renders nothing with unfiltered declarations', function () {
43
+ (0, _vitest.it)('renders nothing with unfiltered Declarations', function () {
45
44
  var declarationstest = [{
46
45
  id: '3',
47
46
  label: 'Declaration 3',
@@ -51,7 +50,7 @@ var declarations = [{
51
50
  var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
52
51
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
53
52
  "data-testid": "declarations-1-BEFORE_QUESTION_TEXT"
54
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations["default"], {
53
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Declarations.Declarations, {
55
54
  id: "1",
56
55
  type: "BEFORE_QUESTION_TEXT",
57
56
  declarations: declarationstest
@@ -61,11 +60,11 @@ var declarations = [{
61
60
  var declarationsElement = queryByTestId('declarations-1-BEFORE_QUESTION_TEXT');
62
61
  (0, _vitest.expect)(declarationsElement.nextElementSibling).toBeNull();
63
62
  });
64
- (0, _vitest.it)('renders nothing with empty declarations array', function () {
63
+ (0, _vitest.it)('renders nothing with empty Declarations array', function () {
65
64
  var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
66
65
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
67
66
  "data-testid": "declarations-1-DETACHABLE"
68
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations["default"], {
67
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Declarations.Declarations, {
69
68
  id: "1",
70
69
  type: "DETACHABLE",
71
70
  declarations: []
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Fieldset = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _slottableComponent = require("../HOC/slottableComponent");
9
+ var _LabelDescription = require("../LabelDescription");
10
+ require("./Fieldset.scss");
11
+ var _isElement = require("../../../utils/is-element");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
15
+ function LunaticFieldset(_ref) {
16
+ var children = _ref.children,
17
+ legend = _ref.legend,
18
+ description = _ref.description,
19
+ className = _ref.className;
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("fieldset", {
21
+ className: (0, _classnames["default"])(className),
22
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("legend", {
23
+ children: [labelToReactNode(legend), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabelDescription.LabelDescription, {
24
+ value: description
25
+ })]
26
+ }), children]
27
+ });
28
+ }
29
+ function labelToReactNode(label) {
30
+ if (!label) {
31
+ return '';
32
+ }
33
+ if (typeof label === 'string' || typeof label === 'boolean' || typeof label === 'number') {
34
+ return label;
35
+ }
36
+ if (_typeof(label) === 'object') {
37
+ if ((0, _isElement.isElement)(label)) return label;
38
+ if ('value' in label && typeof label.value === 'string') {
39
+ return label.value;
40
+ }
41
+ }
42
+ return "";
43
+ }
44
+ var Fieldset = exports.Fieldset = (0, _slottableComponent.slottableComponent)('Fieldset', LunaticFieldset);
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _react = require("@testing-library/react");
4
+ var _Fieldset = require("./Fieldset");
5
+ var _vitest = require("vitest");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ (0, _vitest.describe)('Fieldset', function () {
8
+ (0, _vitest.it)('renders the legend text', function () {
9
+ var legendText = 'Example Legend';
10
+ var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.Fieldset, {
11
+ legend: legendText
12
+ })),
13
+ getByText = _render.getByText;
14
+ var legendElement = getByText(legendText);
15
+ (0, _vitest.expect)(legendElement).toBeInTheDocument();
16
+ });
17
+ (0, _vitest.it)('renders the children', function () {
18
+ var childText = 'Example child text';
19
+ var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.Fieldset, {
20
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
21
+ children: childText
22
+ })
23
+ })),
24
+ getByText = _render2.getByText;
25
+ var childElement = getByText(childText);
26
+ (0, _vitest.expect)(childElement).toBeInTheDocument();
27
+ });
28
+ (0, _vitest.it)('applies the className', function () {
29
+ var className = 'custom-class';
30
+ var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.Fieldset, {
31
+ className: className
32
+ })),
33
+ container = _render3.container;
34
+ var fieldsetElement = container.querySelector('fieldset');
35
+ (0, _vitest.expect)(fieldsetElement).toHaveClass(className);
36
+ });
37
+ });
@@ -3,26 +3,49 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.SlotsProvider = void 0;
7
+ exports.slottableComponent = slottableComponent;
7
8
  var _react = require("react");
8
- var _lunaticContext = require("../../use-lunatic/lunatic-context");
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
13
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
- function createCustomizableLunaticField(LunaticField, name) {
17
- var Memoized = /*#__PURE__*/(0, _react.memo)(LunaticField);
18
- Memoized.displayName = name;
19
- return function OverlayField(props) {
20
- var custom = (0, _lunaticContext.useLunaticCustom)();
21
- if (_typeof(custom) === 'object' && name in custom) {
22
- var CustomComponent = custom[name];
23
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomComponent, _objectSpread({}, props));
15
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16
+ * Contains the type of every customizable component
17
+ */
18
+ var empty = {};
19
+ var SlotsContext = /*#__PURE__*/(0, _react.createContext)(empty);
20
+ var SlotsProvider = exports.SlotsProvider = function SlotsProvider(_ref) {
21
+ var slots = _ref.slots,
22
+ children = _ref.children;
23
+ if (!slots) {
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
25
+ children: children
26
+ });
27
+ }
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SlotsContext.Provider, {
29
+ value: slots !== null && slots !== void 0 ? slots : empty,
30
+ children: children
31
+ });
32
+ };
33
+
34
+ /**
35
+ * Create a replaceable version of a component
36
+ *
37
+ * The component can be replaced using the "slots" props on <LunaticComponents>
38
+ */
39
+ function slottableComponent(name, OriginalComponent) {
40
+ var DecoratedComponent = function DecoratedComponent(props) {
41
+ var _useContext;
42
+ var custom = (_useContext = (0, _react.useContext)(SlotsContext)) !== null && _useContext !== void 0 ? _useContext : empty;
43
+ if (custom && name in custom) {
44
+ var SlotComponent = custom[name];
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SlotComponent, _objectSpread({}, props));
24
46
  }
25
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Memoized, _objectSpread({}, props));
47
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(OriginalComponent, _objectSpread({}, props));
26
48
  };
27
- }
28
- var _default = exports["default"] = createCustomizableLunaticField;
49
+ DecoratedComponent.displayName = name;
50
+ return DecoratedComponent;
51
+ }