@inseefr/lunatic 3.5.6 → 3.5.8

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 (245) hide show
  1. package/components/CheckboxOne/CheckboxOne.spec.js +3 -2
  2. package/components/CheckboxOne/CheckboxOne.spec.js.map +1 -1
  3. package/components/shared/Combobox/Combobox.stories.d.ts +3 -2
  4. package/components/shared/Combobox/Combobox.stories.js +26 -21
  5. package/components/shared/Combobox/Combobox.stories.js.map +1 -1
  6. package/components/type.d.ts +3 -0
  7. package/esm/components/CheckboxOne/CheckboxOne.spec.js +3 -2
  8. package/esm/components/CheckboxOne/CheckboxOne.spec.js.map +1 -1
  9. package/esm/components/shared/Combobox/Combobox.stories.d.ts +3 -2
  10. package/esm/components/shared/Combobox/Combobox.stories.js +28 -24
  11. package/esm/components/shared/Combobox/Combobox.stories.js.map +1 -1
  12. package/esm/components/type.d.ts +3 -0
  13. package/esm/hooks/useLocalStorage.d.ts +1 -0
  14. package/esm/hooks/useLocalStorage.js +31 -0
  15. package/esm/hooks/useLocalStorage.js.map +1 -0
  16. package/esm/type.source.d.ts +6 -0
  17. package/esm/use-lunatic/commons/compile-controls.js +22 -14
  18. package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
  19. package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js +4 -1
  20. package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
  21. package/esm/use-lunatic/hooks/use-page-has-response.js +1 -1
  22. package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  23. package/esm/use-lunatic/hooks/useOverview.spec.js +2 -2
  24. package/esm/use-lunatic/hooks/useOverview.spec.js.map +1 -1
  25. package/esm/use-lunatic/props/getComponentTypeProps.d.ts +3 -0
  26. package/esm/utils/number.d.ts +4 -0
  27. package/esm/utils/number.js +12 -0
  28. package/esm/utils/number.js.map +1 -1
  29. package/esm/utils/object.d.ts +10 -0
  30. package/esm/utils/object.js +26 -0
  31. package/esm/utils/object.js.map +1 -1
  32. package/hooks/useLocalStorage.d.ts +1 -0
  33. package/hooks/useLocalStorage.js +34 -0
  34. package/hooks/useLocalStorage.js.map +1 -0
  35. package/package.json +76 -137
  36. package/src/components/CheckboxOne/CheckboxOne.spec.tsx +3 -0
  37. package/src/components/shared/Combobox/Combobox.stories.tsx +48 -49
  38. package/src/components/type.ts +1 -0
  39. package/src/hooks/useLocalStorage.ts +37 -0
  40. package/src/json.d.ts +16 -0
  41. package/src/stories/accordion/accordion.stories.tsx +21 -0
  42. package/src/stories/behaviour/cleaning/cleaning.stories.tsx +40 -0
  43. package/src/stories/behaviour/controls/controls.stories.tsx +51 -0
  44. package/src/stories/behaviour/disabled/disabled.stories.tsx +29 -0
  45. package/src/stories/behaviour/filter/filter.stories.tsx +34 -0
  46. package/src/stories/behaviour/missing/missing.stories.tsx +31 -0
  47. package/src/stories/behaviour/overview/overview.stories.tsx +61 -0
  48. package/src/stories/{overview/sourceWithHierarchy.json → behaviour/overview/source.json} +1 -1
  49. package/src/stories/{overview → behaviour/overview}/sourceLoop.json +1 -1
  50. package/src/stories/behaviour/performance/performance.stories.tsx +29 -0
  51. package/src/stories/behaviour/resizing/resizing.stories.tsx +34 -0
  52. package/src/stories/behaviour/slots.stories.tsx +34 -0
  53. package/src/stories/checkbox/checkbox.stories.tsx +75 -0
  54. package/src/stories/{checkbox-group/sourceLoop.json → checkbox/sourceGroupLoop.json} +1 -1
  55. package/src/stories/datepicker/datepicker.stories.tsx +21 -0
  56. package/src/stories/declaration/declaration.stories.tsx +27 -0
  57. package/src/stories/dropdown/dropdown.stories.tsx +27 -0
  58. package/src/stories/duration/duration.stories.tsx +27 -0
  59. package/src/stories/filter-description/filter-description.stories.tsx +28 -0
  60. package/src/stories/input/input.stories.tsx +21 -0
  61. package/src/stories/input-number/input-number.stories.tsx +35 -0
  62. package/src/stories/loop/loop.stories.tsx +35 -0
  63. package/src/stories/loop/roster-for-loop.stories.tsx +59 -0
  64. package/src/stories/pairwise/pairwise.stories.tsx +30 -0
  65. package/src/stories/paste.stories.tsx +85 -0
  66. package/src/stories/question/question.stories.tsx +21 -0
  67. package/src/stories/questionnaires/logement/logement.stories.tsx +26 -0
  68. package/src/stories/questionnaires/recensement/recensement.stories.tsx +28 -0
  69. package/src/stories/questionnaires/rp/rp.stories.tsx +21 -0
  70. package/src/stories/questionnaires/simpsons/simpsons.stories.tsx +31 -0
  71. package/src/stories/radio/radio.stories.tsx +53 -0
  72. package/src/stories/roundabout/roundabout.stories.tsx +37 -0
  73. package/src/stories/roundabout/source.json +1 -0
  74. package/src/stories/sequence/sequence.stories.tsx +28 -0
  75. package/src/stories/suggester/source-option-responses.json +1 -1
  76. package/src/stories/suggester/suggester.stories.tsx +68 -0
  77. package/src/stories/summary/source.json +22 -1
  78. package/src/stories/summary/summary.stories.tsx +31 -0
  79. package/src/stories/table/table.stories.tsx +35 -0
  80. package/src/stories/text/text.stories.tsx +38 -0
  81. package/src/stories/textarea/textarea.stories.tsx +21 -0
  82. package/src/stories/utils/Orchestrator.tsx +310 -0
  83. package/src/stories/utils/OrchestratorData.tsx +176 -0
  84. package/src/stories/utils/OrchestratorOverview.tsx +70 -0
  85. package/src/stories/utils/OrchestratorSidebar.tsx +119 -0
  86. package/src/stories/utils/SchemaValidator.tsx +29 -0
  87. package/src/stories/utils/referentiel.ts +9 -0
  88. package/src/type.source.ts +6 -0
  89. package/src/use-lunatic/commons/compile-controls.ts +36 -18
  90. package/src/use-lunatic/commons/fill-components/fill-component-expressions.ts +4 -1
  91. package/src/use-lunatic/hooks/use-page-has-response.ts +1 -1
  92. package/src/use-lunatic/hooks/useOverview.spec.ts +3 -2
  93. package/src/use-lunatic/use-lunatic.test.ts +53 -40
  94. package/src/utils/number.ts +13 -0
  95. package/src/utils/object.ts +40 -0
  96. package/tsconfig.build.tsbuildinfo +1 -1
  97. package/type.source.d.ts +6 -0
  98. package/use-lunatic/commons/compile-controls.js +21 -13
  99. package/use-lunatic/commons/compile-controls.js.map +1 -1
  100. package/use-lunatic/commons/fill-components/fill-component-expressions.js +5 -2
  101. package/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
  102. package/use-lunatic/hooks/use-page-has-response.js +2 -2
  103. package/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  104. package/use-lunatic/hooks/useOverview.spec.js +8 -8
  105. package/use-lunatic/hooks/useOverview.spec.js.map +1 -1
  106. package/use-lunatic/props/getComponentTypeProps.d.ts +3 -0
  107. package/utils/number.d.ts +4 -0
  108. package/utils/number.js +13 -0
  109. package/utils/number.js.map +1 -1
  110. package/utils/object.d.ts +10 -0
  111. package/utils/object.js +30 -0
  112. package/utils/object.js.map +1 -1
  113. package/esm/stories/overview/sourceWithHierarchy.json +0 -5151
  114. package/esm/tests/utils/lunatic.d.ts +0 -15
  115. package/esm/tests/utils/lunatic.js +0 -27
  116. package/esm/tests/utils/lunatic.js.map +0 -1
  117. package/esm/use-lunatic/replace-component-sequence.d.ts +0 -36
  118. package/esm/use-lunatic/replace-component-sequence.js +0 -19
  119. package/esm/use-lunatic/replace-component-sequence.js.map +0 -1
  120. package/esm/use-lunatic/test.utils.d.ts +0 -2
  121. package/esm/use-lunatic/test.utils.js +0 -13
  122. package/esm/use-lunatic/test.utils.js.map +0 -1
  123. package/esm/utils/is-object.d.ts +0 -4
  124. package/esm/utils/is-object.js +0 -7
  125. package/esm/utils/is-object.js.map +0 -1
  126. package/esm/utils/to-number.d.ts +0 -4
  127. package/esm/utils/to-number.js +0 -13
  128. package/esm/utils/to-number.js.map +0 -1
  129. package/src/stories/accordion/accordion.stories.jsx +0 -17
  130. package/src/stories/behaviour/cleaning/cleaning.stories.jsx +0 -69
  131. package/src/stories/behaviour/controls/controls.stories.jsx +0 -81
  132. package/src/stories/behaviour/filter/dataLoop.json +0 -14
  133. package/src/stories/behaviour/filter/filter.stories.jsx +0 -36
  134. package/src/stories/behaviour/missing/missing.stories.jsx +0 -69
  135. package/src/stories/behaviour/others/V2_DeclarationsSimples.json +0 -908
  136. package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +0 -489
  137. package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +0 -3919
  138. package/src/stories/behaviour/others/V2_TCMRallyeGames.json +0 -2760
  139. package/src/stories/behaviour/others/test-dylan.json +0 -538
  140. package/src/stories/behaviour/others/test.stories.jsx +0 -78
  141. package/src/stories/behaviour/paste/source.json +0 -32
  142. package/src/stories/behaviour/paste/test.stories.jsx +0 -62
  143. package/src/stories/behaviour/performance/performance.stories.jsx +0 -26
  144. package/src/stories/behaviour/resizing/resizing.stories.jsx +0 -60
  145. package/src/stories/behaviour/slots.stories.jsx +0 -32
  146. package/src/stories/checkbox-boolean/checkboxBoolean.stories.jsx +0 -17
  147. package/src/stories/checkbox-group/checkbox-group.stories.jsx +0 -77
  148. package/src/stories/checkbox-one/checkboxOne.stories.jsx +0 -53
  149. package/src/stories/date-picker/data.json +0 -3
  150. package/src/stories/date-picker/datepicker.stories.jsx +0 -26
  151. package/src/stories/declaration/data.json +0 -1
  152. package/src/stories/declaration/input.stories.jsx +0 -18
  153. package/src/stories/disabled/data.json +0 -16
  154. package/src/stories/disabled/disabled.stories.jsx +0 -18
  155. package/src/stories/dropdown/data.json +0 -8
  156. package/src/stories/dropdown/dropdown.stories.jsx +0 -25
  157. package/src/stories/duration/duration.stories.jsx +0 -25
  158. package/src/stories/filter-description/filter-description.stories.jsx +0 -37
  159. package/src/stories/input/data.json +0 -1
  160. package/src/stories/input/input.stories.jsx +0 -18
  161. package/src/stories/input-number/input-number.stories.jsx +0 -23
  162. package/src/stories/loop/loop.stories.jsx +0 -29
  163. package/src/stories/loop/roster-for-loop.stories.jsx +0 -46
  164. package/src/stories/markdown/markdown.stories.jsx +0 -20
  165. package/src/stories/overview/data.json +0 -1
  166. package/src/stories/overview/dataLoop.json +0 -93
  167. package/src/stories/overview/overview.stories.jsx +0 -44
  168. package/src/stories/overview/source.json +0 -25
  169. package/src/stories/pairwise/data.json +0 -12
  170. package/src/stories/pairwise/pairwise-links.stories.jsx +0 -48
  171. package/src/stories/question/question.stories.jsx +0 -16
  172. package/src/stories/questionnaires/logement/logement.stories.jsx +0 -59
  173. package/src/stories/questionnaires/recensement/data.json +0 -12
  174. package/src/stories/questionnaires/recensement/recensement.stories.jsx +0 -35
  175. package/src/stories/questionnaires/rp/data.json +0 -5
  176. package/src/stories/questionnaires/rp/rp.stories.jsx +0 -23
  177. package/src/stories/questionnaires/simpsons/simpsons.stories.jsx +0 -246
  178. package/src/stories/radio/radio.stories.jsx +0 -78
  179. package/src/stories/roundabout/data1.json +0 -13
  180. package/src/stories/roundabout/data2.json +0 -16
  181. package/src/stories/roundabout/roundabout.stories.jsx +0 -32
  182. package/src/stories/sequence/sequence.stories.jsx +0 -29
  183. package/src/stories/suggester/suggester.stories.jsx +0 -71
  184. package/src/stories/summary/data.json +0 -16
  185. package/src/stories/summary/summary.stories.jsx +0 -23
  186. package/src/stories/switch/README.md +0 -29
  187. package/src/stories/switch/data-forced.json +0 -40
  188. package/src/stories/switch/source.json +0 -64
  189. package/src/stories/switch/switch.stories.jsx +0 -17
  190. package/src/stories/table/data.json +0 -1
  191. package/src/stories/table/table.stories.jsx +0 -30
  192. package/src/stories/text/data-roster.json +0 -5
  193. package/src/stories/text/text.stories.jsx +0 -20
  194. package/src/stories/textarea/data.json +0 -1
  195. package/src/stories/textarea/textarea.stories.jsx +0 -18
  196. package/src/stories/utils/SchemaValidator.jsx +0 -40
  197. package/src/stories/utils/default-arg-types.js +0 -39
  198. package/src/stories/utils/default-args.js +0 -3
  199. package/src/stories/utils/options.js +0 -19
  200. package/src/stories/utils/orchestrator.jsx +0 -267
  201. package/src/stories/utils/orchestrator.scss +0 -66
  202. package/src/stories/utils/overview.jsx +0 -39
  203. package/src/stories/utils/overview.scss +0 -37
  204. package/src/stories/utils/referentiel.js +0 -7
  205. package/src/tests/utils/e2e.js +0 -91
  206. package/src/tests/utils/lunatic.ts +0 -33
  207. package/src/use-lunatic/replace-component-sequence.ts +0 -25
  208. package/src/use-lunatic/test.utils.ts +0 -17
  209. package/src/utils/is-object.ts +0 -6
  210. package/src/utils/to-number.ts +0 -12
  211. package/stories/overview/sourceWithHierarchy.json +0 -5151
  212. package/tests/utils/lunatic.d.ts +0 -15
  213. package/tests/utils/lunatic.js +0 -31
  214. package/tests/utils/lunatic.js.map +0 -1
  215. package/use-lunatic/replace-component-sequence.d.ts +0 -36
  216. package/use-lunatic/replace-component-sequence.js +0 -22
  217. package/use-lunatic/replace-component-sequence.js.map +0 -1
  218. package/use-lunatic/test.utils.d.ts +0 -2
  219. package/use-lunatic/test.utils.js +0 -17
  220. package/use-lunatic/test.utils.js.map +0 -1
  221. package/utils/is-object.d.ts +0 -4
  222. package/utils/is-object.js +0 -10
  223. package/utils/is-object.js.map +0 -1
  224. package/utils/to-number.d.ts +0 -4
  225. package/utils/to-number.js +0 -16
  226. package/utils/to-number.js.map +0 -1
  227. /package/src/stories/behaviour/cleaning/{loop.json → source-loop-scopes.json} +0 -0
  228. /package/src/stories/behaviour/controls/{boucles-n.json → source-boucles-n.json} +0 -0
  229. /package/src/stories/behaviour/controls/{loop.json → source-loop.json} +0 -0
  230. /package/src/stories/behaviour/controls/{roundabout.json → source-roundabout.json} +0 -0
  231. /package/src/stories/behaviour/controls/{simple-numeric.json → source-simple-numeric.json} +0 -0
  232. /package/src/stories/behaviour/controls/{simple.json → source-simple.json} +0 -0
  233. /package/src/stories/{disabled → behaviour/disabled}/source.json +0 -0
  234. /package/src/stories/{checkbox-boolean → checkbox}/source.json +0 -0
  235. /package/src/stories/{checkbox-group/source.json → checkbox/sourceGroup.json} +0 -0
  236. /package/src/stories/{checkbox-group/sourceCondition.json → checkbox/sourceGroupCondition.json} +0 -0
  237. /package/src/stories/{checkbox-group/sourceDetail.json → checkbox/sourceGroupDetail.json} +0 -0
  238. /package/src/stories/{checkbox-one/source.json → checkbox/sourceOne.json} +0 -0
  239. /package/src/stories/{checkbox-one/sourceDetail.json → checkbox/sourceOneDetail.json} +0 -0
  240. /package/src/stories/{date-picker → datepicker}/source.json +0 -0
  241. /package/src/stories/{markdown/source.json → declaration/sourceMarkdown.json} +0 -0
  242. /package/src/stories/duration/{mois.json → sourceMonths.json} +0 -0
  243. /package/src/stories/duration/{time.json → sourceTime.json} +0 -0
  244. /package/src/stories/filter-description/{source-options.json → sourceOptions.json} +0 -0
  245. /package/src/stories/table/{table-dynamique.json → source-dynamic.json} +0 -0
