@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,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"id": "1",
|
|
5
|
+
"componentType": "Switch",
|
|
6
|
+
"mandatory": false,
|
|
7
|
+
"label": "➡ 1. Are you ready?",
|
|
8
|
+
"response": {
|
|
9
|
+
"name": "READY"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "2",
|
|
14
|
+
"componentType": "Switch",
|
|
15
|
+
"mandatory": false,
|
|
16
|
+
"label": "➡ 2. Are you always ready?",
|
|
17
|
+
"response": {
|
|
18
|
+
"name": "READY2"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"variables": [
|
|
23
|
+
{
|
|
24
|
+
"variableType": "COLLECTED",
|
|
25
|
+
"name": "READY",
|
|
26
|
+
"componentRef": "1",
|
|
27
|
+
"values": {
|
|
28
|
+
"PREVIOUS": null,
|
|
29
|
+
"COLLECTED": true,
|
|
30
|
+
"FORCED": null,
|
|
31
|
+
"EDITED": null,
|
|
32
|
+
"INPUTED": null
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"variableType": "COLLECTED",
|
|
37
|
+
"name": "READY2",
|
|
38
|
+
"componentRef": "2",
|
|
39
|
+
"values": {
|
|
40
|
+
"PREVIOUS": null,
|
|
41
|
+
"COLLECTED": true,
|
|
42
|
+
"FORCED": null,
|
|
43
|
+
"EDITED": null,
|
|
44
|
+
"INPUTED": null
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"id": "1",
|
|
5
|
+
"componentType": "Switch",
|
|
6
|
+
"mandatory": false,
|
|
7
|
+
"label": "➡ 1. Are you ready?",
|
|
8
|
+
"statusLabel": { "true": "Yes", "false": "No" },
|
|
9
|
+
"response": {
|
|
10
|
+
"name": "READY"
|
|
11
|
+
},
|
|
12
|
+
"missingResponse": {
|
|
13
|
+
"name": "READY_MISSING"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "2",
|
|
18
|
+
"componentType": "Switch",
|
|
19
|
+
"mandatory": false,
|
|
20
|
+
"label": "➡ 2. Are you always ready?",
|
|
21
|
+
"response": {
|
|
22
|
+
"name": "READY2"
|
|
23
|
+
},
|
|
24
|
+
"missingResponse": {
|
|
25
|
+
"name": "READY2_MISSING"
|
|
26
|
+
},
|
|
27
|
+
"statusLabel": { "true": "Always", "false": "Never" }
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"variables": [
|
|
31
|
+
{
|
|
32
|
+
"variableType": "COLLECTED",
|
|
33
|
+
"name": "READY",
|
|
34
|
+
"componentRef": "1",
|
|
35
|
+
"values": {
|
|
36
|
+
"PREVIOUS": null,
|
|
37
|
+
"COLLECTED": null,
|
|
38
|
+
"FORCED": null,
|
|
39
|
+
"EDITED": null,
|
|
40
|
+
"INPUTED": null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"variableType": "COLLECTED",
|
|
45
|
+
"name": "READY_MISSING",
|
|
46
|
+
"componentRef": "1",
|
|
47
|
+
"values": {
|
|
48
|
+
"PREVIOUS": null,
|
|
49
|
+
"COLLECTED": null,
|
|
50
|
+
"FORCED": null,
|
|
51
|
+
"EDITED": null,
|
|
52
|
+
"INPUTED": null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"variableType": "COLLECTED",
|
|
57
|
+
"name": "READY2",
|
|
58
|
+
"componentRef": "2",
|
|
59
|
+
"values": {
|
|
60
|
+
"PREVIOUS": null,
|
|
61
|
+
"COLLECTED": true,
|
|
62
|
+
"FORCED": null,
|
|
63
|
+
"EDITED": null,
|
|
64
|
+
"INPUTED": null
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"variableType": "COLLECTED",
|
|
69
|
+
"name": "READY2_MISSING",
|
|
70
|
+
"componentRef": "2",
|
|
71
|
+
"values": {
|
|
72
|
+
"PREVIOUS": null,
|
|
73
|
+
"COLLECTED": null,
|
|
74
|
+
"FORCED": null,
|
|
75
|
+
"EDITED": null,
|
|
76
|
+
"INPUTED": null
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { storiesOf } from '@storybook/react';
|
|
3
|
+
import { withReadme } from 'storybook-readme';
|
|
4
|
+
import Orchestrator from '../utils/orchestrator';
|
|
5
|
+
import readme from './README.md';
|
|
6
|
+
import { titleDecorator } from 'utils/lib';
|
|
7
|
+
import data from './data';
|
|
8
|
+
import dataForced from './data-forced';
|
|
9
|
+
import { boolean, select, object } from '@storybook/addon-knobs/react';
|
|
10
|
+
import { positioningOptions, featuresOptions } from '../utils/options';
|
|
11
|
+
import SwitchMaterialUI from './SwitchMaterialUI';
|
|
12
|
+
|
|
13
|
+
const stories = storiesOf('switch', module)
|
|
14
|
+
.addDecorator(withReadme(readme))
|
|
15
|
+
.addDecorator((Component) => {
|
|
16
|
+
const WrappedComponent = titleDecorator(Component);
|
|
17
|
+
return <WrappedComponent title="<CheckboxBoolean />" />;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
stories.addWithJSX('Default', () => <Orchestrator source={data} />);
|
|
21
|
+
|
|
22
|
+
stories.addWithJSX('Props', () => (
|
|
23
|
+
<Orchestrator
|
|
24
|
+
source={data}
|
|
25
|
+
positioning={select('Items positioning', positioningOptions, 'DEFAULT')}
|
|
26
|
+
features={select('Features', featuresOptions, ['VTL', 'MD'])}
|
|
27
|
+
missing={boolean('Missing', false)}
|
|
28
|
+
bindings={object('Bindings', { test: 'test' })}
|
|
29
|
+
disabled={boolean('Disabled', false)}
|
|
30
|
+
focused={boolean('Focused', false)}
|
|
31
|
+
management={boolean('Management', false)}
|
|
32
|
+
/>
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
stories.addWithJSX('External update', () => {
|
|
36
|
+
const Fake = () => {
|
|
37
|
+
const [up, setUp] = useState(false);
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<button
|
|
41
|
+
type="button"
|
|
42
|
+
onClick={() => {
|
|
43
|
+
setUp(true);
|
|
44
|
+
}}
|
|
45
|
+
disabled={up}
|
|
46
|
+
>
|
|
47
|
+
Force external update
|
|
48
|
+
</button>
|
|
49
|
+
|
|
50
|
+
<Orchestrator id="default" source={up ? dataForced : data} />
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
return <Fake />;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
stories.addWithJSX('Custom Switch', function () {
|
|
58
|
+
const { components } = data;
|
|
59
|
+
const customized = components.map(function (component) {
|
|
60
|
+
const { componentType } = component;
|
|
61
|
+
if (componentType === 'Switch') {
|
|
62
|
+
return { ...component, custom: SwitchMaterialUI };
|
|
63
|
+
}
|
|
64
|
+
return component;
|
|
65
|
+
});
|
|
66
|
+
return (
|
|
67
|
+
<Orchestrator
|
|
68
|
+
source={{ ...data, components: customized }}
|
|
69
|
+
positioning={select('Items positioning', positioningOptions, 'DEFAULT')}
|
|
70
|
+
features={select('Features', featuresOptions, ['VTL', 'MD'])}
|
|
71
|
+
missing={boolean('Missing', false)}
|
|
72
|
+
bindings={object('Bindings', { test: 'test' })}
|
|
73
|
+
disabled={boolean('Disabled', false)}
|
|
74
|
+
focused={boolean('Focused', false)}
|
|
75
|
+
management={boolean('Management', false)}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
});
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
* {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
--color-primary-dark: #2a5885;
|
|
4
|
-
--color-primary-light: #5181b8;
|
|
5
|
-
--color-primary-main: #4a73a4;
|
|
6
|
-
--color-primary-contrast-text: #ffffff;
|
|
7
|
-
|
|
8
|
-
--color-secondary-dark: #14202d;
|
|
9
|
-
--color-secondary-light: #f7f8fa;
|
|
10
|
-
--color-secondary-main: #1a293b;
|
|
11
|
-
--color-secondary-contrast-text: #ffffff;
|
|
12
|
-
|
|
13
|
-
--color-very-light: #dbe4ef;
|
|
14
|
-
--color-very-very-light: #e6eaee;
|
|
15
|
-
--color-current-item: #0d823e;
|
|
16
|
-
|
|
17
|
-
--color-error: #f50c0c;
|
|
18
|
-
--color-disabled: rgb(235, 235, 228);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.pagination {
|
|
22
|
-
margin-top: 2em;
|
|
23
|
-
}
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
--color-primary-dark: #2a5885;
|
|
4
|
+
--color-primary-light: #5181b8;
|
|
5
|
+
--color-primary-main: #4a73a4;
|
|
6
|
+
--color-primary-contrast-text: #ffffff;
|
|
7
|
+
|
|
8
|
+
--color-secondary-dark: #14202d;
|
|
9
|
+
--color-secondary-light: #f7f8fa;
|
|
10
|
+
--color-secondary-main: #1a293b;
|
|
11
|
+
--color-secondary-contrast-text: #ffffff;
|
|
12
|
+
|
|
13
|
+
--color-very-light: #dbe4ef;
|
|
14
|
+
--color-very-very-light: #e6eaee;
|
|
15
|
+
--color-current-item: #0d823e;
|
|
16
|
+
|
|
17
|
+
--color-error: #f50c0c;
|
|
18
|
+
--color-disabled: rgb(235, 235, 228);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pagination {
|
|
22
|
+
margin-top: 2em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.waiting-orchestrator {
|
|
26
|
+
font-size: 1.5em;
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
}
|
|
@@ -1,18 +1,41 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
2
|
import * as lunatic from 'components';
|
|
3
3
|
import './custom-lunatic.scss';
|
|
4
|
+
import Waiting from './waiting';
|
|
4
5
|
|
|
5
6
|
function getStoreInfoRequired() {
|
|
6
7
|
return {};
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
function Pager({ goNext, goPrevious, isLast, isFirst, pageTag, maxPage }) {
|
|
11
|
+
if (maxPage && maxPage > 1) {
|
|
12
|
+
const Button = lunatic.Button;
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<div className="pagination">
|
|
16
|
+
<Button onClick={goPrevious} disabled={isFirst}>
|
|
17
|
+
Previous
|
|
18
|
+
</Button>
|
|
19
|
+
<Button onClick={goNext} disabled={isLast}>
|
|
20
|
+
Next
|
|
21
|
+
</Button>
|
|
22
|
+
</div>
|
|
23
|
+
<div>PAGE: {pageTag}</div>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const DEFAULT_DATA = {};
|
|
31
|
+
const DEFAULT_FEATURES = ['VTL'];
|
|
32
|
+
|
|
33
|
+
function OrchestratorForStories({
|
|
10
34
|
source,
|
|
11
|
-
|
|
12
|
-
data = {},
|
|
35
|
+
data = DEFAULT_DATA,
|
|
13
36
|
management = false,
|
|
14
|
-
|
|
15
|
-
features =
|
|
37
|
+
modalForControls = false,
|
|
38
|
+
features = DEFAULT_FEATURES,
|
|
16
39
|
bindings: initialBindings,
|
|
17
40
|
initialPage = '1',
|
|
18
41
|
getStoreInfo = getStoreInfoRequired,
|
|
@@ -21,88 +44,158 @@ const OrchestratorForStories = ({
|
|
|
21
44
|
activeGoNextForMissing = false,
|
|
22
45
|
suggesterFetcher,
|
|
23
46
|
autoSuggesterLoading,
|
|
47
|
+
addExternal,
|
|
24
48
|
...rest
|
|
25
|
-
})
|
|
49
|
+
}) {
|
|
26
50
|
const preferences = management
|
|
27
51
|
? ['COLLECTED', 'FORCED', 'EDITED']
|
|
28
52
|
: ['COLLECTED'];
|
|
29
53
|
const savingType = management ? 'EDITED' : 'COLLECTED';
|
|
54
|
+
const { maxPage } = source;
|
|
30
55
|
const {
|
|
56
|
+
getComponents,
|
|
57
|
+
goNextPage,
|
|
58
|
+
goPreviousPage,
|
|
31
59
|
handleChange,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
isFirstPage,
|
|
41
|
-
isLastPage,
|
|
42
|
-
flow,
|
|
43
|
-
},
|
|
44
|
-
} = lunatic.useLunatic(source, data, {
|
|
45
|
-
suggesters,
|
|
46
|
-
savingType,
|
|
47
|
-
preferences,
|
|
48
|
-
features,
|
|
49
|
-
management,
|
|
50
|
-
pagination,
|
|
60
|
+
pageTag,
|
|
61
|
+
isFirstPage,
|
|
62
|
+
isLastPage,
|
|
63
|
+
executeExpression,
|
|
64
|
+
waiting,
|
|
65
|
+
} = lunatic.useLunatic({
|
|
66
|
+
source,
|
|
67
|
+
data,
|
|
51
68
|
initialPage,
|
|
52
|
-
|
|
53
|
-
autoSuggesterLoading,
|
|
69
|
+
features,
|
|
54
70
|
});
|
|
55
|
-
const Button = lunatic.Button;
|
|
56
71
|
|
|
57
|
-
const
|
|
72
|
+
const components = getComponents();
|
|
58
73
|
|
|
59
74
|
return (
|
|
60
75
|
<div className="container">
|
|
61
76
|
<div className="components">
|
|
62
|
-
{components.map((
|
|
63
|
-
const { id, componentType } =
|
|
77
|
+
{components.map(function (component) {
|
|
78
|
+
const { id, componentType, response, ...other } = component;
|
|
64
79
|
const Component = lunatic[componentType];
|
|
65
|
-
const { storeName } = q;
|
|
66
|
-
|
|
67
80
|
return (
|
|
68
81
|
<div className="lunatic lunatic-component" key={`component-${id}`}>
|
|
69
82
|
<Component
|
|
83
|
+
id={id}
|
|
84
|
+
response={response}
|
|
85
|
+
{...other}
|
|
70
86
|
{...rest}
|
|
71
|
-
{...
|
|
72
|
-
{...getStoreInfo(storeName)}
|
|
87
|
+
{...component}
|
|
73
88
|
handleChange={handleChange}
|
|
74
89
|
preferences={preferences}
|
|
75
90
|
savingType={savingType}
|
|
76
91
|
management={management}
|
|
77
|
-
features={features}
|
|
78
|
-
bindings={{ ...bindings, ...initialBindings }}
|
|
79
|
-
currentPage={page}
|
|
80
|
-
setPage={setPage}
|
|
81
|
-
flow={flow}
|
|
82
|
-
pagination={pagination}
|
|
83
92
|
missing={missing}
|
|
84
93
|
shortcut={shortcut}
|
|
85
|
-
|
|
94
|
+
executeExpression={executeExpression}
|
|
86
95
|
/>
|
|
87
96
|
</div>
|
|
88
97
|
);
|
|
89
98
|
})}
|
|
90
99
|
</div>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
<Pager
|
|
101
|
+
goNext={goNextPage}
|
|
102
|
+
goPrevious={goPreviousPage}
|
|
103
|
+
isLast={isLastPage}
|
|
104
|
+
isFirst={isFirstPage}
|
|
105
|
+
pageTag={pageTag}
|
|
106
|
+
maxPage={maxPage}
|
|
107
|
+
/>
|
|
108
|
+
<Waiting status={waiting}>
|
|
109
|
+
<div className="waiting-orchestrator">
|
|
110
|
+
Initialisation des données de suggestion...
|
|
111
|
+
</div>
|
|
112
|
+
</Waiting>
|
|
104
113
|
</div>
|
|
105
114
|
);
|
|
106
|
-
};
|
|
107
115
|
|
|
108
|
-
|
|
116
|
+
// /* */
|
|
117
|
+
// const {
|
|
118
|
+
// handleExternals,
|
|
119
|
+
// components,
|
|
120
|
+
// bindings,
|
|
121
|
+
// pagination: {
|
|
122
|
+
// goNext,
|
|
123
|
+
// goPrevious,
|
|
124
|
+
// page,
|
|
125
|
+
// setPage,
|
|
126
|
+
// maxPage,
|
|
127
|
+
// isFirstPage,
|
|
128
|
+
// isLastPage,
|
|
129
|
+
// flow,
|
|
130
|
+
// },
|
|
131
|
+
// } = lunatic.useLunatic(source, data, {
|
|
132
|
+
// suggesters,
|
|
133
|
+
// savingType,
|
|
134
|
+
// preferences,
|
|
135
|
+
// features,
|
|
136
|
+
// management,
|
|
137
|
+
// pagination,
|
|
138
|
+
// modalForControls,
|
|
139
|
+
// initialPage,
|
|
140
|
+
// suggesterFetcher,
|
|
141
|
+
// autoSuggesterLoading,
|
|
142
|
+
// });
|
|
143
|
+
|
|
144
|
+
// useEffect(() => {
|
|
145
|
+
// handleExternals(addExternal);
|
|
146
|
+
// }, [addExternal, handleExternals]);
|
|
147
|
+
|
|
148
|
+
// const Button = lunatic.Button;
|
|
149
|
+
|
|
150
|
+
// const missingStrategy = (b) => goNext(null, b);
|
|
151
|
+
|
|
152
|
+
// return (
|
|
153
|
+
// <div className="container">
|
|
154
|
+
// <div className="components">
|
|
155
|
+
// {components.map((q) => {
|
|
156
|
+
// const { id, componentType } = q;
|
|
157
|
+
// const Component = lunatic[componentType];
|
|
158
|
+
// const { storeName } = q;
|
|
159
|
+
|
|
160
|
+
// return (
|
|
161
|
+
// <div className="lunatic lunatic-component" key={`component-${id}`}>
|
|
162
|
+
// <Component
|
|
163
|
+
// {...rest}
|
|
164
|
+
// {...q}
|
|
165
|
+
// {...getStoreInfo(storeName)}
|
|
166
|
+
// handleChange={handleChange}
|
|
167
|
+
// preferences={preferences}
|
|
168
|
+
// savingType={savingType}
|
|
169
|
+
// management={management}
|
|
170
|
+
// features={features}
|
|
171
|
+
// bindings={{ ...bindings, ...initialBindings }}
|
|
172
|
+
// currentPage={page}
|
|
173
|
+
// setPage={setPage}
|
|
174
|
+
// flow={flow}
|
|
175
|
+
// pagination={pagination}
|
|
176
|
+
// missing={missing}
|
|
177
|
+
// shortcut={shortcut}
|
|
178
|
+
// missingStrategy={activeGoNextForMissing && missingStrategy}
|
|
179
|
+
// />
|
|
180
|
+
// </div>
|
|
181
|
+
// );
|
|
182
|
+
// })}
|
|
183
|
+
// </div>
|
|
184
|
+
// {pagination && (
|
|
185
|
+
// <>
|
|
186
|
+
// <div className="pagination">
|
|
187
|
+
// <Button
|
|
188
|
+
// onClick={goPrevious}
|
|
189
|
+
// disabled={isFirstPage}
|
|
190
|
+
// value="Previous"
|
|
191
|
+
// />
|
|
192
|
+
// <Button onClick={goNext} disabled={isLastPage} value="Next" />
|
|
193
|
+
// </div>
|
|
194
|
+
// <div>{`Page : ${page}/${maxPage}`}</div>
|
|
195
|
+
// </>
|
|
196
|
+
// )}
|
|
197
|
+
// </div>
|
|
198
|
+
// );
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export default memo(OrchestratorForStories);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './waiting';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="64px" height="64px" viewBox="0 0 128 128" xml:space="preserve"><g><circle cx="16" cy="64" r="16" fill="#000"/><circle cx="16" cy="64" r="16" fill="#555" transform="rotate(45,64,64)"/><circle cx="16" cy="64" r="16" fill="#949494" transform="rotate(90,64,64)"/><circle cx="16" cy="64" r="16" fill="#ccc" transform="rotate(135,64,64)"/><circle cx="16" cy="64" r="16" fill="#e1e1e1" transform="rotate(180,64,64)"/><circle cx="16" cy="64" r="16" fill="#e1e1e1" transform="rotate(225,64,64)"/><circle cx="16" cy="64" r="16" fill="#e1e1e1" transform="rotate(270,64,64)"/><circle cx="16" cy="64" r="16" fill="#e1e1e1" transform="rotate(315,64,64)"/><animateTransform attributeName="transform" type="rotate" values="0 64 64;315 64 64;270 64 64;225 64 64;180 64 64;135 64 64;90 64 64;45 64 64" calcMode="discrete" dur="720ms" repeatCount="indefinite"></animateTransform></g></svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './waiting.scss';
|
|
3
|
+
import preloader from './preloader.svg';
|
|
4
|
+
|
|
5
|
+
function Waiting({ status, children }) {
|
|
6
|
+
if (status) {
|
|
7
|
+
return (
|
|
8
|
+
<div className="waiting">
|
|
9
|
+
<img src={preloader} alt="loading" />
|
|
10
|
+
<div className="content">{children}</div>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Waiting.defaultProps = {
|
|
18
|
+
status: false,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default React.memo(Waiting);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.waiting {
|
|
2
|
+
display: block;
|
|
3
|
+
position: fixed;
|
|
4
|
+
height: 100%;
|
|
5
|
+
width: 100%;
|
|
6
|
+
background-color: rgba(23, 59, 77, 0.8);
|
|
7
|
+
top: 0;
|
|
8
|
+
img {
|
|
9
|
+
display: block;
|
|
10
|
+
margin-left: auto;
|
|
11
|
+
margin-right: auto;
|
|
12
|
+
width: 10%;
|
|
13
|
+
margin-top: 120px;
|
|
14
|
+
}
|
|
15
|
+
.content {
|
|
16
|
+
display: block;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
margin-left: auto;
|
|
19
|
+
margin-right: auto;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import LunaticIcon from './lunatic-icon';
|
|
3
|
+
|
|
4
|
+
function CheckboxCheckedIcon({ className, width = 32, height = 32 }) {
|
|
5
|
+
return (
|
|
6
|
+
<LunaticIcon className={className}>
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width={width}
|
|
10
|
+
height={height}
|
|
11
|
+
x="0"
|
|
12
|
+
y="0"
|
|
13
|
+
enableBackground="new 0 0 32 32"
|
|
14
|
+
version="1.1"
|
|
15
|
+
viewBox="0 0 32 32"
|
|
16
|
+
xmlSpace="preserve"
|
|
17
|
+
>
|
|
18
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
19
|
+
<path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
|
|
20
|
+
</svg>
|
|
21
|
+
</LunaticIcon>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default CheckboxCheckedIcon;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import LunaticIcon from './lunatic-icon';
|
|
3
|
+
|
|
4
|
+
function CheckboxUncheckedIcon({ className, width = 32, height = 32 }) {
|
|
5
|
+
return (
|
|
6
|
+
<LunaticIcon className={className}>
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width={width}
|
|
10
|
+
height={height}
|
|
11
|
+
x="0"
|
|
12
|
+
y="0"
|
|
13
|
+
enableBackground="new 0 0 32 32"
|
|
14
|
+
version="1.1"
|
|
15
|
+
viewBox="0 0 32 32"
|
|
16
|
+
xmlSpace="preserve"
|
|
17
|
+
>
|
|
18
|
+
<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" />
|
|
19
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
20
|
+
</svg>
|
|
21
|
+
</LunaticIcon>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default CheckboxUncheckedIcon;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import LunaticIcon from './lunatic-icon';
|
|
3
|
+
|
|
4
|
+
function RadioCheckedIcon({ className, width = 32, height = 32 }) {
|
|
5
|
+
return (
|
|
6
|
+
<LunaticIcon className={className}>
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width={width}
|
|
10
|
+
height={height}
|
|
11
|
+
x="0"
|
|
12
|
+
y="0"
|
|
13
|
+
enableBackground="new 0 0 32 32"
|
|
14
|
+
version="1.1"
|
|
15
|
+
viewBox="0 0 32 32"
|
|
16
|
+
xmlSpace="preserve"
|
|
17
|
+
>
|
|
18
|
+
<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
|
|
19
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
20
|
+
</svg>
|
|
21
|
+
</LunaticIcon>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default RadioCheckedIcon;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import LunaticIcon from './lunatic-icon';
|
|
3
|
+
|
|
4
|
+
function RadioUncheckedIcon({ className, width = 32, height = 32 }) {
|
|
5
|
+
return (
|
|
6
|
+
<LunaticIcon className={className}>
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width={width}
|
|
10
|
+
height={height}
|
|
11
|
+
x="0"
|
|
12
|
+
y="0"
|
|
13
|
+
enableBackground="new 0 0 32 32"
|
|
14
|
+
version="1.1"
|
|
15
|
+
viewBox="0 0 32 32"
|
|
16
|
+
xmlSpace="preserve"
|
|
17
|
+
>
|
|
18
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
|
|
19
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
20
|
+
</svg>
|
|
21
|
+
</LunaticIcon>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default RadioUncheckedIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|