@inseefr/lunatic 3.0.0-rc.6 → 3.0.0-rc.9

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 (125) hide show
  1. package/lib/components/CheckboxGroup/CheckboxGroup.js +3 -2
  2. package/lib/components/CheckboxGroup/CustomCheckboxGroup.js +2 -3
  3. package/lib/components/CheckboxGroup/CustomCheckboxGroup.spec.js +3 -0
  4. package/lib/components/CheckboxOne/CheckboxOne.js +0 -1
  5. package/lib/components/Datepicker/Datepicker.js +0 -1
  6. package/lib/components/Dropdown/Dropdown.js +0 -17
  7. package/lib/components/Duration/Duration.js +0 -1
  8. package/lib/components/Input/Input.js +0 -1
  9. package/lib/components/InputNumber/InputNumber.js +0 -1
  10. package/lib/components/LunaticComponents.js +19 -15
  11. package/lib/components/RosterForLoop/RosterForLoop.js +0 -1
  12. package/lib/components/Roundabout/Roundabout.js +0 -1
  13. package/lib/components/Sequence/Sequence.js +0 -1
  14. package/lib/components/Subsequence/Subsequence.spec.js +1 -1
  15. package/lib/components/Suggester/CustomSuggester.js +7 -4
  16. package/lib/components/Suggester/Suggester.js +67 -4
  17. package/lib/components/Suggester/SuggesterType.js +5 -0
  18. package/lib/components/Textarea/Textarea.js +1 -2
  19. package/lib/components/shared/Button/Button.js +0 -1
  20. package/lib/components/shared/Button/IconButton.js +0 -1
  21. package/lib/components/shared/Checkbox/CheckboxOption.js +0 -1
  22. package/lib/components/shared/Combobox/Combobox.js +3 -2
  23. package/lib/components/shared/ComponentErrors/ComponentErrors.js +0 -1
  24. package/lib/components/shared/Declarations/Declarations.js +3 -4
  25. package/lib/components/shared/Declarations/Declarations.spec.js +5 -5
  26. package/lib/components/shared/Fieldset/Fieldset.js +0 -1
  27. package/lib/components/shared/Icons/lunatic-icon.js +0 -1
  28. package/lib/components/shared/Label/Label.js +0 -1
  29. package/lib/components/shared/Missing/Missing.js +0 -1
  30. package/lib/components/shared/ModalControls/ModalControls.js +0 -1
  31. package/lib/components/shared/Radio/RadioGroup.js +0 -1
  32. package/lib/components/shared/Table/Table.js +0 -1
  33. package/lib/components/shared/VariableStatus/VariableStatus.js +0 -1
  34. package/lib/components/shared/suggester-loader-widget/dragger/dragger.js +0 -1
  35. package/lib/components/shared/suggester-loader-widget/widget.js +0 -1
  36. package/lib/css/components/Button.scss +24 -0
  37. package/lib/css/components/CheckboxGroup.scss +13 -0
  38. package/lib/css/components/CheckboxOne.scss +19 -0
  39. package/lib/css/components/CheckboxOption.scss +19 -0
  40. package/lib/css/components/Combobox.scss +206 -0
  41. package/lib/css/components/ComponentErrors.scss +5 -0
  42. package/lib/css/components/Datepicker.scss +19 -0
  43. package/lib/css/components/Declarations.scss +42 -0
  44. package/lib/css/components/Dragger.scss +8 -0
  45. package/lib/css/components/Dropdown.scss +38 -0
  46. package/lib/css/components/Duration.scss +9 -0
  47. package/lib/css/components/Fieldset.scss +5 -0
  48. package/lib/css/components/IconButton.scss +38 -0
  49. package/lib/css/components/Input.scss +42 -0
  50. package/lib/css/components/InputNumber.scss +11 -0
  51. package/lib/css/components/Label.scss +6 -0
  52. package/lib/css/components/Missing.scss +27 -0
  53. package/lib/css/components/ModalControls.scss +48 -0
  54. package/lib/css/components/RadioGroup.scss +21 -0
  55. package/lib/css/components/RosterForLoop.scss +39 -0
  56. package/lib/css/components/Roundabout.scss +13 -0
  57. package/lib/css/components/Sequence.scss +10 -0
  58. package/lib/css/components/Suggester.scss +170 -0
  59. package/lib/css/components/SuggesterWidget.scss +176 -0
  60. package/lib/css/components/Table.scss +27 -0
  61. package/lib/css/components/Textarea.scss +8 -0
  62. package/lib/css/components/VariableStatus.scss +36 -0
  63. package/lib/css/main.scss +181 -0
  64. package/lib/hooks/useSuggesterInfo.js +14 -12
  65. package/lib/main.css +1063 -0
  66. package/lib/main.css.map +1 -0
  67. package/lib/src/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  68. package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +0 -1
  69. package/lib/src/components/Datepicker/Datepicker.d.ts +0 -1
  70. package/lib/src/components/Dropdown/Dropdown.d.ts +0 -1
  71. package/lib/src/components/Duration/Duration.d.ts +0 -1
  72. package/lib/src/components/Input/Input.d.ts +0 -1
  73. package/lib/src/components/InputNumber/InputNumber.d.ts +0 -1
  74. package/lib/src/components/RosterForLoop/RosterForLoop.d.ts +0 -1
  75. package/lib/src/components/Roundabout/Roundabout.d.ts +0 -1
  76. package/lib/src/components/Sequence/Sequence.d.ts +1 -2
  77. package/lib/src/components/Subsequence/Subsequence.d.ts +1 -1
  78. package/lib/src/components/Suggester/CustomSuggester.d.ts +7 -3
  79. package/lib/src/components/Suggester/Suggester.d.ts +1 -2
  80. package/lib/src/components/Suggester/SuggesterType.d.ts +6 -0
  81. package/lib/src/components/Suggester/helpers.d.ts +2 -2
  82. package/lib/src/components/Textarea/Textarea.d.ts +0 -1
  83. package/lib/src/components/library.d.ts +3 -3
  84. package/lib/src/components/shared/Button/Button.d.ts +0 -1
  85. package/lib/src/components/shared/Button/IconButton.d.ts +0 -1
  86. package/lib/src/components/shared/Checkbox/CheckboxOption.d.ts +0 -1
  87. package/lib/src/components/shared/Combobox/Combobox.d.ts +1 -1
  88. package/lib/src/components/shared/ComponentErrors/ComponentErrors.d.ts +0 -1
  89. package/lib/src/components/shared/Declarations/Declarations.d.ts +2 -3
  90. package/lib/src/components/shared/Fieldset/Fieldset.d.ts +0 -1
  91. package/lib/src/components/shared/HOC/slottableComponent.d.ts +4 -0
  92. package/lib/src/components/shared/Icons/lunatic-icon.d.ts +0 -1
  93. package/lib/src/components/shared/Label/Label.d.ts +0 -1
  94. package/lib/src/components/shared/Missing/Missing.d.ts +0 -1
  95. package/lib/src/components/shared/ModalControls/ModalControls.d.ts +0 -1
  96. package/lib/src/components/shared/Radio/RadioGroup.d.ts +0 -1
  97. package/lib/src/components/shared/Table/Table.d.ts +0 -1
  98. package/lib/src/components/shared/VariableStatus/VariableStatus.d.ts +0 -1
  99. package/lib/src/components/shared/suggester-loader-widget/dragger/dragger.d.ts +0 -1
  100. package/lib/src/components/shared/suggester-loader-widget/widget.d.ts +0 -1
  101. package/lib/src/components/type.d.ts +7 -2
  102. package/lib/src/hooks/use-track-changes.d.ts +9 -1
  103. package/lib/src/hooks/useSuggesterInfo.d.ts +1 -1
  104. package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +106 -44
  105. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +87 -21
  106. package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +47 -36
  107. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +166 -46
  108. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
  109. package/lib/src/use-lunatic/replace-component-sequence.d.ts +21 -3
  110. package/lib/src/use-lunatic/type-source.d.ts +55 -42
  111. package/lib/src/use-lunatic/type.d.ts +4 -4
  112. package/lib/src/use-lunatic/use-lunatic.d.ts +57 -15
  113. package/lib/src/utils/variables.d.ts +10 -2
  114. package/lib/stories/loop/source-roster.json +2 -2
  115. package/lib/stories/suggester/fakeReferentiel.json +12 -0
  116. package/lib/stories/suggester/source-option-responses.json +145 -0
  117. package/lib/stories/suggester/suggester.stories.js +46 -1
  118. package/lib/use-lunatic/use-lunatic.test.js +8 -7
  119. package/package.json +2 -2
  120. package/lib/components/Dropdown/DropdownWritable.js +0 -58
  121. package/lib/components/Dropdown/renderer/WritableLabelRenderer.js +0 -38
  122. package/lib/components/Dropdown/renderer/WritableOptionRenderer.js +0 -140
  123. package/lib/src/components/Dropdown/DropdownWritable.d.ts +0 -17
  124. package/lib/src/components/Dropdown/renderer/WritableLabelRenderer.d.ts +0 -8
  125. package/lib/src/components/Dropdown/renderer/WritableOptionRenderer.d.ts +0 -8
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../src/css/main.scss","../src/css/components/Button.scss","../src/css/components/CheckboxGroup.scss","../src/css/components/CheckboxOne.scss","../src/css/components/CheckboxOption.scss","../src/css/components/Combobox.scss","../src/css/components/ComponentErrors.scss","../src/css/components/Datepicker.scss","../src/css/components/Declarations.scss","../src/css/components/Dropdown.scss","../src/css/components/Duration.scss","../src/css/components/Fieldset.scss","../src/css/components/IconButton.scss","../src/css/components/Input.scss","../src/css/components/InputNumber.scss","../src/css/components/Label.scss","../src/css/components/Missing.scss","../src/css/components/ModalControls.scss","../src/css/components/RadioGroup.scss","../src/css/components/RosterForLoop.scss","../src/css/components/Roundabout.scss","../src/css/components/Sequence.scss","../src/css/components/Suggester.scss","../src/css/components/Table.scss","../src/css/components/Textarea.scss","../src/css/components/VariableStatus.scss","../src/css/components/Dragger.scss","../src/css/components/SuggesterWidget.scss"],"names":[],"mappings":";AAAA;EACE;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;;;AAkBF;AA0BE;AA+BA;;AAxDA;EACE;EACA;;AAEF;EACE;EACA;;AAIF;AAAA;AAAA;AAAA;AAAA;EAKE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AASF;EACE;;AAEA;EACE;EACA;;AACA;EACE;;AAGJ;EACE;EACA;;AACA;EACE;;AAGJ;EACE;;AAEF;EACE;;AAMJ;EAzEA;EACA;;AA2EA;EA5EA;EACA;;AA8EA;EACE;EA3EF;EACA;EACA;;AAEA;EACE;;AAyEF;EA9EA;EACA;EACA;;AAEA;EACE;;AA6EF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;;AACA;EACE;EACA;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEE;EACE;;AAEF;EACE;;;ACpJR;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEC;EACA;EACA;;AAED;EACC;EACA;EACA;;AAED;EACC;EACA;;;AClBE;EACE;EACA;;AAGJ;EACE;EACA;;;ACRF;EACC;;AAGF;EACC;;AAEA;EACC;EACA;EACA;;AACA;EACC;;;ACbH;EACC;;AACA;EACC;;AAGD;EACC;EACA;EACA;EACA;;;AAIH;EACC;EACA;;;ACMD;EACC;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;;AACA;EACC;EACA;EACA;;AAEC;EACC;EACA;EACA;;AACA;EACC;;AAED;EACC;EACA;EACA;EACA;EApCL;;AAuCK;EAhDL;EASA;EAPA;EACA;EACA;EACA;;AAgDI;EACC;EACA;EACA;EACA;EACA;EAjDL;EAmDK;EACA;EACA;EA9DL;EASA;EAPA;EACA;EACA;EACA;;AA4DK;EACC;EACA;EACA;;AAGD;EACC;;AAKH;EApEH;EAsEI;EACA;EACA;EACA;;AAGA;EACC;EACA;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;;AAED;EACC;EACA;;AAQN;EACC;EACA;EACA;EACA;;AACA;EACC;;AAIA;EACC;EACA;EACA;EACA;;AAKH;EACC;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;EACA;;AAEA;EACC;;AACA;EACC;EACA;EACA;EACA;EAKA;;AAJA;EACC;;AAMF;EAEC;EACA;EACA;EACA;EACA;;AACA;EACC;;AAKH;AAAA;AAAA;AAAA;EAIC;EACA;EACA;EACA;;AAIA;EACC;;AAED;EACC;EAtMJ;EACA;EACA;;;ACFA;EACC;;;ACFF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AChBD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;;AAIF;EACC;EACA;;AACA;EACC;;;ACxBD;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;;ACjCJ;AAAA;EAEE;EACA;EACA;;;AAEF;EACE;;;ACPF;EACC;EACA;EACA;;;ACHD;EACC;EACA;;;AAID;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACC;EACA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;;AC9BA;AAAA;AAAA;AAAA;EACC;;AACA;AAAA;AAAA;AAAA;EACC;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;AAAA;AAAA;AAAA;EACC;EACA;;AAED;AAAA;AAAA;AAAA;EACC;;AAED;AAAA;AAAA;AAAA;EACC;;AAIF;AAAA;AAAA;AAAA;EACC;EACA;EACA;;;ACnCF;EACC;;AAEA;EACC;;;ACNF;EACC;EACA;;;ACHF;EACC;;;AAED;EACC;EACA;EACA;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;AAED;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;ACzBD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AAGD;EACC;EACA;;AACA;EACC;;AAMF;AAAA;AAAA;AAAA;EAIC;EACA;;AAGF;EACC;EACA;;;AC3CA;EACC;;AAGF;EACC;;AAEA;EACC;;AAGD;EACC;EACA;EACA;EACA;;;ACUH;EACC;EACA;EACA;EACA;;AAEC;EACC;EACA;;;ACnCH;EACC;;AAGC;EACC;;AAGD;EACC;;;ACRF;EACC;EACA;EACA;EACA;EACA;EACA;;;AC8BD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;EACC;;AACA;EACC;EACA;EACA;;AAQC;EACC;EACA;EACA;;AACA;EACC;;AAED;EACC;EACA;EACA;EACA;EAvEN;;AA0EM;EAlEN;EARA;EAUA;EACA;EACA;EACA;;AAkEK;EACC;EACA;EACA;EACA;EACA;EApFN;;AAuFM;EACC;EAhFP;EARA;EAUA;EACA;EACA;EACA;;AA8EM;EACC;EACA;EACA;;AAGD;EACC;;AAKH;EAvGJ;EAyGK;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AAED;EACC;EACA;;AASP;EACC;EACA;EACA;;AAEA;EACC;;AAjIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAsHA;EACC;;AArIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA0HA;EACC;;AAzIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA+HA;EACC;EACA;;AACA;EACC;EACA;EACA;;;ACpKH;EACC;EACA;EACA;EACA;;AACA;AAAA;EAEC;EACA;EACA;;AAGA;AAAA;EAEC;EACA;EACA;;AAKH;EACC;EACA;;;ACrBD;EACC;EACA;;;ACLF;EACC;AAMA;AAUA;;AAdA;EACC;;AAID;EACC;EACA;EACA;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEC;EACC;;AAED;EACC;;;AC/BJ;EACE;EACA;EACA;EACA;EACA;EACA;;;ACaD;EACC;EACA;;AAED;EACC;EACA;EACA,kBA1BO;EA2BP;EACA;EACA;EACA;;AAlBD;EACC;EACA;;AAoBA;EACC;EACA;EACA;EACA;;AACA;EACC;EACA,OAxCK;EAyCL;EACA;EACA;;AAED;EACC,OA9CK;EA+CL;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA,kBA1DK;;AA4DL;EACC;EACA;;AAGD;EACC,kBAjEI;EAkEJ;EACA;;AAIA;EACC;EACA;EACA,MA5EG;;AAiFN;EACC;EACA;EACA;EACA;;AAGC;EACC,cAvFG;EAwFH;EAMA;;AALA;EACC,kBA1FE;EA2FF;;AAOH;EACC;EACA;EACA;;AACA;EACC,kBAxGG;EAyGH;;AAMJ;EACC;EACA;EACA;EACA,kBApHM;EAqHN;EACA;EACA;EACA;EACA;;AAGC;EACC;;AAIF;EACC;EACA;EACA,MAnIK;;AAWR;EACC;EACA;;AA4HA;EACC;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA,kBAnJK;EAoJL;EACA;;AAEA;EACC;;AAGD;EACC,kBA1JI;EA2JJ;;AAGD;EACC;;AACA;EACC;;AAED;EACC;EACA;EACA,MAzKG","file":"main.css"}
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { LunaticComponentProps } from '../type';
3
- import './CheckboxGroup.scss';
4
3
  export type CheckboxGroupOption = {
4
+ id: string;
5
5
  label: ReactNode;
6
6
  name: string;
7
7
  checked: boolean;
@@ -1,4 +1,3 @@
1
- import './CheckboxOne.scss';
2
1
  import type { LunaticComponentProps } from '../type';
3
2
  /**
4
3
  * Checkbox acting as a radio (only one option can be checked at a time)
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './Datepicker.scss';
3
2
  import type { LunaticComponentProps } from '../type';
4
3
  import type { LunaticError } from '../../use-lunatic/type';
5
4
  export declare function Datepicker({ dateFormat, response, handleChange, errors, ...props }: LunaticComponentProps<'Datepicker'>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './Dropdown.scss';
3
2
  import type { LunaticComponentProps } from '../type';
4
3
  import type { LunaticError } from '../../use-lunatic/type';
5
4
  export declare function Dropdown({ handleChange, response, errors, ...props }: LunaticComponentProps<'Dropdown'>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './Duration.scss';
3
2
  import type { LunaticComponentProps } from '../type';
4
3
  import type { LunaticError } from '../../use-lunatic/type';
5
4
  export declare function Duration({ handleChange, response, errors, ...props }: LunaticComponentProps<'Duration'>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './Input.scss';
3
2
  import type { LunaticComponentProps } from '../type';
4
3
  import type { LunaticError } from '../../use-lunatic/type';
5
4
  export declare function Input({ handleChange, response, errors, ...props }: LunaticComponentProps<'Input'>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './InputNumber.scss';
3
2
  import type { LunaticComponentProps } from '../type';
4
3
  import type { LunaticError } from '../../use-lunatic/type';
5
4
  export declare function InputNumber({ handleChange, response, errors, decimals, ...props }: LunaticComponentProps<'InputNumber'>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import './RosterForLoop.scss';
2
1
  import type { LunaticComponentProps } from '../type';
3
2
  /**
4
3
  * Loop displayed as a table
@@ -1,4 +1,3 @@
1
- import './Roundabout.scss';
2
1
  import type { LunaticComponentProps } from '../type';
3
2
  /**
4
3
  * Roundabout is a special loop component where the user can select the iteration to go to
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
- import './Sequence.scss';
3
- export declare const Sequence: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<string>, "id" | "label" | "style" | "description" | "declarations">>;
2
+ export declare const Sequence: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<string>, "label" | "description" | "declarations" | "id" | "style">>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const Subsequence: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<string>, "id" | "label" | "declarations">>;
2
+ export declare const Subsequence: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<string>, "label" | "declarations" | "id">>;
@@ -1,12 +1,15 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { LunaticError } from '../../use-lunatic/type';
3
3
  import type { LunaticComponentProps } from '../type';
4
- import type { ComboboxOptionType } from '../shared/Combobox/ComboboxType';
4
+ import type { SuggesterOptionType } from './SuggesterType';
5
5
  type Props = {
6
6
  className?: string;
7
7
  classNamePrefix?: string;
8
8
  placeholder?: string;
9
- onSelect?: (s: string | null) => void;
9
+ onSelect: (option: string | null | {
10
+ id?: string;
11
+ [key: string]: ReactNode;
12
+ }) => void;
10
13
  value: string | null;
11
14
  labelRenderer: LunaticComponentProps<'Suggester'>['labelRenderer'];
12
15
  optionRenderer: LunaticComponentProps<'Suggester'>['optionRenderer'];
@@ -14,12 +17,13 @@ type Props = {
14
17
  readOnly?: boolean;
15
18
  id?: string;
16
19
  searching?: (s: string | null) => Promise<{
17
- results: ComboboxOptionType[];
20
+ results: SuggesterOptionType[];
18
21
  search: string;
19
22
  }>;
20
23
  label?: ReactNode;
21
24
  description?: ReactNode;
22
25
  errors?: LunaticError[];
26
+ defaultOptions?: SuggesterOptionType[];
23
27
  };
24
28
  export declare const CustomSuggester: import("react").ComponentType<Props>;
25
29
  export {};
@@ -1,3 +1,2 @@
1
1
  import type { LunaticComponentProps } from '../type';
2
- import './Suggester.scss';
3
- export declare function Suggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, handleChange, disabled, value, label, description, getSuggesterStatus, errors, readOnly, workersBasePath, response, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Suggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, handleChange, disabled, value, label, description, getSuggesterStatus, errors, readOnly, workersBasePath, response, optionResponses, executeExpression, iteration, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export type SuggesterOptionType = {
2
+ id: string;
3
+ label: string;
4
+ value: string;
5
+ [k: string]: string;
6
+ };
@@ -1,6 +1,6 @@
1
- import type { ComboboxOptionType } from '../shared/Combobox/ComboboxType';
1
+ import type { SuggesterOptionType } from './SuggesterType';
2
2
  export declare function isWorkerCompatible(): boolean;
3
3
  export declare function createSearching(name: string, version: string, workersBasePath?: string): (search: string | null) => Promise<{
4
- results: ComboboxOptionType[];
4
+ results: SuggesterOptionType[];
5
5
  search: string;
6
6
  }>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './Textarea.scss';
3
2
  import type { LunaticComponentProps } from '../type';
4
3
  import type { LunaticError } from '../../use-lunatic/type';
5
4
  export declare function Textarea({ handleChange, response, errors, ...props }: LunaticComponentProps<'Textarea'>): import("react/jsx-runtime").JSX.Element;
@@ -14,8 +14,8 @@ import { CheckboxOne } from './CheckboxOne/CheckboxOne';
14
14
  import { Suggester } from './Suggester/Suggester';
15
15
  import { Summary } from './Summary/Summary';
16
16
  export declare const library: {
17
- Sequence: ComponentType<Pick<import("./type").LunaticBaseProps<string>, "id" | "label" | "style" | "description" | "declarations">>;
18
- Subsequence: ComponentType<Pick<import("./type").LunaticBaseProps<string>, "id" | "label" | "declarations">>;
17
+ Sequence: ComponentType<Pick<import("./type").LunaticBaseProps<string>, "label" | "description" | "declarations" | "id" | "style">>;
18
+ Subsequence: ComponentType<Pick<import("./type").LunaticBaseProps<string>, "label" | "declarations" | "id">>;
19
19
  RosterForLoop: (props: import("./type").LunaticBaseProps<unknown> & {
20
20
  lines: {
21
21
  min: number;
@@ -66,7 +66,7 @@ export declare const library: {
66
66
  false: string;
67
67
  } | undefined;
68
68
  }>;
69
- Question: ({ components, ...props }: Pick<import("./type").LunaticBaseProps<unknown>, "id" | "label" | "description" | "declarations"> & {
69
+ Question: ({ components, ...props }: Pick<import("./type").LunaticBaseProps<unknown>, "label" | "description" | "declarations" | "id"> & {
70
70
  components: import("../use-lunatic/commons/fill-components/fill-components").FilledLunaticComponentProps[];
71
71
  }) => import("react/jsx-runtime").JSX.Element;
72
72
  FilterDescription: ({ id, label }: {
@@ -1,5 +1,4 @@
1
1
  import { type MouseEventHandler, type PropsWithChildren } from 'react';
2
- import './Button.scss';
3
2
  type Props = PropsWithChildren<{
4
3
  onClick?: MouseEventHandler<HTMLButtonElement | HTMLInputElement>;
5
4
  className?: string;
@@ -1,5 +1,4 @@
1
1
  import type { HTMLAttributes, PropsWithChildren } from 'react';
2
- import './IconButton.scss';
3
2
  type Props = PropsWithChildren<{
4
3
  disabled?: boolean;
5
4
  }> & HTMLAttributes<HTMLButtonElement>;
@@ -1,5 +1,4 @@
1
1
  import { type ReactNode } from 'react';
2
- import './CheckboxOption.scss';
3
2
  import type { LunaticBaseProps } from '../../type';
4
3
  export type CheckboxOptionProps = {
5
4
  disabled?: boolean;
@@ -1,5 +1,4 @@
1
1
  import { type ReactNode } from 'react';
2
- import './Combobox.scss';
3
2
  import type { ComboboxOptionType, ComboboxPanelProps, ComboboxSelectionProps } from './ComboboxType';
4
3
  import type { LunaticError } from '../../../use-lunatic/type';
5
4
  type Props = ComboboxSelectionProps & ComboboxPanelProps & {
@@ -14,6 +13,7 @@ type Props = ComboboxSelectionProps & ComboboxPanelProps & {
14
13
  errors?: LunaticError[];
15
14
  onChange?: (s: string | null) => void;
16
15
  onSelect: (s: string | null) => void;
16
+ onBlur?: () => void;
17
17
  options: ComboboxOptionType[];
18
18
  readOnly?: boolean;
19
19
  };
@@ -1,4 +1,3 @@
1
- import './ComponentErrors.scss';
2
1
  import type { LunaticError } from '../../../use-lunatic/type';
3
2
  type Props = {
4
3
  errors?: Record<string, LunaticError[]>;
@@ -1,14 +1,13 @@
1
- import './Declarations.scss';
2
1
  import { type PropsWithChildren, type ReactNode } from 'react';
3
2
  export declare const Declaration: import("react").ComponentType<PropsWithChildren<{
4
- type: string;
3
+ declarationType: 'INSTRUCTION' | 'COMMENT' | 'HELP' | 'CODECARD' | 'WARNING' | 'STATEMENT';
5
4
  }>>;
6
5
  type Props = {
7
6
  id?: string;
8
7
  type?: 'AFTER_QUESTION_TEXT' | 'BEFORE_QUESTION_TEXT' | 'DETACHABLE';
9
8
  declarations?: {
10
9
  id: string;
11
- declarationType: string;
10
+ declarationType: 'INSTRUCTION' | 'COMMENT' | 'HELP' | 'CODECARD' | 'WARNING' | 'STATEMENT';
12
11
  position: string;
13
12
  label: ReactNode;
14
13
  }[];
@@ -1,5 +1,4 @@
1
1
  import { type PropsWithChildren, type ReactNode } from 'react';
2
- import './Fieldset.scss';
3
2
  import type { LunaticBaseProps } from '../../type';
4
3
  type Props = PropsWithChildren<{
5
4
  legend?: ReactNode;
@@ -36,6 +36,7 @@ import type { CustomSuggester } from '../../Suggester/CustomSuggester';
36
36
  import type { CustomCheckboxGroup } from '../../CheckboxGroup/CustomCheckboxGroup';
37
37
  import type { RouterLink } from '../MDLabel/RouterLink';
38
38
  import type { SummaryResponses, SummaryTitle } from '../../Summary/Summary';
39
+ import type { FilledLunaticComponentProps } from '../../../use-lunatic/commons/fill-components/fill-components';
39
40
  /**
40
41
  * Contains the type of every customizable component
41
42
  */
@@ -89,6 +90,9 @@ export type LunaticSlotComponents = {
89
90
  Fieldset: typeof Fieldset;
90
91
  Notification: typeof Notification;
91
92
  RouterLink: typeof RouterLink;
93
+ ComponentWrapper: ComponentType<PropsWithChildren<FilledLunaticComponentProps & {
94
+ index: number;
95
+ }>>;
92
96
  };
93
97
  export declare const SlotsProvider: ({ slots, children, }: PropsWithChildren<{
94
98
  slots?: Partial<LunaticSlotComponents> | undefined;
@@ -1,4 +1,3 @@
1
- import './lunatic-icon.scss';
2
1
  import { type PropsWithChildren } from 'react';
3
2
  export declare function LunaticIcon({ className, children, }: PropsWithChildren<{
4
3
  className?: string;
@@ -1,5 +1,4 @@
1
1
  import { type CSSProperties, type PropsWithChildren, type ReactNode } from 'react';
2
- import './Label.scss';
3
2
  type Props = PropsWithChildren<{
4
3
  id?: string;
5
4
  htmlFor?: string;
@@ -1,4 +1,3 @@
1
- import './Missing.scss';
2
1
  import { useLunaticMissing } from '../../../use-lunatic/lunatic-context';
3
2
  import type { LunaticBaseProps } from '../../type';
4
3
  type Props = {
@@ -1,6 +1,5 @@
1
1
  import { type MouseEventHandler } from 'react';
2
2
  import type { LunaticError } from '../../../use-lunatic/type';
3
- import './ModalControls.scss';
4
3
  type Props = {
5
4
  goNext: MouseEventHandler;
6
5
  onClose: MouseEventHandler;
@@ -1,4 +1,3 @@
1
- import './RadioGroup.scss';
2
1
  import type { ReactNode } from 'react';
3
2
  import type { LunaticError } from '../../../use-lunatic/type';
4
3
  export type RadioGroupProps = {
@@ -1,5 +1,4 @@
1
1
  import React, { type PropsWithChildren } from 'react';
2
- import './Table.scss';
3
2
  type Props = PropsWithChildren<{
4
3
  className?: string;
5
4
  id?: string;
@@ -1,5 +1,4 @@
1
1
  import { type PropsWithChildren } from 'react';
2
- import './VariableStatus.scss';
3
2
  type Props = PropsWithChildren<{
4
3
  id?: string;
5
4
  }>;
@@ -1,5 +1,4 @@
1
1
  import { type PropsWithChildren } from 'react';
2
- import './dragger.scss';
3
2
  type Props = PropsWithChildren<{
4
3
  el?: {
5
4
  style: {
@@ -1,5 +1,4 @@
1
1
  import type { SuggesterType } from '../../../use-lunatic/type-source';
2
- import './widget.scss';
3
2
  type Props = {
4
3
  absolute?: boolean;
5
4
  source: {
@@ -35,7 +35,7 @@ export type LunaticBaseProps<ValueType = unknown> = {
35
35
  iteration?: number;
36
36
  declarations?: {
37
37
  id: string;
38
- declarationType: string;
38
+ declarationType: 'INSTRUCTION' | 'COMMENT' | 'HELP' | 'CODECARD' | 'WARNING' | 'STATEMENT';
39
39
  position: string;
40
40
  label: ReactNode;
41
41
  }[];
@@ -206,7 +206,6 @@ type ComponentPropsByType = {
206
206
  response: {
207
207
  name: string;
208
208
  };
209
- writable?: boolean;
210
209
  };
211
210
  Textarea: LunaticBaseProps<string> & {
212
211
  cols?: number;
@@ -250,6 +249,12 @@ type ComponentPropsByType = {
250
249
  response: {
251
250
  name: string;
252
251
  };
252
+ optionResponses?: {
253
+ name: string;
254
+ attribute: string;
255
+ }[];
256
+ executeExpression: LunaticState['executeExpression'];
257
+ iteration: LunaticState['pager']['iteration'];
253
258
  };
254
259
  Summary: LunaticBaseProps<string | null> & {
255
260
  executeExpression: LunaticState['executeExpression'];
@@ -4,6 +4,14 @@ import type { LunaticData } from '../use-lunatic/type';
4
4
  * Allow tracking changed while interacting with Lunatic forms
5
5
  */
6
6
  export declare function useTrackChanges(enabled: boolean, store: LunaticVariablesStore, getData: (names: string[]) => LunaticData): {
7
- getChangedData: (reset?: boolean) => LunaticData;
7
+ getChangedData: (reset?: boolean) => Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
8
+ COLLECTED: Record<string, Partial<{
9
+ COLLECTED: unknown;
10
+ EDITED: unknown;
11
+ FORCED: unknown;
12
+ INPUTED: unknown;
13
+ PREVIOUS: unknown;
14
+ }>>;
15
+ }>;
8
16
  resetChangedData: () => void;
9
17
  };
@@ -3,7 +3,7 @@ import type { SuggesterType } from '../use-lunatic/type-source';
3
3
  * Retrieves suggester info from indexedDB
4
4
  */
5
5
  export declare function useSuggesterInfo(storeName: string, version: string): {
6
- infos: SuggesterType | undefined;
7
6
  state: "Loading" | "Ready" | "Error";
7
+ infos: SuggesterType | undefined;
8
8
  fetchInfos: () => Promise<void>;
9
9
  };