@inseefr/lunatic 3.0.0-rc.13 → 3.0.0-rc.14
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/lib/main.css +0 -2
- package/lib/main.css.map +1 -1
- package/lib/package.json +3 -3
- package/lib/src/components/Suggester/CustomSuggester.d.ts +9 -8
- package/lib/src/components/Suggester/CustomSuggester.js +4 -31
- package/lib/src/components/Suggester/CustomSuggester.js.map +1 -1
- package/lib/src/components/Suggester/Suggester.d.ts +1 -1
- package/lib/src/components/Suggester/Suggester.js +57 -35
- package/lib/src/components/Suggester/Suggester.js.map +1 -1
- package/lib/src/components/Suggester/SuggesterNotification.d.ts +5 -6
- package/lib/src/components/Suggester/SuggesterNotification.js +5 -10
- package/lib/src/components/Suggester/SuggesterNotification.js.map +1 -1
- package/lib/src/components/Suggester/useSuggestions.d.ts +20 -0
- package/lib/src/components/Suggester/useSuggestions.js +86 -0
- package/lib/src/components/Suggester/useSuggestions.js.map +1 -0
- package/lib/src/components/shared/Combobox/Combobox.d.ts +2 -0
- package/lib/src/components/shared/Combobox/Combobox.js +5 -6
- package/lib/src/components/shared/Combobox/Combobox.js.map +1 -1
- package/lib/src/components/shared/Combobox/ComboboxType.d.ts +1 -0
- package/lib/src/components/shared/Combobox/Panel/ComboboxOption.js +4 -0
- package/lib/src/components/shared/Combobox/Panel/ComboboxOption.js.map +1 -1
- package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.d.ts +1 -1
- package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.js +15 -1
- package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.js.map +1 -1
- package/lib/src/components/shared/Combobox/Selection/ComboboxLabelSelection.js +6 -0
- package/lib/src/components/shared/Combobox/Selection/ComboboxLabelSelection.js.map +1 -1
- package/lib/src/components/type.d.ts +7 -0
- package/lib/src/hooks/use-track-changes.js +1 -1
- package/lib/src/hooks/use-track-changes.js.map +1 -1
- package/lib/src/hooks/useDebounce.d.ts +4 -0
- package/lib/src/hooks/useDebounce.js +23 -0
- package/lib/src/hooks/useDebounce.js.map +1 -0
- package/lib/src/hooks/useDocumentEvent.js +1 -1
- package/lib/src/hooks/useDocumentEvent.js.map +1 -1
- package/lib/src/hooks/{use-ref-sync.js → useRefSync.js} +1 -1
- package/lib/src/hooks/useRefSync.js.map +1 -0
- package/lib/src/hooks/useSuggesterInfo.d.ts +1 -1
- package/lib/src/i18n/dictionary.d.ts +16 -0
- package/lib/src/i18n/dictionary.js +16 -0
- package/lib/src/i18n/dictionary.js.map +1 -1
- package/lib/src/i18n/index.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.js +3 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +71 -66
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +68 -63
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +16 -16
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +70 -60
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.js +16 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.js.map +1 -1
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
- package/lib/src/use-lunatic/type-source.d.ts +7 -2
- package/lib/src/use-lunatic/use-lunatic.d.ts +14 -0
- package/lib/src/utils/function.d.ts +1 -0
- package/lib/src/utils/function.js +18 -0
- package/lib/src/utils/function.js.map +1 -1
- package/package.json +3 -3
- package/lib/src/components/Suggester/SuggesterStatus.d.ts +0 -23
- package/lib/src/components/Suggester/SuggesterStatus.js +0 -24
- package/lib/src/components/Suggester/SuggesterStatus.js.map +0 -1
- package/lib/src/hooks/use-ref-sync.js.map +0 -1
- /package/lib/src/hooks/{use-ref-sync.d.ts → useRefSync.d.ts} +0 -0
|
@@ -86,11 +86,11 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
86
86
|
};
|
|
87
87
|
header?: {
|
|
88
88
|
value: string;
|
|
89
|
-
label: string | import("../../type-source").LabelType
|
|
89
|
+
label: string | import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
90
90
|
options: {
|
|
91
91
|
value: string;
|
|
92
|
-
label: import("../../type-source").LabelType
|
|
93
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
92
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
93
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
94
94
|
}[];
|
|
95
95
|
colspan?: number | undefined;
|
|
96
96
|
rowspan?: number | undefined;
|
|
@@ -274,11 +274,11 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
274
274
|
};
|
|
275
275
|
header?: {
|
|
276
276
|
value: string;
|
|
277
|
-
label: string | import("../../type-source").LabelType
|
|
277
|
+
label: string | import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
278
278
|
options: {
|
|
279
279
|
value: string;
|
|
280
|
-
label: import("../../type-source").LabelType
|
|
281
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
280
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
281
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
282
282
|
}[];
|
|
283
283
|
colspan?: number | undefined;
|
|
284
284
|
rowspan?: number | undefined;
|
|
@@ -375,17 +375,17 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
375
375
|
componentType: "Table";
|
|
376
376
|
header: {
|
|
377
377
|
value: string;
|
|
378
|
-
label: string | import("../../type-source").LabelType
|
|
378
|
+
label: string | import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
379
379
|
options: {
|
|
380
380
|
value: string;
|
|
381
|
-
label: import("../../type-source").LabelType
|
|
382
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
381
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
382
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
383
383
|
}[];
|
|
384
384
|
colspan?: number | undefined;
|
|
385
385
|
rowspan?: number | undefined;
|
|
386
386
|
}[] | undefined;
|
|
387
387
|
body: ({
|
|
388
|
-
label: import("../../type-source").LabelType
|
|
388
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
389
389
|
colspan?: number | undefined;
|
|
390
390
|
rowspan?: number | undefined;
|
|
391
391
|
} | (import("../../type-source").ComponentType & {
|
|
@@ -510,8 +510,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
510
510
|
page: string;
|
|
511
511
|
componentType: "CheckboxGroup";
|
|
512
512
|
responses: {
|
|
513
|
-
label: import("../../type-source").LabelType
|
|
514
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
513
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
514
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
515
515
|
response: import("../../type-source").ResponseType;
|
|
516
516
|
id: string;
|
|
517
517
|
}[];
|
|
@@ -573,8 +573,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
573
573
|
componentType: "Radio";
|
|
574
574
|
options: {
|
|
575
575
|
value: string;
|
|
576
|
-
label: import("../../type-source").LabelType
|
|
577
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
576
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
577
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
578
578
|
}[];
|
|
579
579
|
response: {
|
|
580
580
|
name: string;
|
|
@@ -635,8 +635,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
635
635
|
componentType: "Dropdown";
|
|
636
636
|
options: {
|
|
637
637
|
value: string;
|
|
638
|
-
label: import("../../type-source").LabelType
|
|
639
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
638
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
639
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
640
640
|
}[];
|
|
641
641
|
response: {
|
|
642
642
|
name: string;
|
|
@@ -736,6 +736,11 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
736
736
|
response: {
|
|
737
737
|
name: string;
|
|
738
738
|
};
|
|
739
|
+
arbitrary?: {
|
|
740
|
+
response: {
|
|
741
|
+
name: string;
|
|
742
|
+
};
|
|
743
|
+
} | undefined;
|
|
739
744
|
optionResponses: {
|
|
740
745
|
name: string;
|
|
741
746
|
attribute: string;
|
|
@@ -805,8 +810,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
805
810
|
} | undefined;
|
|
806
811
|
options: {
|
|
807
812
|
value: string;
|
|
808
|
-
label: import("../../type-source").LabelType
|
|
809
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
813
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
814
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
810
815
|
}[];
|
|
811
816
|
} & import("./fill-management").FilledProps & import("./fill-component-value").FilledProps & import("./fill-missing-response").FilledProps & import("./fill-from-state").FilledProps & import("./fill-pagination").FilledProps & {
|
|
812
817
|
conditionFilter?: boolean | undefined;
|
|
@@ -865,15 +870,51 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
865
870
|
componentType: "Table";
|
|
866
871
|
header: {
|
|
867
872
|
value: string;
|
|
868
|
-
label: string | import("../../type-source").LabelType
|
|
873
|
+
label: string | import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
869
874
|
options: {
|
|
870
875
|
value: string;
|
|
871
|
-
label: import("../../type-source").LabelType
|
|
872
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
876
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
877
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
873
878
|
}[];
|
|
874
879
|
colspan?: number | undefined;
|
|
875
880
|
rowspan?: number | undefined;
|
|
876
881
|
}[] | undefined;
|
|
882
|
+
} | {
|
|
883
|
+
label: import("react").ReactNode;
|
|
884
|
+
description?: import("react").ReactNode;
|
|
885
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
886
|
+
conditionFilter?: import("react").ReactNode;
|
|
887
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
888
|
+
id: string;
|
|
889
|
+
bindingDependencies?: string[] | undefined;
|
|
890
|
+
hierarchy?: {
|
|
891
|
+
sequence: {
|
|
892
|
+
label: import("react").ReactNode;
|
|
893
|
+
id: string;
|
|
894
|
+
page: string;
|
|
895
|
+
};
|
|
896
|
+
subSequence?: {
|
|
897
|
+
label: import("react").ReactNode;
|
|
898
|
+
id: string;
|
|
899
|
+
page: string;
|
|
900
|
+
} | undefined;
|
|
901
|
+
} | undefined;
|
|
902
|
+
mandatory?: boolean | undefined;
|
|
903
|
+
page: string;
|
|
904
|
+
componentType: "Suggester";
|
|
905
|
+
storeName: string;
|
|
906
|
+
response: {
|
|
907
|
+
name: string;
|
|
908
|
+
};
|
|
909
|
+
arbitrary?: {
|
|
910
|
+
response: {
|
|
911
|
+
name: string;
|
|
912
|
+
};
|
|
913
|
+
} | undefined;
|
|
914
|
+
optionResponses: {
|
|
915
|
+
name: string;
|
|
916
|
+
attribute: string;
|
|
917
|
+
}[];
|
|
877
918
|
} | {
|
|
878
919
|
label: import("react").ReactNode;
|
|
879
920
|
description?: import("react").ReactNode;
|
|
@@ -1031,8 +1072,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
1031
1072
|
page: string;
|
|
1032
1073
|
componentType: "CheckboxGroup";
|
|
1033
1074
|
responses: {
|
|
1034
|
-
label: import("../../type-source").LabelType
|
|
1035
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
1075
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
1076
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
1036
1077
|
response: import("../../type-source").ResponseType;
|
|
1037
1078
|
id: string;
|
|
1038
1079
|
}[];
|
|
@@ -1090,8 +1131,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
1090
1131
|
componentType: "Radio";
|
|
1091
1132
|
options: {
|
|
1092
1133
|
value: string;
|
|
1093
|
-
label: import("../../type-source").LabelType
|
|
1094
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
1134
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
1135
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
1095
1136
|
}[];
|
|
1096
1137
|
response: {
|
|
1097
1138
|
name: string;
|
|
@@ -1148,8 +1189,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
1148
1189
|
componentType: "Dropdown";
|
|
1149
1190
|
options: {
|
|
1150
1191
|
value: string;
|
|
1151
|
-
label: import("../../type-source").LabelType
|
|
1152
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
1192
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
1193
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
1153
1194
|
}[];
|
|
1154
1195
|
response: {
|
|
1155
1196
|
name: string;
|
|
@@ -1157,37 +1198,6 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
1157
1198
|
missingResponse?: {
|
|
1158
1199
|
name: string;
|
|
1159
1200
|
} | undefined;
|
|
1160
|
-
} | {
|
|
1161
|
-
label: import("react").ReactNode;
|
|
1162
|
-
description?: import("react").ReactNode;
|
|
1163
|
-
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
1164
|
-
conditionFilter?: import("react").ReactNode;
|
|
1165
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
1166
|
-
id: string;
|
|
1167
|
-
bindingDependencies?: string[] | undefined;
|
|
1168
|
-
hierarchy?: {
|
|
1169
|
-
sequence: {
|
|
1170
|
-
label: import("react").ReactNode;
|
|
1171
|
-
id: string;
|
|
1172
|
-
page: string;
|
|
1173
|
-
};
|
|
1174
|
-
subSequence?: {
|
|
1175
|
-
label: import("react").ReactNode;
|
|
1176
|
-
id: string;
|
|
1177
|
-
page: string;
|
|
1178
|
-
} | undefined;
|
|
1179
|
-
} | undefined;
|
|
1180
|
-
mandatory?: boolean | undefined;
|
|
1181
|
-
page: string;
|
|
1182
|
-
componentType: "Suggester";
|
|
1183
|
-
storeName: string;
|
|
1184
|
-
response: {
|
|
1185
|
-
name: string;
|
|
1186
|
-
};
|
|
1187
|
-
optionResponses: {
|
|
1188
|
-
name: string;
|
|
1189
|
-
attribute: string;
|
|
1190
|
-
}[];
|
|
1191
1201
|
} | {
|
|
1192
1202
|
label: import("react").ReactNode;
|
|
1193
1203
|
description?: import("react").ReactNode;
|
|
@@ -1249,8 +1259,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
1249
1259
|
} | undefined;
|
|
1250
1260
|
options: {
|
|
1251
1261
|
value: string;
|
|
1252
|
-
label: import("../../type-source").LabelType
|
|
1253
|
-
description?: import("../../type-source").LabelType | undefined;
|
|
1262
|
+
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
1263
|
+
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
1254
1264
|
}[];
|
|
1255
1265
|
};
|
|
1256
1266
|
export default fillSpecificExpressions;
|
|
@@ -109,6 +109,20 @@ function fillTable(component, state) {
|
|
|
109
109
|
})),
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* For suggester, inject the arbitrary value if necessary
|
|
114
|
+
*/
|
|
115
|
+
function fillSuggester(component, state) {
|
|
116
|
+
if (!component.arbitrary) {
|
|
117
|
+
return component;
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
...component,
|
|
121
|
+
arbitraryValue: state.executeExpression(component.arbitrary.response.name, {
|
|
122
|
+
iteration: state.pager.iteration,
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
112
126
|
/**
|
|
113
127
|
* Fill component specific props (RoundAbout for instance)
|
|
114
128
|
*/
|
|
@@ -125,6 +139,8 @@ function fillSpecificExpressions(component, state) {
|
|
|
125
139
|
return fillPairwise(component, state);
|
|
126
140
|
case 'Table':
|
|
127
141
|
return fillTable(component, state);
|
|
142
|
+
case 'Suggester':
|
|
143
|
+
return fillSuggester(component, state);
|
|
128
144
|
default:
|
|
129
145
|
return component;
|
|
130
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-specific-expression.js","sourceRoot":"","sources":["../../../../../src/use-lunatic/commons/fill-components/fill-specific-expression.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,MAAM,8BAA8B,CAAC;AAC5E,OAAO,cAAc,EAAE,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,SAAS,mBAAmB,CAC3B,SAA4E,EAC5E,KAA8C;IAE9C,MAAM,UAAU,GAAG,SAAS,CAAC,UAAoB,CAAC,CAAC,sEAAsE;IACzH,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,UAC7D,MAAM,EACN,CAAC,IAAI,EAAE,UAAU,CAAC;QAElB,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG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AAED,eAAe,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"fill-specific-expression.js","sourceRoot":"","sources":["../../../../../src/use-lunatic/commons/fill-components/fill-specific-expression.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,MAAM,8BAA8B,CAAC;AAC5E,OAAO,cAAc,EAAE,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,SAAS,mBAAmB,CAC3B,SAA4E,EAC5E,KAA8C;IAE9C,MAAM,UAAU,GAAG,SAAS,CAAC,UAAoB,CAAC,CAAC,sEAAsE;IACzH,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,UAC7D,MAAM,EACN,CAAC,IAAI,EAAE,UAAU,CAAC;QAElB,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE;YACpE,OAAO,KAAK,CAAC,iBAAiB,CAAC,UAAU,EAAE;gBAC1C,SAAS;aACT,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IACtC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,EAAE,GAAG,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC3B,SAA0E,EAC1E,KAAmB;IAEnB,OAAO;QACN,GAAG,SAAS;QACZ,UAAU,EAAE,cAAc,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC;KACvD,CAAC;AACH,CAAC;AAED;;G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15
15
|
paginatedLoop: true;
|
|
16
16
|
maxPage: string;
|
|
17
|
-
iterations: import("./type-source").LabelType
|
|
17
|
+
iterations: import("./type-source").LabelType<"VTL" | "VTL|MD">;
|
|
18
18
|
}) | (import("./type-source").ComponentTypeBase & {
|
|
19
19
|
componentType: "Loop";
|
|
20
20
|
loopDependencies: string[];
|
|
@@ -23,7 +23,7 @@ export declare function replaceComponentSequence(components: Array<LunaticCompon
|
|
|
23
23
|
} & {
|
|
24
24
|
paginatedLoop: false;
|
|
25
25
|
lines: {
|
|
26
|
-
min: import("./type-source").LabelType
|
|
27
|
-
max: import("./type-source").LabelType
|
|
26
|
+
min: import("./type-source").LabelType<"VTL" | "VTL|MD">;
|
|
27
|
+
max: import("./type-source").LabelType<"VTL" | "VTL|MD">;
|
|
28
28
|
};
|
|
29
29
|
}) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentTableType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentNumberType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDatePickerType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDurationType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxGroupType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxBooleanType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRadioType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentFilterDescriptionType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDropdownType) | (Omit<import("./type-source").ComponentTypeBase, "label"> & import("./type-source").ComponentPairWiseLinksType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRoundaboutType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentSuggesterType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentInputOrTextareaType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxOneType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentQuestionType))[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types used for source data (lunatic models and data.json)
|
|
3
3
|
*/
|
|
4
|
-
export type LabelType = {
|
|
4
|
+
export type LabelType<T extends 'VTL' | 'VTL|MD' = 'VTL' | 'VTL|MD'> = {
|
|
5
5
|
value: string;
|
|
6
|
-
type:
|
|
6
|
+
type: T;
|
|
7
7
|
};
|
|
8
8
|
export type ValuesType<T = unknown> = {
|
|
9
9
|
PREVIOUS: T | null;
|
|
@@ -210,6 +210,11 @@ export type ComponentSuggesterType = {
|
|
|
210
210
|
componentType: 'Suggester';
|
|
211
211
|
storeName: string;
|
|
212
212
|
response: ResponseType;
|
|
213
|
+
arbitrary?: {
|
|
214
|
+
response: {
|
|
215
|
+
name: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
213
218
|
optionResponses: {
|
|
214
219
|
name: string;
|
|
215
220
|
attribute: string;
|
|
@@ -252,6 +252,13 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
|
|
|
252
252
|
name: string;
|
|
253
253
|
attribute: string;
|
|
254
254
|
}[] | undefined;
|
|
255
|
+
arbitrary: {
|
|
256
|
+
response: {
|
|
257
|
+
name: string;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
arbitraryValue?: string | undefined;
|
|
261
|
+
allowArbitrary?: boolean | undefined;
|
|
255
262
|
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
256
263
|
iteration?: number | number[] | undefined;
|
|
257
264
|
bindingDependencies?: string[] | undefined;
|
|
@@ -494,6 +501,13 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
|
|
|
494
501
|
name: string;
|
|
495
502
|
attribute: string;
|
|
496
503
|
}[] | undefined;
|
|
504
|
+
arbitrary: {
|
|
505
|
+
response: {
|
|
506
|
+
name: string;
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
arbitraryValue?: string | undefined;
|
|
510
|
+
allowArbitrary?: boolean | undefined;
|
|
497
511
|
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
498
512
|
iteration?: number | number[] | undefined;
|
|
499
513
|
bindingDependencies?: string[] | undefined;
|
|
@@ -2,3 +2,4 @@
|
|
|
2
2
|
* Global void function to use as default parameters
|
|
3
3
|
*/
|
|
4
4
|
export declare const voidFunction: () => void;
|
|
5
|
+
export declare function debounce<A extends unknown[], R = void>(fn: (...args: A) => R, ms: number): [(...args: A) => Promise<R extends Promise<infer RR> ? RR : R>, () => void];
|
|
@@ -2,4 +2,22 @@
|
|
|
2
2
|
* Global void function to use as default parameters
|
|
3
3
|
*/
|
|
4
4
|
export const voidFunction = () => { };
|
|
5
|
+
export function debounce(fn, ms) {
|
|
6
|
+
let timer;
|
|
7
|
+
const debouncedFunc = (...args) => new Promise((resolve, reject) => {
|
|
8
|
+
if (timer) {
|
|
9
|
+
clearTimeout(timer);
|
|
10
|
+
}
|
|
11
|
+
timer = window.setTimeout(async () => {
|
|
12
|
+
try {
|
|
13
|
+
resolve((await fn(...args)));
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}, ms);
|
|
19
|
+
});
|
|
20
|
+
const teardown = () => clearTimeout(timer);
|
|
21
|
+
return [debouncedFunc, teardown];
|
|
22
|
+
}
|
|
5
23
|
//# sourceMappingURL=function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/utils/function.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/utils/function.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAErC,MAAM,UAAU,QAAQ,CACvB,EAAqB,EACrB,EAAU;IAEV,IAAI,KAAa,CAAC;IAElB,MAAM,aAAa,GAAG,CACrB,GAAG,IAAO,EACsC,EAAE,CAClD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC/B,IAAI,KAAK,EAAE,CAAC;YACX,YAAY,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE;YACpC,IAAI,CAAC;gBACJ,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAQ,CAAC,CAAC;YACrC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,MAAM,CAAC,CAAC,CAAC,CAAC;YACX,CAAC;QACF,CAAC,EAAE,EAAE,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;IAEJ,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAE3C,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.14",
|
|
4
4
|
"workersVersion": "0.3.0",
|
|
5
5
|
"description": "Library of questionnaire components",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test:e2e:codegen": "playwright codegen http://localhost:9999/iframe.html?viewMode=story&id=",
|
|
47
47
|
"test:storybook": "test-storybook --url http://localhost:9999 --maxWorkers=4 --no-cache",
|
|
48
48
|
"test-watch": "vitest",
|
|
49
|
-
"check": "tsc",
|
|
49
|
+
"check": "tsc --noEmit",
|
|
50
50
|
"lint": "eslint ./src",
|
|
51
51
|
"lint:check": "eslint . --ext .ts,.tsx",
|
|
52
52
|
"_format": "prettier **/*.{ts,tsx,json}",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"build-workers": "node ./scripts/build/build-workers.js",
|
|
57
57
|
"prepare-workers": "npm run build-workers && node ./scripts/build/add-workers-to-public.js",
|
|
58
58
|
"postinstall": "node ./scripts/build/add-workers-to-public.js",
|
|
59
|
-
"build": "tsc
|
|
59
|
+
"build": "tsc && sass ./src/css/main.scss ./lib/main.css && cp -R ./src/css/icons ./lib/icons && npm run build-workers",
|
|
60
60
|
"storybook": "npm run prepare-workers && storybook dev -p 9999 --no-open",
|
|
61
61
|
"build-storybook": "npm run prepare-workers && storybook build"
|
|
62
62
|
},
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
-
import { SuggesterStatus as SuggesterStatusEnum } from '../../use-lunatic/use-suggesters';
|
|
3
|
-
export declare const STATUS: {
|
|
4
|
-
unused: number;
|
|
5
|
-
idle: number;
|
|
6
|
-
pending: number;
|
|
7
|
-
success: number;
|
|
8
|
-
unknown: number;
|
|
9
|
-
error: number;
|
|
10
|
-
};
|
|
11
|
-
type Props = PropsWithChildren<{
|
|
12
|
-
getSuggesterStatus: (s: string) => {
|
|
13
|
-
status: SuggesterStatusEnum;
|
|
14
|
-
};
|
|
15
|
-
storeName: string;
|
|
16
|
-
label?: ReactNode;
|
|
17
|
-
description?: ReactNode;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Check the status of suggester status and shows a warning / error
|
|
21
|
-
*/
|
|
22
|
-
export declare function SuggesterStatus({ children, storeName, getSuggesterStatus, label, description, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {} from 'react';
|
|
3
|
-
import { SuggesterStatus as SuggesterStatusEnum } from '../../use-lunatic/use-suggesters';
|
|
4
|
-
import { Label } from '../shared/Label/Label';
|
|
5
|
-
import { SuggesterNotification } from './SuggesterNotification';
|
|
6
|
-
export const STATUS = {
|
|
7
|
-
unused: 0,
|
|
8
|
-
idle: 1,
|
|
9
|
-
pending: 2,
|
|
10
|
-
success: 3,
|
|
11
|
-
unknown: 4,
|
|
12
|
-
error: 5,
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Check the status of suggester status and shows a warning / error
|
|
16
|
-
*/
|
|
17
|
-
export function SuggesterStatus({ children, storeName, getSuggesterStatus, label, description, }) {
|
|
18
|
-
const { status } = getSuggesterStatus(storeName);
|
|
19
|
-
if (status === SuggesterStatusEnum.unused) {
|
|
20
|
-
return (_jsxs(_Fragment, { children: [_jsx(Label, { description: description, children: label }), children] }));
|
|
21
|
-
}
|
|
22
|
-
return (_jsx(SuggesterNotification, { status: status, storeName: storeName, label: label, description: description, children: children }));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=SuggesterStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuggesterStatus.js","sourceRoot":"","sources":["../../../../src/components/Suggester/SuggesterStatus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACR,CAAC;AASF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,WAAW,GACJ;IACP,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAEjD,IAAI,MAAM,KAAK,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC3C,OAAO,CACN,8BACC,KAAC,KAAK,IAAC,WAAW,EAAE,WAAW,YAAG,KAAK,GAAS,EAC/C,QAAQ,IACP,CACH,CAAC;IACH,CAAC;IACD,OAAO,CACN,KAAC,qBAAqB,IACrB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,YAEvB,QAAQ,GACc,CACxB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-ref-sync.js","sourceRoot":"","sources":["../../../src/hooks/use-ref-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,UAAU,CAAI,KAAQ;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACpB,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
File without changes
|