@inseefr/lunatic 3.5.1 → 3.5.3

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 (88) hide show
  1. package/components/FilterDescription/FilterDescription.d.ts +5 -7
  2. package/components/FilterDescription/FilterDescription.js +10 -3
  3. package/components/FilterDescription/FilterDescription.js.map +1 -1
  4. package/components/InputNumber/InputNumber.js +2 -2
  5. package/components/InputNumber/InputNumber.js.map +1 -1
  6. package/components/InputNumber/InputNumberThousand.d.ts +2 -1
  7. package/components/InputNumber/InputNumberThousand.js +14 -6
  8. package/components/InputNumber/InputNumberThousand.js.map +1 -1
  9. package/components/library.d.ts +2 -4
  10. package/components/shared/HOC/slottableComponent.d.ts +2 -0
  11. package/components/shared/HOC/slottableComponent.js.map +1 -1
  12. package/esm/components/FilterDescription/FilterDescription.d.ts +5 -7
  13. package/esm/components/FilterDescription/FilterDescription.js +8 -1
  14. package/esm/components/FilterDescription/FilterDescription.js.map +1 -1
  15. package/esm/components/InputNumber/InputNumber.js +2 -2
  16. package/esm/components/InputNumber/InputNumber.js.map +1 -1
  17. package/esm/components/InputNumber/InputNumberThousand.d.ts +2 -1
  18. package/esm/components/InputNumber/InputNumberThousand.js +14 -6
  19. package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
  20. package/esm/components/library.d.ts +2 -4
  21. package/esm/components/shared/HOC/slottableComponent.d.ts +2 -0
  22. package/esm/components/shared/HOC/slottableComponent.js.map +1 -1
  23. package/esm/type.source.d.ts +5 -1
  24. package/esm/use-lunatic/commons/fill-components/fill-component.spec.d.ts +1 -0
  25. package/esm/use-lunatic/commons/fill-components/fill-component.spec.js +485 -0
  26. package/esm/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -0
  27. package/esm/use-lunatic/commons/fill-components/fill-components.d.ts +3 -3
  28. package/esm/use-lunatic/commons/fill-components/fill-components.js +29 -5
  29. package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  30. package/esm/use-lunatic/props/getComponentTypeProps.d.ts +4 -4
  31. package/esm/use-lunatic/props/getComponentTypeProps.js +1 -1
  32. package/esm/use-lunatic/props/getComponentTypeProps.js.map +1 -1
  33. package/esm/use-lunatic/props/propOptions.d.ts +1 -1
  34. package/esm/use-lunatic/props/propOptions.js +5 -3
  35. package/esm/use-lunatic/props/propOptions.js.map +1 -1
  36. package/esm/use-lunatic/props/propOptions.spec.js +100 -2
  37. package/esm/use-lunatic/props/propOptions.spec.js.map +1 -1
  38. package/esm/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
  39. package/esm/use-lunatic/reducer/reducerInitializer.js +3 -3
  40. package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  41. package/esm/use-lunatic/replace-component-sequence.d.ts +1 -1
  42. package/esm/use-lunatic/type.d.ts +3 -0
  43. package/esm/use-lunatic/use-lunatic.js +3 -1
  44. package/esm/use-lunatic/use-lunatic.js.map +1 -1
  45. package/package.json +8 -2
  46. package/src/components/FilterDescription/FilterDescription.tsx +24 -13
  47. package/src/components/InputNumber/InputNumber.tsx +2 -0
  48. package/src/components/InputNumber/InputNumberThousand.tsx +13 -5
  49. package/src/components/shared/HOC/slottableComponent.tsx +2 -0
  50. package/src/stories/behaviour/paste/test.stories.jsx +5 -0
  51. package/src/stories/filter-description/filter-description.stories.jsx +7 -3
  52. package/src/stories/loop/roster-for-loop.stories.jsx +1 -4
  53. package/src/stories/loop/source-roster.json +65 -2
  54. package/src/stories/utils/default-arg-types.js +1 -1
  55. package/src/stories/utils/orchestrator.jsx +3 -3
  56. package/src/type.source.ts +6 -1
  57. package/src/use-lunatic/commons/fill-components/fill-component.spec.ts +581 -0
  58. package/src/use-lunatic/commons/fill-components/fill-components.ts +39 -7
  59. package/src/use-lunatic/props/getComponentTypeProps.ts +15 -11
  60. package/src/use-lunatic/props/propOptions.spec.ts +140 -2
  61. package/src/use-lunatic/props/propOptions.ts +8 -3
  62. package/src/use-lunatic/reducer/reducerInitializer.tsx +4 -2
  63. package/src/use-lunatic/type.ts +5 -0
  64. package/src/use-lunatic/use-lunatic.ts +3 -0
  65. package/tsconfig.build.tsbuildinfo +1 -1
  66. package/type.source.d.ts +5 -1
  67. package/use-lunatic/commons/fill-components/fill-component.spec.d.ts +1 -0
  68. package/use-lunatic/commons/fill-components/fill-component.spec.js +487 -0
  69. package/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -0
  70. package/use-lunatic/commons/fill-components/fill-components.d.ts +3 -3
  71. package/use-lunatic/commons/fill-components/fill-components.js +26 -5
  72. package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  73. package/use-lunatic/props/getComponentTypeProps.d.ts +4 -4
  74. package/use-lunatic/props/getComponentTypeProps.js +1 -1
  75. package/use-lunatic/props/getComponentTypeProps.js.map +1 -1
  76. package/use-lunatic/props/propOptions.d.ts +1 -1
  77. package/use-lunatic/props/propOptions.js +5 -3
  78. package/use-lunatic/props/propOptions.js.map +1 -1
  79. package/use-lunatic/props/propOptions.spec.js +100 -2
  80. package/use-lunatic/props/propOptions.spec.js.map +1 -1
  81. package/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
  82. package/use-lunatic/reducer/reducerInitializer.js +3 -3
  83. package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  84. package/use-lunatic/replace-component-sequence.d.ts +1 -1
  85. package/use-lunatic/type.d.ts +3 -0
  86. package/use-lunatic/use-lunatic.js +3 -1
  87. package/use-lunatic/use-lunatic.js.map +1 -1
  88. package/src/stories/loop/source-with-header.json +0 -128
