@inseefr/lunatic 0.1.0-hackathon → 0.1.0-v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1433 -835
- package/lib/index.js.map +1 -1
- package/package.json +11 -8
- package/src/components/breadcrumb/component.js +29 -29
- package/src/components/button/index.js +1 -1
- package/src/components/button/lunatic-button.js +32 -0
- package/src/components/checkbox/checkbox-boolean/index.js +1 -0
- package/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +44 -0
- package/src/components/checkbox/checkbox-group/checkbox-group.js +78 -0
- package/src/components/checkbox/checkbox-group/checkbox-option.js +46 -0
- package/src/components/checkbox/checkbox-group/index.js +1 -0
- package/src/components/checkbox/checkbox-group/lunatic-checkbox-group.js +32 -0
- package/src/components/checkbox/checkbox-one/index.js +1 -0
- package/src/components/checkbox/checkbox-one/lunatic-checkbox-one.js +7 -0
- package/src/components/checkbox/checkbox.scss +1 -73
- package/src/components/checkbox/commons/checkbox-option.js +49 -0
- package/src/components/checkbox/commons/index.js +1 -0
- package/src/components/checkbox/index.js +3 -3
- package/src/components/commons/components/field-container/field-container.js +28 -0
- package/src/components/commons/components/field-container/field-container.scss +0 -0
- package/src/components/commons/components/field-container/index.js +1 -0
- package/src/components/commons/components/fieldset.js +12 -0
- package/src/components/commons/components/input-container.js +30 -0
- package/src/components/commons/components/label.js +14 -0
- package/src/components/commons/components/lunatic-field.js +35 -0
- package/src/components/commons/create-customizable-field.js +13 -0
- package/src/components/commons/index.js +9 -0
- package/src/components/commons/use-on-handle-change.js +16 -0
- package/src/components/commons/use-options-keydown.js +22 -0
- package/src/components/commons/use-previous.js +11 -0
- 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 +33 -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 +1 -1
- package/src/components/{missing-wrapper → component-wrapper/missing}/component.js +72 -12
- package/src/components/component-wrapper/missing/index.js +1 -0
- package/src/components/{missing-wrapper → component-wrapper/missing}/missing.scss +0 -0
- package/src/components/component-wrapper/wrapper.js +23 -0
- package/src/components/components.js +22 -18
- package/src/components/datepicker/datepicker.js +25 -0
- package/src/components/datepicker/index.js +1 -1
- package/src/components/datepicker/lunatic-datepicker.js +50 -0
- package/src/components/declarations/declaration.js +11 -0
- package/src/components/declarations/declarations-after-text.js +8 -0
- package/src/components/declarations/declarations-before-text.js +8 -0
- package/src/components/declarations/declarations-detachable.js +8 -0
- package/src/components/declarations/declarations.js +35 -0
- package/src/components/declarations/index.js +4 -1
- package/src/components/declarations/wrappers/input-declarations-wrapper.js +40 -12
- package/src/components/declarations/wrappers/list-declarations-wrapper.js +235 -232
- package/src/components/dropdown/commons/actions.js +40 -31
- package/src/components/dropdown/commons/components/panel.js +78 -78
- package/src/components/dropdown/commons/reducer.js +152 -149
- package/src/components/dropdown/component.js +121 -115
- package/src/components/dropdown/dropdown-edit/dropdown-edit.js +6 -0
- package/src/components/dropdown/dropdown-simple/dropdown.js +8 -1
- package/src/components/filter-description/component.js +48 -42
- package/src/components/icon/component.js +31 -33
- package/src/components/index.scss +5 -3
- package/src/components/input/index.js +1 -2
- package/src/components/input/input.js +45 -9
- package/src/components/input/input.scss +0 -6
- package/src/components/input/lunatic-input.js +53 -0
- package/src/components/input-number/index.js +1 -0
- package/src/components/input-number/input-number.js +38 -0
- package/src/components/input-number/input-number.scss +0 -0
- package/src/components/input-number/lunatic-input-number.js +50 -0
- package/src/components/loop/{component.js → _old/component.js} +1 -0
- package/src/components/loop/{loop.scss → _old/loop.scss} +0 -0
- package/src/components/loop/{wrapper.js → _old/wrapper.js} +15 -15
- package/src/components/loop/block-for-loop/block-for-loop-ochestrator.js +6 -0
- package/src/components/loop/block-for-loop/block-for-loop.js +91 -0
- package/src/components/loop/block-for-loop/index.js +1 -0
- package/src/components/loop/block-for-loop/row.js +52 -0
- package/src/components/loop/commons/create-loop-orchestrator.js +36 -0
- package/src/components/loop/commons/index.js +2 -0
- package/src/components/loop/commons/row-component.js +52 -0
- package/src/components/loop/index.js +1 -1
- package/src/components/loop/loop.js +78 -0
- package/src/components/loop/roster-for-loop/add-row-button.js +12 -0
- package/src/components/loop/roster-for-loop/body.js +44 -0
- package/src/components/loop/roster-for-loop/header.js +25 -0
- package/src/components/loop/roster-for-loop/html-table/table.js +11 -0
- package/src/components/loop/roster-for-loop/html-table/tbody.js +11 -0
- package/src/components/loop/roster-for-loop/html-table/td.js +14 -0
- package/src/components/loop/roster-for-loop/html-table/th.js +11 -0
- package/src/components/loop/roster-for-loop/html-table/thead.js +11 -0
- package/src/components/loop/roster-for-loop/html-table/tr.js +11 -0
- package/src/components/loop/roster-for-loop/index.js +1 -0
- package/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +6 -0
- package/src/components/loop/roster-for-loop/roster-for-loop.js +90 -0
- package/src/components/loop/roster-for-loop/roster-table.js +39 -0
- package/src/components/loop/roster-for-loop/roster.scss +42 -0
- package/src/components/loop/roster-for-loop/row.js +65 -0
- package/src/components/loop-constructor/block/component.js +2 -2
- package/src/components/loop-constructor/block/index.js +1 -1
- package/src/components/loop-constructor/index.js +1 -1
- package/src/components/loop-constructor/roster/component.js +2 -2
- package/src/components/loop-constructor/roster/index.js +1 -1
- package/src/components/loop-constructor/wrapper/body-component.js +6 -0
- package/src/components/loop-constructor/wrapper/build-components.js +33 -33
- package/src/components/loop-constructor/wrapper/index.js +1 -1
- package/src/components/modal/component.js +42 -0
- package/src/components/modal/index.js +1 -0
- package/src/components/modal/modal.scss +33 -0
- package/src/components/radio/index.js +1 -1
- package/src/components/radio/lunatic-radio-group.js +45 -0
- package/src/components/radio/radio-group.js +33 -0
- package/src/components/radio/radio-option.js +87 -0
- package/src/components/radio/radio.scss +52 -52
- package/src/components/sequence/index.js +1 -1
- package/src/components/sequence/sequence.js +75 -0
- package/src/components/subsequence/index.js +1 -1
- package/src/components/subsequence/subsequence.js +73 -0
- package/src/components/suggester/check-store.js +70 -70
- package/src/components/suggester/components/panel/option-container.js +11 -10
- package/src/components/suggester/components/panel/panel.js +20 -6
- package/src/components/suggester/components/selection/label.js +7 -6
- package/src/components/suggester/components/selection/selection.js +36 -11
- package/src/components/suggester/components/suggester-content.js +35 -42
- package/src/components/suggester/components/suggester.js +45 -26
- package/src/components/suggester/{components/create-on-keydown-callback.js → create-on-keydown-callback.js} +28 -28
- package/src/components/suggester/find-best-label/find-best-label.js +3 -1
- package/src/components/suggester/idb-suggester.js +2 -1
- package/src/components/suggester/lunatic-suggester.js +48 -96
- package/src/components/suggester/searching/create-searching.js +3 -1
- package/src/components/suggester/suggester-wrapper.js +75 -9
- package/src/components/switch/index.js +1 -0
- package/src/components/switch/lunatic-switch.js +49 -0
- package/src/components/switch/switch.js +72 -0
- package/src/components/switch/switch.scss +47 -0
- package/src/components/table/table.js +164 -158
- package/src/components/textarea/component.js +11 -5
- package/src/components/tooltip/response.js +58 -52
- package/src/stories/checkbox-boolean/data-forced.json +48 -48
- package/src/stories/checkbox-group/data-vtl.json +102 -102
- package/src/stories/cleaning/cleaning.stories.js +39 -0
- package/src/stories/cleaning/simple-loop.json +911 -0
- package/src/stories/cleaning/simpsons.json +5839 -0
- package/src/stories/datepicker/data.json +45 -43
- package/src/stories/declarations/declarations.stories.js +20 -13
- package/src/stories/icons/icons.stories.js +24 -16
- package/src/stories/loop-constructor/README.md +27 -27
- package/src/stories/loop-constructor/data-input-forced.json +64 -64
- package/src/stories/loop-constructor/data-input.json +100 -100
- package/src/stories/loop-constructor/data-loop-forced.json +66 -66
- package/src/stories/loop-constructor/data-loop-static-forced.json +66 -66
- package/src/stories/loop-constructor/data-loop-static.json +81 -81
- package/src/stories/loop-constructor/data-loop.json +81 -81
- package/src/stories/loop-constructor/data-roster-forced.json +68 -68
- package/src/stories/loop-constructor/data-roster.json +83 -83
- package/src/stories/loop-constructor/loop-constructor.stories.js +180 -180
- package/src/stories/questionnaire/logement-queen.json +23234 -0
- package/src/stories/questionnaire/logement.json +22068 -26812
- package/src/stories/questionnaire/questionnaire.stories.js +86 -29
- package/src/stories/questionnaire/update-external/data.json +1 -0
- package/src/stories/questionnaire/update-external/questionnaire.json +75 -0
- 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/data-auto.json +1 -0
- package/src/stories/suggester/data.json +35 -2
- package/src/stories/suggester/lunatic-suggester-mui.scss +27 -0
- package/src/stories/suggester/suggester-material-ui.js +148 -0
- package/src/stories/suggester/suggester-workers.stories.js +48 -1
- package/src/stories/suggester/suggester.stories.js +27 -1
- package/src/stories/switch/README.md +31 -0
- package/src/stories/switch/SwitchMaterialUI.js +35 -0
- package/src/stories/switch/data-forced.json +48 -0
- package/src/stories/switch/data.json +80 -0
- package/src/stories/switch/switch.stories.js +78 -0
- package/src/stories/utils/custom-lunatic.scss +28 -23
- package/src/stories/utils/orchestrator.js +151 -58
- package/src/stories/utils/waiting/index.js +1 -0
- package/src/stories/utils/waiting/preloader.svg +1 -0
- package/src/stories/utils/waiting/waiting.js +21 -0
- package/src/stories/utils/waiting/waiting.scss +21 -0
- package/src/tests/sample.spec.js +5 -0
- package/src/utils/icons/checkbox-checked.icon.js +25 -0
- package/src/utils/icons/checkbox-unchecked.icon.js +25 -0
- package/src/utils/icons/radio-checked.icon.js +25 -0
- package/src/utils/icons/radio-unchecked.icon.js +25 -0
- package/src/utils/lib/controls/index.js +1 -0
- package/src/utils/lib/controls/utils.js +146 -0
- package/src/utils/lib/index.js +20 -19
- package/src/utils/lib/pagination/navigation/shared.js +7 -4
- package/src/utils/lib/responses.js +9 -7
- package/src/utils/lib/tooltip/build-response.js +53 -41
- package/src/utils/store-tools/auto-load.js +2 -1
- package/src/utils/store-tools/create/index.js +2 -1
- package/src/utils/store-tools/create/update-store-info.js +26 -26
- package/src/utils/store-tools/index.js +7 -5
- package/src/utils/suggester-workers/append-to-index/create-append-task.js +3 -1
- 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 +11 -11
- 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} +0 -0
- 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} +0 -0
- 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} +2 -2
- 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} +0 -0
- package/src/utils/suggester-workers/commons-tokenizer/index.js +6 -5
- package/src/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +7 -3
- package/src/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +1 -1
- package/src/utils/suggester-workers/create-worker.js +55 -0
- package/src/utils/suggester-workers/find-best-label/tokenize.js +2 -5
- package/src/utils/suggester-workers/{query-parser → searching/query-parser}/index.js +0 -0
- 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 +0 -0
- package/src/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +34 -0
- package/src/utils/suggester-workers/searching/resolve-query-parser.js +2 -2
- package/src/utils/suggester-workers/searching/searching.js +2 -2
- package/src/utils/to-expose/{calculated-variables.js → _old/calculated-variables.js} +0 -0
- package/src/utils/to-expose/{handler.js → _old/handler.js} +22 -0
- package/src/utils/to-expose/{init-questionnaire.js → _old/init-questionnaire.js} +0 -0
- package/src/utils/to-expose/{state.js → _old/state.js} +13 -14
- package/src/utils/to-expose/hooks/filter-components.js +106 -106
- package/src/utils/to-expose/hooks/index.js +1 -1
- package/src/utils/to-expose/hooks/lunatic.js +68 -7
- package/src/utils/to-expose/hooks/use-lunatic/actions.js +23 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/check-loops.js +61 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/create-map-pages.js +69 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-condition-filter.js +16 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/create-execute-expression.js +182 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/create-memoizer.js +42 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/create-refresh-calculated.js +50 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/execute-expression.js +60 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/get-expressions-variables.js +22 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/execute-expression/index.js +1 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/fill-component-expressions.js +113 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/fill-components.js +31 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/get-compatible-vtl-expression.js +14 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/get-component-value/get-component-value.js +161 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/get-component-value/index.js +1 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/get-components-from-state.js +24 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/get-page-tag.js +10 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/index.js +12 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/is-First-last-page.js +8 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/is-paginated-loop.js +6 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/load-suggesters.js +59 -0
- package/src/utils/to-expose/hooks/use-lunatic/commons/use-components-from-state.js +20 -0
- package/src/utils/to-expose/hooks/use-lunatic/index.js +1 -0
- package/src/utils/to-expose/hooks/use-lunatic/initial-state.js +22 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/index.js +3 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/is-empty-on-empty-page.js +29 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/resize-array-variable.js +26 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/commons/validate-loop-condition-filter.js +20 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/index.js +1 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-go-next-page.js +129 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-go-previous-page.js +131 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/index.js +1 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +69 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +22 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +13 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-on-init.js +166 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reduce-on-set-waiting.js +7 -0
- package/src/utils/to-expose/hooks/use-lunatic/reducer/reducer.js +26 -0
- package/src/utils/to-expose/hooks/use-lunatic/use-lunatic.js +79 -0
- package/src/utils/to-expose/index.js +16 -11
- package/src/components/button/component.js +0 -53
- package/src/components/checkbox/boolean.js +0 -172
- package/src/components/checkbox/group.js +0 -231
- package/src/components/checkbox/one.js +0 -11
- package/src/components/datepicker/component.js +0 -11
- package/src/components/input/input-number.js +0 -54
- package/src/components/missing-wrapper/wrapper.js +0 -10
- package/src/components/radio/component.js +0 -9
- package/src/components/sequence/component.js +0 -50
- package/src/components/subsequence/component.js +0 -49
- package/src/tests/components/breadcrumb.spec.js +0 -13
- package/src/tests/components/button.spec.js +0 -11
- package/src/tests/components/checkbox-boolean.spec.js +0 -45
- package/src/tests/components/checkbox-group.spec.js +0 -53
- package/src/tests/components/checkbox-one.spec.js +0 -32
- package/src/tests/components/datepicker.spec.js +0 -22
- package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +0 -67
- package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +0 -52
- package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +0 -21
- package/src/tests/components/declarations.spec.js +0 -46
- package/src/tests/components/input-number.spec.js +0 -194
- package/src/tests/components/input.spec.js +0 -18
- package/src/tests/components/loops/loop-static.json +0 -66
- package/src/tests/components/loops/loop.json +0 -258
- package/src/tests/components/loops/loop.spec.js +0 -30
- package/src/tests/components/loops/roster-for-loop.spec.js +0 -18
- package/src/tests/components/loops/roster-loop.json +0 -71
- package/src/tests/components/missing-wrapper.spec.js +0 -33
- package/src/tests/components/progress-bar.spec.js +0 -15
- package/src/tests/components/radio.spec.js +0 -27
- package/src/tests/components/sequence.spec.js +0 -9
- package/src/tests/components/subsequence.spec.js +0 -9
- package/src/tests/components/table.spec.js +0 -11
- package/src/tests/components/textarea.spec.js +0 -18
- package/src/tests/components/tooltip.spec.js +0 -25
- package/src/tests/setup/setupTests.js +0 -4
- package/src/tests/utils/lib/alphabet.spec.js +0 -36
- package/src/tests/utils/lib/array.spec.js +0 -22
- package/src/tests/utils/lib/checkbox/group.spec.js +0 -72
- package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
- package/src/tests/utils/lib/input-number.spec.js +0 -18
- package/src/tests/utils/lib/items-positioning.spec.js +0 -17
- package/src/tests/utils/lib/label-position.spec.js +0 -22
- package/src/tests/utils/lib/loops/bindings.spec.js +0 -75
- package/src/tests/utils/lib/loops/shared.spec.js +0 -82
- package/src/tests/utils/lib/missing/missing.spec.js +0 -74
- package/src/tests/utils/lib/missing/mock.js +0 -137
- package/src/tests/utils/lib/pagination/shared.spec.js +0 -42
- package/src/tests/utils/lib/responses.spec.js +0 -64
- package/src/tests/utils/lib/style.spec.js +0 -26
- package/src/tests/utils/lib/table/roster.spec.js +0 -25
- package/src/tests/utils/lib/tooltip/build-response.spec.js +0 -95
- package/src/tests/utils/lib/tooltip/content.spec.js +0 -109
- package/src/tests/utils/to-expose/handler/handler.spec.js +0 -94
- package/src/tests/utils/to-expose/handler/questionnaire.json +0 -158
- package/src/tests/utils/to-expose/handler/results/index.js +0 -6
- package/src/tests/utils/to-expose/handler/results/res-double.json +0 -158
- package/src/tests/utils/to-expose/handler/results/res-input-collected.json +0 -158
- package/src/tests/utils/to-expose/handler/results/res-input-edited.json +0 -158
- package/src/tests/utils/to-expose/handler/results/res-loop.json +0 -158
- package/src/tests/utils/to-expose/handler/results/res-matrix.json +0 -158
- package/src/tests/utils/to-expose/handler/results/res-responses.json +0 -158
- package/src/tests/utils/to-expose/hooks/use-lunatic.spec.js +0 -46
- package/src/tests/utils/to-expose/init-questionnaire/data.json +0 -12
- package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +0 -19
- package/src/tests/utils/to-expose/init-questionnaire/questionnaire.json +0 -148
- package/src/tests/utils/to-expose/init-questionnaire/result.json +0 -181
- package/src/tests/utils/to-expose/interpret/interpret.spec.js +0 -48
- package/src/tests/utils/to-expose/state/questionnaire.json +0 -61
- package/src/tests/utils/to-expose/state/results.js +0 -78
- package/src/tests/utils/to-expose/state/state.spec.js +0 -59
- 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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// .lunatic-component {
|
|
2
|
+
// .table-lunatic {
|
|
3
|
+
// table-layout: fixed;
|
|
4
|
+
// border-collapse: collapse;
|
|
5
|
+
// margin-top: 0.3em;
|
|
6
|
+
// margin-bottom: 0.3em;
|
|
7
|
+
// & td,
|
|
8
|
+
// th {
|
|
9
|
+
// border: 0.15em solid var(--color-primary-dark);
|
|
10
|
+
// padding: 0.2em;
|
|
11
|
+
// }
|
|
12
|
+
// & td {
|
|
13
|
+
// .field,
|
|
14
|
+
// .field-with-tooltip {
|
|
15
|
+
// display: flex;
|
|
16
|
+
// justify-content: center;
|
|
17
|
+
// align-items: center;
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
// }
|
|
21
|
+
|
|
22
|
+
// .table-lunatic .tooltip-lunatic img {
|
|
23
|
+
// height: 20px;
|
|
24
|
+
// width: 20px;
|
|
25
|
+
// }
|
|
26
|
+
// }
|
|
27
|
+
|
|
28
|
+
.lunatic-table {
|
|
29
|
+
table-layout: fixed;
|
|
30
|
+
border-collapse: collapse;
|
|
31
|
+
margin-top: 0.3em;
|
|
32
|
+
margin-bottom: 0.3em;
|
|
33
|
+
.lunatic-table-thead {
|
|
34
|
+
.lunatic-table-th {
|
|
35
|
+
border: 0.15em solid var(--color-primary-dark);
|
|
36
|
+
padding: 0.2em;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.lunatic-table-tbody {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import Tr from './html-table/tr';
|
|
3
|
+
import Td from './html-table/td';
|
|
4
|
+
import { RowComponent } from '../commons';
|
|
5
|
+
|
|
6
|
+
function Row({
|
|
7
|
+
id,
|
|
8
|
+
components,
|
|
9
|
+
valueMap,
|
|
10
|
+
rowIndex,
|
|
11
|
+
handleChange,
|
|
12
|
+
features,
|
|
13
|
+
missing,
|
|
14
|
+
shortcut,
|
|
15
|
+
management,
|
|
16
|
+
preferences,
|
|
17
|
+
executeExpression,
|
|
18
|
+
}) {
|
|
19
|
+
const handleChangeRow = useCallback(
|
|
20
|
+
function (response, value) {
|
|
21
|
+
handleChange(response, value, { index: rowIndex });
|
|
22
|
+
},
|
|
23
|
+
[handleChange, rowIndex]
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
if (Array.isArray(components)) {
|
|
27
|
+
return (
|
|
28
|
+
<Tr id={id}>
|
|
29
|
+
{components.map(function (component, index) {
|
|
30
|
+
const { response, id } = component;
|
|
31
|
+
const idComponent = `${id}-${rowIndex + 1} `;
|
|
32
|
+
let value = undefined;
|
|
33
|
+
if (response) {
|
|
34
|
+
const { name } = response;
|
|
35
|
+
if (name in valueMap) {
|
|
36
|
+
value = valueMap[name][rowIndex] || '';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Td id={idComponent}>
|
|
42
|
+
<RowComponent
|
|
43
|
+
component={component}
|
|
44
|
+
key={id}
|
|
45
|
+
handleChange={handleChangeRow}
|
|
46
|
+
features={features}
|
|
47
|
+
missing={missing}
|
|
48
|
+
shortcut={shortcut}
|
|
49
|
+
management={management}
|
|
50
|
+
value={value}
|
|
51
|
+
id={idComponent}
|
|
52
|
+
preferences={preferences}
|
|
53
|
+
iteration={rowIndex}
|
|
54
|
+
executeExpression={executeExpression}
|
|
55
|
+
/>
|
|
56
|
+
</Td>
|
|
57
|
+
);
|
|
58
|
+
})}
|
|
59
|
+
</Tr>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return <Tr id={id}></Tr>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default Row;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import componentWrapper from '../../component-wrapper';
|
|
3
3
|
import LoopConstructorWrapper from '../wrapper';
|
|
4
4
|
import * as U from '../../../utils/lib';
|
|
5
5
|
import './block.scss';
|
|
6
6
|
|
|
7
7
|
const BlockForLoop = (props) => <LoopConstructorWrapper {...props} />;
|
|
8
8
|
|
|
9
|
-
export default
|
|
9
|
+
export default componentWrapper(React.memo(BlockForLoop), U.areEqual);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './component';
|
|
1
|
+
export { default } from './component';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import componentWrapper from '../../component-wrapper';
|
|
3
3
|
import LoopConstructorWrapper from '../wrapper';
|
|
4
4
|
import * as U from '../../../utils/lib';
|
|
5
5
|
|
|
6
6
|
const RosterForLoop = (props) => <LoopConstructorWrapper {...props} />;
|
|
7
7
|
|
|
8
|
-
export default
|
|
8
|
+
export default componentWrapper(React.memo(RosterForLoop), U.areEqual);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './component';
|
|
1
|
+
export { default } from './component';
|
|
@@ -62,8 +62,11 @@ const BodyComponent = ({
|
|
|
62
62
|
management={management}
|
|
63
63
|
features={features}
|
|
64
64
|
bindings={localBindings}
|
|
65
|
+
fullBindings={bindings}
|
|
66
|
+
missingLoopIteration={i}
|
|
65
67
|
zIndex={uiComponents.length - i || 0}
|
|
66
68
|
logFunction={logFunction}
|
|
69
|
+
focused={i === 0 && j === 0}
|
|
67
70
|
/>
|
|
68
71
|
</td>
|
|
69
72
|
);
|
|
@@ -112,7 +115,10 @@ const BodyComponent = ({
|
|
|
112
115
|
management={management}
|
|
113
116
|
features={features}
|
|
114
117
|
bindings={localBindings}
|
|
118
|
+
fullBindings={bindings}
|
|
119
|
+
missingLoopIteration={i}
|
|
115
120
|
logFunction={logFunction}
|
|
121
|
+
focused={i === 0}
|
|
116
122
|
/>
|
|
117
123
|
</div>
|
|
118
124
|
);
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import * as C from '../../../constants';
|
|
2
|
-
|
|
3
|
-
export const buildContentForLoopConstructor = ({ components, headers }) => {
|
|
4
|
-
// Start hack to find interation number
|
|
5
|
-
// Refactor if we have to handle complex components (vector, matrix)
|
|
6
|
-
const iterations =
|
|
7
|
-
components.find((c) => c.response).response.values[C.COLLECTED].length || 1;
|
|
8
|
-
// End
|
|
9
|
-
const initialArray = [...Array(iterations).keys()];
|
|
10
|
-
const uiComponents = components.map((comp) => {
|
|
11
|
-
const { response, ...other } = comp;
|
|
12
|
-
if (!response) return initialArray.map(() => comp);
|
|
13
|
-
// Handle reponses & cells components ?
|
|
14
|
-
const { name, values } = response;
|
|
15
|
-
return initialArray.map((rowNumber) => {
|
|
16
|
-
const newValues = Object.entries(values).reduce(
|
|
17
|
-
(acc, [key, value]) => ({
|
|
18
|
-
...acc,
|
|
19
|
-
[key]: value ? value[rowNumber] : null,
|
|
20
|
-
}),
|
|
21
|
-
{}
|
|
22
|
-
);
|
|
23
|
-
return {
|
|
24
|
-
...other,
|
|
25
|
-
response: { name, values: newValues },
|
|
26
|
-
rowNumber,
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
}, []);
|
|
30
|
-
const transpose = (m) => m[0].map((_, i) => m.map((x) => x[i]));
|
|
31
|
-
const rows = transpose(uiComponents);
|
|
32
|
-
return headers ? [headers, ...rows] : rows;
|
|
33
|
-
};
|
|
1
|
+
import * as C from '../../../constants';
|
|
2
|
+
|
|
3
|
+
export const buildContentForLoopConstructor = ({ components, headers }) => {
|
|
4
|
+
// Start hack to find interation number
|
|
5
|
+
// Refactor if we have to handle complex components (vector, matrix)
|
|
6
|
+
const iterations =
|
|
7
|
+
components.find((c) => c.response).response.values[C.COLLECTED].length || 1;
|
|
8
|
+
// End
|
|
9
|
+
const initialArray = [...Array(iterations).keys()];
|
|
10
|
+
const uiComponents = components.map((comp) => {
|
|
11
|
+
const { response, ...other } = comp;
|
|
12
|
+
if (!response) return initialArray.map(() => comp);
|
|
13
|
+
// Handle reponses & cells components ?
|
|
14
|
+
const { name, values } = response;
|
|
15
|
+
return initialArray.map((rowNumber) => {
|
|
16
|
+
const newValues = Object.entries(values).reduce(
|
|
17
|
+
(acc, [key, value]) => ({
|
|
18
|
+
...acc,
|
|
19
|
+
[key]: value ? value[rowNumber] : null,
|
|
20
|
+
}),
|
|
21
|
+
{}
|
|
22
|
+
);
|
|
23
|
+
return {
|
|
24
|
+
...other,
|
|
25
|
+
response: { name, values: newValues },
|
|
26
|
+
rowNumber,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}, []);
|
|
30
|
+
const transpose = (m) => m[0].map((_, i) => m.map((x) => x[i]));
|
|
31
|
+
const rows = transpose(uiComponents);
|
|
32
|
+
return headers ? [headers, ...rows] : rows;
|
|
33
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './component';
|
|
1
|
+
export { default } from './component';
|
|
@@ -0,0 +1,42 @@
|
|
|
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;
|
|
37
|
+
|
|
38
|
+
function Modal() {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
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 +1 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './lunatic-radio-group';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import RadioGroup from './radio-group';
|
|
3
|
+
import { FieldContainer, Fieldset, useOnHandleChange } from '../commons';
|
|
4
|
+
import {
|
|
5
|
+
DeclarationsBeforeText,
|
|
6
|
+
DeclarationsAfterText,
|
|
7
|
+
DeclarationsDetachable,
|
|
8
|
+
} from '../declarations';
|
|
9
|
+
import './radio.scss';
|
|
10
|
+
|
|
11
|
+
function LunaticRadioGroup(props) {
|
|
12
|
+
const {
|
|
13
|
+
label,
|
|
14
|
+
id,
|
|
15
|
+
options,
|
|
16
|
+
value,
|
|
17
|
+
handleChange,
|
|
18
|
+
response,
|
|
19
|
+
declarations,
|
|
20
|
+
checkboxStyle,
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
const onClick = useOnHandleChange({ handleChange, response, value });
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<DeclarationsBeforeText declarations={declarations} />
|
|
28
|
+
<FieldContainer id={id} value={value}>
|
|
29
|
+
<Fieldset legend={label}>
|
|
30
|
+
<DeclarationsAfterText declarations={declarations} />
|
|
31
|
+
<RadioGroup
|
|
32
|
+
id={id}
|
|
33
|
+
options={options}
|
|
34
|
+
value={value}
|
|
35
|
+
onClick={onClick}
|
|
36
|
+
checkboxStyle={checkboxStyle}
|
|
37
|
+
/>
|
|
38
|
+
</Fieldset>
|
|
39
|
+
</FieldContainer>
|
|
40
|
+
<DeclarationsDetachable declarations={declarations} />
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default React.memo(LunaticRadioGroup);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import RadioOption from './radio-option';
|
|
3
|
+
import { Label, useOptionsKeydown } from '../commons';
|
|
4
|
+
|
|
5
|
+
function RadioGroup({ options, value, id, onClick, checkboxStyle = false }) {
|
|
6
|
+
const onKeyDown = useOptionsKeydown(options, onClick);
|
|
7
|
+
|
|
8
|
+
return options.map(function (option, index) {
|
|
9
|
+
const { value: valueOption, label } = option;
|
|
10
|
+
const radioId = `lunatic-radio-${id}-${valueOption}`;
|
|
11
|
+
const labelId = `lunatic-radio-label-${id}-${valueOption}`;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div key={radioId} className="lunatic-radio-group-option">
|
|
15
|
+
<Label id={labelId} htmlFor={radioId}>
|
|
16
|
+
{label}
|
|
17
|
+
</Label>
|
|
18
|
+
<RadioOption
|
|
19
|
+
id={radioId}
|
|
20
|
+
labelledBy={labelId}
|
|
21
|
+
index={index}
|
|
22
|
+
checked={value === valueOption}
|
|
23
|
+
onClick={onClick}
|
|
24
|
+
value={valueOption}
|
|
25
|
+
onKeyDown={onKeyDown}
|
|
26
|
+
checkboxStyle={checkboxStyle}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import RadioChecked from '../../utils/icons/radio-checked.icon';
|
|
4
|
+
import RadioUnchecked from '../../utils/icons/radio-unchecked.icon';
|
|
5
|
+
import CheckboxChecked from '../../utils/icons/checkbox-checked.icon';
|
|
6
|
+
import CheckboxUnchecked from '../../utils/icons/checkbox-unchecked.icon';
|
|
7
|
+
|
|
8
|
+
function getIcon(checked, checkboxStyle) {
|
|
9
|
+
if (checked) {
|
|
10
|
+
if (checkboxStyle) {
|
|
11
|
+
return CheckboxChecked;
|
|
12
|
+
}
|
|
13
|
+
return RadioChecked;
|
|
14
|
+
}
|
|
15
|
+
if (checkboxStyle) {
|
|
16
|
+
return CheckboxUnchecked;
|
|
17
|
+
}
|
|
18
|
+
return RadioUnchecked;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function RadioOption({
|
|
22
|
+
checked,
|
|
23
|
+
onClick,
|
|
24
|
+
value,
|
|
25
|
+
id,
|
|
26
|
+
disabled,
|
|
27
|
+
onKeyDown,
|
|
28
|
+
index,
|
|
29
|
+
labelledBy,
|
|
30
|
+
checkboxStyle,
|
|
31
|
+
}) {
|
|
32
|
+
const spanEl = useRef();
|
|
33
|
+
const Icon = getIcon(checked, checkboxStyle);
|
|
34
|
+
const tabIndex = checked ? '0' : '-1';
|
|
35
|
+
|
|
36
|
+
const onClickOption = useCallback(
|
|
37
|
+
function () {
|
|
38
|
+
onClick(value);
|
|
39
|
+
},
|
|
40
|
+
[value, onClick]
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const handleKeyDown = useCallback(
|
|
44
|
+
function (e) {
|
|
45
|
+
const { key } = e;
|
|
46
|
+
const { current } = spanEl;
|
|
47
|
+
onKeyDown({ key, index });
|
|
48
|
+
current.blur();
|
|
49
|
+
},
|
|
50
|
+
[onKeyDown, index, spanEl]
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
useEffect(
|
|
54
|
+
function () {
|
|
55
|
+
const { current } = spanEl;
|
|
56
|
+
if (current && checked) {
|
|
57
|
+
current.focus();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
[checked, spanEl, value]
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
className={classnames('radio-modality', 'radio-modality-block', {
|
|
66
|
+
checked,
|
|
67
|
+
disabled,
|
|
68
|
+
})}
|
|
69
|
+
>
|
|
70
|
+
<span
|
|
71
|
+
id={id}
|
|
72
|
+
role="radio"
|
|
73
|
+
className="lunatic-input-radio"
|
|
74
|
+
aria-checked={checked}
|
|
75
|
+
tabIndex={tabIndex}
|
|
76
|
+
onClick={onClickOption}
|
|
77
|
+
onKeyDown={handleKeyDown}
|
|
78
|
+
aria-labelledby={labelledBy}
|
|
79
|
+
ref={spanEl}
|
|
80
|
+
>
|
|
81
|
+
<Icon />
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default RadioOption;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
.lunatic-component {
|
|
2
|
-
.radio-group-list {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
// .radio-group-list {
|
|
3
|
+
// border: 0;
|
|
4
|
+
// outline: 0;
|
|
5
|
+
// padding: 0;
|
|
6
|
+
// margin-top: 0.9375rem;
|
|
7
|
+
// }
|
|
8
8
|
|
|
9
|
-
.radio-lunatic {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
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
30
|
|
|
31
|
-
.field,
|
|
32
|
-
.field-with-tooltip {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
31
|
+
// .field,
|
|
32
|
+
// .field-with-tooltip {
|
|
33
|
+
// .radio-group-list .radio-modality {
|
|
34
|
+
// height: 1.375em;
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
37
|
|
|
38
|
-
.radio-group-list {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
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
51
|
|
|
52
|
-
.radio-modality {
|
|
53
|
-
|
|
54
|
-
}
|
|
52
|
+
// .radio-modality {
|
|
53
|
+
// margin-bottom: 0.8em;
|
|
54
|
+
// }
|
|
55
55
|
|
|
56
|
-
.radio-lunatic + label {
|
|
57
|
-
|
|
58
|
-
}
|
|
56
|
+
// .radio-lunatic + label {
|
|
57
|
+
// margin-top: 0.325em;
|
|
58
|
+
// }
|
|
59
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './sequence';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
// import PropTypes from 'prop-types';
|
|
3
|
+
// import { SimpleDeclarationsWrapper } from '../declarations/wrappers';
|
|
4
|
+
// import * as U from '../../utils/lib';
|
|
5
|
+
// import { interpret } from '../../utils/to-expose';
|
|
6
|
+
import {
|
|
7
|
+
DeclarationsBeforeText,
|
|
8
|
+
DeclarationsAfterText,
|
|
9
|
+
DeclarationsDetachable,
|
|
10
|
+
} from '../declarations';
|
|
11
|
+
import './sequence.scss';
|
|
12
|
+
|
|
13
|
+
// const Sequence = ({
|
|
14
|
+
// id,
|
|
15
|
+
// label,
|
|
16
|
+
// declarations,
|
|
17
|
+
// features,
|
|
18
|
+
// bindings,
|
|
19
|
+
// style,
|
|
20
|
+
// logFunction,
|
|
21
|
+
// }) => (
|
|
22
|
+
// <SimpleDeclarationsWrapper
|
|
23
|
+
// id={id}
|
|
24
|
+
// declarations={declarations}
|
|
25
|
+
// features={features}
|
|
26
|
+
// bindings={bindings}
|
|
27
|
+
// >
|
|
28
|
+
// <div
|
|
29
|
+
// aria-label={`sequence-${id}`}
|
|
30
|
+
// className="sequence-lunatic"
|
|
31
|
+
// style={U.buildStyleObject(style)}
|
|
32
|
+
// id={`sequence-${id}`}
|
|
33
|
+
// >
|
|
34
|
+
// {interpret(features, logFunction)(bindings)(label)}
|
|
35
|
+
// </div>
|
|
36
|
+
// </SimpleDeclarationsWrapper>
|
|
37
|
+
// );
|
|
38
|
+
|
|
39
|
+
// Sequence.defaultProps = {
|
|
40
|
+
// declarations: [],
|
|
41
|
+
// features: [],
|
|
42
|
+
// bindings: {},
|
|
43
|
+
// style: {},
|
|
44
|
+
// };
|
|
45
|
+
|
|
46
|
+
// Sequence.propTypes = {
|
|
47
|
+
// id: PropTypes.string.isRequired,
|
|
48
|
+
// label: PropTypes.string.isRequired,
|
|
49
|
+
// declarations: U.declarationsPropTypes,
|
|
50
|
+
// features: PropTypes.arrayOf(PropTypes.string),
|
|
51
|
+
// bindings: PropTypes.object,
|
|
52
|
+
// style: PropTypes.object,
|
|
53
|
+
// };
|
|
54
|
+
|
|
55
|
+
// export default React.memo(Sequence, U.areEqual);
|
|
56
|
+
|
|
57
|
+
function Sequence({ declarations, label, id, style }) {
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
<DeclarationsBeforeText declarations={declarations} />
|
|
61
|
+
<div
|
|
62
|
+
aria-label={`sequence-${id}`}
|
|
63
|
+
className="sequence-lunatic"
|
|
64
|
+
// style={{}}
|
|
65
|
+
id={`sequence-${id}`}
|
|
66
|
+
>
|
|
67
|
+
{label}
|
|
68
|
+
</div>
|
|
69
|
+
<DeclarationsAfterText declarations={declarations} />
|
|
70
|
+
<DeclarationsDetachable declarations={declarations} />
|
|
71
|
+
</>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default Sequence;
|