@inseefr/lunatic 2.6.3-rc.1 → 2.6.4

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 (261) hide show
  1. package/README.md +49 -3
  2. package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +3 -3
  3. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -1
  4. package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -2
  5. package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +4 -2
  6. package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +3 -3
  7. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +2 -1
  8. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +2 -1
  9. package/lib/components/checkbox/commons/checkbox-option.js +3 -1
  10. package/lib/components/commons/components/combo-box/combo-box-container.js +1 -2
  11. package/lib/components/commons/components/combo-box/combo-box.js +2 -2
  12. package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +3 -1
  13. package/lib/components/commons/components/combo-box/selection/input.js +3 -1
  14. package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
  15. package/lib/components/commons/components/errors/errors.js +12 -10
  16. package/lib/components/commons/components/errors/errors.spec.js +6 -6
  17. package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +2 -0
  18. package/lib/components/component-set/html/component-set.js +2 -2
  19. package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +2 -0
  20. package/lib/components/datepicker/html/datepicker-input.js +4 -2
  21. package/lib/components/datepicker/html/datepicker.js +3 -3
  22. package/lib/components/datepicker/lunatic-datepicker.js +2 -1
  23. package/lib/components/dropdown/lunatic-dropdown.js +2 -1
  24. package/lib/components/index.js +4 -4
  25. package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +2 -0
  26. package/lib/components/input/html/input.js +3 -3
  27. package/lib/components/input/lunatic-input.js +2 -1
  28. package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +2 -2
  29. package/lib/components/input-number/html/input-number-thousand.js +4 -17
  30. package/lib/components/input-number/html/input-number.js +3 -5
  31. package/lib/components/input-number/lunatic-input-number.js +2 -3
  32. package/lib/components/loop/block-for-loop.js +10 -6
  33. package/lib/components/loop/roster-for-loop/roster-for-loop.js +35 -27
  34. package/lib/components/loop/utils/get-initial-nb-rows.js +17 -0
  35. package/lib/components/lunatic-components.js +7 -27
  36. package/lib/components/pairwise-links/index.js +13 -0
  37. package/lib/components/pairwise-links/orchestrator.js +71 -0
  38. package/lib/components/pairwise-links/pairwise-links.js +30 -27
  39. package/lib/components/pairwise-links/row.js +74 -0
  40. package/lib/components/radio/html/radio-group-content.js +4 -2
  41. package/lib/components/radio/html/radio-group.js +3 -3
  42. package/lib/components/radio/html/radio-option.js +3 -1
  43. package/lib/components/radio/lunatic-radio-group.js +2 -1
  44. package/lib/components/suggester/find-best-label/find-best-label.js +6 -6
  45. package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -3
  46. package/lib/components/suggester/lunatic-suggester.js +7 -4
  47. package/lib/components/suggester/searching/create-searching.js +20 -39
  48. package/lib/components/switch/html/switch.js +2 -2
  49. package/lib/components/switch/lunatic-switch.js +2 -1
  50. package/lib/components/table/cell.js +89 -0
  51. package/lib/components/table/{table-header.js → header.js} +5 -3
  52. package/lib/components/table/index.js +13 -0
  53. package/lib/components/table/lunatic-table.js +15 -24
  54. package/lib/components/table/row.js +40 -0
  55. package/lib/components/table/table-orchestrator.js +35 -0
  56. package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +2 -0
  57. package/lib/components/textarea/html/textarea.js +6 -4
  58. package/lib/components/textarea/lunatic-textarea.js +6 -3
  59. package/lib/hooks/use-auto-focus.js +26 -0
  60. package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +1 -1
  61. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +2 -1
  62. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +1 -1
  63. package/lib/src/components/checkbox/commons/checkbox-option.d.ts +1 -0
  64. package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +2 -2
  65. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +2 -2
  66. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +4 -6
  67. package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +1 -0
  68. package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -0
  69. package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
  70. package/lib/src/components/commons/components/errors/errors.d.ts +6 -3
  71. package/lib/src/components/datepicker/html/datepicker-input.d.ts +2 -1
  72. package/lib/src/components/datepicker/html/datepicker.d.ts +1 -1
  73. package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +1 -1
  74. package/lib/src/components/dropdown/html/dropdown.d.ts +3 -1
  75. package/lib/src/components/index.d.ts +2 -2
  76. package/lib/src/components/input/html/input.d.ts +2 -2
  77. package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -2
  78. package/lib/src/components/input-number/html/input-number.d.ts +2 -3
  79. package/lib/src/components/loop/block-for-loop.d.ts +4 -3
  80. package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +4 -3
  81. package/lib/src/components/loop/utils/get-initial-nb-rows.d.ts +4 -0
  82. package/lib/src/components/lunatic-components.d.ts +3 -5
  83. package/lib/src/components/pairwise-links/index.d.ts +1 -0
  84. package/lib/src/components/pairwise-links/orchestrator.d.ts +6 -0
  85. package/lib/src/components/pairwise-links/pairwise-links.d.ts +2 -1
  86. package/lib/src/components/pairwise-links/row.d.ts +7 -0
  87. package/lib/src/components/radio/html/radio-group-content.d.ts +2 -1
  88. package/lib/src/components/radio/html/radio-group.d.ts +1 -1
  89. package/lib/src/components/radio/html/radio-option.d.ts +1 -0
  90. package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +1 -1
  91. package/lib/src/components/suggester/html/suggester.d.ts +1 -1
  92. package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +5 -2
  93. package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
  94. package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
  95. package/lib/src/components/switch/html/switch.d.ts +1 -1
  96. package/lib/src/components/table/cell.d.ts +19 -0
  97. package/lib/src/components/table/{table-header.d.ts → header.d.ts} +2 -2
  98. package/lib/src/components/table/index.d.ts +1 -0
  99. package/lib/src/components/table/lunatic-table.d.ts +1 -1
  100. package/lib/src/components/table/row.d.ts +18 -0
  101. package/lib/src/components/table/table-orchestrator.d.ts +4 -0
  102. package/lib/src/components/textarea/html/textarea.d.ts +3 -2
  103. package/lib/src/components/type.d.ts +9 -7
  104. package/lib/src/hooks/use-auto-focus.d.ts +6 -0
  105. package/lib/src/use-lunatic/actions.d.ts +19 -3
  106. package/lib/src/use-lunatic/commons/calculated-variables.d.ts +8 -0
  107. package/lib/src/use-lunatic/commons/compile-controls.d.ts +2 -3
  108. package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +9 -0
  109. package/lib/src/use-lunatic/commons/execute-expression/create-memoizer.d.ts +8 -0
  110. package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +24 -0
  111. package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +11 -0
  112. package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.d.ts +7 -0
  113. package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.spec.d.ts +1 -0
  114. package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +6 -0
  115. package/lib/src/use-lunatic/commons/execute-expression/index.d.ts +1 -0
  116. package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +418 -0
  117. package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +3 -2
  118. package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +0 -6
  119. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +142 -107
  120. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +89 -53
  121. package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +0 -1
  122. package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +6 -0
  123. package/lib/src/use-lunatic/commons/get-component-value/index.d.ts +1 -0
  124. package/lib/src/use-lunatic/commons/get-data.d.ts +26 -0
  125. package/lib/src/use-lunatic/commons/index.d.ts +3 -0
  126. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +9 -10
  127. package/lib/src/use-lunatic/reducer/reduce-handle-change/index.d.ts +1 -0
  128. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +7 -0
  129. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.d.ts +1 -0
  130. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +4 -0
  131. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +15 -0
  132. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +7 -0
  133. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +4 -0
  134. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +14 -0
  135. package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +9 -0
  136. package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +12 -1
  137. package/lib/src/use-lunatic/reducer/reduce-on-init.spec.d.ts +1 -0
  138. package/lib/src/use-lunatic/type-source.d.ts +21 -7
  139. package/lib/src/use-lunatic/type.d.ts +12 -13
  140. package/lib/src/use-lunatic/use-lunatic.d.ts +62 -36
  141. package/lib/src/use-lunatic/use-suggesters.d.ts +2 -1
  142. package/lib/src/utils/array.d.ts +1 -6
  143. package/lib/src/utils/number.d.ts +0 -4
  144. package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +1 -1
  145. package/lib/src/utils/suggester-workers/searching/meloto-order.d.ts +2 -1
  146. package/lib/src/utils/suggester-workers/worker-path.d.ts +6 -0
  147. package/lib/src/utils/vtl/dataset-builder.d.ts +5 -0
  148. package/lib/src/utils/vtl/index.d.ts +1 -0
  149. package/lib/stories/behaviour/cleaning/source.json +151 -0
  150. package/lib/stories/behaviour/cleaning/test.stories.js +84 -0
  151. package/lib/stories/{questionnaires-test → behaviour}/controls/controls.stories.js +5 -5
  152. package/lib/stories/{questionnaires-test → behaviour/others}/test.stories.js +7 -7
  153. package/lib/stories/{paste-questionnaire → behaviour/paste}/test.stories.js +3 -3
  154. package/lib/stories/{resizing-questionnaire → behaviour/resizing}/test.stories.js +3 -3
  155. package/lib/stories/suggester/suggester-workers.stories.js +36 -1
  156. package/lib/stories/suggester/suggester.stories.js +8 -4
  157. package/lib/use-lunatic/actions.js +3 -3
  158. package/lib/use-lunatic/commons/calculated-variables.js +104 -0
  159. package/lib/use-lunatic/commons/compile-controls.js +5 -3
  160. package/lib/use-lunatic/commons/execute-condition-filter.js +9 -1
  161. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +233 -0
  162. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.spec.js +155 -0
  163. package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +63 -0
  164. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +149 -0
  165. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.spec.js +130 -0
  166. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +90 -0
  167. package/lib/use-lunatic/commons/execute-expression/execute-expression.spec.js +38 -0
  168. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +40 -0
  169. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.spec.js +31 -0
  170. package/lib/use-lunatic/commons/{fill-components/fill-iterations.js → execute-expression/get-safety-expression.js} +20 -30
  171. package/lib/use-lunatic/commons/execute-expression/index.js +13 -0
  172. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +3 -2
  173. package/lib/use-lunatic/{reducer/reduce-handle-change.js → commons/fill-components/fill-component-required.js} +8 -14
  174. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +7 -21
  175. package/lib/use-lunatic/commons/fill-components/fill-components.js +4 -5
  176. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -0
  177. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +13 -6
  178. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +5 -58
  179. package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +0 -1
  180. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +174 -0
  181. package/lib/use-lunatic/commons/get-component-value/index.js +13 -0
  182. package/lib/use-lunatic/commons/get-data.js +80 -0
  183. package/lib/use-lunatic/commons/index.js +21 -0
  184. package/lib/use-lunatic/initial-state.js +4 -6
  185. package/lib/use-lunatic/reducer/overview/overview-on-change.js +1 -1
  186. package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +792 -0
  187. package/lib/use-lunatic/reducer/reduce-handle-change/index.js +13 -0
  188. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +78 -0
  189. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.js +46 -0
  190. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +115 -0
  191. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +89 -0
  192. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +88 -0
  193. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +119 -0
  194. package/lib/use-lunatic/{commons/variables/get-questionnaire-data.js → reducer/reduce-handle-change/reduce-variables-array.js} +32 -53
  195. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +28 -0
  196. package/lib/use-lunatic/reducer/reduce-on-init.js +184 -90
  197. package/lib/use-lunatic/reducer/reduce-on-init.spec.js +17 -0
  198. package/lib/use-lunatic/reducer/reducer.js +2 -2
  199. package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +4 -2
  200. package/lib/use-lunatic/use-lunatic.js +29 -22
  201. package/lib/use-lunatic/use-lunatic.test.js +36 -133
  202. package/lib/use-lunatic/use-suggesters.js +4 -3
  203. package/lib/utils/array.js +6 -57
  204. package/lib/utils/get-component-value.js +9 -3
  205. package/lib/utils/number.js +1 -13
  206. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +4 -3
  207. package/lib/utils/suggester-workers/searching/meloto-order.js +6 -5
  208. package/lib/utils/suggester-workers/worker-path.js +29 -0
  209. package/lib/utils/vtl/dataset-builder.js +27 -0
  210. package/lib/utils/vtl/index.js +13 -0
  211. package/package.json +15 -10
  212. package/scripts/build/add-workers-to-public.js +44 -0
  213. package/scripts/build/workers-paths.js +44 -0
  214. package/workers-release/lunatic-append-worker-0.3.0-experimental.js +2 -0
  215. package/workers-release/lunatic-append-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
  216. package/workers-release/lunatic-label-worker-0.3.0-experimental.js +2 -0
  217. package/workers-release/lunatic-label-worker-0.3.0-experimental.js.LICENSE.txt +13 -0
  218. package/workers-release/lunatic-searching-worker-0.3.0-experimental.js +2 -0
  219. package/workers-release/lunatic-searching-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
  220. package/lib/hooks/use-track-changes.js +0 -50
  221. package/lib/src/hooks/use-track-changes.d.ts +0 -9
  222. package/lib/src/use-lunatic/commons/component.d.ts +0 -22
  223. package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +0 -112
  224. package/lib/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +0 -7
  225. package/lib/src/use-lunatic/commons/variables/behaviours/missing-behaviour.d.ts +0 -7
  226. package/lib/src/use-lunatic/commons/variables/behaviours/resizing-behaviour.d.ts +0 -7
  227. package/lib/src/use-lunatic/commons/variables/get-questionnaire-data.d.ts +0 -4
  228. package/lib/src/use-lunatic/commons/variables/lunatic-variables-store.d.ts +0 -77
  229. package/lib/src/use-lunatic/reducer/reduce-handle-change.d.ts +0 -6
  230. package/lib/src/utils/env.d.ts +0 -1
  231. package/lib/src/utils/store-tools/worker-path.d.ts +0 -1
  232. package/lib/src/utils/variables.d.ts +0 -5
  233. package/lib/src/utils/vtl.d.ts +0 -14
  234. package/lib/use-lunatic/commons/component.js +0 -22
  235. package/lib/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +0 -39
  236. package/lib/use-lunatic/commons/variables/behaviours/missing-behaviour.js +0 -47
  237. package/lib/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +0 -78
  238. package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +0 -330
  239. package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +0 -216
  240. package/lib/utils/array.spec.js +0 -30
  241. package/lib/utils/env.js +0 -10
  242. package/lib/utils/store-tools/worker-path.js +0 -13
  243. package/lib/utils/suggester-workers/create-worker.js +0 -55
  244. package/lib/utils/variables.js +0 -37
  245. package/lib/utils/vtl.js +0 -100
  246. /package/lib/src/use-lunatic/commons/{variables/lunatic-variables-store.spec.d.ts → execute-expression/create-refresh-calculated.spec.d.ts} +0 -0
  247. /package/lib/src/{utils/array.spec.d.ts → use-lunatic/commons/execute-expression/execute-expression.spec.d.ts} +0 -0
  248. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -0
  249. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -0
  250. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -0
  251. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -0
  252. /package/lib/stories/{questionnaires-test → behaviour}/controls/boucles-n.json +0 -0
  253. /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.json +0 -0
  254. /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.stories.js +0 -0
  255. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_DeclarationsSimples.json +0 -0
  256. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_MinMaxSum_Boucles.json +0 -0
  257. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_QuestSimple_Boucles.json +0 -0
  258. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_TCMRallyeGames.json +0 -0
  259. /package/lib/stories/{questionnaires-test → behaviour/others}/test-dylan.json +0 -0
  260. /package/lib/stories/{paste-questionnaire → behaviour/paste}/source.json +0 -0
  261. /package/lib/stories/{resizing-questionnaire → behaviour/resizing}/source.json +0 -0