@@ -15,18 +15,34 @@
15
15
  {
16
16
  "id": "loop-prenom",
17
17
  "componentType": "RosterForLoop",
18
+ "header": [
19
+ { "headerCell": true, "label": { "value": "", "type": "TXT" } },
20
+ { "headerCell": true, "label": { "value": "Prénom", "type": "TXT" } },
21
+ { "headerCell": true, "label": { "value": "Age", "type": "TXT" } },
22
+ {
23
+ "headerCell": true,
24
+ "label": { "value": "Buvez vous de l'alcool ?", "type": "TXT" }
25
+ },
26
+ { "headerCell": true, "label": { "value": "Nom", "type": "TXT" } }
27
+ ],
18
28
  "label": { "value": "\"Ajouter un individu\"", "type": "VTL|MD" },
19
29
  "conditionFilter": { "value": "true", "type": "VTL" },
20
- "bindingDependencies": ["PRENOM"],
30
+ "bindingDependencies": ["PRENOM", "AGE"],
21
31
  "lines": {
22
32
  "min": { "value": "1", "type": "VTL" },
23
33
  "max": { "value": "10", "type": "VTL" }
24
34
  },
25
35
  "page": "1",
26
36
  "components": [
37
+ {
38
+ "componentType": "Text",
39
+ "label": {
40
+ "value": "\"Individu \" || cast(GLOBAL_ITERATION_INDEX, string)",
41
+ "type": "VTL"
42
+ }
43
+ },
27
44
  {
28
45
  "componentType": "Input",
29
- "label": { "value": "\"Prénom\"", "type": "VTL|MD" },
30
46
  "conditionFilter": { "value": "true", "type": "VTL" },
31
47
  "maxLength": 30,
32
48
  "bindingDependencies": ["PRENOM"],
@@ -34,6 +50,39 @@
34
50
  "response": {
35
51
  "name": "PRENOM"
36
52
  }
53
+ },
54
+ {
55
+ "componentType": "Input",
56
+ "conditionFilter": { "value": "true", "type": "VTL" },
57
+ "maxLength": 30,
58
+ "bindingDependencies": ["AGE"],
59
+ "id": "age",
60
+ "response": {
61
+ "name": "AGE"
62
+ }
63
+ },
64
+ {
65
+ "componentType": "CheckboxBoolean",
66
+ "conditionFilter": {
67
+ "value": "cast(AGE, integer) > 18",
68
+ "type": "VTL"
69
+ },
70
+ "maxLength": 30,
71
+ "bindingDependencies": ["DRINK"],
72
+ "id": "drink",
73
+ "response": {
74
+ "name": "DRINK"
75
+ }
76
+ },
77
+ {
78
+ "componentType": "Input",
79
+ "conditionFilter": { "value": "true", "type": "VTL" },
80
+ "maxLength": 30,
81
+ "bindingDependencies": ["NOM"],
82
+ "id": "nom",
83
+ "response": {
84
+ "name": "NOM"
85
+ }
37
86
  }
38
87
  ]
39
88
  },
