@inseefr/lunatic 3.5.7 → 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/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/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/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/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/shared/Combobox/Combobox.stories.tsx +48 -49
- 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/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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
|
|
8
|
+
import { Meta } from '@storybook/react';
|
|
9
|
+
|
|
10
|
+
import { dataFromObject } from '../../utils/object';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
13
|
+
title: 'Components/Pairwise',
|
|
14
|
+
...OrchestratorMeta,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const Default: OrchestratorStory = {
|
|
20
|
+
args: {
|
|
21
|
+
source,
|
|
22
|
+
data: dataFromObject({
|
|
23
|
+
PRENOM: ['Dad', 'Mom', 'Unknow'],
|
|
24
|
+
AGE: [30, 29, 5],
|
|
25
|
+
LINKS: [[null]],
|
|
26
|
+
OTHER: [[null]],
|
|
27
|
+
}),
|
|
28
|
+
initialPage: '3',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from './utils/Orchestrator';
|
|
6
|
+
|
|
7
|
+
import { Meta } from '@storybook/react';
|
|
8
|
+
import { type ComponentProps, type FormEventHandler, useMemo } from 'react';
|
|
9
|
+
import { useLocalStorage } from '../hooks/useLocalStorage';
|
|
10
|
+
import type { LunaticSource } from '../type.source';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
13
|
+
title: 'Paste',
|
|
14
|
+
...OrchestratorMeta,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const Default: OrchestratorStory = {
|
|
20
|
+
args: {},
|
|
21
|
+
render(args) {
|
|
22
|
+
return <PasteOrchestrator {...args} />;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function PasteOrchestrator(
|
|
27
|
+
props: Readonly<ComponentProps<typeof Orchestrator>>
|
|
28
|
+
) {
|
|
29
|
+
const [source, setSource, sourceAsString] =
|
|
30
|
+
useLocalStorage<LunaticSource | null>('story-source');
|
|
31
|
+
const extraTabs = useMemo(() => {
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
label: 'Source',
|
|
35
|
+
children: (
|
|
36
|
+
<FormForSource source={sourceAsString} onChange={setSource} />
|
|
37
|
+
),
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}, [sourceAsString, setSource]);
|
|
41
|
+
if (!source) {
|
|
42
|
+
return extraTabs[0].children;
|
|
43
|
+
}
|
|
44
|
+
return (
|
|
45
|
+
<div key={sourceAsString}>
|
|
46
|
+
<Orchestrator {...props} source={source} extraTabs={extraTabs} />
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function FormForSource(
|
|
52
|
+
props: Readonly<{
|
|
53
|
+
source: string;
|
|
54
|
+
onChange: (source: string) => void;
|
|
55
|
+
}>
|
|
56
|
+
) {
|
|
57
|
+
const onSubmit: FormEventHandler<HTMLFormElement> = (e) => {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
const data = new FormData(e.currentTarget);
|
|
60
|
+
if (data.has('source')) {
|
|
61
|
+
props.onChange(data.get('source') as string);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return (
|
|
65
|
+
<form onSubmit={onSubmit}>
|
|
66
|
+
<fieldset className="fieldset">
|
|
67
|
+
<legend className="fieldset-legend">Paste the source.json</legend>
|
|
68
|
+
<textarea
|
|
69
|
+
required
|
|
70
|
+
name="source"
|
|
71
|
+
defaultValue={props.source}
|
|
72
|
+
className="textarea w-full h-24"
|
|
73
|
+
placeholder="source.json content"
|
|
74
|
+
/>
|
|
75
|
+
<div className="label">
|
|
76
|
+
The content of this textarea will be saved in your local storage to
|
|
77
|
+
persist between refreshes
|
|
78
|
+
</div>
|
|
79
|
+
</fieldset>
|
|
80
|
+
<button className="btn btn-primary mt-2" type="submit">
|
|
81
|
+
Load
|
|
82
|
+
</button>
|
|
83
|
+
</form>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
|
|
8
|
+
import { Meta } from '@storybook/react';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
11
|
+
title: 'Components/Question',
|
|
12
|
+
...OrchestratorMeta,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
export const Default: OrchestratorStory = {
|
|
18
|
+
args: {
|
|
19
|
+
source,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
import data from './data.json';
|
|
8
|
+
import sourceSum from './source-sum.json';
|
|
9
|
+
import sourceSequence from './source-sequence.json';
|
|
10
|
+
|
|
11
|
+
import { Meta } from '@storybook/react';
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
14
|
+
title: 'Questionnaires/Logement',
|
|
15
|
+
...OrchestratorMeta,
|
|
16
|
+
args: {
|
|
17
|
+
data,
|
|
18
|
+
source,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
export const Default: OrchestratorStory = {};
|
|
25
|
+
export const Sum: OrchestratorStory = { args: { source: sourceSum } };
|
|
26
|
+
export const Sequence: OrchestratorStory = { args: { source: sourceSequence } };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
|
|
8
|
+
import { Meta } from '@storybook/react';
|
|
9
|
+
import { dataFromObject } from '../../../utils/object';
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
12
|
+
title: 'Questionnaires/Recensement',
|
|
13
|
+
...OrchestratorMeta,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
export const Default: OrchestratorStory = {
|
|
19
|
+
args: {
|
|
20
|
+
source,
|
|
21
|
+
data: dataFromObject({
|
|
22
|
+
PRENOM: [null],
|
|
23
|
+
AGE: [null],
|
|
24
|
+
LINKS: [[null]],
|
|
25
|
+
OTHER: [[null]],
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
|
|
8
|
+
import { Meta } from '@storybook/react';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
11
|
+
title: 'Questionnaires/RP',
|
|
12
|
+
...OrchestratorMeta,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
export const Default: OrchestratorStory = {
|
|
18
|
+
args: {
|
|
19
|
+
source,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
import { Meta } from '@storybook/react';
|
|
8
|
+
import { Logger } from '../../../utils/logger';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
11
|
+
title: 'Questionnaires/Simpsons',
|
|
12
|
+
...OrchestratorMeta,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
export const Default: OrchestratorStory = {
|
|
18
|
+
args: {
|
|
19
|
+
source,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const WithMissing: OrchestratorStory = {
|
|
24
|
+
args: {
|
|
25
|
+
source,
|
|
26
|
+
missing: true,
|
|
27
|
+
missingStrategy: () => {
|
|
28
|
+
Logger.info('your strategy has been applied');
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
import sourceHorizontal from './sourceHorizontal.json';
|
|
8
|
+
import sourceDetail from './sourceDetail.json';
|
|
9
|
+
import sourceCondition from './sourceCondition.json';
|
|
10
|
+
|
|
11
|
+
import { Meta } from '@storybook/react';
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
14
|
+
title: 'Components/Radio',
|
|
15
|
+
...OrchestratorMeta,
|
|
16
|
+
args: {
|
|
17
|
+
...OrchestratorMeta.args,
|
|
18
|
+
shortcut: true,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
export const Default: OrchestratorStory = {
|
|
25
|
+
args: {
|
|
26
|
+
source,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Condition: OrchestratorStory = {
|
|
31
|
+
args: {
|
|
32
|
+
source: sourceCondition,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Horizontal: OrchestratorStory = {
|
|
37
|
+
args: {
|
|
38
|
+
source: sourceHorizontal,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ReadOnly: OrchestratorStory = {
|
|
43
|
+
args: {
|
|
44
|
+
source,
|
|
45
|
+
readOnly: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const WithDetail: OrchestratorStory = {
|
|
50
|
+
args: {
|
|
51
|
+
source: sourceDetail,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Orchestrator } from '../utils/Orchestrator';
|
|
2
|
+
import source from './source.json';
|
|
3
|
+
|
|
4
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import { dataFromObject } from '../../utils/object';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
9
|
+
title: 'Components/Roundabout',
|
|
10
|
+
component: Orchestrator,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof Orchestrator>;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
source,
|
|
19
|
+
data: dataFromObject({
|
|
20
|
+
NB_HAB: 2,
|
|
21
|
+
PRENOMS: ['Fanny', 'Ines'],
|
|
22
|
+
AGE: [24, 22],
|
|
23
|
+
PROGRESS: [-1, -1],
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const OneIteration: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
source,
|
|
31
|
+
data: dataFromObject({
|
|
32
|
+
NB_HAB: 1,
|
|
33
|
+
PRENOMS: ['Fanny'],
|
|
34
|
+
AGE: [15],
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import sourceDeclarations from './source-declarations.json';
|
|
7
|
+
import source from './source.json';
|
|
8
|
+
|
|
9
|
+
import { Meta } from '@storybook/react';
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
12
|
+
title: 'Components/Sequence',
|
|
13
|
+
...OrchestratorMeta,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
export const Default: OrchestratorStory = {
|
|
19
|
+
args: {
|
|
20
|
+
source,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WithDeclarations: OrchestratorStory = {
|
|
25
|
+
args: {
|
|
26
|
+
source: sourceDeclarations,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"declarationType": "INSTRUCTION",
|
|
57
57
|
"position": "BEFORE_QUESTION_TEXT",
|
|
58
58
|
"label": {
|
|
59
|
-
"value": "\"Démontre la capacité d'un suggester à extraire plusieurs réponse à partir des propriétés du référentiel\"",
|
|
59
|
+
"value": "\"Démontre la capacité d'un suggester à extraire plusieurs réponse à partir des propriétés du référentiel (rechercher 'brosse' ou 'balle')\"",
|
|
60
60
|
"type": "VTL|MD"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
import sourceOptionResponses from './source-option-responses.json';
|
|
8
|
+
import sourceArbitraryResponse from './source-arbitrary-response.json';
|
|
9
|
+
import sourceError from './source-error.json';
|
|
10
|
+
import sourceMultiline from './source-multiline.json';
|
|
11
|
+
import { getReferentiel } from '../utils/referentiel';
|
|
12
|
+
import { Meta } from '@storybook/react';
|
|
13
|
+
import { IndexEntry } from '../../utils/search/SearchInterface';
|
|
14
|
+
|
|
15
|
+
const getFakeReferentiel = async (name: string): Promise<IndexEntry[]> => {
|
|
16
|
+
try {
|
|
17
|
+
return (await import(`./fakeReferentiel.json`)).default;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.log('error', error);
|
|
20
|
+
throw new Error(`Unknown référentiel ${name}`);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
25
|
+
title: 'Components/Suggester',
|
|
26
|
+
...OrchestratorMeta,
|
|
27
|
+
args: {
|
|
28
|
+
...OrchestratorMeta.args,
|
|
29
|
+
autoSuggesterLoading: true,
|
|
30
|
+
getReferentiel,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
|
|
36
|
+
export const Default: OrchestratorStory = {
|
|
37
|
+
args: {
|
|
38
|
+
source,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const OptionResponses: OrchestratorStory = {
|
|
43
|
+
args: {
|
|
44
|
+
source: sourceOptionResponses,
|
|
45
|
+
getReferentiel: getFakeReferentiel,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const ArbitraryResponse: OrchestratorStory = {
|
|
50
|
+
args: {
|
|
51
|
+
...OptionResponses.args,
|
|
52
|
+
source: sourceArbitraryResponse,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const WithError: OrchestratorStory = {
|
|
57
|
+
args: {
|
|
58
|
+
...OptionResponses.args,
|
|
59
|
+
source: sourceError,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const MultiLine: OrchestratorStory = {
|
|
64
|
+
args: {
|
|
65
|
+
source: sourceMultiline,
|
|
66
|
+
initialPage: '2',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -94,6 +94,21 @@
|
|
|
94
94
|
"iterations": { "value": "NB_HAB", "type": "VTL" },
|
|
95
95
|
"label": { "value": "\"Libellé du rondpoint\"", "type": "VTL" },
|
|
96
96
|
"locked": true,
|
|
97
|
+
"item": {
|
|
98
|
+
"label": {
|
|
99
|
+
"value": "\"Questions de \" || PRENOMS",
|
|
100
|
+
"type": "VTL"
|
|
101
|
+
},
|
|
102
|
+
"description": {
|
|
103
|
+
"value": "\"\"",
|
|
104
|
+
"type": "VTL"
|
|
105
|
+
},
|
|
106
|
+
"disabled": {
|
|
107
|
+
"value": "-1",
|
|
108
|
+
"type": "VTL"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"progressVariable": "PROGRESS",
|
|
97
112
|
"expressions": {
|
|
98
113
|
"unnecessary": {
|
|
99
114
|
"value": "AGE < 13",
|
|
@@ -210,7 +225,6 @@
|
|
|
210
225
|
}
|
|
211
226
|
]
|
|
212
227
|
},
|
|
213
|
-
|
|
214
228
|
{
|
|
215
229
|
"id": "Summary",
|
|
216
230
|
"componentType": "Summary",
|
|
@@ -325,6 +339,13 @@
|
|
|
325
339
|
"COLLECTED": [null]
|
|
326
340
|
}
|
|
327
341
|
},
|
|
342
|
+
{
|
|
343
|
+
"variableType": "COLLECTED",
|
|
344
|
+
"name": "PROGRESS",
|
|
345
|
+
"values": {
|
|
346
|
+
"COLLECTED": [null]
|
|
347
|
+
}
|
|
348
|
+
},
|
|
328
349
|
{
|
|
329
350
|
"variableType": "CALCULATED",
|
|
330
351
|
"name": "PRENOMREF",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
|
|
8
|
+
import { Meta } from '@storybook/react';
|
|
9
|
+
|
|
10
|
+
import { dataFromObject } from '../../utils/object';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
13
|
+
title: 'Components/Summary',
|
|
14
|
+
...OrchestratorMeta,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const Default: OrchestratorStory = {
|
|
20
|
+
args: {
|
|
21
|
+
source,
|
|
22
|
+
initialPage: '5',
|
|
23
|
+
data: dataFromObject({
|
|
24
|
+
NB_HAB: 2,
|
|
25
|
+
PRENOMS: ['Matt', 'Julia'],
|
|
26
|
+
PROGRESS: [-1, -1],
|
|
27
|
+
AGE: [26, 31],
|
|
28
|
+
SEXE: ['1', '2'],
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
import sourceColspan from './source-colspan.json';
|
|
8
|
+
import sourceDynamic from './source-dynamic.json';
|
|
9
|
+
import { Meta } from '@storybook/react/*';
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
12
|
+
title: 'Components/Table',
|
|
13
|
+
...OrchestratorMeta,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
// Create data equivalent to data.json but using dataFromObject
|
|
19
|
+
export const Default: OrchestratorStory = {
|
|
20
|
+
args: {
|
|
21
|
+
source,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Colspan: OrchestratorStory = {
|
|
26
|
+
args: {
|
|
27
|
+
source: sourceColspan,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const DynamicTable: OrchestratorStory = {
|
|
32
|
+
args: {
|
|
33
|
+
source: sourceDynamic,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
import sourceRoster from './source-roster.json';
|
|
8
|
+
import sourceTable from './source-table.json';
|
|
9
|
+
|
|
10
|
+
import { Meta } from '@storybook/react';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
13
|
+
title: 'Components/Text',
|
|
14
|
+
...OrchestratorMeta,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const Default: OrchestratorStory = {
|
|
20
|
+
args: {
|
|
21
|
+
source,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const Roster: OrchestratorStory = {
|
|
25
|
+
args: {
|
|
26
|
+
source: sourceRoster,
|
|
27
|
+
data: {
|
|
28
|
+
EXTERNAL: {
|
|
29
|
+
VARIABLE_EXT: ['TRUC', 'BIDULE', 'CHOSE'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const Table: OrchestratorStory = {
|
|
35
|
+
args: {
|
|
36
|
+
source: sourceTable,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Orchestrator,
|
|
3
|
+
OrchestratorMeta,
|
|
4
|
+
type OrchestratorStory,
|
|
5
|
+
} from '../utils/Orchestrator';
|
|
6
|
+
import source from './source.json';
|
|
7
|
+
|
|
8
|
+
import { Meta } from '@storybook/react';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof Orchestrator> = {
|
|
11
|
+
title: 'Components/Textarea',
|
|
12
|
+
...OrchestratorMeta,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
export const Default: OrchestratorStory = {
|
|
18
|
+
args: {
|
|
19
|
+
source,
|
|
20
|
+
},
|
|
21
|
+
};
|