@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.
- package/components/FilterDescription/FilterDescription.d.ts +5 -7
- package/components/FilterDescription/FilterDescription.js +10 -3
- package/components/FilterDescription/FilterDescription.js.map +1 -1
- package/components/InputNumber/InputNumber.js +2 -2
- package/components/InputNumber/InputNumber.js.map +1 -1
- package/components/InputNumber/InputNumberThousand.d.ts +2 -1
- package/components/InputNumber/InputNumberThousand.js +14 -6
- package/components/InputNumber/InputNumberThousand.js.map +1 -1
- package/components/library.d.ts +2 -4
- package/components/shared/HOC/slottableComponent.d.ts +2 -0
- package/components/shared/HOC/slottableComponent.js.map +1 -1
- package/esm/components/FilterDescription/FilterDescription.d.ts +5 -7
- package/esm/components/FilterDescription/FilterDescription.js +8 -1
- package/esm/components/FilterDescription/FilterDescription.js.map +1 -1
- package/esm/components/InputNumber/InputNumber.js +2 -2
- package/esm/components/InputNumber/InputNumber.js.map +1 -1
- package/esm/components/InputNumber/InputNumberThousand.d.ts +2 -1
- package/esm/components/InputNumber/InputNumberThousand.js +14 -6
- package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
- package/esm/components/library.d.ts +2 -4
- package/esm/components/shared/HOC/slottableComponent.d.ts +2 -0
- package/esm/components/shared/HOC/slottableComponent.js.map +1 -1
- package/esm/type.source.d.ts +5 -1
- package/esm/use-lunatic/commons/fill-components/fill-component.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component.spec.js +485 -0
- package/esm/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.d.ts +3 -3
- package/esm/use-lunatic/commons/fill-components/fill-components.js +29 -5
- package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +4 -4
- package/esm/use-lunatic/props/getComponentTypeProps.js +1 -1
- package/esm/use-lunatic/props/getComponentTypeProps.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.d.ts +1 -1
- package/esm/use-lunatic/props/propOptions.js +5 -3
- package/esm/use-lunatic/props/propOptions.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.spec.js +100 -2
- package/esm/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/esm/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
- package/esm/use-lunatic/reducer/reducerInitializer.js +3 -3
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/esm/use-lunatic/replace-component-sequence.d.ts +1 -1
- package/esm/use-lunatic/type.d.ts +3 -0
- package/esm/use-lunatic/use-lunatic.js +3 -1
- package/esm/use-lunatic/use-lunatic.js.map +1 -1
- package/package.json +8 -2
- package/src/components/FilterDescription/FilterDescription.tsx +24 -13
- package/src/components/InputNumber/InputNumber.tsx +2 -0
- package/src/components/InputNumber/InputNumberThousand.tsx +13 -5
- package/src/components/shared/HOC/slottableComponent.tsx +2 -0
- package/src/stories/behaviour/paste/test.stories.jsx +5 -0
- package/src/stories/filter-description/filter-description.stories.jsx +7 -3
- package/src/stories/loop/roster-for-loop.stories.jsx +1 -4
- package/src/stories/loop/source-roster.json +65 -2
- package/src/stories/utils/default-arg-types.js +1 -1
- package/src/stories/utils/orchestrator.jsx +3 -3
- package/src/type.source.ts +6 -1
- package/src/use-lunatic/commons/fill-components/fill-component.spec.ts +581 -0
- package/src/use-lunatic/commons/fill-components/fill-components.ts +39 -7
- package/src/use-lunatic/props/getComponentTypeProps.ts +15 -11
- package/src/use-lunatic/props/propOptions.spec.ts +140 -2
- package/src/use-lunatic/props/propOptions.ts +8 -3
- package/src/use-lunatic/reducer/reducerInitializer.tsx +4 -2
- package/src/use-lunatic/type.ts +5 -0
- package/src/use-lunatic/use-lunatic.ts +3 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +5 -1
- package/use-lunatic/commons/fill-components/fill-component.spec.d.ts +1 -0
- package/use-lunatic/commons/fill-components/fill-component.spec.js +487 -0
- package/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -0
- package/use-lunatic/commons/fill-components/fill-components.d.ts +3 -3
- package/use-lunatic/commons/fill-components/fill-components.js +26 -5
- package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/use-lunatic/props/getComponentTypeProps.d.ts +4 -4
- package/use-lunatic/props/getComponentTypeProps.js +1 -1
- package/use-lunatic/props/getComponentTypeProps.js.map +1 -1
- package/use-lunatic/props/propOptions.d.ts +1 -1
- package/use-lunatic/props/propOptions.js +5 -3
- package/use-lunatic/props/propOptions.js.map +1 -1
- package/use-lunatic/props/propOptions.spec.js +100 -2
- package/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
- package/use-lunatic/reducer/reducerInitializer.js +3 -3
- package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/use-lunatic/replace-component-sequence.d.ts +1 -1
- package/use-lunatic/type.d.ts +3 -0
- package/use-lunatic/use-lunatic.js +3 -1
- package/use-lunatic/use-lunatic.js.map +1 -1
- 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",
|
|
@@ -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
|
})}
|
package/src/type.source.ts
CHANGED
|
@@ -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)
|