@@ -96,6 +145,20 @@
96
145
  "COLLECTED": [null]
97
146
  }
98
147
  },
148
+ {
149
+ "variableType": "COLLECTED",
150
+ "name": "NOM",
151
+ "values": {
152
+ "COLLECTED": [null]
153
+ }
154
+ },
155
+ {
156
+ "variableType": "COLLECTED",
157
+ "name": "DRINK",
158
+ "values": {
159
+ "COLLECTED": [null]
160
+ }
161
+ },
99
162
  {
100
163
  "variableType": "COLLECTED",
101
164
  "name": "AGE",
@@ -11,7 +11,7 @@ const fields = [
11
11
  'getStoreInfo',
12
12
  'missing',
13
13
  'shortcut',
14
- 'filterDescription',
14
+ 'disableFiltersDescription',
15
15
  'disabled',
16
16
  'showOverview',
17
17
  'missingStrategy',
@@ -101,6 +101,7 @@ function OrchestratorForStories({
101
101
  source,
102
102
  data,
103
103
  disableFilters = false,
104
+ disableFiltersDescription = true,
104
105
  management = false,
105
106
  shortcut = false,
106
107
  activeControls = false,
@@ -114,7 +115,6 @@ function OrchestratorForStories({
114
115
  preferences,
115
116
  slots,
116
117
  showOverview = false,
117
- filterDescription = true,
118
118
  getReferentiel,
119
119
  dontKnowButton,
120
120
  refusedButton,
@@ -146,7 +146,8 @@ function OrchestratorForStories({
146
146
  initialPage,
147
147
  features,
148
148
  preferences,
149
- disableFilters,
149
+ disableFilters,
150
+ disableFiltersDescription,
150
151
  onChange: onLogChange,
151
152
  autoSuggesterLoading,
152
153
  getReferentiel,
@@ -220,7 +221,6 @@ function OrchestratorForStories({
220
221
  components={components}
221
222
  componentProps={() => ({
222
223
  errors: errorActive[pageTag],
223
- filterDescription: filterDescription,
224
224
  disabled: disabled,
225
225
  readOnly: readOnly,
226
226
  })}
@@ -33,7 +33,8 @@ export type ComponentDefinition =
33
33
  | ComponentPairWiseLinksDefinition
34
34
  | ComponentSummaryDefinition
35
35
  | ComponentText
36
- | ComponentAccordion;
36
+ | ComponentAccordion
37
+ | ComponentFilterDescriptionDefinition;
37
38
  export type ComponentInputDefinition = ComponentDefinitionBaseWithResponse & {
38
39
  componentType: 'Input' | 'Textarea';
39
40
  maxLength?: number;
@@ -391,6 +392,10 @@ export type ComponentAccordion = {
391
392
  body: VTLExpression;
392
393
  }[];
393
394
  };
395
+ export type ComponentFilterDescriptionDefinition = {
396
+ componentType: 'FilterDescription';
397
+ label: VTLExpression;
398
+ };
394
399
  export type SuggesterDefinition = {
395
400
  /**
396
401
  * Name of the list (will be used as storeName for suggester)