@@ -1,15 +0,0 @@
1
- import type { LunaticData } from '../../use-lunatic/type';
2
- /**
3
- * Generate LunaticData from a record of values
4
- */
5
- export declare function generateData<T extends Record<string, unknown>>(data: T): LunaticData;
6
- export declare function generateVariable({ type, name }: {
7
- type?: string | undefined;
8
- name?: string | undefined;
9
- }): {
10
- variableType: string;
11
- name: string;
12
- values: {
13
- COLLECTED: null;
14
- };
15
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * Generate LunaticData from a record of values
3
- */
4
- export function generateData(data) {
5
- return {
6
- COLLECTED: Object.fromEntries(Object.entries(data).map(([key, value]) => [
7
- key,
8
- {
9
- CALCULATED: null,
10
- EXTERNAL: null,
11
- COLLECTED: value,
12
- },
13
- ])),
14
- CALCULATED: {},
15
- EXTERNAL: {},
16
- };
17
- }
18
- export function generateVariable({ type = 'COLLECTED', name = 'VARIABLE' }) {
19
- return {
20
- variableType: type,
21
- name: name,
22
- values: {
23
- COLLECTED: null,
24
- },
25
- };
26
- }
27
- //# sourceMappingURL=lunatic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lunatic.js","sourceRoot":"","sources":["../../../src/tests/utils/lunatic.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,YAAY,CAC3B,IAAO;IAEP,OAAO;QACN,SAAS,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YAC1C,GAAG;YACH;gBACC,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI;gBACd,SAAS,EAAE,KAAK;aAChB;SACD,CAAC,CACqB;QACxB,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE,IAAI,GAAG,UAAU,EAAE;IACzE,OAAO;QACN,YAAY,EAAE,IAAI;QAClB,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACP,SAAS,EAAE,IAAI;SACf;KACD,CAAC;AACH,CAAC"}
@@ -1,36 +0,0 @@
1
- import type { LunaticComponentDefinition } from './type';
2
- /**
3
- * Pour le Question : les composants du fieldset n'existe pas dans pages.
4
- * Ils échappent donc aux controls. On les substitue ici au Question.
5
- * On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
6
- * des composant à part entière.
7
- * D'autres composant pourraient un jour figurer ici.
8
- */
9
- export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): (import("../type.source").ComponentInputDefinition | import("../type.source").ComponentSequenceDefinition | import("../type.source").ComponentRoundaboutDefinition | ({
10
- componentType: "Loop";
11
- loopDependencies?: string[];
12
- } & import("../type.source").ComponentDefinitionBase & {
13
- components: import("../type.source").ComponentDefinitionWithPage[];
14
- iterations: import("../type.source").VTLScalarExpression;
15
- maxPage: string;
16
- paginatedLoop: true;
17
- }) | ({
18
- componentType: "Loop";
19
- loopDependencies?: string[];
20
- } & import("../type.source").ComponentDefinitionBase & {
21
- paginatedLoop: false;
22
- components: import("../type.source").ComponentDefinition[];
23
- } & {
24
- lines: {
25
- min: import("../type.source").VTLExpression;
26
- max: import("../type.source").VTLExpression;
27
- };
28
- }) | ({
29
- componentType: "Loop";
30
- loopDependencies?: string[];
31
- } & import("../type.source").ComponentDefinitionBase & {
32
- paginatedLoop: false;
33
- components: import("../type.source").ComponentDefinition[];
34
- } & {
35
- iterations: import("../type.source").VTLExpression;
36
- }) | import("../type.source").ComponentRosterForLoopDefinition | import("../type.source").ComponentTableDefinition | import("../type.source").ComponentNumberDefinition | import("../type.source").ComponentDurationDefinition | import("../type.source").ComponentDatePickerDefinition | import("../type.source").ComponentCheckboxGroupDefinition | import("../type.source").ComponentCheckboxBooleanDefinition | import("../type.source").ComponentRadioDefinition | import("../type.source").ComponentDropdownDefinition | import("../type.source").ComponentQuestionDefinition | import("../type.source").ComponentCheckboxOneDefinition | import("../type.source").ComponentSuggesterDefinition | import("../type.source").ComponentPairWiseLinksDefinition | import("../type.source").ComponentSummaryDefinition | import("../type.source").ComponentText | import("../type.source").ComponentAccordion | import("../type.source").ComponentFilterDescriptionDefinition)[];
@@ -1,19 +0,0 @@
1
- /**
2
- * Pour le Question : les composants du fieldset n'existe pas dans pages.
3
- * Ils échappent donc aux controls. On les substitue ici au Question.
4
- * On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
5
- * des composant à part entière.
6
- * D'autres composant pourraient un jour figurer ici.
7
- */
8
- export function replaceComponentSequence(components) {
9
- return components.reduce(function (acc, component) {
10
- const { componentType } = component;
11
- switch (componentType) {
12
- case 'Question':
13
- return [...acc, ...component.components];
14
- default:
15
- return [...acc, component];
16
- }
17
- }, []);
18
- }
19
- //# sourceMappingURL=replace-component-sequence.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replace-component-sequence.js","sourceRoot":"","sources":["../../src/use-lunatic/replace-component-sequence.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACvC,UAA6C;IAE7C,OAAO,UAAU,CAAC,MAAM,CAAC,UACxB,GAAsC,EACtC,SAAS;QAET,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;QACpC,QAAQ,aAAa,EAAE,CAAC;YACvB,KAAK,UAAU;gBACd,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;YAC1C;gBACC,OAAO,CAAC,GAAG,GAAG,EAAE,SAAS,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC,EAAE,EAAE,CAAC,CAAC;AACR,CAAC"}
@@ -1,2 +0,0 @@
1
- import { LunaticData } from './type';
2
- export declare const dataFromObject: (o: Record<string, unknown>) => LunaticData;
@@ -1,13 +0,0 @@
1
- export const dataFromObject = (o) => {
2
- return {
3
- EXTERNAL: {},
4
- COLLECTED: Object.keys(o).reduce((acc, k) => ({
5
- ...acc,
6
- [k]: {
7
- COLLECTED: o[k],
8
- },
9
- }), {}),
10
- CALCULATED: {},
11
- };
12
- };
13
- //# sourceMappingURL=test.utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.utils.js","sourceRoot":"","sources":["../../src/use-lunatic/test.utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAA0B,EAAe,EAAE;IACzE,OAAO;QACN,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACZ,GAAG,GAAG;YACN,CAAC,CAAC,CAAC,EAAE;gBACJ,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;aACf;SACD,CAAC,EACF,EAAE,CACF;QACD,UAAU,EAAE,EAAE;KACd,CAAC;AACH,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * isObject function with type narrowing
3
- */
4
- export declare function isObject(v: unknown): v is Record<string, unknown>;
@@ -1,7 +0,0 @@
1
- /**
2
- * isObject function with type narrowing
3
- */
4
- export function isObject(v) {
5
- return typeof v === 'object' && v !== null;
6
- }
7
- //# sourceMappingURL=is-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-object.js","sourceRoot":"","sources":["../../src/utils/is-object.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IAClC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;AAC5C,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Convert an unknown value into a number
3
- */
4
- export declare function toNumber(v: unknown): number | null;
@@ -1,13 +0,0 @@
1
- /**
2
- * Convert an unknown value into a number
3
- */
4
- export function toNumber(v) {
5
- if (typeof v === 'number') {
6
- return v;
7
- }
8
- if (typeof v === 'string') {
9
- return parseInt(v, 10);
10
- }
11
- return null;
12
- }
13
- //# sourceMappingURL=to-number.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-number.js","sourceRoot":"","sources":["../../src/utils/to-number.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IAClC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACV,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import Orchestrator from '../utils/orchestrator';
3
- import source from './source';
4
- import defaultArgTypes from '../utils/default-arg-types';
5
-
6
- const stories = {
7
- title: 'Components/Accordion',
8
- component: Orchestrator,
9
- argTypes: defaultArgTypes,
10
- };
11
-
12
- export default stories;
13
-
14
- const Template = (args) => <Orchestrator {...args} />;
15
- export const Default = Template.bind({});
16
-
17
- Default.args = { id: 'input', source, data: {} };
@@ -1,69 +0,0 @@
1
- import React from 'react';
2
- import Orchestrator from '../../utils/orchestrator';
3
- import source from './source.json';
4
- import sourceLoop from './source-loop.json';
5
- import sourceLoop2 from './loop.json';
6
- import defaultArgTypes from '../../utils/default-arg-types';
7
-
8
- const stories = {
9
- title: 'Behaviour/Cleaning',
10
- component: Orchestrator,
11
- argTypes: {
12
- ...defaultArgTypes,
13
- missing: {
14
- table: { disable: false },
15
- control: 'boolean',
16
- defaultValue: true,
17
- },
18
- activeGoNextForMissing: {
19
- table: { disable: false },
20
- control: 'boolean',
21
- defaultValue: true,
22
- },
23
- management: {
24
- table: { disable: false },
25
- control: 'boolean',
26
- defaultValue: false,
27
- },
28
- activeControls: {
29
- control: 'boolean',
30
- defaultValue: true,
31
- },
32
- source: {
33
- table: { disable: false },
34
- control: { type: 'object' },
35
- defaultValue: source,
36
- },
37
- data: {
38
- table: { disable: false },
39
- control: { type: 'object' },
40
- defaultValue: { COLLECTED: { READY: { COLLECTED: true } } },
41
- },
42
- },
43
- };
44
-
45
- export default stories;
46
-
47
- const Template = (args) => <Orchestrator {...args} />;
48
- export const Default = Template.bind({});
49
- Default.args = {
50
- id: 'cleaning-default',
51
- pagination: true,
52
- source,
53
- };
54
- export const Loop = Template.bind({});
55
- Loop.args = {
56
- id: 'cleaning-loop',
57
- pagination: true,
58
- source: sourceLoop,
59
- };
60
-
61
- export const Loop2 = Template.bind({});
62
- Loop2.args = {
63
- id: 'cleaning-loop-2',
64
- pagination: true,
65
- source: sourceLoop2,
66
- data: {
67
- COLLECTED: { PRENOM: { COLLECTED: ['Laurent', 'Alain', 'toto'] } },
68
- },
69
- };
@@ -1,81 +0,0 @@
1
- import React from 'react';
2
- import Orchestrator from '../../utils/orchestrator';
3
- import simple from './simple.json';
4
- import simpleNum from './simple-numeric.json';
5
- import sourceLoop from './loop.json';
6
- import sourceRoundabout from './roundabout.json';
7
- import defaultArgTypes from '../../utils/default-arg-types';
8
- import boucleNTabDynamique from './boucles-n.json';
9
-
10
- const stories = {
11
- title: 'Behaviour/Controls',
12
- component: Orchestrator,
13
- argTypes: {
14
- ...defaultArgTypes,
15
- missing: {
16
- table: { disable: false },
17
- control: 'boolean',
18
- defaultValue: true,
19
- },
20
- activeGoNextForMissing: {
21
- table: { disable: false },
22
- control: 'boolean',
23
- defaultValue: true,
24
- },
25
- management: {
26
- table: { disable: false },
27
- control: 'boolean',
28
- defaultValue: false,
29
- },
30
- activeControls: {
31
- control: 'boolean',
32
- defaultValue: true,
33
- },
34
- },
35
- };
36
-
37
- export default stories;
38
-
39
- const Template = (args) => <Orchestrator {...args} />;
40
- export const BoucleN = Template.bind({});
41
-
42
- BoucleN.args = {
43
- id: 'boucle-dylan',
44
- pagination: true,
45
- activeControls: true,
46
- source: boucleNTabDynamique,
47
- };
48
-
49
- export const Simple = Template.bind({});
50
-
51
- Simple.args = {
52
- id: 'controls-simple',
53
- source: simple,
54
- pagination: true,
55
- };
56
-
57
- export const SimpleNum = Template.bind({});
58
-
59
- SimpleNum.args = {
60
- id: 'controls-simple-num',
61
- source: simpleNum,
62
- pagination: true,
63
- activeControls: true,
64
- };
65
-
66
- export const LinkedLoop = Template.bind({});
67
-
68
- export const Loop = Template.bind({});
69
- Loop.args = {
70
- id: 'controls-loop',
71
- source: sourceLoop,
72
- pagination: true,
73
- activeControls: true,
74
- };
75
-
76
- export const Roundabout = Template.bind({});
77
- Roundabout.args = {
78
- source: sourceRoundabout,
79
- pagination: true,
80
- activeControls: true,
81
- };
@@ -1,14 +0,0 @@
1
- {
2
- "data": {
3
- "EXTERNAL": {},
4
- "CALCULATED": {},
5
- "COLLECTED": {
6
- "NBHAB": {
7
- "COLLECTED": 2
8
- },
9
- "NAME": {
10
- "COLLECTED": ["Jean", "Paul"]
11
- }
12
- }
13
- }
14
- }
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import defaultArgTypes from '../../utils/default-arg-types';
3
- import Orchestrator from '../../utils/orchestrator';
4
- import source from './source.json';
5
- import sourceLoop from './sourceLoop.json';
6
- import dataLoop from './dataLoop.json';
7
-
8
- const stories = {
9
- title: 'Behaviour/Filter',
10
- component: Orchestrator,
11
- argTypes: {
12
- ...defaultArgTypes,
13
- disableFilters: {
14
- table: { disable: false },
15
- control: 'boolean',
16
- defaultValue: false,
17
- },
18
- },
19
- };
20
-
21
- export default stories;
22
-
23
- const Template = (args) => <Orchestrator {...args} />;
24
- export const Default = Template.bind({});
25
-
26
- Default.args = {
27
- disableFilters: false,
28
- source,
29
- };
30
-
31
- export const WithLoop = Template.bind({});
32
- WithLoop.args = {
33
- disableFilters: false,
34
- source: sourceLoop,
35
- data: dataLoop.data,
36
- };
@@ -1,69 +0,0 @@
1
- import React from 'react';
2
- import defaultArgTypes from '../../utils/default-arg-types';
3
- import Orchestrator from '../../utils/orchestrator';
4
- import source from './source.json';
5
-
6
- const stories = {
7
- title: 'Behaviour/Missing',
8
- component: Orchestrator,
9
- argTypes: {
10
- ...defaultArgTypes,
11
- shortcut: {
12
- table: { disable: false },
13
- control: 'boolean',
14
- defaultValue: true,
15
- },
16
- missing: {
17
- table: { disable: false },
18
- control: 'boolean',
19
- defaultValue: true,
20
- },
21
- missingStrategy: {
22
- table: { disable: false },
23
- control: 'object',
24
- },
25
- activeGoNextForMissing: {
26
- table: { disable: false },
27
- control: 'boolean',
28
- defaultValue: true,
29
- },
30
- management: {
31
- table: { disable: false },
32
- control: 'boolean',
33
- defaultValue: false,
34
- },
35
- activeControls: {
36
- control: 'boolean',
37
- defaultValue: true,
38
- },
39
- source: {
40
- table: { disable: false },
41
- control: { type: 'object' },
42
- defaultValue: source,
43
- },
44
- data: {
45
- table: { disable: false },
46
- control: { type: 'object' },
47
- defaultValue: { COLLECTED: { READY: { COLLECTED: true } } },
48
- },
49
- },
50
- };
51
-
52
- export default stories;
53
-
54
- const Template = (args) => <Orchestrator {...args} />;
55
- export const Default = Template.bind({});
56
-
57
- Default.args = {
58
- pagination: true,
59
- missing: true,
60
- source,
61
- shortcut: true,
62
- missingShortcut: { dontKnow: 'f2', refused: 'f4' },
63
- };
64
-
65
- export const ReadOnly = Template.bind({});
66
- ReadOnly.args = {
67
- ...Default.args,
68
- readOnly: true,
69
- };