@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.
- package/components/CheckboxOne/CheckboxOne.spec.js +3 -2
- package/components/CheckboxOne/CheckboxOne.spec.js.map +1 -1
- package/components/shared/Combobox/Combobox.stories.d.ts +3 -2
- package/components/shared/Combobox/Combobox.stories.js +26 -21
- package/components/shared/Combobox/Combobox.stories.js.map +1 -1
- package/components/type.d.ts +3 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.js +3 -2
- package/esm/components/CheckboxOne/CheckboxOne.spec.js.map +1 -1
- package/esm/components/shared/Combobox/Combobox.stories.d.ts +3 -2
- package/esm/components/shared/Combobox/Combobox.stories.js +28 -24
- package/esm/components/shared/Combobox/Combobox.stories.js.map +1 -1
- package/esm/components/type.d.ts +3 -0
- package/esm/hooks/useLocalStorage.d.ts +1 -0
- package/esm/hooks/useLocalStorage.js +31 -0
- package/esm/hooks/useLocalStorage.js.map +1 -0
- package/esm/type.source.d.ts +6 -0
- package/esm/use-lunatic/commons/compile-controls.js +22 -14
- package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js +4 -1
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/esm/use-lunatic/hooks/use-page-has-response.js +1 -1
- package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/esm/use-lunatic/hooks/useOverview.spec.js +2 -2
- package/esm/use-lunatic/hooks/useOverview.spec.js.map +1 -1
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +3 -0
- package/esm/utils/number.d.ts +4 -0
- package/esm/utils/number.js +12 -0
- package/esm/utils/number.js.map +1 -1
- package/esm/utils/object.d.ts +10 -0
- package/esm/utils/object.js +26 -0
- package/esm/utils/object.js.map +1 -1
- package/hooks/useLocalStorage.d.ts +1 -0
- package/hooks/useLocalStorage.js +34 -0
- package/hooks/useLocalStorage.js.map +1 -0
- package/package.json +76 -137
- package/src/components/CheckboxOne/CheckboxOne.spec.tsx +3 -0
- package/src/components/shared/Combobox/Combobox.stories.tsx +48 -49
- package/src/components/type.ts +1 -0
- package/src/hooks/useLocalStorage.ts +37 -0
- package/src/json.d.ts +16 -0
- package/src/stories/accordion/accordion.stories.tsx +21 -0
- package/src/stories/behaviour/cleaning/cleaning.stories.tsx +40 -0
- package/src/stories/behaviour/controls/controls.stories.tsx +51 -0
- package/src/stories/behaviour/disabled/disabled.stories.tsx +29 -0
- package/src/stories/behaviour/filter/filter.stories.tsx +34 -0
- package/src/stories/behaviour/missing/missing.stories.tsx +31 -0
- package/src/stories/behaviour/overview/overview.stories.tsx +61 -0
- package/src/stories/{overview/sourceWithHierarchy.json → behaviour/overview/source.json} +1 -1
- package/src/stories/{overview → behaviour/overview}/sourceLoop.json +1 -1
- package/src/stories/behaviour/performance/performance.stories.tsx +29 -0
- package/src/stories/behaviour/resizing/resizing.stories.tsx +34 -0
- package/src/stories/behaviour/slots.stories.tsx +34 -0
- package/src/stories/checkbox/checkbox.stories.tsx +75 -0
- package/src/stories/{checkbox-group/sourceLoop.json → checkbox/sourceGroupLoop.json} +1 -1
- package/src/stories/datepicker/datepicker.stories.tsx +21 -0
- package/src/stories/declaration/declaration.stories.tsx +27 -0
- package/src/stories/dropdown/dropdown.stories.tsx +27 -0
- package/src/stories/duration/duration.stories.tsx +27 -0
- package/src/stories/filter-description/filter-description.stories.tsx +28 -0
- package/src/stories/input/input.stories.tsx +21 -0
- package/src/stories/input-number/input-number.stories.tsx +35 -0
- package/src/stories/loop/loop.stories.tsx +35 -0
- package/src/stories/loop/roster-for-loop.stories.tsx +59 -0
- package/src/stories/pairwise/pairwise.stories.tsx +30 -0
- package/src/stories/paste.stories.tsx +85 -0
- package/src/stories/question/question.stories.tsx +21 -0
- package/src/stories/questionnaires/logement/logement.stories.tsx +26 -0
- package/src/stories/questionnaires/recensement/recensement.stories.tsx +28 -0
- package/src/stories/questionnaires/rp/rp.stories.tsx +21 -0
- package/src/stories/questionnaires/simpsons/simpsons.stories.tsx +31 -0
- package/src/stories/radio/radio.stories.tsx +53 -0
- package/src/stories/roundabout/roundabout.stories.tsx +37 -0
- package/src/stories/roundabout/source.json +1 -0
- package/src/stories/sequence/sequence.stories.tsx +28 -0
- package/src/stories/suggester/source-option-responses.json +1 -1
- package/src/stories/suggester/suggester.stories.tsx +68 -0
- package/src/stories/summary/source.json +22 -1
- package/src/stories/summary/summary.stories.tsx +31 -0
- package/src/stories/table/table.stories.tsx +35 -0
- package/src/stories/text/text.stories.tsx +38 -0
- package/src/stories/textarea/textarea.stories.tsx +21 -0
- package/src/stories/utils/Orchestrator.tsx +310 -0
- package/src/stories/utils/OrchestratorData.tsx +176 -0
- package/src/stories/utils/OrchestratorOverview.tsx +70 -0
- package/src/stories/utils/OrchestratorSidebar.tsx +119 -0
- package/src/stories/utils/SchemaValidator.tsx +29 -0
- package/src/stories/utils/referentiel.ts +9 -0
- package/src/type.source.ts +6 -0
- package/src/use-lunatic/commons/compile-controls.ts +36 -18
- package/src/use-lunatic/commons/fill-components/fill-component-expressions.ts +4 -1
- package/src/use-lunatic/hooks/use-page-has-response.ts +1 -1
- package/src/use-lunatic/hooks/useOverview.spec.ts +3 -2
- package/src/use-lunatic/use-lunatic.test.ts +53 -40
- package/src/utils/number.ts +13 -0
- package/src/utils/object.ts +40 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +6 -0
- package/use-lunatic/commons/compile-controls.js +21 -13
- package/use-lunatic/commons/compile-controls.js.map +1 -1
- package/use-lunatic/commons/fill-components/fill-component-expressions.js +5 -2
- package/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/use-lunatic/hooks/use-page-has-response.js +2 -2
- package/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/use-lunatic/hooks/useOverview.spec.js +8 -8
- package/use-lunatic/hooks/useOverview.spec.js.map +1 -1
- package/use-lunatic/props/getComponentTypeProps.d.ts +3 -0
- package/utils/number.d.ts +4 -0
- package/utils/number.js +13 -0
- package/utils/number.js.map +1 -1
- package/utils/object.d.ts +10 -0
- package/utils/object.js +30 -0
- package/utils/object.js.map +1 -1
- package/esm/stories/overview/sourceWithHierarchy.json +0 -5151
- package/esm/tests/utils/lunatic.d.ts +0 -15
- package/esm/tests/utils/lunatic.js +0 -27
- package/esm/tests/utils/lunatic.js.map +0 -1
- package/esm/use-lunatic/replace-component-sequence.d.ts +0 -36
- package/esm/use-lunatic/replace-component-sequence.js +0 -19
- package/esm/use-lunatic/replace-component-sequence.js.map +0 -1
- package/esm/use-lunatic/test.utils.d.ts +0 -2
- package/esm/use-lunatic/test.utils.js +0 -13
- package/esm/use-lunatic/test.utils.js.map +0 -1
- package/esm/utils/is-object.d.ts +0 -4
- package/esm/utils/is-object.js +0 -7
- package/esm/utils/is-object.js.map +0 -1
- package/esm/utils/to-number.d.ts +0 -4
- package/esm/utils/to-number.js +0 -13
- package/esm/utils/to-number.js.map +0 -1
- package/src/stories/accordion/accordion.stories.jsx +0 -17
- package/src/stories/behaviour/cleaning/cleaning.stories.jsx +0 -69
- package/src/stories/behaviour/controls/controls.stories.jsx +0 -81
- package/src/stories/behaviour/filter/dataLoop.json +0 -14
- package/src/stories/behaviour/filter/filter.stories.jsx +0 -36
- package/src/stories/behaviour/missing/missing.stories.jsx +0 -69
- package/src/stories/behaviour/others/V2_DeclarationsSimples.json +0 -908
- package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +0 -489
- package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +0 -3919
- package/src/stories/behaviour/others/V2_TCMRallyeGames.json +0 -2760
- package/src/stories/behaviour/others/test-dylan.json +0 -538
- package/src/stories/behaviour/others/test.stories.jsx +0 -78
- package/src/stories/behaviour/paste/source.json +0 -32
- package/src/stories/behaviour/paste/test.stories.jsx +0 -62
- package/src/stories/behaviour/performance/performance.stories.jsx +0 -26
- package/src/stories/behaviour/resizing/resizing.stories.jsx +0 -60
- package/src/stories/behaviour/slots.stories.jsx +0 -32
- package/src/stories/checkbox-boolean/checkboxBoolean.stories.jsx +0 -17
- package/src/stories/checkbox-group/checkbox-group.stories.jsx +0 -77
- package/src/stories/checkbox-one/checkboxOne.stories.jsx +0 -53
- package/src/stories/date-picker/data.json +0 -3
- package/src/stories/date-picker/datepicker.stories.jsx +0 -26
- package/src/stories/declaration/data.json +0 -1
- package/src/stories/declaration/input.stories.jsx +0 -18
- package/src/stories/disabled/data.json +0 -16
- package/src/stories/disabled/disabled.stories.jsx +0 -18
- package/src/stories/dropdown/data.json +0 -8
- package/src/stories/dropdown/dropdown.stories.jsx +0 -25
- package/src/stories/duration/duration.stories.jsx +0 -25
- package/src/stories/filter-description/filter-description.stories.jsx +0 -37
- package/src/stories/input/data.json +0 -1
- package/src/stories/input/input.stories.jsx +0 -18
- package/src/stories/input-number/input-number.stories.jsx +0 -23
- package/src/stories/loop/loop.stories.jsx +0 -29
- package/src/stories/loop/roster-for-loop.stories.jsx +0 -46
- package/src/stories/markdown/markdown.stories.jsx +0 -20
- package/src/stories/overview/data.json +0 -1
- package/src/stories/overview/dataLoop.json +0 -93
- package/src/stories/overview/overview.stories.jsx +0 -44
- package/src/stories/overview/source.json +0 -25
- package/src/stories/pairwise/data.json +0 -12
- package/src/stories/pairwise/pairwise-links.stories.jsx +0 -48
- package/src/stories/question/question.stories.jsx +0 -16
- package/src/stories/questionnaires/logement/logement.stories.jsx +0 -59
- package/src/stories/questionnaires/recensement/data.json +0 -12
- package/src/stories/questionnaires/recensement/recensement.stories.jsx +0 -35
- package/src/stories/questionnaires/rp/data.json +0 -5
- package/src/stories/questionnaires/rp/rp.stories.jsx +0 -23
- package/src/stories/questionnaires/simpsons/simpsons.stories.jsx +0 -246
- package/src/stories/radio/radio.stories.jsx +0 -78
- package/src/stories/roundabout/data1.json +0 -13
- package/src/stories/roundabout/data2.json +0 -16
- package/src/stories/roundabout/roundabout.stories.jsx +0 -32
- package/src/stories/sequence/sequence.stories.jsx +0 -29
- package/src/stories/suggester/suggester.stories.jsx +0 -71
- package/src/stories/summary/data.json +0 -16
- package/src/stories/summary/summary.stories.jsx +0 -23
- package/src/stories/switch/README.md +0 -29
- package/src/stories/switch/data-forced.json +0 -40
- package/src/stories/switch/source.json +0 -64
- package/src/stories/switch/switch.stories.jsx +0 -17
- package/src/stories/table/data.json +0 -1
- package/src/stories/table/table.stories.jsx +0 -30
- package/src/stories/text/data-roster.json +0 -5
- package/src/stories/text/text.stories.jsx +0 -20
- package/src/stories/textarea/data.json +0 -1
- package/src/stories/textarea/textarea.stories.jsx +0 -18
- package/src/stories/utils/SchemaValidator.jsx +0 -40
- package/src/stories/utils/default-arg-types.js +0 -39
- package/src/stories/utils/default-args.js +0 -3
- package/src/stories/utils/options.js +0 -19
- package/src/stories/utils/orchestrator.jsx +0 -267
- package/src/stories/utils/orchestrator.scss +0 -66
- package/src/stories/utils/overview.jsx +0 -39
- package/src/stories/utils/overview.scss +0 -37
- package/src/stories/utils/referentiel.js +0 -7
- package/src/tests/utils/e2e.js +0 -91
- package/src/tests/utils/lunatic.ts +0 -33
- package/src/use-lunatic/replace-component-sequence.ts +0 -25
- package/src/use-lunatic/test.utils.ts +0 -17
- package/src/utils/is-object.ts +0 -6
- package/src/utils/to-number.ts +0 -12
- package/stories/overview/sourceWithHierarchy.json +0 -5151
- package/tests/utils/lunatic.d.ts +0 -15
- package/tests/utils/lunatic.js +0 -31
- package/tests/utils/lunatic.js.map +0 -1
- package/use-lunatic/replace-component-sequence.d.ts +0 -36
- package/use-lunatic/replace-component-sequence.js +0 -22
- package/use-lunatic/replace-component-sequence.js.map +0 -1
- package/use-lunatic/test.utils.d.ts +0 -2
- package/use-lunatic/test.utils.js +0 -17
- package/use-lunatic/test.utils.js.map +0 -1
- package/utils/is-object.d.ts +0 -4
- package/utils/is-object.js +0 -10
- package/utils/is-object.js.map +0 -1
- package/utils/to-number.d.ts +0 -4
- package/utils/to-number.js +0 -16
- package/utils/to-number.js.map +0 -1
- /package/src/stories/behaviour/cleaning/{loop.json → source-loop-scopes.json} +0 -0
- /package/src/stories/behaviour/controls/{boucles-n.json → source-boucles-n.json} +0 -0
- /package/src/stories/behaviour/controls/{loop.json → source-loop.json} +0 -0
- /package/src/stories/behaviour/controls/{roundabout.json → source-roundabout.json} +0 -0
- /package/src/stories/behaviour/controls/{simple-numeric.json → source-simple-numeric.json} +0 -0
- /package/src/stories/behaviour/controls/{simple.json → source-simple.json} +0 -0
- /package/src/stories/{disabled → behaviour/disabled}/source.json +0 -0
- /package/src/stories/{checkbox-boolean → checkbox}/source.json +0 -0
- /package/src/stories/{checkbox-group/source.json → checkbox/sourceGroup.json} +0 -0
- /package/src/stories/{checkbox-group/sourceCondition.json → checkbox/sourceGroupCondition.json} +0 -0
- /package/src/stories/{checkbox-group/sourceDetail.json → checkbox/sourceGroupDetail.json} +0 -0
- /package/src/stories/{checkbox-one/source.json → checkbox/sourceOne.json} +0 -0
- /package/src/stories/{checkbox-one/sourceDetail.json → checkbox/sourceOneDetail.json} +0 -0
- /package/src/stories/{date-picker → datepicker}/source.json +0 -0
- /package/src/stories/{markdown/source.json → declaration/sourceMarkdown.json} +0 -0
- /package/src/stories/duration/{mois.json → sourceMonths.json} +0 -0
- /package/src/stories/duration/{time.json → sourceTime.json} +0 -0
- /package/src/stories/filter-description/{source-options.json → sourceOptions.json} +0 -0
- /package/src/stories/table/{table-dynamique.json → source-dynamic.json} +0 -0
package/esm/utils/object.js
CHANGED
|
@@ -12,6 +12,14 @@ export function objectMap(object, callback) {
|
|
|
12
12
|
return acc;
|
|
13
13
|
}, {});
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Filter items from an object
|
|
17
|
+
*/
|
|
18
|
+
export function objectFilter(object, callback) {
|
|
19
|
+
return Object.fromEntries(Object.entries(object).filter(([k, v]) => {
|
|
20
|
+
return callback(k, v);
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
15
23
|
// Adds the possibility of preserving the original type of the object's keys.
|
|
16
24
|
// The native function produces an array of strings. (Object.keys)
|
|
17
25
|
export function objectKeys(object) {
|
|
@@ -24,4 +32,22 @@ export function mergeDefault(obj, defaults) {
|
|
|
24
32
|
return [k, (_a = obj[k]) !== null && _a !== void 0 ? _a : defaults[k]];
|
|
25
33
|
});
|
|
26
34
|
}
|
|
35
|
+
export const dataFromObject = (o) => {
|
|
36
|
+
return {
|
|
37
|
+
EXTERNAL: {},
|
|
38
|
+
COLLECTED: Object.keys(o).reduce((acc, k) => ({
|
|
39
|
+
...acc,
|
|
40
|
+
[k]: {
|
|
41
|
+
COLLECTED: o[k],
|
|
42
|
+
},
|
|
43
|
+
}), {}),
|
|
44
|
+
CALCULATED: {},
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* isObject function with type narrowing
|
|
49
|
+
*/
|
|
50
|
+
export function isObject(v) {
|
|
51
|
+
return typeof v === 'object' && v !== null;
|
|
52
|
+
}
|
|
27
53
|
//# sourceMappingURL=object.js.map
|
package/esm/utils/object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,SAAS,CACxB,MAAS,EACT,QAAkE;IAElE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CACnC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC;QAC5B,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACjB,OAAO,GAAG,CAAC;IACZ,CAAC,EACD,EAAwB,CACxB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAS,EACT,QAAgD;IAEhD,OAAO,MAAM,CAAC,WAAW,CACxB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACxC,OAAO,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CACG,CAAC;AACR,CAAC;AAED,6EAA6E;AAC7E,kEAAkE;AAClE,MAAM,UAAU,UAAU,CAAoC,MAAS;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAgB,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,YAAY,CAG1B,GAAM,EAAE,QAAW;IACpB,OAAO,SAAS,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE;;QAC/C,6EAA6E;QAC7E,OAAO,CAAC,CAAC,EAAE,MAAA,GAAG,CAAC,CAAC,CAAC,mCAAI,QAAQ,CAAC,CAAC,CAAC,CAAU,CAAC;IAC5C,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,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;AAEF;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IAClC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLocalStorage<T>(key: string): [T | null, (value: string) => void, string];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLocalStorage = useLocalStorage;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useLocalStorage(key) {
|
|
6
|
+
const [storedValue, setStoredValue] = (0, react_1.useState)(() => {
|
|
7
|
+
try {
|
|
8
|
+
const item = window.localStorage.getItem(key);
|
|
9
|
+
return item ? JSON.parse(item) : null;
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
console.error(`Error reading localStorage key "${key}":`, error);
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const setValue = (0, react_1.useCallback)((value) => {
|
|
17
|
+
try {
|
|
18
|
+
const parsedValue = JSON.parse(value);
|
|
19
|
+
setStoredValue(parsedValue);
|
|
20
|
+
window.localStorage.setItem(key, value);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error(`Error setting localStorage key "${key}":`, error);
|
|
24
|
+
}
|
|
25
|
+
}, [key]);
|
|
26
|
+
const stringValue = (0, react_1.useMemo)(() => {
|
|
27
|
+
if (!storedValue) {
|
|
28
|
+
return '';
|
|
29
|
+
}
|
|
30
|
+
return JSON.stringify(storedValue, null, 2);
|
|
31
|
+
}, [storedValue]);
|
|
32
|
+
return [storedValue, setValue, stringValue];
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocalStorage.js","sourceRoot":"","sources":["../src/hooks/useLocalStorage.ts"],"names":[],"mappings":";;AAEA,0CAkCC;AApCD,iCAAuD;AAEvD,SAAgB,eAAe,CAC9B,GAAW;IAEX,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAW,GAAG,EAAE;QAC7D,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC9C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,mCAAmC,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAC3B,CAAC,KAAa,EAAE,EAAE;QACjB,IAAI,CAAC;YACJ,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtC,cAAc,CAAC,WAAW,CAAC,CAAC;YAC5B,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,mCAAmC,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;QAClE,CAAC;IACF,CAAC,EACD,CAAC,GAAG,CAAC,CACL,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,OAAO,EAAE,CAAC;QACX,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.8",
|
|
4
4
|
"description": "Library of questionnaire components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -222,6 +222,7 @@
|
|
|
222
222
|
"src/hooks/useDocumentEvent.ts",
|
|
223
223
|
"src/hooks/useKeyboardKey.ts",
|
|
224
224
|
"src/hooks/useListKeyboardHandler.ts",
|
|
225
|
+
"src/hooks/useLocalStorage.ts",
|
|
225
226
|
"src/hooks/useRefSync.ts",
|
|
226
227
|
"src/i18n/build-dictionary.ts",
|
|
227
228
|
"src/i18n/dictionary.ts",
|
|
@@ -229,114 +230,91 @@
|
|
|
229
230
|
"src/i18n/inputNumberProps.ts",
|
|
230
231
|
"src/index.ts",
|
|
231
232
|
"src/insee.d.ts",
|
|
232
|
-
"src/
|
|
233
|
+
"src/json.d.ts",
|
|
234
|
+
"src/stories/accordion/accordion.stories.tsx",
|
|
233
235
|
"src/stories/accordion/source.json",
|
|
234
|
-
"src/stories/behaviour/cleaning/cleaning.stories.
|
|
235
|
-
"src/stories/behaviour/cleaning/loop.json",
|
|
236
|
+
"src/stories/behaviour/cleaning/cleaning.stories.tsx",
|
|
237
|
+
"src/stories/behaviour/cleaning/source-loop-scopes.json",
|
|
236
238
|
"src/stories/behaviour/cleaning/source-loop.json",
|
|
237
239
|
"src/stories/behaviour/cleaning/source.json",
|
|
238
|
-
"src/stories/behaviour/controls/
|
|
239
|
-
"src/stories/behaviour/controls/
|
|
240
|
-
"src/stories/behaviour/controls/loop.json",
|
|
241
|
-
"src/stories/behaviour/controls/roundabout.json",
|
|
242
|
-
"src/stories/behaviour/controls/simple-numeric.json",
|
|
243
|
-
"src/stories/behaviour/controls/simple.json",
|
|
244
|
-
"src/stories/behaviour/
|
|
245
|
-
"src/stories/behaviour/
|
|
240
|
+
"src/stories/behaviour/controls/controls.stories.tsx",
|
|
241
|
+
"src/stories/behaviour/controls/source-boucles-n.json",
|
|
242
|
+
"src/stories/behaviour/controls/source-loop.json",
|
|
243
|
+
"src/stories/behaviour/controls/source-roundabout.json",
|
|
244
|
+
"src/stories/behaviour/controls/source-simple-numeric.json",
|
|
245
|
+
"src/stories/behaviour/controls/source-simple.json",
|
|
246
|
+
"src/stories/behaviour/disabled/disabled.stories.tsx",
|
|
247
|
+
"src/stories/behaviour/disabled/source.json",
|
|
248
|
+
"src/stories/behaviour/filter/filter.stories.tsx",
|
|
246
249
|
"src/stories/behaviour/filter/source.json",
|
|
247
250
|
"src/stories/behaviour/filter/sourceLoop.json",
|
|
248
|
-
"src/stories/behaviour/missing/missing.stories.
|
|
251
|
+
"src/stories/behaviour/missing/missing.stories.tsx",
|
|
249
252
|
"src/stories/behaviour/missing/source.json",
|
|
250
|
-
"src/stories/behaviour/
|
|
251
|
-
"src/stories/behaviour/
|
|
252
|
-
"src/stories/behaviour/
|
|
253
|
-
"src/stories/behaviour/
|
|
254
|
-
"src/stories/behaviour/others/test-dylan.json",
|
|
255
|
-
"src/stories/behaviour/others/test.stories.jsx",
|
|
256
|
-
"src/stories/behaviour/paste/source.json",
|
|
257
|
-
"src/stories/behaviour/paste/test.stories.jsx",
|
|
258
|
-
"src/stories/behaviour/performance/performance.stories.jsx",
|
|
253
|
+
"src/stories/behaviour/overview/overview.stories.tsx",
|
|
254
|
+
"src/stories/behaviour/overview/source.json",
|
|
255
|
+
"src/stories/behaviour/overview/sourceLoop.json",
|
|
256
|
+
"src/stories/behaviour/performance/performance.stories.tsx",
|
|
259
257
|
"src/stories/behaviour/performance/source.json",
|
|
260
|
-
"src/stories/behaviour/resizing/resizing.stories.
|
|
258
|
+
"src/stories/behaviour/resizing/resizing.stories.tsx",
|
|
261
259
|
"src/stories/behaviour/resizing/source-resizing-cleaning.json",
|
|
262
260
|
"src/stories/behaviour/resizing/source.json",
|
|
263
|
-
"src/stories/behaviour/slots.stories.
|
|
264
|
-
"src/stories/checkbox
|
|
265
|
-
"src/stories/checkbox
|
|
266
|
-
"src/stories/checkbox
|
|
267
|
-
"src/stories/checkbox
|
|
268
|
-
"src/stories/checkbox
|
|
269
|
-
"src/stories/checkbox
|
|
270
|
-
"src/stories/checkbox
|
|
271
|
-
"src/stories/checkbox
|
|
272
|
-
"src/stories/
|
|
273
|
-
"src/stories/
|
|
274
|
-
"src/stories/
|
|
275
|
-
"src/stories/date-picker/datepicker.stories.jsx",
|
|
276
|
-
"src/stories/date-picker/source.json",
|
|
277
|
-
"src/stories/declaration/data.json",
|
|
278
|
-
"src/stories/declaration/input.stories.jsx",
|
|
261
|
+
"src/stories/behaviour/slots.stories.tsx",
|
|
262
|
+
"src/stories/checkbox/checkbox.stories.tsx",
|
|
263
|
+
"src/stories/checkbox/source.json",
|
|
264
|
+
"src/stories/checkbox/sourceGroup.json",
|
|
265
|
+
"src/stories/checkbox/sourceGroupCondition.json",
|
|
266
|
+
"src/stories/checkbox/sourceGroupDetail.json",
|
|
267
|
+
"src/stories/checkbox/sourceGroupLoop.json",
|
|
268
|
+
"src/stories/checkbox/sourceOne.json",
|
|
269
|
+
"src/stories/checkbox/sourceOneDetail.json",
|
|
270
|
+
"src/stories/datepicker/datepicker.stories.tsx",
|
|
271
|
+
"src/stories/datepicker/source.json",
|
|
272
|
+
"src/stories/declaration/declaration.stories.tsx",
|
|
279
273
|
"src/stories/declaration/source.json",
|
|
280
|
-
"src/stories/
|
|
281
|
-
"src/stories/
|
|
282
|
-
"src/stories/disabled/source.json",
|
|
283
|
-
"src/stories/dropdown/data.json",
|
|
284
|
-
"src/stories/dropdown/dropdown.stories.jsx",
|
|
274
|
+
"src/stories/declaration/sourceMarkdown.json",
|
|
275
|
+
"src/stories/dropdown/dropdown.stories.tsx",
|
|
285
276
|
"src/stories/dropdown/source.json",
|
|
286
|
-
"src/stories/duration/duration.stories.
|
|
287
|
-
"src/stories/duration/
|
|
288
|
-
"src/stories/duration/
|
|
289
|
-
"src/stories/filter-description/filter-description.stories.
|
|
290
|
-
"src/stories/filter-description/source-options.json",
|
|
277
|
+
"src/stories/duration/duration.stories.tsx",
|
|
278
|
+
"src/stories/duration/sourceMonths.json",
|
|
279
|
+
"src/stories/duration/sourceTime.json",
|
|
280
|
+
"src/stories/filter-description/filter-description.stories.tsx",
|
|
291
281
|
"src/stories/filter-description/source.json",
|
|
292
|
-
"src/stories/
|
|
293
|
-
"src/stories/input/input.stories.
|
|
282
|
+
"src/stories/filter-description/sourceOptions.json",
|
|
283
|
+
"src/stories/input/input.stories.tsx",
|
|
294
284
|
"src/stories/input/source.json",
|
|
295
|
-
"src/stories/input-number/input-number.stories.
|
|
285
|
+
"src/stories/input-number/input-number.stories.tsx",
|
|
296
286
|
"src/stories/input-number/source-big-number.json",
|
|
297
287
|
"src/stories/input-number/source-euro.json",
|
|
298
288
|
"src/stories/input-number/source.json",
|
|
299
|
-
"src/stories/loop/loop.stories.
|
|
300
|
-
"src/stories/loop/roster-for-loop.stories.
|
|
289
|
+
"src/stories/loop/loop.stories.tsx",
|
|
290
|
+
"src/stories/loop/roster-for-loop.stories.tsx",
|
|
301
291
|
"src/stories/loop/source-bloc.json",
|
|
302
292
|
"src/stories/loop/source-paginated.json",
|
|
303
293
|
"src/stories/loop/source-roster.json",
|
|
304
|
-
"src/stories/
|
|
305
|
-
"src/stories/markdown/source.json",
|
|
306
|
-
"src/stories/overview/data.json",
|
|
307
|
-
"src/stories/overview/dataLoop.json",
|
|
308
|
-
"src/stories/overview/overview.stories.jsx",
|
|
309
|
-
"src/stories/overview/source.json",
|
|
310
|
-
"src/stories/overview/sourceLoop.json",
|
|
311
|
-
"src/stories/overview/sourceWithHierarchy.json",
|
|
312
|
-
"src/stories/pairwise/data.json",
|
|
313
|
-
"src/stories/pairwise/pairwise-links.stories.jsx",
|
|
294
|
+
"src/stories/pairwise/pairwise.stories.tsx",
|
|
314
295
|
"src/stories/pairwise/source.json",
|
|
315
|
-
"src/stories/
|
|
296
|
+
"src/stories/paste.stories.tsx",
|
|
297
|
+
"src/stories/question/question.stories.tsx",
|
|
316
298
|
"src/stories/question/source.json",
|
|
317
299
|
"src/stories/questionnaires/logement/data.json",
|
|
318
|
-
"src/stories/questionnaires/logement/logement.stories.
|
|
300
|
+
"src/stories/questionnaires/logement/logement.stories.tsx",
|
|
319
301
|
"src/stories/questionnaires/logement/source-sequence.json",
|
|
320
302
|
"src/stories/questionnaires/logement/source-sum.json",
|
|
321
303
|
"src/stories/questionnaires/logement/source.json",
|
|
322
|
-
"src/stories/questionnaires/recensement/
|
|
323
|
-
"src/stories/questionnaires/recensement/recensement.stories.jsx",
|
|
304
|
+
"src/stories/questionnaires/recensement/recensement.stories.tsx",
|
|
324
305
|
"src/stories/questionnaires/recensement/source.json",
|
|
325
|
-
"src/stories/questionnaires/rp/
|
|
326
|
-
"src/stories/questionnaires/rp/rp.stories.jsx",
|
|
306
|
+
"src/stories/questionnaires/rp/rp.stories.tsx",
|
|
327
307
|
"src/stories/questionnaires/rp/source.json",
|
|
328
|
-
"src/stories/questionnaires/simpsons/simpsons.stories.
|
|
308
|
+
"src/stories/questionnaires/simpsons/simpsons.stories.tsx",
|
|
329
309
|
"src/stories/questionnaires/simpsons/source.json",
|
|
330
|
-
"src/stories/radio/radio.stories.
|
|
310
|
+
"src/stories/radio/radio.stories.tsx",
|
|
331
311
|
"src/stories/radio/source.json",
|
|
332
312
|
"src/stories/radio/sourceCondition.json",
|
|
333
313
|
"src/stories/radio/sourceDetail.json",
|
|
334
314
|
"src/stories/radio/sourceHorizontal.json",
|
|
335
|
-
"src/stories/roundabout/
|
|
336
|
-
"src/stories/roundabout/data2.json",
|
|
337
|
-
"src/stories/roundabout/roundabout.stories.jsx",
|
|
315
|
+
"src/stories/roundabout/roundabout.stories.tsx",
|
|
338
316
|
"src/stories/roundabout/source.json",
|
|
339
|
-
"src/stories/sequence/sequence.stories.
|
|
317
|
+
"src/stories/sequence/sequence.stories.tsx",
|
|
340
318
|
"src/stories/sequence/source-declarations.json",
|
|
341
319
|
"src/stories/sequence/source.json",
|
|
342
320
|
"src/stories/suggester/fakeReferentiel.json",
|
|
@@ -345,41 +323,28 @@
|
|
|
345
323
|
"src/stories/suggester/source-multiline.json",
|
|
346
324
|
"src/stories/suggester/source-option-responses.json",
|
|
347
325
|
"src/stories/suggester/source.json",
|
|
348
|
-
"src/stories/suggester/suggester.stories.
|
|
349
|
-
"src/stories/summary/data.json",
|
|
326
|
+
"src/stories/suggester/suggester.stories.tsx",
|
|
350
327
|
"src/stories/summary/source.json",
|
|
351
|
-
"src/stories/summary/summary.stories.
|
|
352
|
-
"src/stories/switch/README.md",
|
|
353
|
-
"src/stories/switch/data-forced.json",
|
|
354
|
-
"src/stories/switch/source.json",
|
|
355
|
-
"src/stories/switch/switch.stories.jsx",
|
|
356
|
-
"src/stories/table/data.json",
|
|
328
|
+
"src/stories/summary/summary.stories.tsx",
|
|
357
329
|
"src/stories/table/source-colspan.json",
|
|
330
|
+
"src/stories/table/source-dynamic.json",
|
|
358
331
|
"src/stories/table/source.json",
|
|
359
|
-
"src/stories/table/table
|
|
360
|
-
"src/stories/table/table.stories.jsx",
|
|
361
|
-
"src/stories/text/data-roster.json",
|
|
332
|
+
"src/stories/table/table.stories.tsx",
|
|
362
333
|
"src/stories/text/source-roster.json",
|
|
363
334
|
"src/stories/text/source-table.json",
|
|
364
335
|
"src/stories/text/source.json",
|
|
365
|
-
"src/stories/text/text.stories.
|
|
366
|
-
"src/stories/textarea/data.json",
|
|
336
|
+
"src/stories/text/text.stories.tsx",
|
|
367
337
|
"src/stories/textarea/source.json",
|
|
368
|
-
"src/stories/textarea/textarea.stories.
|
|
369
|
-
"src/stories/utils/
|
|
338
|
+
"src/stories/textarea/textarea.stories.tsx",
|
|
339
|
+
"src/stories/utils/Orchestrator.tsx",
|
|
340
|
+
"src/stories/utils/OrchestratorData.tsx",
|
|
341
|
+
"src/stories/utils/OrchestratorOverview.tsx",
|
|
342
|
+
"src/stories/utils/OrchestratorSidebar.tsx",
|
|
343
|
+
"src/stories/utils/SchemaValidator.tsx",
|
|
370
344
|
"src/stories/utils/custom-lunatic.scss",
|
|
371
|
-
"src/stories/utils/
|
|
372
|
-
"src/stories/utils/default-args.js",
|
|
373
|
-
"src/stories/utils/options.js",
|
|
374
|
-
"src/stories/utils/orchestrator.jsx",
|
|
375
|
-
"src/stories/utils/orchestrator.scss",
|
|
376
|
-
"src/stories/utils/overview.jsx",
|
|
377
|
-
"src/stories/utils/overview.scss",
|
|
378
|
-
"src/stories/utils/referentiel.js",
|
|
345
|
+
"src/stories/utils/referentiel.ts",
|
|
379
346
|
"src/test.d.ts",
|
|
380
347
|
"src/tests/setup.ts",
|
|
381
|
-
"src/tests/utils/e2e.js",
|
|
382
|
-
"src/tests/utils/lunatic.ts",
|
|
383
348
|
"src/tests/utils/timer.ts",
|
|
384
349
|
"src/type.source.ts",
|
|
385
350
|
"src/type.utils.ts",
|
|
@@ -442,8 +407,6 @@
|
|
|
442
407
|
"src/use-lunatic/reducer/reduce-handle-changes.ts",
|
|
443
408
|
"src/use-lunatic/reducer/reducer.ts",
|
|
444
409
|
"src/use-lunatic/reducer/reducerInitializer.tsx",
|
|
445
|
-
"src/use-lunatic/replace-component-sequence.ts",
|
|
446
|
-
"src/use-lunatic/test.utils.ts",
|
|
447
410
|
"src/use-lunatic/type.ts",
|
|
448
411
|
"src/use-lunatic/use-lunatic.test.ts",
|
|
449
412
|
"src/use-lunatic/use-lunatic.ts",
|
|
@@ -461,7 +424,6 @@
|
|
|
461
424
|
"src/utils/env.ts",
|
|
462
425
|
"src/utils/function.ts",
|
|
463
426
|
"src/utils/is-element.ts",
|
|
464
|
-
"src/utils/is-object.ts",
|
|
465
427
|
"src/utils/logger.ts",
|
|
466
428
|
"src/utils/number.spec.ts",
|
|
467
429
|
"src/utils/number.ts",
|
|
@@ -474,7 +436,6 @@
|
|
|
474
436
|
"src/utils/search/melauto.ts",
|
|
475
437
|
"src/utils/search/tokenizer.spec.ts",
|
|
476
438
|
"src/utils/search/tokenizer.ts",
|
|
477
|
-
"src/utils/to-number.ts",
|
|
478
439
|
"src/utils/variables.spec.ts",
|
|
479
440
|
"src/utils/variables.ts",
|
|
480
441
|
"src/utils/vtl.ts",
|
|
@@ -1345,6 +1306,9 @@
|
|
|
1345
1306
|
"esm/hooks/useListKeyboardHandler.d.ts",
|
|
1346
1307
|
"esm/hooks/useListKeyboardHandler.js",
|
|
1347
1308
|
"esm/hooks/useListKeyboardHandler.js.map",
|
|
1309
|
+
"esm/hooks/useLocalStorage.d.ts",
|
|
1310
|
+
"esm/hooks/useLocalStorage.js",
|
|
1311
|
+
"esm/hooks/useLocalStorage.js.map",
|
|
1348
1312
|
"esm/hooks/useRefSync.d.ts",
|
|
1349
1313
|
"esm/hooks/useRefSync.js",
|
|
1350
1314
|
"esm/hooks/useRefSync.js.map",
|
|
@@ -1368,13 +1332,9 @@
|
|
|
1368
1332
|
"esm/index.js.map",
|
|
1369
1333
|
"esm/main.css",
|
|
1370
1334
|
"esm/main.css.map",
|
|
1371
|
-
"esm/stories/overview/sourceWithHierarchy.json",
|
|
1372
1335
|
"esm/tests/setup.d.ts",
|
|
1373
1336
|
"esm/tests/setup.js",
|
|
1374
1337
|
"esm/tests/setup.js.map",
|
|
1375
|
-
"esm/tests/utils/lunatic.d.ts",
|
|
1376
|
-
"esm/tests/utils/lunatic.js",
|
|
1377
|
-
"esm/tests/utils/lunatic.js.map",
|
|
1378
1338
|
"esm/tests/utils/timer.d.ts",
|
|
1379
1339
|
"esm/tests/utils/timer.js",
|
|
1380
1340
|
"esm/tests/utils/timer.js.map",
|
|
@@ -1555,12 +1515,6 @@
|
|
|
1555
1515
|
"esm/use-lunatic/reducer/reducerInitializer.d.ts",
|
|
1556
1516
|
"esm/use-lunatic/reducer/reducerInitializer.js",
|
|
1557
1517
|
"esm/use-lunatic/reducer/reducerInitializer.js.map",
|
|
1558
|
-
"esm/use-lunatic/replace-component-sequence.d.ts",
|
|
1559
|
-
"esm/use-lunatic/replace-component-sequence.js",
|
|
1560
|
-
"esm/use-lunatic/replace-component-sequence.js.map",
|
|
1561
|
-
"esm/use-lunatic/test.utils.d.ts",
|
|
1562
|
-
"esm/use-lunatic/test.utils.js",
|
|
1563
|
-
"esm/use-lunatic/test.utils.js.map",
|
|
1564
1518
|
"esm/use-lunatic/type.d.ts",
|
|
1565
1519
|
"esm/use-lunatic/type.js",
|
|
1566
1520
|
"esm/use-lunatic/type.js.map",
|
|
@@ -1609,9 +1563,6 @@
|
|
|
1609
1563
|
"esm/utils/is-element.d.ts",
|
|
1610
1564
|
"esm/utils/is-element.js",
|
|
1611
1565
|
"esm/utils/is-element.js.map",
|
|
1612
|
-
"esm/utils/is-object.d.ts",
|
|
1613
|
-
"esm/utils/is-object.js",
|
|
1614
|
-
"esm/utils/is-object.js.map",
|
|
1615
1566
|
"esm/utils/logger.d.ts",
|
|
1616
1567
|
"esm/utils/logger.js",
|
|
1617
1568
|
"esm/utils/logger.js.map",
|
|
@@ -1648,9 +1599,6 @@
|
|
|
1648
1599
|
"esm/utils/search/tokenizer.spec.d.ts",
|
|
1649
1600
|
"esm/utils/search/tokenizer.spec.js",
|
|
1650
1601
|
"esm/utils/search/tokenizer.spec.js.map",
|
|
1651
|
-
"esm/utils/to-number.d.ts",
|
|
1652
|
-
"esm/utils/to-number.js",
|
|
1653
|
-
"esm/utils/to-number.js.map",
|
|
1654
1602
|
"esm/utils/variables.d.ts",
|
|
1655
1603
|
"esm/utils/variables.js",
|
|
1656
1604
|
"esm/utils/variables.js.map",
|
|
@@ -1681,6 +1629,9 @@
|
|
|
1681
1629
|
"hooks/useListKeyboardHandler.d.ts",
|
|
1682
1630
|
"hooks/useListKeyboardHandler.js",
|
|
1683
1631
|
"hooks/useListKeyboardHandler.js.map",
|
|
1632
|
+
"hooks/useLocalStorage.d.ts",
|
|
1633
|
+
"hooks/useLocalStorage.js",
|
|
1634
|
+
"hooks/useLocalStorage.js.map",
|
|
1684
1635
|
"hooks/useRefSync.d.ts",
|
|
1685
1636
|
"hooks/useRefSync.js",
|
|
1686
1637
|
"hooks/useRefSync.js.map",
|
|
@@ -1704,13 +1655,9 @@
|
|
|
1704
1655
|
"index.js.map",
|
|
1705
1656
|
"main.css",
|
|
1706
1657
|
"main.css.map",
|
|
1707
|
-
"stories/overview/sourceWithHierarchy.json",
|
|
1708
1658
|
"tests/setup.d.ts",
|
|
1709
1659
|
"tests/setup.js",
|
|
1710
1660
|
"tests/setup.js.map",
|
|
1711
|
-
"tests/utils/lunatic.d.ts",
|
|
1712
|
-
"tests/utils/lunatic.js",
|
|
1713
|
-
"tests/utils/lunatic.js.map",
|
|
1714
1661
|
"tests/utils/timer.d.ts",
|
|
1715
1662
|
"tests/utils/timer.js",
|
|
1716
1663
|
"tests/utils/timer.js.map",
|
|
@@ -1892,12 +1839,6 @@
|
|
|
1892
1839
|
"use-lunatic/reducer/reducerInitializer.d.ts",
|
|
1893
1840
|
"use-lunatic/reducer/reducerInitializer.js",
|
|
1894
1841
|
"use-lunatic/reducer/reducerInitializer.js.map",
|
|
1895
|
-
"use-lunatic/replace-component-sequence.d.ts",
|
|
1896
|
-
"use-lunatic/replace-component-sequence.js",
|
|
1897
|
-
"use-lunatic/replace-component-sequence.js.map",
|
|
1898
|
-
"use-lunatic/test.utils.d.ts",
|
|
1899
|
-
"use-lunatic/test.utils.js",
|
|
1900
|
-
"use-lunatic/test.utils.js.map",
|
|
1901
1842
|
"use-lunatic/type.d.ts",
|
|
1902
1843
|
"use-lunatic/type.js",
|
|
1903
1844
|
"use-lunatic/type.js.map",
|
|
@@ -1946,9 +1887,6 @@
|
|
|
1946
1887
|
"utils/is-element.d.ts",
|
|
1947
1888
|
"utils/is-element.js",
|
|
1948
1889
|
"utils/is-element.js.map",
|
|
1949
|
-
"utils/is-object.d.ts",
|
|
1950
|
-
"utils/is-object.js",
|
|
1951
|
-
"utils/is-object.js.map",
|
|
1952
1890
|
"utils/logger.d.ts",
|
|
1953
1891
|
"utils/logger.js",
|
|
1954
1892
|
"utils/logger.js.map",
|
|
@@ -1985,9 +1923,6 @@
|
|
|
1985
1923
|
"utils/search/tokenizer.spec.d.ts",
|
|
1986
1924
|
"utils/search/tokenizer.spec.js",
|
|
1987
1925
|
"utils/search/tokenizer.spec.js.map",
|
|
1988
|
-
"utils/to-number.d.ts",
|
|
1989
|
-
"utils/to-number.js",
|
|
1990
|
-
"utils/to-number.js.map",
|
|
1991
1926
|
"utils/variables.d.ts",
|
|
1992
1927
|
"utils/variables.js",
|
|
1993
1928
|
"utils/variables.js.map",
|
|
@@ -2040,6 +1975,7 @@
|
|
|
2040
1975
|
"@storybook/react-vite": "^8.2.9",
|
|
2041
1976
|
"@storybook/test": "^8.2.9",
|
|
2042
1977
|
"@storybook/test-runner": "^0.19.1",
|
|
1978
|
+
"@tailwindcss/vite": "^4.1.4",
|
|
2043
1979
|
"@testing-library/jest-dom": "^6.4.8",
|
|
2044
1980
|
"@testing-library/react": "^16.0.0",
|
|
2045
1981
|
"@types/node": "^22.8.0",
|
|
@@ -2047,8 +1983,10 @@
|
|
|
2047
1983
|
"@types/react-dom": "^18.3.0",
|
|
2048
1984
|
"@vitejs/plugin-react": "^4.3.1",
|
|
2049
1985
|
"@vitest/coverage-v8": "2.1.2",
|
|
1986
|
+
"@xyflow/react": "^12.6.0",
|
|
2050
1987
|
"ajv": "^8.17.1",
|
|
2051
1988
|
"concurrently": "^8.2.2",
|
|
1989
|
+
"daisyui": "^5.0.28",
|
|
2052
1990
|
"eslint": "^9.9.0",
|
|
2053
1991
|
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
2054
1992
|
"eslint-plugin-react-refresh": "^0.4.9",
|
|
@@ -2059,6 +1997,7 @@
|
|
|
2059
1997
|
"react": "^18.3.1",
|
|
2060
1998
|
"react-dom": "^18.3.1",
|
|
2061
1999
|
"storybook": "^8.2.9",
|
|
2000
|
+
"tailwindcss": "^4.1.4",
|
|
2062
2001
|
"tsx": "^4.19.1",
|
|
2063
2002
|
"typescript": "^5.4.5",
|
|
2064
2003
|
"typescript-eslint": "^8.11.0",
|
|
@@ -9,6 +9,7 @@ describe('CheckboxOne component', () => {
|
|
|
9
9
|
{ label: 'Option 2', value: 'option-2', onCheck: onCheck, checked: false },
|
|
10
10
|
{ label: 'Option 3', value: 'option-3', onCheck: onCheck, checked: false },
|
|
11
11
|
] satisfies InterpretedOption[];
|
|
12
|
+
const response = { name: 'demo' };
|
|
12
13
|
|
|
13
14
|
it('renders the component with correct props', () => {
|
|
14
15
|
const { getByText } = render(
|
|
@@ -17,6 +18,7 @@ describe('CheckboxOne component', () => {
|
|
|
17
18
|
value="option-1"
|
|
18
19
|
id="checkbox-one"
|
|
19
20
|
handleChanges={onCheck}
|
|
21
|
+
response={response}
|
|
20
22
|
/>
|
|
21
23
|
);
|
|
22
24
|
|
|
@@ -34,6 +36,7 @@ describe('CheckboxOne component', () => {
|
|
|
34
36
|
label="Checkbox One"
|
|
35
37
|
description="Choose one option"
|
|
36
38
|
handleChanges={onCheck}
|
|
39
|
+
response={response}
|
|
37
40
|
/>
|
|
38
41
|
);
|
|
39
42
|
|
|
@@ -1,62 +1,61 @@
|
|
|
1
1
|
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Combobox } from './Combobox';
|
|
4
|
-
import
|
|
4
|
+
import { fn } from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Combobox> = {
|
|
7
|
-
title: 'Components/
|
|
7
|
+
title: 'Components/ComboBox',
|
|
8
8
|
component: Combobox,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof Combobox>;
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Default: StoryObj<typeof Combobox> = {
|
|
55
|
-
render: (args) => <Template {...args} />,
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
render(args) {
|
|
16
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
|
+
const [localValue, setLocalValue] = useState(args.value);
|
|
18
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
19
|
+
const [search, setSearch] = useState<string | null>('');
|
|
20
|
+
// Simulate a search
|
|
21
|
+
const options = search
|
|
22
|
+
? args.options.filter((v) =>
|
|
23
|
+
v.value.toLowerCase().includes(search.toLowerCase())
|
|
24
|
+
)
|
|
25
|
+
: args.options;
|
|
26
|
+
return (
|
|
27
|
+
<fieldset>
|
|
28
|
+
<legend>Select an option : {localValue}</legend>
|
|
29
|
+
<Combobox
|
|
30
|
+
{...args}
|
|
31
|
+
value={localValue}
|
|
32
|
+
onSelect={(v) => {
|
|
33
|
+
console.log('onSelect', v);
|
|
34
|
+
setLocalValue(v);
|
|
35
|
+
args.onSelect(v);
|
|
36
|
+
}}
|
|
37
|
+
onChange={(v) => {
|
|
38
|
+
console.log('onChange', v);
|
|
39
|
+
setSearch(v);
|
|
40
|
+
args.onChange?.(v);
|
|
41
|
+
}}
|
|
42
|
+
options={options}
|
|
43
|
+
/>
|
|
44
|
+
<button
|
|
45
|
+
className="btn btn-primary"
|
|
46
|
+
onClick={() => setLocalValue('paris')}
|
|
47
|
+
>
|
|
48
|
+
Sélectionner paris
|
|
49
|
+
</button>
|
|
50
|
+
</fieldset>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
56
53
|
args: {
|
|
57
54
|
value: '1',
|
|
55
|
+
onSelect: fn(),
|
|
56
|
+
onChange: fn(),
|
|
58
57
|
options: [
|
|
59
|
-
{ id: '1', value: 'Option 1', label:
|
|
58
|
+
{ id: '1', value: 'Option 1', label: 'Option 1' },
|
|
60
59
|
{ id: '2', value: 'Option 2', label: 'Option 2' },
|
|
61
60
|
{ id: '3', value: 'Option 3', label: 'Option 3' },
|
|
62
61
|
{ id: 'paris', value: 'Paris', label: 'Paris' },
|
|
@@ -65,10 +64,10 @@ export const Default: StoryObj<typeof Combobox> = {
|
|
|
65
64
|
},
|
|
66
65
|
};
|
|
67
66
|
|
|
68
|
-
export const Editable:
|
|
69
|
-
|
|
67
|
+
export const Editable: Story = {
|
|
68
|
+
render: Default.render,
|
|
70
69
|
args: {
|
|
71
|
-
...Default.
|
|
70
|
+
...Default.args,
|
|
72
71
|
editable: true,
|
|
73
72
|
},
|
|
74
73
|
};
|
package/src/components/type.ts
CHANGED
|
@@ -205,6 +205,7 @@ export type ComponentPropsByType = {
|
|
|
205
205
|
CheckboxOne: LunaticBaseProps<string | null> &
|
|
206
206
|
LunaticExtraProps & {
|
|
207
207
|
options: Array<InterpretedOption>;
|
|
208
|
+
response: { name: string };
|
|
208
209
|
componentType?: 'CheckboxOne';
|
|
209
210
|
orientation?: 'horizontal' | 'vertical';
|
|
210
211
|
detailAlwaysDisplayed?: boolean;
|