@@ -1,11 +1,11 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import type { LunaticBaseProps } from '../../../type';
2
+ import type { LunaticError } from '../../../../use-lunatic/type';
3
3
  type Props = PropsWithChildren<{
4
4
  classNamePrefix?: string;
5
5
  className?: string;
6
6
  id?: string;
7
7
  classStyle?: string;
8
- errors?: LunaticBaseProps['errors'];
8
+ errors?: LunaticError[];
9
9
  }>;
10
10
  declare const _default: import("react").ComponentType<Props>;
11
11
  export default _default;
@@ -1,9 +1,9 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { LunaticBaseProps } from '../../../type';
3
2
  import './combo-box.scss';
4
3
  import type { ComboBoxOptionType } from './combo-box.type';
5
4
  import { type PanelProps } from './panel/panel';
6
5
  import { type SelectionProps } from './selection/selection';
6
+ import type { LunaticError } from '../../../../use-lunatic/type';
7
7
  type Props = SelectionProps & PanelProps & {
8
8
  className?: string;
9
9
  classNamePrefix?: string;
@@ -13,7 +13,7 @@ type Props = SelectionProps & PanelProps & {
13
13
  getOptionValue?: (o: ComboBoxOptionType) => string;
14
14
  label?: ReactNode;
15
15
  description?: ReactNode;
16
- errors?: LunaticBaseProps['errors'];
16
+ errors?: LunaticError[];
17
17
  onChange?: (s: string | null) => void;
18
18
  onSelect: (s: string | null) => void;
19
19
  options: ComboBoxOptionType[];
@@ -12,6 +12,7 @@ export declare const Default: Story<{
12
12
  id?: string | undefined;
13
13
  classNamePrefix?: string | undefined;
14
14
  readOnly?: boolean | undefined;
15
+ invalid?: boolean | undefined;
15
16
  } & import("./selection/label-selection").LabelSelectionProps & import("./panel/panel").PanelProps & {
16
17
  className?: string | undefined;
17
18
  classNamePrefix?: string | undefined;
@@ -21,9 +22,7 @@ export declare const Default: Story<{
21
22
  getOptionValue?: ((o: ComboBoxOptionType) => string) | undefined;
22
23
  label?: import("react").ReactNode;
23
24
  description?: import("react").ReactNode;
24
- errors?: {
25
- [id: string]: import("../../../..").LunaticError[];
26
- } | undefined;
25
+ errors?: import("../../../..").LunaticError[] | undefined;
27
26
  onChange?: ((s: string | null) => void) | undefined;
28
27
  onSelect: (s: string | null) => void;
29
28
  options: ComboBoxOptionType[];
@@ -38,6 +37,7 @@ export declare const Editable: Story<{
38
37
  id?: string | undefined;
39
38
  classNamePrefix?: string | undefined;
40
39
  readOnly?: boolean | undefined;
40
+ invalid?: boolean | undefined;
41
41
  } & import("./selection/label-selection").LabelSelectionProps & import("./panel/panel").PanelProps & {
42
42
  className?: string | undefined;
43
43
  classNamePrefix?: string | undefined;
@@ -47,9 +47,7 @@ export declare const Editable: Story<{
47
47
  getOptionValue?: ((o: ComboBoxOptionType) => string) | undefined;
48
48
  label?: import("react").ReactNode;
49
49
  description?: import("react").ReactNode;
50
- errors?: {
51
- [id: string]: import("../../../..").LunaticError[];
52
- } | undefined;
50
+ errors?: import("../../../..").LunaticError[] | undefined;
53
51
  onChange?: ((s: string | null) => void) | undefined;
54
52
  onSelect: (s: string | null) => void;
55
53
  options: ComboBoxOptionType[];
@@ -4,6 +4,7 @@ type LabelOrInputTypeProps = LabelSelectionProps & InputProps & {
4
4
  editable?: boolean;
5
5
  expanded?: boolean;
6
6
  readOnly?: boolean;
7
+ invalid?: boolean;
7
8
  };
8
9
  /**
9
10
  * Display the input or the label of the selection based on the state of the Suggester.
@@ -5,6 +5,7 @@ export type InputProps = {
5
5
  value?: string;
6
6
  labelledBy?: string;
7
7
  focused?: boolean;
8
+ invalid?: boolean;
8
9
  } & HTMLAttributes<HTMLInputElement>;
9
10
  declare const _default: React.ComponentType<Record<string, unknown>>;
10
11
  export default _default;
@@ -8,5 +8,6 @@ export type SelectionProps = {
8
8
  id?: string;
9
9
  classNamePrefix?: string;
10
10
  readOnly?: boolean;
11
+ invalid?: boolean;
11
12
  } & LabelSelectionProps;
12
- export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, readOnly, focused, onChange, selectedIndex, options, editable, labelId, id, classNamePrefix, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, readOnly, focused, onChange, selectedIndex, options, editable, labelId, id, classNamePrefix, invalid, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,11 @@
1
1
  import './errors.scss';
2
2
  import type { LunaticError } from '../../../../use-lunatic/type';
3
3
  type Props = {
4
- errors?: Record<string, LunaticError[]>;
5
- activeId?: string;
4
+ errors?: LunaticError[];
6
5
  };
7
- declare function Errors({ errors, activeId }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ /**
7
+ * Display a list of error as simple red text
8
+ */
9
+ declare function Errors({ errors }: Props): import("react/jsx-runtime").JSX.Element | null;
10
+ export declare function getComponentErrors(errors?: Record<string, LunaticError[]>, componentId?: string): LunaticError[] | undefined;
8
11
  export default Errors;
@@ -8,6 +8,7 @@ export type Props = {
8
8
  onChange?: ChangeEventHandler<HTMLInputElement>;
9
9
  min?: string;
10
10
  max?: string;
11
+ invalid?: boolean;
11
12
  };
12
- declare function DatepickerInput({ id, disabled, readOnly, labelId, value, onChange, min, max, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ declare function DatepickerInput({ id, disabled, readOnly, labelId, value, onChange, min, max, invalid, }: Props): import("react/jsx-runtime").JSX.Element;
13
14
  export default DatepickerInput;
@@ -4,7 +4,7 @@ import type { LunaticError } from '../../../use-lunatic/type';
4
4
  type Props = {
5
5
  label?: ReactNode;
6
6
  description?: ReactNode;
7
- errors?: Record<string, LunaticError[]>;
7
+ errors?: LunaticError[];
8
8
  disabled?: boolean;
9
9
  readOnly?: boolean;
10
10
  min?: string;
@@ -9,7 +9,7 @@ type Props = {
9
9
  className?: string;
10
10
  value: string | null;
11
11
  label?: ReactNode;
12
- errors?: Record<string, LunaticError[]>;
12
+ errors?: LunaticError[];
13
13
  description?: ReactNode;
14
14
  readOnly?: boolean;
15
15
  };
@@ -1,10 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import './dropdown.scss';
3
3
  import type { LunaticComponentProps } from '../../type';
4
+ import type { LunaticError } from '../../../use-lunatic/type';
4
5
  export type DropdownProps = {
5
6
  onSelect: (v: string | null) => void;
6
7
  className?: string;
7
8
  readOnly?: boolean;
8
- } & Pick<LunaticComponentProps<'Dropdown'>, 'id' | 'disabled' | 'options' | 'writable' | 'value' | 'description' | 'label' | 'errors'>;
9
+ errors?: LunaticError[];
10
+ } & Pick<LunaticComponentProps<'Dropdown'>, 'id' | 'disabled' | 'options' | 'writable' | 'value' | 'description' | 'label'>;
9
11
  declare const _default: import("react").ComponentType<DropdownProps>;
10
12
  export default _default;
@@ -10,7 +10,7 @@ export { default as InputNumber } from './input-number';
10
10
  export { default as FilterDescription } from './filter-description';
11
11
  export { Loop } from './loop/loop';
12
12
  export { default as Modal } from './modal-controls';
13
- export { PairwiseLinks } from './pairwise-links/pairwise-links';
13
+ export { default as PairwiseLinks } from './pairwise-links';
14
14
  export { default as Radio } from './radio';
15
15
  export { RosterForLoop } from './loop/roster-for-loop/roster-for-loop';
16
16
  export { default as Sequence } from './sequence';
@@ -20,7 +20,7 @@ export { default as Switch } from './switch';
20
20
  export { default as Textarea } from './textarea';
21
21
  export { default as SuggesterLoaderWidget } from './suggester-loader-widget';
22
22
  export { default as Roundabout } from './roundabout';
23
- export { LunaticTable as Table } from './table/lunatic-table';
23
+ export { default as Table } from './table';
24
24
  export { LunaticComponentSet as ComponentSet } from './component-set/lunatic-component-set';
25
25
  export { default as Duration } from './duration';
26
26
  export { Summary } from './summary';
@@ -1,11 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import './input.scss';
3
- import type { LunaticBaseProps } from '../../type';
3
+ import type { LunaticError } from '../../../use-lunatic/type';
4
4
  type Props = {
5
5
  label?: ReactNode;
6
6
  onChange: (v: string) => void;
7
7
  description?: string;
8
- errors: LunaticBaseProps['errors'];
8
+ errors?: LunaticError[];
9
9
  value?: string | null;
10
10
  disabled?: boolean;
11
11
  readOnly?: boolean;
@@ -6,9 +6,9 @@ type Props = {
6
6
  readOnly?: boolean;
7
7
  required?: boolean;
8
8
  labelId?: string;
9
- min?: number;
10
9
  max?: number;
11
10
  decimals?: number;
11
+ invalid?: boolean;
12
12
  };
13
- declare const InputNumberThousand: ({ id, onChange, value, disabled, readOnly, required, labelId, min, max, decimals, }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ declare const InputNumberThousand: ({ id, onChange, value, disabled, readOnly, required, labelId, max, decimals, invalid, }: Props) => import("react/jsx-runtime").JSX.Element;
14
14
  export default InputNumberThousand;
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
- import { type LunaticBaseProps } from '../../type';
3
2
  import './input-number.scss';
3
+ import type { LunaticError } from '../../../use-lunatic/type';
4
4
  type Props = {
5
5
  id?: string;
6
6
  onChange?: (n: number | null) => void;
@@ -9,13 +9,12 @@ type Props = {
9
9
  readOnly?: boolean;
10
10
  required?: boolean;
11
11
  labelId?: string;
12
- min?: number;
13
12
  max?: number;
14
13
  decimals?: number;
15
14
  label?: ReactNode;
16
15
  description?: string;
17
16
  unit?: string;
18
- errors?: LunaticBaseProps['errors'];
17
+ errors?: LunaticError[];
19
18
  };
20
19
  declare const _default: import("react").ComponentType<Props>;
21
20
  export default _default;
@@ -7,12 +7,13 @@ export declare const BlockForLoop: import("react").ComponentType<import("../type
7
7
  min: number;
8
8
  max: number;
9
9
  };
10
- iterations: number;
10
+ iterations?: number | undefined;
11
11
  getComponents: (n: number) => import("../../use-lunatic/commons/fill-components/fill-components").FilledLunaticComponentProps[];
12
12
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
13
- iteration?: number | number[] | undefined;
13
+ iteration?: number | undefined;
14
+ linksIterations?: number[] | undefined;
15
+ logging?: import("../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
14
16
  bindingDependencies?: string[] | undefined;
15
- deps?: string[] | undefined;
16
17
  } | undefined) => T;
17
18
  value: Record<string, unknown[]>;
18
19
  headers?: {
@@ -7,12 +7,13 @@ export declare const RosterForLoop: import("react").ComponentType<import("../../
7
7
  min: number;
8
8
  max: number;
9
9
  };
10
- iterations: number;
10
+ iterations?: number | undefined;
11
11
  getComponents: (n: number) => import("../../../use-lunatic/commons/fill-components/fill-components").FilledLunaticComponentProps[];
12
12
  executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
13
- iteration?: number | number[] | undefined;
13
+ iteration?: number | undefined;
14
+ linksIterations?: number[] | undefined;
15
+ logging?: import("../../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
14
16
  bindingDependencies?: string[] | undefined;
15
- deps?: string[] | undefined;
16
17
  } | undefined) => T;
17
18
  value: Record<string, unknown[]>;
18
19
  headers?: {
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Find the length of the variable (the biggest value sent to the loop)
3
+ */
4
+ export declare function getInitialNbRows(value: Record<string, unknown>): number;
@@ -1,12 +1,10 @@
1
- import { type PropsWithChildren, type ReactElement, type ReactNode } from 'react';
1
+ import { type PropsWithChildren, type ReactNode } from 'react';
2
2
  import type { FilledLunaticComponentProps } from '../use-lunatic/commons/fill-components/fill-components';
3
3
  type Props<T extends Record<string, unknown>> = {
4
- components: (FilledLunaticComponentProps | ReactElement)[];
4
+ components: FilledLunaticComponentProps[];
5
5
  autoFocusKey?: string;
6
6
  componentProps?: (component: FilledLunaticComponentProps) => T;
7
- wrapper?: (props: PropsWithChildren<FilledLunaticComponentProps & T & {
8
- index: number;
9
- }>) => ReactNode;
7
+ wrapper?: (props: PropsWithChildren<FilledLunaticComponentProps & T>) => ReactNode;
10
8
  };
11
9
  /**
12
10
  * Entry point for orchestrators, this component display the list of fields
@@ -0,0 +1 @@
1
+ export { default } from './pairwise-links';
@@ -0,0 +1,6 @@
1
+ import type { LunaticComponentProps } from '../type';
2
+ type Props = {
3
+ nbRows: number;
4
+ } & Omit<LunaticComponentProps<'PairwiseLinks'>, 'declarations'>;
5
+ declare function LinksOrchestrator(props: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ export default LinksOrchestrator;
@@ -1,2 +1,3 @@
1
1
  import type { LunaticComponentProps } from '../type';
2
- export declare const PairwiseLinks: ({ declarations, xAxisIterations, yAxisIterations, id, getComponents, }: LunaticComponentProps<'PairwiseLinks'>) => import("react/jsx-runtime").JSX.Element;
2
+ declare const PairwiseLinks: ({ declarations, components, handleChange, value, missing, shortcut, features, preferences, management, executeExpression, xAxisIterations, yAxisIterations, id, symLinks, }: LunaticComponentProps<'PairwiseLinks'>) => import("react/jsx-runtime").JSX.Element;
3
+ export default PairwiseLinks;
@@ -0,0 +1,7 @@
1
+ import type { LunaticComponentProps } from '../type';
2
+ type Props = {
3
+ linksIterations: [number, number];
4
+ lengths: number[];
5
+ } & Omit<LunaticComponentProps<'PairwiseLinks'>, 'declarations' | 'xAxisIterations' | 'yAxisIterations'>;
6
+ declare function Row({ components, value: valueMap, handleChange, features, missing, shortcut, management, className, preferences, executeExpression, linksIterations, symLinks, lengths, }: Props): import("react/jsx-runtime").JSX.Element | null;
7
+ export default Row;
@@ -13,6 +13,7 @@ export type Props = {
13
13
  shortcut?: boolean;
14
14
  disabled?: boolean;
15
15
  readOnly?: boolean;
16
+ invalid?: boolean;
16
17
  };
17
- declare function RadioGroupContent({ options, value, id, onClick, checkboxStyle, shortcut, disabled, readOnly, }: Props): import("react/jsx-runtime").JSX.Element;
18
+ declare function RadioGroupContent({ options, value, id, onClick, checkboxStyle, shortcut, disabled, readOnly, invalid, }: Props): import("react/jsx-runtime").JSX.Element;
18
19
  export default RadioGroupContent;
@@ -13,7 +13,7 @@ export type RadioGroupProps = {
13
13
  label?: ReactNode;
14
14
  onSelect: (v: string | null) => void;
15
15
  checkboxStyle?: boolean;
16
- errors?: Record<string, LunaticError[]>;
16
+ errors?: LunaticError[];
17
17
  className?: string;
18
18
  shortcut?: boolean;
19
19
  disabled?: boolean;
@@ -17,6 +17,7 @@ export type Props = {
17
17
  labelledBy?: string;
18
18
  label?: ReactNode;
19
19
  codeModality?: string;
20
+ invalid?: boolean;
20
21
  };
21
22
  declare const _default: import("react").ComponentType<Props>;
22
23
  export default _default;
@@ -1,2 +1,2 @@
1
- declare function findBestLabel(option: unknown, search: unknown): Promise<unknown>;
1
+ declare function findBestLabel(option: unknown, search: unknown, workersBasePath?: string): Promise<unknown>;
2
2
  export default findBestLabel;
@@ -19,7 +19,7 @@ type Props = {
19
19
  }>;
20
20
  label?: ReactNode;
21
21
  description?: ReactNode;
22
- errors?: Record<string, LunaticError[]>;
22
+ errors?: LunaticError[];
23
23
  };
24
24
  declare const _default: import("react").ComponentType<Props>;
25
25
  export default _default;
@@ -1,6 +1,9 @@
1
+ import type { LunaticError } from '../../../use-lunatic/type';
1
2
  import type { LunaticComponentProps } from '../../type';
2
- type Props = Pick<LunaticComponentProps<'Suggester'>, 'storeName' | 'idbVersion' | 'id' | 'className' | 'optionRenderer' | 'labelRenderer' | 'disabled' | 'readOnly' | 'value' | 'label' | 'description' | 'getSuggesterStatus' | 'errors'> & {
3
+ type Props = Pick<LunaticComponentProps<'Suggester'>, 'storeName' | 'idbVersion' | 'id' | 'className' | 'optionRenderer' | 'labelRenderer' | 'disabled' | 'readOnly' | 'value' | 'label' | 'description' | 'getSuggesterStatus'> & {
4
+ errors?: LunaticError[];
3
5
  onSelect: (v: string | null) => void;
6
+ workersBasePath?: string;
4
7
  };
5
- export declare function IDBSuggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, onSelect, disabled, value, label, description, getSuggesterStatus, errors, readOnly, }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export declare function IDBSuggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, onSelect, disabled, value, label, description, getSuggesterStatus, errors, readOnly, workersBasePath, }: Props): import("react/jsx-runtime").JSX.Element;
6
9
  export {};
@@ -1,3 +1,3 @@
1
1
  import type { LunaticComponentProps } from '../type';
2
- declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, readOnly, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
2
+ declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, readOnly, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, workersBasePath, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
3
3
  export default LunaticSuggester;
@@ -1,6 +1,6 @@
1
1
  import type { ComboBoxOptionType } from '../../commons/components/combo-box/combo-box.type';
2
2
  export declare function isWorkerCompatible(): boolean;
3
- declare function createSearching(name: string, version: string): (search: string | null) => Promise<{
3
+ declare function createSearching(name: string, version: string, workersBasePath?: string): (search: string | null) => Promise<{
4
4
  results: ComboBoxOptionType[];
5
5
  }>;
6
6
  export default createSearching;
@@ -11,7 +11,7 @@ type Props = {
11
11
  onClick: (v: boolean) => void;
12
12
  id: string;
13
13
  label: ReactNode;
14
- errors?: Record<string, LunaticError[]>;
14
+ errors?: LunaticError[];
15
15
  };
16
16
  declare const _default: import("react").ComponentType<Props>;
17
17
  export default _default;
@@ -0,0 +1,19 @@
1
+ import type { LunaticBaseProps } from '../type';
2
+ import type { LunaticComponentDefinition, LunaticExpression } from '../../use-lunatic/type';
3
+ type Props = {
4
+ content: LunaticComponentDefinition | {
5
+ label: LunaticExpression;
6
+ rowspan?: number;
7
+ colspan?: number;
8
+ };
9
+ id: string;
10
+ executeExpression: LunaticBaseProps['executeExpression'];
11
+ iteration?: number;
12
+ value: Record<string, unknown>;
13
+ row?: string | number;
14
+ index?: string | number;
15
+ handleChange: LunaticBaseProps['handleChange'];
16
+ errors?: LunaticBaseProps['errors'];
17
+ };
18
+ declare function Cell({ content, id, executeExpression, iteration, value, row, index, handleChange, errors, }: Props): import("react/jsx-runtime").JSX.Element;
19
+ export default Cell;
@@ -7,5 +7,5 @@ type Props = {
7
7
  rowspan?: number;
8
8
  }>;
9
9
  };
10
- export declare function TableHeader({ id, header }: Props): import("react/jsx-runtime").JSX.Element | null;
11
- export {};
10
+ declare function Header({ id, header }: Props): import("react/jsx-runtime").JSX.Element | null;
11
+ export default Header;
@@ -0,0 +1 @@
1
+ export { default } from './lunatic-table';
@@ -1,3 +1,3 @@
1
1
  import type { LunaticComponentProps } from '../type';
2
- export declare function LunaticTable(props: LunaticComponentProps<'Table'>): import("react/jsx-runtime").JSX.Element;
2
+ declare function LunaticTable(props: LunaticComponentProps<'Table'>): import("react/jsx-runtime").JSX.Element;
3
3
  export default LunaticTable;
@@ -0,0 +1,18 @@
1
+ import type { LunaticComponentDefinition, LunaticExpression } from '../../use-lunatic/type';
2
+ import type { LunaticBaseProps } from '../type';
3
+ type Props = {
4
+ components: Array<LunaticComponentDefinition | {
5
+ label: LunaticExpression;
6
+ rowspan?: number;
7
+ colspan?: number;
8
+ }>;
9
+ id: string;
10
+ executeExpression: LunaticBaseProps['executeExpression'];
11
+ iteration?: number;
12
+ valueMap: Record<string, unknown>;
13
+ rowIndex?: string | number;
14
+ handleChange: LunaticBaseProps['handleChange'];
15
+ errors?: LunaticBaseProps['errors'];
16
+ };
17
+ declare function Row({ id, components, executeExpression, valueMap, rowIndex, iteration, handleChange, errors, }: Props): import("react/jsx-runtime").JSX.Element;
18
+ export default Row;
@@ -0,0 +1,4 @@
1
+ import type { LunaticComponentProps } from '../type';
2
+ type Props = Pick<LunaticComponentProps<'Table'>, 'body' | 'id' | 'executeExpression' | 'value' | 'handleChange' | 'iteration'>;
3
+ declare function TableOrchestrator({ body, id, executeExpression, value: valueMap, handleChange, iteration, }: Props): import("react/jsx-runtime").JSX.Element | null;
4
+ export default TableOrchestrator;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import './textarea.scss';
3
- import type { LunaticBaseProps } from '../../type';
3
+ import { type LunaticError } from '../../../use-lunatic/type';
4
4
  type Props = {
5
5
  id?: string;
6
6
  rows?: number;
@@ -11,8 +11,9 @@ type Props = {
11
11
  label?: ReactNode;
12
12
  value?: string | number | null;
13
13
  description?: string;
14
- errors?: LunaticBaseProps['errors'];
14
+ errors?: LunaticError[];
15
15
  readOnly?: boolean;
16
+ required?: boolean;
16
17
  };
17
18
  declare const _default: import("react").ComponentType<Props>;
18
19
  export default _default;
@@ -1,8 +1,8 @@
1
- import type { LunaticComponentDefinition, LunaticError, LunaticState } from '../use-lunatic/type';
2
1
  import type { CSSProperties, FunctionComponent, ReactNode } from 'react';
3
- import { SuggesterStatus } from '../use-lunatic/use-suggesters';
4
2
  import useLunatic from '../use-lunatic';
5
3
  import type { FilledLunaticComponentProps } from '../use-lunatic/commons/fill-components/fill-components';
4
+ import type { LunaticComponentDefinition, LunaticError, LunaticExpression, LunaticState } from '../use-lunatic/type';
5
+ import { SuggesterStatus } from '../use-lunatic/use-suggesters';
6
6
  type Formats = 'PTnHnM' | 'PnYnM';
7
7
  export type VtlExpression = {
8
8
  value: string;
@@ -60,7 +60,7 @@ export type SuggesterOption = {
60
60
  };
61
61
  type ComponentPropsByType = {
62
62
  InputNumber: LunaticBaseProps<number | null> & {
63
- min: number;
63
+ min?: number;
64
64
  max: number;
65
65
  decimals: number;
66
66
  unit?: string;
@@ -94,7 +94,7 @@ type ComponentPropsByType = {
94
94
  min: number;
95
95
  max: number;
96
96
  };
97
- iterations: number;
97
+ iterations?: number;
98
98
  getComponents: (n: number) => FilledLunaticComponentProps[];
99
99
  executeExpression: LunaticState['executeExpression'];
100
100
  value: Record<string, unknown[]>;
@@ -108,7 +108,7 @@ type ComponentPropsByType = {
108
108
  min: number;
109
109
  max: number;
110
110
  };
111
- iterations: number;
111
+ iterations?: number;
112
112
  getComponents: (n: number) => FilledLunaticComponentProps[];
113
113
  executeExpression: LunaticState['executeExpression'];
114
114
  value: Record<string, unknown[]>;
@@ -124,7 +124,9 @@ type ComponentPropsByType = {
124
124
  rowspan?: number;
125
125
  colspan?: number;
126
126
  }>;
127
- body: FilledLunaticComponentProps[][];
127
+ body: Array<Array<{
128
+ label: LunaticExpression;
129
+ }>>;
128
130
  executeExpression: LunaticState['executeExpression'];
129
131
  iteration: LunaticState['pager']['iteration'];
130
132
  };
@@ -232,10 +234,10 @@ type ComponentPropsByType = {
232
234
  yAxisIterations: number;
233
235
  symLinks: Record<string, Record<string, string>>;
234
236
  value: Record<string, unknown[]>;
235
- getComponents: (x: number, y: number) => FilledLunaticComponentProps[];
236
237
  };
237
238
  Suggester: LunaticBaseProps<string | null> & {
238
239
  storeName: string;
240
+ workersBasePath?: string;
239
241
  getSuggesterStatus: (name: string) => {
240
242
  status: SuggesterStatus;
241
243
  timestamp: number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Focus the first focusable element in the wrapper when the "key" changes and is defined
3
+ */
4
+ export declare function useAutoFocus(wrapperRef: {
5
+ current: HTMLDivElement | null;
6
+ }, key?: string): void;
@@ -13,9 +13,23 @@ export declare enum ActionKind {
13
13
  export type ActionHandleChange = {
14
14
  type: ActionKind.HANDLE_CHANGE;
15
15
  payload: {
16
- name: string;
16
+ response: {
17
+ name: string;
18
+ };
17
19
  value: unknown;
18
- iteration?: number[];
20
+ args?: {
21
+ loop?: boolean;
22
+ length?: number;
23
+ index?: number;
24
+ linksIterations?: number[];
25
+ symLinks?: {
26
+ [variableName: string]: Record<string, string>;
27
+ };
28
+ paginatedLoop?: unknown;
29
+ shallowIteration?: unknown;
30
+ lengths?: number[];
31
+ onChange?: LunaticState['handleChange'];
32
+ };
19
33
  };
20
34
  };
21
35
  export type ActionGoToPage = {
@@ -40,6 +54,7 @@ export type ActionInit = {
40
54
  goNextPage: () => void;
41
55
  goPreviousPage: () => void;
42
56
  withOverview: boolean;
57
+ workersBasePath?: string;
43
58
  };
44
59
  };
45
60
  export type ActionOnSetWaiting = {
@@ -100,10 +115,11 @@ export declare const onInit: (payload: {
100
115
  goNextPage: () => void;
101
116
  goPreviousPage: () => void;
102
117
  withOverview: boolean;
118
+ workersBasePath?: string | undefined;
103
119
  }) => ActionInit & {
104
120
  type: ActionKind.ON_INIT;
105
121
  };
106
- export declare const handleChange: (name: ActionHandleChange['payload']['name'], value: ActionHandleChange['payload']['value'], iteration: ActionHandleChange['payload']['iteration']) => Action;
122
+ export declare const handleChange: (response: ActionHandleChange['payload']['response'], value: ActionHandleChange['payload']['value'], args: ActionHandleChange['payload']['args']) => Action;
107
123
  export declare const onSetWaiting: (status: boolean) => Action;
108
124
  export declare const updateState: (payload: {
109
125
  getSuggesterStatus: (name: string) => {
@@ -0,0 +1,8 @@
1
+ import type { LunaticState, LunaticValues } from '../type';
2
+ export declare const interpretAllCalculatedVariables: ({ variables, partialVariables, builtVariables, }: {
3
+ variables: LunaticState['variables'];
4
+ builtVariables: LunaticValues;
5
+ partialVariables?: {
6
+ [variableName: string]: import("../type").LunaticStateVariable;
7
+ } | undefined;
8
+ }) => LunaticValues;
@@ -1,8 +1,7 @@
1
1
  import type { LunaticError, LunaticState } from '../type';
2
2
  export type StateForControls = Pick<LunaticState, 'pager' | 'pages' | 'isInLoop' | 'executeExpression'>;
3
- type ControlsResult = {
3
+ declare function computeErrors(state: StateForControls): {
4
4
  currentErrors: Record<string, LunaticError[]> | undefined;
5
5
  isCritical: boolean;
6
6
  };
7
- export declare function compileControls(state: StateForControls): ControlsResult;
8
- export {};
7
+ export default computeErrors;