@inseefr/lunatic 0.2.2-experimental → 0.2.3-prisme
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/LICENSE +21 -21
- package/README.md +25 -23
- package/lib/index.js +1191 -475
- package/lib/index.js.map +1 -1
- package/package.json +174 -172
- package/src/components/breadcrumb/breadcrumb.scss +22 -22
- package/src/components/checkbox/boolean.js +172 -172
- package/src/components/checkbox/checkbox.scss +73 -73
- package/src/components/checkbox/group.js +231 -231
- package/src/components/checkbox/one.js +11 -11
- package/src/components/component-wrapper/controls/component.js +70 -0
- package/src/components/component-wrapper/controls/controls.scss +6 -0
- package/src/components/component-wrapper/controls/index.js +1 -0
- package/src/components/component-wrapper/controls/validators/datepicker.js +44 -0
- package/src/components/component-wrapper/controls/validators/index.js +16 -0
- package/src/components/component-wrapper/controls/validators/input-number.js +23 -0
- package/src/components/{missing-wrapper → component-wrapper}/index.js +0 -0
- package/src/components/component-wrapper/missing/component.js +200 -0
- package/src/components/component-wrapper/missing/index.js +1 -0
- package/src/components/{missing-wrapper → component-wrapper/missing}/missing.scss +32 -32
- package/src/components/component-wrapper/wrapper.js +23 -0
- package/src/components/components.js +1 -0
- package/src/components/datepicker/component.js +26 -11
- package/src/components/declarations/component.js +46 -46
- package/src/components/declarations/declarations.scss +40 -40
- package/src/components/declarations/wrappers/input-declarations-wrapper.js +328 -274
- package/src/components/declarations/wrappers/simple-declarations-wrapper.js +54 -54
- package/src/components/dropdown/commons/actions.js +65 -56
- package/src/components/dropdown/commons/children-to-option.js +9 -9
- package/src/components/dropdown/commons/cleaner-callbacks.js +58 -58
- package/src/components/dropdown/commons/components/dropdown-container.js +29 -29
- package/src/components/dropdown/commons/components/dropdown.js +204 -183
- package/src/components/dropdown/commons/event-callbacks/on-mousedown-callback.js +15 -15
- package/src/components/dropdown/commons/reducer.js +3 -0
- package/src/components/dropdown/commons/tools/index.js +17 -17
- package/src/components/dropdown/component.js +135 -135
- package/src/components/dropdown/dropdown-edit/dropdown-edit.js +194 -185
- package/src/components/dropdown/dropdown-edit/index.js +11 -11
- package/src/components/dropdown/dropdown-simple/dropdown.js +173 -164
- package/src/components/dropdown/dropdown-simple/index.js +20 -20
- package/src/components/dropdown/dropdown.scss +178 -178
- package/src/components/icon/icon.scss +15 -15
- package/src/components/index.js +2 -0
- package/src/components/index.scss +177 -175
- package/src/components/input/input-number.js +30 -54
- package/src/components/input/input.js +11 -11
- package/src/components/input/input.scss +31 -37
- package/src/components/loop/component.js +170 -169
- package/src/components/loop/loop.scss +13 -13
- package/src/components/loop/wrapper.js +1 -1
- package/src/components/loop-constructor/block/block.scss +10 -10
- package/src/components/loop-constructor/block/component.js +9 -9
- package/src/components/loop-constructor/roster/component.js +8 -8
- package/src/components/loop-constructor/wrapper/body-component.js +146 -125
- package/src/components/modal/component.js +36 -0
- package/src/components/modal/index.js +1 -0
- package/src/components/modal/modal.scss +33 -0
- package/src/components/progress-bar/progress-bar.scss +54 -54
- package/src/components/radio/component.js +9 -9
- package/src/components/radio/radio.scss +59 -59
- package/src/components/sequence/component.js +50 -50
- package/src/components/sequence/sequence.scss +10 -10
- package/src/components/subsequence/component.js +49 -49
- package/src/components/suggester/check-store.js +2 -4
- package/src/components/suggester/components/panel/default-option-renderer.js +27 -27
- package/src/components/suggester/components/panel/option-container.js +61 -61
- package/src/components/suggester/components/panel/panel.js +47 -47
- package/src/components/suggester/components/selection/default-label-renderer.js +31 -31
- package/src/components/suggester/components/selection/label.js +35 -35
- package/src/components/suggester/components/selection/selection.js +50 -50
- package/src/components/suggester/components/suggester-content.js +2 -2
- package/src/components/suggester/components/suggester.js +128 -88
- package/src/components/suggester/components/suggester.scss +101 -101
- package/src/components/suggester/default-style.scss +125 -125
- package/src/components/suggester/find-best-label/find-best-label.js +51 -49
- package/src/components/suggester/find-best-label/index.js +1 -1
- package/src/components/suggester/idb-suggester.js +73 -67
- package/src/components/suggester/lunatic-suggester.js +140 -137
- package/src/components/suggester/searching/create-searching.js +49 -47
- package/src/components/suggester/searching/index.js +1 -1
- package/src/components/suggester/state-management/actions.js +38 -38
- package/src/components/suggester/state-management/reducer/reduce-on-delete-search.js +11 -11
- package/src/components/suggester/state-management/reducer/reduce-on-init.js +29 -29
- package/src/components/suggester/state-management/reducer/reducer.js +38 -38
- package/src/components/suggester/suggester-wrapper.js +127 -121
- package/src/components/suggester-loader-widget/loader.js +67 -67
- package/src/components/suggester-loader-widget/widget.js +123 -123
- package/src/components/table/table.js +173 -171
- package/src/components/table/table.scss +26 -26
- package/src/components/textarea/component.js +11 -11
- package/src/components/textarea/textarea.scss +8 -8
- package/src/components/tooltip/tooltip.scss +30 -30
- package/src/stories/checkbox-boolean/data.json +78 -78
- package/src/stories/datepicker/data.json +3 -1
- package/src/stories/dropdown/README.md +44 -44
- package/src/stories/dropdown/data.json +98 -98
- package/src/stories/dropdown/dropdown.stories.js +89 -89
- package/src/stories/progress-bar/progress-bar.stories.js +24 -24
- package/src/stories/questionnaire/arithmetic-management.json +47 -0
- package/src/stories/questionnaire/arithmetic.json +247 -247
- package/src/stories/questionnaire/kish.json +275 -0
- package/src/stories/questionnaire/logement-queen.json +23390 -0
- package/src/stories/questionnaire/logement-s2.json +46028 -0
- package/src/stories/questionnaire/logement.json +20347 -26087
- package/src/stories/questionnaire/loop-and-controls.json +481 -0
- package/src/stories/questionnaire/questionnaire.stories.js +236 -138
- package/src/stories/questionnaire/update-external/data.json +1 -0
- package/src/stories/questionnaire/update-external/questionnaire.json +75 -0
- package/src/stories/suggester/README.md +46 -46
- package/src/stories/suggester/bailleurs-sociaux/fetch-bailleurs.js +15 -15
- package/src/stories/suggester/bailleurs-sociaux/index.js +2 -2
- package/src/stories/suggester/bailleurs-sociaux/option-bailleur-renderer.js +58 -58
- package/src/stories/suggester/bailleurs-sociaux/preloader.svg +51 -51
- package/src/stories/suggester/bailleurs-sociaux/theme.scss +22 -22
- package/src/stories/suggester/bailleurs-sociaux-2021/fetch-bailleurs.js +12 -0
- package/src/stories/suggester/bailleurs-sociaux-2021/index.js +1 -0
- package/src/stories/suggester/cog-communes/fetch-cog.js +15 -15
- package/src/stories/suggester/data-auto.json +232 -231
- package/src/stories/suggester/data-vtl.json +82 -82
- package/src/stories/suggester/data.json +169 -136
- package/src/stories/suggester/naf-rev2/index.js +2 -2
- package/src/stories/suggester/naf-rev2/option-naf-renderer.js +17 -17
- package/src/stories/suggester/suggester-workers.stories.js +226 -179
- package/src/stories/suggester/suggester.stories.js +138 -133
- package/src/stories/utils/orchestrator-split.js +119 -0
- package/src/stories/utils/orchestrator.js +119 -108
- package/src/tests/components/input-number.spec.js +6 -12
- package/src/tests/components/missing-wrapper.spec.js +0 -1
- package/src/tests/utils/lib/table/roster.spec.js +25 -25
- package/src/tests/utils/to-expose/handler/results/res-input-edited.json +1 -1
- package/src/utils/components/dragger/dragger.scss +7 -7
- package/src/utils/idb-tools/create-db-opener.js +43 -43
- package/src/utils/idb-tools/create-open-db.js +25 -25
- package/src/utils/idb-tools/idb-bulk-insert.js +96 -96
- package/src/utils/idb-tools/index.js +10 -10
- package/src/utils/idb-tools/insert-entity.js +15 -15
- package/src/utils/idb-tools/open-db.js +13 -13
- package/src/utils/idb-tools/open-or-create-db.js +34 -34
- package/src/utils/lib/controls/index.js +1 -0
- package/src/utils/lib/controls/utils.js +152 -0
- package/src/utils/lib/decorator/title-decorator.js +16 -16
- package/src/utils/lib/env.js +2 -2
- package/src/utils/lib/index.js +2 -0
- package/src/utils/lib/input-number.js +1 -1
- package/src/utils/lib/options-positioning.js +9 -9
- package/src/utils/lib/pagination/navigation/shared.js +12 -9
- package/src/utils/lib/prop-types/lines.js +6 -6
- package/src/utils/lib/responses.js +11 -9
- package/src/utils/lib/splitting.js +142 -0
- package/src/utils/lib/style.js +10 -10
- package/src/utils/store-tools/auto-load.js +74 -73
- package/src/utils/suggester-workers/append-to-index/append.js +25 -25
- package/src/utils/suggester-workers/append-to-index/append.worker.js +16 -16
- package/src/utils/suggester-workers/append-to-index/create-append-task.js +45 -43
- package/src/utils/suggester-workers/append-to-index/index.js +2 -2
- package/src/utils/suggester-workers/append-to-index/prepare-entities.js +61 -61
- package/src/utils/suggester-workers/append-to-index/store-messages.js +21 -21
- package/src/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +56 -0
- package/src/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +56 -0
- package/src/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +17 -17
- package/src/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +10 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +17 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +14 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/{filter-double.js → filters/filter-double.js} +12 -12
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +20 -0
- package/src/utils/suggester-workers/commons-tokenizer/{filter-length.js → filters/filter-length.js} +7 -7
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +18 -0
- package/src/utils/suggester-workers/commons-tokenizer/{filter-stemmer.js → filters/filter-stemmer.js} +13 -13
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +36 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +10 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/index.js +2 -0
- package/src/utils/suggester-workers/commons-tokenizer/{stop-words.js → filters/stop-words.js} +118 -118
- package/src/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +8 -8
- package/src/utils/suggester-workers/commons-tokenizer/get-stemmer.js +18 -18
- package/src/utils/suggester-workers/commons-tokenizer/index.js +9 -8
- package/src/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +13 -9
- package/src/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +7 -7
- package/src/utils/suggester-workers/create-worker.js +56 -0
- package/src/utils/suggester-workers/find-best-label/find-best-label.js +39 -39
- package/src/utils/suggester-workers/find-best-label/find-best-label.worker.js +40 -40
- package/src/utils/suggester-workers/find-best-label/tokenize.js +30 -33
- package/src/utils/suggester-workers/find-best-label/tokenize.spec.js +19 -19
- package/src/utils/suggester-workers/searching/compute-score.js +33 -33
- package/src/utils/suggester-workers/searching/get-db.js +18 -18
- package/src/utils/suggester-workers/searching/index.js +1 -1
- package/src/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +20 -20
- package/src/utils/suggester-workers/searching/order/index.js +19 -19
- package/src/utils/suggester-workers/{query-parser → searching/query-parser}/index.js +2 -2
- package/src/utils/suggester-workers/searching/query-parser/query-parser-soft.js +7 -0
- package/src/utils/suggester-workers/{query-parser → searching/query-parser}/query-parser-soft.spec.js +24 -24
- package/src/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +34 -0
- package/src/utils/suggester-workers/searching/resolve-query-parser.js +27 -27
- package/src/utils/suggester-workers/searching/search-in-index.js +17 -17
- package/src/utils/suggester-workers/searching/searching.js +70 -70
- package/src/utils/suggester-workers/searching/searching.worker.js +11 -11
- package/src/utils/to-expose/calculated-variables.js +113 -113
- package/src/utils/to-expose/handler.js +149 -112
- package/src/utils/to-expose/hooks/filter-components.js +27 -12
- package/src/utils/to-expose/hooks/index.js +2 -1
- package/src/utils/to-expose/hooks/lunatic-split.js +428 -0
- package/src/utils/to-expose/hooks/lunatic.js +284 -187
- package/src/utils/to-expose/index.js +1 -1
- package/src/utils/to-expose/init-questionnaire.js +164 -164
- package/src/utils/to-expose/interpret/vtl.js +18 -18
- package/src/utils/to-expose/state.js +66 -58
- package/src/components/missing-wrapper/component.js +0 -120
- package/src/components/missing-wrapper/wrapper.js +0 -10
- package/src/tests/utils/to-expose/hooks/use-lunatic.spec.js +0 -46
- package/src/utils/suggester-workers/commons-tokenizer/create-tokenizer.js +0 -103
- package/src/utils/suggester-workers/commons-tokenizer/filter-accents-to-lower.js +0 -9
- package/src/utils/suggester-workers/commons-tokenizer/filter-synonyms.js +0 -10
- package/src/utils/suggester-workers/query-parser/query-parser-soft.js +0 -7
- package/src/utils/suggester-workers/query-parser/query-parser-tokenized.js +0 -31
- package/src/utils/suggester-workers/query-parser/query-parser-tokenized.spec.js +0 -32
|
@@ -1,125 +1,146 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as lunatic from '../../components';
|
|
3
|
-
import * as U from '../../../utils/lib';
|
|
4
|
-
import { interpret } from '../../../utils/to-expose';
|
|
5
|
-
import { buildContentForLoopConstructor } from './build-components';
|
|
6
|
-
|
|
7
|
-
const BodyComponent = ({
|
|
8
|
-
componentType,
|
|
9
|
-
mainId,
|
|
10
|
-
headers,
|
|
11
|
-
components,
|
|
12
|
-
bindings,
|
|
13
|
-
width,
|
|
14
|
-
preferences,
|
|
15
|
-
positioning,
|
|
16
|
-
management,
|
|
17
|
-
features,
|
|
18
|
-
setTodo,
|
|
19
|
-
logFunction,
|
|
20
|
-
...otherProps
|
|
21
|
-
}) => {
|
|
22
|
-
const uiComponents = buildContentForLoopConstructor({
|
|
23
|
-
components,
|
|
24
|
-
headers,
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as lunatic from '../../components';
|
|
3
|
+
import * as U from '../../../utils/lib';
|
|
4
|
+
import { interpret } from '../../../utils/to-expose';
|
|
5
|
+
import { buildContentForLoopConstructor } from './build-components';
|
|
6
|
+
|
|
7
|
+
const BodyComponent = ({
|
|
8
|
+
componentType,
|
|
9
|
+
mainId,
|
|
10
|
+
headers,
|
|
11
|
+
components,
|
|
12
|
+
bindings,
|
|
13
|
+
width,
|
|
14
|
+
preferences,
|
|
15
|
+
positioning,
|
|
16
|
+
management,
|
|
17
|
+
features,
|
|
18
|
+
setTodo,
|
|
19
|
+
logFunction,
|
|
20
|
+
...otherProps
|
|
21
|
+
}) => {
|
|
22
|
+
const uiComponents = buildContentForLoopConstructor({
|
|
23
|
+
components,
|
|
24
|
+
headers,
|
|
25
|
+
});
|
|
26
|
+
const featuresWithoutMD = features.filter((f) => f !== 'MD');
|
|
27
|
+
if (componentType === 'RosterForLoop')
|
|
28
|
+
return (
|
|
29
|
+
<table id={`table-${mainId}`} className="table-lunatic">
|
|
30
|
+
<tbody>
|
|
31
|
+
{uiComponents.map((row, i) => (
|
|
32
|
+
<tr key={`table-${mainId}-row${i}`}>
|
|
33
|
+
{row.map((component, j) => {
|
|
34
|
+
const {
|
|
35
|
+
label,
|
|
36
|
+
headerCell,
|
|
37
|
+
colspan,
|
|
38
|
+
rowspan,
|
|
39
|
+
componentType,
|
|
40
|
+
id,
|
|
41
|
+
rowNumber,
|
|
42
|
+
conditionFilter,
|
|
43
|
+
...componentProps
|
|
44
|
+
} = component;
|
|
45
|
+
const localBindings =
|
|
46
|
+
U.buildBindingsForDeeperComponents(rowNumber)(bindings);
|
|
47
|
+
if (conditionFilter) {
|
|
48
|
+
const { value = '' } = conditionFilter;
|
|
49
|
+
if (!interpret(featuresWithoutMD)(localBindings)(value))
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
if (componentType) {
|
|
53
|
+
const Component = lunatic[componentType];
|
|
54
|
+
return (
|
|
55
|
+
<td
|
|
56
|
+
key={`table-${mainId}-row-${i}-cell-${j}`}
|
|
57
|
+
style={{ width }}
|
|
58
|
+
>
|
|
59
|
+
<Component
|
|
60
|
+
{...otherProps}
|
|
61
|
+
{...componentProps}
|
|
62
|
+
id={`${id}-row-${i}`}
|
|
63
|
+
label={label}
|
|
64
|
+
handleChange={(up) => {
|
|
65
|
+
setTodo({ up, rowNumber });
|
|
66
|
+
}}
|
|
67
|
+
preferences={preferences}
|
|
68
|
+
positioning={positioning}
|
|
69
|
+
management={management}
|
|
70
|
+
features={features}
|
|
71
|
+
bindings={localBindings}
|
|
72
|
+
fullBindings={bindings}
|
|
73
|
+
missingLoopIteration={i}
|
|
74
|
+
zIndex={uiComponents.length - i || 0}
|
|
75
|
+
logFunction={logFunction}
|
|
76
|
+
focused={i === 0 && j === 0}
|
|
77
|
+
/>
|
|
78
|
+
</td>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
const cellOptions = {
|
|
82
|
+
key: `table-${mainId}-row-${i}-cell-${j}`,
|
|
83
|
+
style: { width },
|
|
84
|
+
colSpan: colspan || 1,
|
|
85
|
+
rowSpan: rowspan || 1,
|
|
86
|
+
};
|
|
87
|
+
const interpretedLabel = interpret(
|
|
88
|
+
features,
|
|
89
|
+
logFunction
|
|
90
|
+
)(bindings)(label);
|
|
91
|
+
return headerCell ? (
|
|
92
|
+
<th {...cellOptions}>{interpretedLabel}</th>
|
|
93
|
+
) : (
|
|
94
|
+
<td {...cellOptions}>{interpretedLabel}</td>
|
|
95
|
+
);
|
|
96
|
+
})}
|
|
97
|
+
</tr>
|
|
98
|
+
))}
|
|
99
|
+
</tbody>
|
|
100
|
+
</table>
|
|
101
|
+
);
|
|
102
|
+
else
|
|
103
|
+
return (
|
|
104
|
+
<div className="block-for-loop">
|
|
105
|
+
{uiComponents.map((row, i) =>
|
|
106
|
+
row.map(({ componentType, id, label, ...componentProps }) => {
|
|
107
|
+
const Component = lunatic[componentType];
|
|
108
|
+
const localBindings =
|
|
109
|
+
U.buildBindingsForDeeperComponents(i)(bindings);
|
|
110
|
+
// ensure to have only N-1 missingResponse
|
|
111
|
+
const { missingResponse, conditionFilter } = componentProps;
|
|
112
|
+
if (conditionFilter) {
|
|
113
|
+
const { value = '' } = conditionFilter;
|
|
114
|
+
if (!interpret(featuresWithoutMD)(localBindings)(value))
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return (
|
|
118
|
+
<div className="block-component" key={`${id}-row-${i}`}>
|
|
119
|
+
<Component
|
|
120
|
+
{...otherProps}
|
|
121
|
+
{...componentProps}
|
|
122
|
+
missingResponse={missingResponse}
|
|
123
|
+
id={`${id}-row-${i}`}
|
|
124
|
+
label={label}
|
|
125
|
+
handleChange={(up) => {
|
|
126
|
+
setTodo({ up, rowNumber: i });
|
|
127
|
+
}}
|
|
128
|
+
preferences={preferences}
|
|
129
|
+
positioning={positioning}
|
|
130
|
+
management={management}
|
|
131
|
+
features={features}
|
|
132
|
+
bindings={localBindings}
|
|
133
|
+
fullBindings={bindings}
|
|
134
|
+
missingLoopIteration={i}
|
|
135
|
+
logFunction={logFunction}
|
|
136
|
+
focused={i === 0}
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
})
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export default BodyComponent;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../button';
|
|
3
|
+
import './modal.scss';
|
|
4
|
+
|
|
5
|
+
const Modal = ({ controls, cancelModal, validateModal }) => {
|
|
6
|
+
const disableValidation = controls
|
|
7
|
+
.map(({ criticality }) => criticality)
|
|
8
|
+
.includes('LOCK');
|
|
9
|
+
return (
|
|
10
|
+
<div className="lunatic-modal">
|
|
11
|
+
<div className="lunatic-modal-content">
|
|
12
|
+
<div className="lunatic-modal-text">
|
|
13
|
+
<ul>
|
|
14
|
+
{controls.map(({ id, errorMessage }) => (
|
|
15
|
+
<li key={id}>{errorMessage}</li>
|
|
16
|
+
))}
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
<div className="lunatic-modal-buttons">
|
|
20
|
+
<div className="lunatic-modal-button">
|
|
21
|
+
<Button value="Corriger ma réponse" onClick={cancelModal} />
|
|
22
|
+
</div>
|
|
23
|
+
<div className="lunatic-modal-button">
|
|
24
|
+
<Button
|
|
25
|
+
value="Continuer"
|
|
26
|
+
onClick={validateModal}
|
|
27
|
+
disabled={disableValidation}
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default Modal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './component';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.lunatic-modal {
|
|
2
|
+
position: fixed;
|
|
3
|
+
padding-top: 50px;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
background-color: rgb(0, 0, 0);
|
|
9
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
10
|
+
z-index: 1000;
|
|
11
|
+
.lunatic-modal-content {
|
|
12
|
+
position: relative;
|
|
13
|
+
background-color: white;
|
|
14
|
+
padding: 20px;
|
|
15
|
+
margin: auto;
|
|
16
|
+
width: 50%;
|
|
17
|
+
-webkit-animation-name: animatetop;
|
|
18
|
+
-webkit-animation-duration: 0.4s;
|
|
19
|
+
animation-name: animatetop;
|
|
20
|
+
animation-duration: 0.4s;
|
|
21
|
+
.lunatic-modal-text {
|
|
22
|
+
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
23
|
+
font-size: 1em;
|
|
24
|
+
}
|
|
25
|
+
.lunatic-modal-buttons {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-around;
|
|
28
|
+
.lunatic-modal-button {
|
|
29
|
+
font-size: 0.8em;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
.lunatic-component {
|
|
2
|
-
.progress-lunatic {
|
|
3
|
-
height: 30px;
|
|
4
|
-
position: relative;
|
|
5
|
-
background: var(--color-disabled);
|
|
6
|
-
-moz-border-radius: 20px;
|
|
7
|
-
-webkit-border-radius: 20px;
|
|
8
|
-
border-radius: 20px;
|
|
9
|
-
padding: 5px;
|
|
10
|
-
box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
|
|
11
|
-
text-align: center;
|
|
12
|
-
font-weight: bold;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.progress-lunatic > span {
|
|
16
|
-
display: block;
|
|
17
|
-
height: 100%;
|
|
18
|
-
border-radius: 20px;
|
|
19
|
-
background-color: var(--color-primary-light);
|
|
20
|
-
opacity: 0.6;
|
|
21
|
-
box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3),
|
|
22
|
-
inset 0 -2px 6px rgba(0, 0, 0, 0.4);
|
|
23
|
-
position: relative;
|
|
24
|
-
top: -18px;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.progress-lunatic > span:after {
|
|
29
|
-
content: '';
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: 0;
|
|
32
|
-
left: 0;
|
|
33
|
-
bottom: 0;
|
|
34
|
-
right: 0;
|
|
35
|
-
background-image: linear-gradient(
|
|
36
|
-
-45deg,
|
|
37
|
-
rgba(255, 255, 255, 0.2) 25%,
|
|
38
|
-
transparent 25%,
|
|
39
|
-
transparent 50%,
|
|
40
|
-
rgba(255, 255, 255, 0.2) 50%,
|
|
41
|
-
rgba(255, 255, 255, 0.2) 75%,
|
|
42
|
-
transparent 75%,
|
|
43
|
-
transparent
|
|
44
|
-
);
|
|
45
|
-
z-index: 1;
|
|
46
|
-
background-size: 50px 50px;
|
|
47
|
-
animation: move 2s linear infinite;
|
|
48
|
-
border-top-right-radius: 8px;
|
|
49
|
-
border-bottom-right-radius: 8px;
|
|
50
|
-
border-top-left-radius: 20px;
|
|
51
|
-
border-bottom-left-radius: 20px;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
.lunatic-component {
|
|
2
|
+
.progress-lunatic {
|
|
3
|
+
height: 30px;
|
|
4
|
+
position: relative;
|
|
5
|
+
background: var(--color-disabled);
|
|
6
|
+
-moz-border-radius: 20px;
|
|
7
|
+
-webkit-border-radius: 20px;
|
|
8
|
+
border-radius: 20px;
|
|
9
|
+
padding: 5px;
|
|
10
|
+
box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
|
|
11
|
+
text-align: center;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.progress-lunatic > span {
|
|
16
|
+
display: block;
|
|
17
|
+
height: 100%;
|
|
18
|
+
border-radius: 20px;
|
|
19
|
+
background-color: var(--color-primary-light);
|
|
20
|
+
opacity: 0.6;
|
|
21
|
+
box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3),
|
|
22
|
+
inset 0 -2px 6px rgba(0, 0, 0, 0.4);
|
|
23
|
+
position: relative;
|
|
24
|
+
top: -18px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.progress-lunatic > span:after {
|
|
29
|
+
content: '';
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
background-image: linear-gradient(
|
|
36
|
+
-45deg,
|
|
37
|
+
rgba(255, 255, 255, 0.2) 25%,
|
|
38
|
+
transparent 25%,
|
|
39
|
+
transparent 50%,
|
|
40
|
+
rgba(255, 255, 255, 0.2) 50%,
|
|
41
|
+
rgba(255, 255, 255, 0.2) 75%,
|
|
42
|
+
transparent 75%,
|
|
43
|
+
transparent
|
|
44
|
+
);
|
|
45
|
+
z-index: 1;
|
|
46
|
+
background-size: 50px 50px;
|
|
47
|
+
animation: move 2s linear infinite;
|
|
48
|
+
border-top-right-radius: 8px;
|
|
49
|
+
border-bottom-right-radius: 8px;
|
|
50
|
+
border-top-left-radius: 20px;
|
|
51
|
+
border-bottom-left-radius: 20px;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { ListDeclarationsWrapper } from '../declarations/wrappers';
|
|
4
|
-
import { areEqual } from '../../utils/lib';
|
|
5
|
-
import './radio.scss';
|
|
6
|
-
|
|
7
|
-
const Radio = (props) => <ListDeclarationsWrapper type="radio" {...props} />;
|
|
8
|
-
|
|
9
|
-
export default
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import componentWrapper from '../component-wrapper';
|
|
3
|
+
import { ListDeclarationsWrapper } from '../declarations/wrappers';
|
|
4
|
+
import { areEqual } from '../../utils/lib';
|
|
5
|
+
import './radio.scss';
|
|
6
|
+
|
|
7
|
+
const Radio = (props) => <ListDeclarationsWrapper type="radio" {...props} />;
|
|
8
|
+
|
|
9
|
+
export default componentWrapper(React.memo(Radio, areEqual));
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
.lunatic-component {
|
|
2
|
-
.radio-group-list {
|
|
3
|
-
border: 0;
|
|
4
|
-
outline: 0;
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin-top: 0.9375rem;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.radio-lunatic {
|
|
10
|
-
position: absolute;
|
|
11
|
-
opacity: 0;
|
|
12
|
-
margin-bottom: 0;
|
|
13
|
-
margin-top: 0.05rem;
|
|
14
|
-
margin-left: 0.2rem;
|
|
15
|
-
height: 20px;
|
|
16
|
-
width: 20px;
|
|
17
|
-
+ label {
|
|
18
|
-
margin-left: 2rem;
|
|
19
|
-
}
|
|
20
|
-
&:focus {
|
|
21
|
-
+ label {
|
|
22
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
+ label::before {
|
|
26
|
-
float: left;
|
|
27
|
-
line-height: 2rem;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.field,
|
|
32
|
-
.field-with-tooltip {
|
|
33
|
-
.radio-group-list .radio-modality {
|
|
34
|
-
height: 1.375em;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.radio-group-list {
|
|
39
|
-
.radio-modality {
|
|
40
|
-
label {
|
|
41
|
-
display: flex;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
.radio-modality.radio-modality-block label {
|
|
45
|
-
padding-top: 0.325em;
|
|
46
|
-
}
|
|
47
|
-
.radio-modality.radio-modality-block.horizontal-options label {
|
|
48
|
-
padding-top: 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.radio-modality {
|
|
53
|
-
margin-bottom: 0.8em;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.radio-lunatic + label {
|
|
57
|
-
margin-top: 0.325em;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
.lunatic-component {
|
|
2
|
+
.radio-group-list {
|
|
3
|
+
border: 0;
|
|
4
|
+
outline: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin-top: 0.9375rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.radio-lunatic {
|
|
10
|
+
position: absolute;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
margin-bottom: 0;
|
|
13
|
+
margin-top: 0.05rem;
|
|
14
|
+
margin-left: 0.2rem;
|
|
15
|
+
height: 20px;
|
|
16
|
+
width: 20px;
|
|
17
|
+
+ label {
|
|
18
|
+
margin-left: 2rem;
|
|
19
|
+
}
|
|
20
|
+
&:focus {
|
|
21
|
+
+ label {
|
|
22
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
+ label::before {
|
|
26
|
+
float: left;
|
|
27
|
+
line-height: 2rem;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.field,
|
|
32
|
+
.field-with-tooltip {
|
|
33
|
+
.radio-group-list .radio-modality {
|
|
34
|
+
height: 1.375em;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.radio-group-list {
|
|
39
|
+
.radio-modality {
|
|
40
|
+
label {
|
|
41
|
+
display: flex;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.radio-modality.radio-modality-block label {
|
|
45
|
+
padding-top: 0.325em;
|
|
46
|
+
}
|
|
47
|
+
.radio-modality.radio-modality-block.horizontal-options label {
|
|
48
|
+
padding-top: 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.radio-modality {
|
|
53
|
+
margin-bottom: 0.8em;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.radio-lunatic + label {
|
|
57
|
+
margin-top: 0.325em;
|
|
58
|
+
}
|
|
59
|
+
}
|