@inseefr/lunatic 2.0.0 → 2.0.1-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/LICENSE +21 -21
- package/README.md +25 -22
- package/lib/components/button/button.scss +24 -0
- package/lib/components/button/index.js +15 -0
- package/lib/components/button/lunatic-button.js +66 -0
- package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +36 -0
- package/lib/components/checkbox/checkbox-boolean/index.js +15 -0
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +48 -0
- package/lib/components/checkbox/checkbox-group/checkbox-group.js +96 -0
- package/lib/components/checkbox/checkbox-group/checkbox.scss +4 -0
- package/lib/components/checkbox/checkbox-group/index.js +15 -0
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +42 -0
- package/lib/components/checkbox/checkbox-one/index.js +15 -0
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +39 -0
- package/lib/components/checkbox/commons/checkbox-option.js +68 -0
- package/lib/components/checkbox/commons/checkbox-option.scss +3 -0
- package/lib/components/checkbox/commons/index.js +15 -0
- package/lib/components/checkbox/index.js +31 -0
- package/lib/components/commons/build-style-object.js +36 -0
- package/lib/components/commons/components/combo-box/combo-box-container.js +37 -0
- package/lib/components/commons/components/combo-box/combo-box-content.js +73 -0
- package/lib/components/commons/components/combo-box/combo-box.js +222 -0
- package/lib/components/commons/components/combo-box/combo-box.scss +205 -0
- package/lib/components/commons/components/combo-box/index.js +15 -0
- package/lib/components/commons/components/combo-box/panel/index.js +15 -0
- package/lib/components/commons/components/combo-box/panel/option-container.js +77 -0
- package/lib/components/commons/components/combo-box/panel/panel-container.js +31 -0
- package/lib/components/commons/components/combo-box/panel/panel.js +70 -0
- package/lib/components/commons/components/combo-box/selection/delete.js +69 -0
- package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +30 -0
- package/lib/components/commons/components/combo-box/selection/index.js +15 -0
- package/lib/components/commons/components/combo-box/selection/input.js +68 -0
- package/lib/components/commons/components/combo-box/selection/label-selection.js +39 -0
- package/lib/components/commons/components/combo-box/selection/selection-container.js +40 -0
- package/lib/components/commons/components/combo-box/selection/selection.js +71 -0
- package/lib/components/commons/components/combo-box/state-management/actions.js +98 -0
- package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/index.js +42 -0
- package/lib/components/commons/components/combo-box/state-management/initial-state.js +14 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/index.js +15 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +24 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +23 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +46 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +15 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/keyboard-key-codes.js +18 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +37 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +37 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +28 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +23 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +28 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +59 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +24 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +63 -0
- package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +75 -0
- package/lib/components/commons/components/create-lunatic-component/index.js +14 -0
- package/lib/components/commons/components/default-label-renderer.js +54 -0
- package/lib/components/commons/components/default-option-renderer.js +43 -0
- package/lib/components/commons/components/dragger/dragger.js +118 -0
- package/lib/components/commons/components/dragger/dragger.scss +8 -0
- package/lib/components/commons/components/dragger/index.js +15 -0
- package/lib/components/commons/components/errors/errors.js +55 -0
- package/lib/components/commons/components/errors/errors.scss +5 -0
- package/lib/components/commons/components/errors/index.js +15 -0
- package/lib/components/commons/components/fab/fab.js +56 -0
- package/lib/components/commons/components/fab/fab.scss +32 -0
- package/lib/components/commons/components/fab/index.js +15 -0
- package/lib/components/commons/components/field-container/field-container.js +48 -0
- package/lib/components/commons/components/field-container/field-container.scss +0 -0
- package/lib/components/commons/components/field-container/index.js +15 -0
- package/lib/components/commons/components/fieldset.js +26 -0
- package/lib/components/commons/components/fieldset.scss +5 -0
- package/lib/components/commons/components/html-table/index.js +55 -0
- package/lib/components/commons/components/html-table/table.js +38 -0
- package/lib/components/commons/components/html-table/tbody.js +38 -0
- package/lib/components/commons/components/html-table/td.js +50 -0
- package/lib/components/commons/components/html-table/th.js +48 -0
- package/lib/components/commons/components/html-table/thead.js +38 -0
- package/lib/components/commons/components/html-table/tr.js +40 -0
- package/lib/components/commons/components/is-network/index.js +15 -0
- package/lib/components/commons/components/is-network/is-network.js +70 -0
- package/lib/components/commons/components/is-network/use-online-status.js +55 -0
- package/lib/components/commons/components/label.js +35 -0
- package/lib/components/commons/components/lunatic-component.js +67 -0
- package/lib/components/commons/components/lunatic-fieldset-component.js +60 -0
- package/lib/components/commons/components/md-label/index.js +15 -0
- package/lib/components/commons/components/md-label/link.js +57 -0
- package/lib/components/commons/components/md-label/md-label.js +52 -0
- package/lib/components/commons/components/missing/index.js +15 -0
- package/lib/components/commons/components/missing/missing.js +90 -0
- package/lib/components/commons/components/missing/missing.scss +30 -0
- package/lib/components/commons/components/nothing-to-display.js +17 -0
- package/lib/components/commons/components/orchestrated-component.js +71 -0
- package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/edited.png +0 -0
- package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/forced.png +0 -0
- package/lib/components/commons/components/variable-status/img/index.js +23 -0
- package/lib/components/commons/components/variable-status/index.js +15 -0
- package/lib/components/commons/components/variable-status/variable-status.js +95 -0
- package/lib/components/commons/components/variable-status/variable-status.scss +39 -0
- package/lib/components/commons/create-customizable-field.js +38 -0
- package/lib/components/commons/create-row-orchestrator.js +60 -0
- package/lib/components/commons/icons/checkbox-checked.icon.js +41 -0
- package/lib/components/commons/icons/checkbox-unchecked.icon.js +41 -0
- package/lib/components/commons/icons/closed.icon.js +38 -0
- package/lib/components/commons/icons/cross.icon.js +38 -0
- package/lib/components/commons/icons/index.js +87 -0
- package/lib/components/commons/icons/load.icon.js +38 -0
- package/lib/components/commons/icons/lunatic-icon.js +25 -0
- package/lib/components/commons/icons/lunatic-icon.scss +3 -0
- package/lib/components/commons/icons/network.icon.js +38 -0
- package/lib/components/commons/icons/on-drag.icon.js +38 -0
- package/lib/components/commons/icons/opened.icon.js +38 -0
- package/lib/components/commons/icons/radio-checked.icon.js +41 -0
- package/lib/components/commons/icons/radio-unchecked.icon.js +41 -0
- package/lib/components/commons/index.js +162 -0
- package/lib/components/commons/prop-types/declarations.js +27 -0
- package/lib/components/commons/prop-types/index.js +47 -0
- package/lib/components/commons/prop-types/lines.js +17 -0
- package/lib/components/commons/prop-types/options.js +17 -0
- package/lib/components/commons/prop-types/response.js +17 -0
- package/lib/components/commons/prop-types/value-type.js +22 -0
- package/lib/components/commons/safety-label.js +34 -0
- package/lib/components/commons/use-document-add-event-listener.js +108 -0
- package/lib/components/commons/use-on-handle-change.js +22 -0
- package/lib/components/commons/use-options-keydown.js +29 -0
- package/lib/components/commons/use-previous.js +19 -0
- package/lib/components/components.js +188 -0
- package/lib/components/datepicker/datepicker.js +56 -0
- package/lib/components/datepicker/datepicker.scss +1 -0
- package/lib/components/datepicker/index.js +15 -0
- package/lib/components/datepicker/lunatic-datepicker.js +39 -0
- package/lib/components/declarations/declaration.js +26 -0
- package/lib/components/declarations/declarations-after-text.js +29 -0
- package/lib/components/declarations/declarations-before-text.js +29 -0
- package/lib/components/declarations/declarations-detachable.js +29 -0
- package/lib/components/declarations/declarations.js +61 -0
- package/lib/components/declarations/declarations.scss +36 -0
- package/lib/components/declarations/index.js +51 -0
- package/lib/components/dropdown/dropdown-simple/dropdown-simple.js +43 -0
- package/lib/components/dropdown/dropdown-simple/index.js +15 -0
- package/lib/components/dropdown/dropdown-simple/simple-label-renderer.js +53 -0
- package/lib/components/dropdown/dropdown-simple/simple-option-renderer.js +42 -0
- package/lib/components/dropdown/dropdown-writable/dropdown-writable.js +79 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/filter-options.js +47 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +40 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/match.js +27 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +17 -0
- package/lib/components/dropdown/dropdown-writable/index.js +15 -0
- package/lib/components/dropdown/dropdown-writable/writable-label-renderer.js +53 -0
- package/lib/components/dropdown/dropdown-writable/writable-option-renderer.js +170 -0
- package/lib/components/dropdown/dropdown.js +58 -0
- package/lib/components/dropdown/dropdown.scss +41 -0
- package/lib/components/dropdown/index.js +15 -0
- package/lib/components/dropdown/lunatic-dropdown.js +62 -0
- package/lib/components/filter-description/component.js +26 -0
- package/lib/components/filter-description/index.js +15 -0
- package/lib/components/index.js +32 -0
- package/lib/components/index.scss +136 -0
- package/lib/components/input/index.js +15 -0
- package/lib/components/input/input.js +61 -0
- package/lib/components/input/input.scss +32 -0
- package/lib/components/input/lunatic-input.js +43 -0
- package/lib/components/input-number/index.js +15 -0
- package/lib/components/input-number/input-number.js +61 -0
- package/lib/components/input-number/input-number.scss +7 -0
- package/lib/components/input-number/lunatic-input-number.js +37 -0
- package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +16 -0
- package/lib/components/loop/block-for-loop/block-for-loop.js +179 -0
- package/lib/components/loop/block-for-loop/index.js +15 -0
- package/lib/components/loop/block-for-loop/row.js +84 -0
- package/lib/components/loop/commons/get-init-length.js +19 -0
- package/lib/components/loop/commons/handle-row-button.js +25 -0
- package/lib/components/loop/commons/index.js +23 -0
- package/lib/components/loop/commons/row-component.js +86 -0
- package/lib/components/loop/index.js +15 -0
- package/lib/components/loop/loop.js +94 -0
- package/lib/components/loop/roster-for-loop/body.js +69 -0
- package/lib/components/loop/roster-for-loop/header.js +42 -0
- package/lib/components/loop/roster-for-loop/index.js +15 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +16 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +153 -0
- package/lib/components/loop/roster-for-loop/roster-table.js +61 -0
- package/lib/components/loop/roster-for-loop/roster.scss +42 -0
- package/lib/components/loop/roster-for-loop/row.js +88 -0
- package/lib/components/modal-controls/close-or-skip.js +46 -0
- package/lib/components/modal-controls/index.js +15 -0
- package/lib/components/modal-controls/modal-container.js +24 -0
- package/lib/components/modal-controls/modal-controls.js +94 -0
- package/lib/components/modal-controls/modal-controls.scss +46 -0
- package/lib/components/pairwise/index.js +15 -0
- package/lib/components/pairwise/links/index.js +15 -0
- package/lib/components/pairwise/links/orchestrator.js +16 -0
- package/lib/components/pairwise/links/pairwise-links.js +75 -0
- package/lib/components/pairwise/links/row.js +95 -0
- package/lib/components/radio/index.js +15 -0
- package/lib/components/radio/lunatic-radio-group.js +45 -0
- package/lib/components/radio/radio-group.js +48 -0
- package/lib/components/radio/radio-option.js +94 -0
- package/lib/components/radio/radio.scss +66 -0
- package/lib/components/sequence/index.js +15 -0
- package/lib/components/sequence/sequence.js +41 -0
- package/lib/components/sequence/sequence.scss +10 -0
- package/lib/components/subsequence/index.js +15 -0
- package/lib/components/subsequence/subsequence.js +38 -0
- package/lib/components/suggester/check-store.js +149 -0
- package/lib/components/suggester/default-style.scss +125 -0
- package/lib/components/suggester/find-best-label/find-best-label.js +67 -0
- package/lib/components/suggester/find-best-label/index.js +15 -0
- package/lib/components/suggester/idb-suggester.js +95 -0
- package/lib/components/suggester/index.js +15 -0
- package/lib/components/suggester/lunatic-suggester.js +94 -0
- package/lib/components/suggester/searching/create-searching.js +88 -0
- package/lib/components/suggester/searching/index.js +15 -0
- package/lib/components/suggester/suggester.js +172 -0
- package/lib/components/suggester-loader-widget/index.js +15 -0
- package/lib/components/suggester-loader-widget/loader-row.js +150 -0
- package/lib/components/suggester-loader-widget/loader.js +180 -0
- package/lib/components/suggester-loader-widget/progress.js +45 -0
- package/lib/components/suggester-loader-widget/tools/action-tool.js +35 -0
- package/lib/components/suggester-loader-widget/tools/index.js +23 -0
- package/lib/components/suggester-loader-widget/tools/tools.js +20 -0
- package/lib/components/suggester-loader-widget/widget-container.js +48 -0
- package/lib/components/suggester-loader-widget/widget.js +170 -0
- package/lib/components/suggester-loader-widget/widget.scss +176 -0
- package/lib/components/switch/index.js +15 -0
- package/lib/components/switch/lunatic-switch.js +59 -0
- package/lib/components/switch/switch.js +92 -0
- package/lib/components/switch/switch.scss +47 -0
- package/lib/components/table/cell.js +113 -0
- package/lib/components/table/components/cell.js +113 -0
- package/lib/components/table/components/header.js +48 -0
- package/lib/components/table/components/row.js +47 -0
- package/lib/components/table/components/table.js +38 -0
- package/lib/components/table/components/table.scss +27 -0
- package/lib/components/table/index.js +15 -0
- package/lib/components/table/lunatic-table.js +97 -0
- package/lib/components/table/table-orchestrator.js +55 -0
- package/lib/components/textarea/index.js +15 -0
- package/lib/components/textarea/lunatic-textarea.js +52 -0
- package/lib/components/textarea/textarea.js +54 -0
- package/lib/components/textarea/textarea.scss +8 -0
- package/lib/constants/component-types.js +8 -0
- package/lib/constants/declarations.js +26 -0
- package/lib/constants/event-types.js +28 -0
- package/lib/constants/index.js +70 -0
- package/lib/constants/supported-preferences.js +18 -0
- package/lib/constants/value-types.js +16 -0
- package/lib/constants/variable-types.js +12 -0
- package/lib/i18n/build-dictionary.js +56 -0
- package/lib/i18n/dictionary.js +26 -0
- package/lib/i18n/index.js +19 -0
- package/lib/index.js +21 -4164
- package/lib/stories/Introduction.stories.mdx +114 -0
- package/lib/stories/checkboxOne/checkboxOne.stories.js +35 -0
- package/lib/stories/checkboxOne/source.json +36 -0
- package/lib/stories/custom-mui/checkbox-boolean-mui.js +39 -0
- package/lib/stories/custom-mui/checkbox-group-mui.js +80 -0
- package/lib/stories/custom-mui/checkbox-one-mui.js +17 -0
- package/lib/stories/custom-mui/index.js +127 -0
- package/lib/stories/custom-mui/input-mui.js +61 -0
- package/lib/stories/custom-mui/input-number-mui.js +47 -0
- package/lib/stories/custom-mui/radio-mui.js +75 -0
- package/lib/stories/custom-mui/suggester-mui/index.js +15 -0
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +328 -0
- package/lib/stories/custom-mui/switch-mui.js +51 -0
- package/lib/stories/custom-mui/table-mui.js +33 -0
- package/lib/stories/custom-mui/tbody-mui.js +27 -0
- package/lib/stories/custom-mui/td-mui.js +29 -0
- package/lib/stories/custom-mui/textarea-mui.js +51 -0
- package/lib/stories/custom-mui/th-mui.js +28 -0
- package/lib/stories/custom-mui/thead-mui.js +27 -0
- package/lib/stories/custom-mui/tr-mui.js +38 -0
- package/lib/stories/date-picker/data.json +3 -0
- package/lib/stories/date-picker/datepicker.stories.js +38 -0
- package/lib/stories/date-picker/source.json +140 -0
- package/lib/stories/dropdown/data.json +16 -0
- package/lib/stories/dropdown/dropdown.stories.js +38 -0
- package/lib/stories/dropdown/source.json +122 -0
- package/lib/stories/filter-description/filter-description.stories.js +58 -0
- package/lib/stories/filter-description/source-options.json +81 -0
- package/lib/stories/filter-description/source.json +11 -0
- package/lib/stories/input/data.json +1 -0
- package/lib/stories/input/input.stories.js +38 -0
- package/lib/stories/input/source.json +28 -0
- package/lib/stories/input-number/input-number.stories.js +43 -0
- package/lib/stories/input-number/source-euros.json +38 -0
- package/lib/stories/input-number/source.json +37 -0
- package/lib/stories/pairwise/data.json +13 -0
- package/lib/stories/pairwise/links.json +207 -0
- package/lib/stories/pairwise/pairwise-links.stories.js +39 -0
- package/lib/stories/paste-questionnaire/source.json +6290 -0
- package/lib/stories/paste-questionnaire/test.stories.js +91 -0
- package/lib/stories/questionnaires/logement/data.json +2691 -0
- package/lib/stories/questionnaires/logement/logement.stories.js +86 -0
- package/lib/stories/questionnaires/logement/source-sequence.json +34181 -0
- package/lib/stories/questionnaires/logement/source-sum.json +34612 -0
- package/lib/stories/questionnaires/logement/source.json +34191 -0
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +71 -0
- package/lib/stories/questionnaires/simpsons/source.json +6290 -0
- package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +848 -0
- package/lib/stories/questionnaires-test/V2_MinMaxSum_Boucles.json +509 -0
- package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4091 -0
- package/lib/stories/questionnaires-test/V2_TCMRallyeGames.json +2892 -0
- package/lib/stories/questionnaires-test/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +666 -0
- package/lib/stories/questionnaires-test/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +1957 -0
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees2_PasPageFin.json +709 -0
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +533 -0
- package/lib/stories/questionnaires-test/controls/boucles-n.json +202 -0
- package/lib/stories/questionnaires-test/controls/controls.stories.js +108 -0
- package/lib/stories/questionnaires-test/test-dylan.json +558 -0
- package/lib/stories/questionnaires-test/test.stories.js +104 -0
- package/lib/stories/radio/radio.stories.js +35 -0
- package/lib/stories/radio/source.json +36 -0
- package/lib/stories/roster-for-loop/roster-for-loop.stories.js +35 -0
- package/lib/stories/roster-for-loop/source.json +114 -0
- package/lib/stories/suggester/source.json +234 -0
- package/lib/stories/suggester/suggester.stories.js +59 -0
- package/{src/stories/checkbox-one → lib/stories/switch}/README.md +31 -31
- package/lib/stories/switch/SwitchMaterialUI.js +51 -0
- package/{src/stories/checkbox-boolean/data.json → lib/stories/switch/data-forced.json} +48 -48
- package/lib/stories/switch/data.json +80 -0
- package/lib/stories/switch/switch.js +108 -0
- package/lib/stories/table/data-roster.json +1 -0
- package/lib/stories/table/data.json +1 -0
- package/{src/stories/table/data-roster.json → lib/stories/table/source-roster.json} +504 -461
- package/{src/stories/table/data-default.json → lib/stories/table/source.json} +19 -19
- package/lib/stories/table/table.stories.js +65 -0
- package/lib/stories/utils/custom-lunatic.scss +28 -0
- package/lib/stories/utils/default-arg-types.js +23 -0
- package/lib/stories/utils/options.js +32 -0
- package/lib/stories/utils/orchestrator.js +188 -0
- package/lib/stories/utils/waiting/index.js +15 -0
- package/lib/stories/utils/waiting/preloader.svg +1 -0
- package/lib/stories/utils/waiting/waiting.js +40 -0
- package/lib/stories/utils/waiting/waiting.scss +21 -0
- package/lib/tests/sample.spec.js +7 -0
- package/lib/use-lunatic/actions.js +102 -0
- package/lib/use-lunatic/commons/calculated-variables.js +124 -0
- package/lib/use-lunatic/commons/check-loops.js +111 -0
- package/lib/use-lunatic/commons/compose.js +28 -0
- package/lib/use-lunatic/commons/create-map-pages.js +108 -0
- package/lib/use-lunatic/commons/execute-condition-filter.js +34 -0
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +308 -0
- package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +78 -0
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +160 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +118 -0
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +51 -0
- package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +37 -0
- package/lib/use-lunatic/commons/execute-expression/index.js +15 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +149 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +26 -0
- package/lib/use-lunatic/commons/fill-components/fill-components.js +47 -0
- package/lib/use-lunatic/commons/fill-components/fill-errors.js +31 -0
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +26 -0
- package/lib/use-lunatic/commons/fill-components/fill-management.js +27 -0
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +37 -0
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +23 -0
- package/lib/use-lunatic/commons/fill-components/index.js +15 -0
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +32 -0
- package/lib/use-lunatic/commons/get-component-value/get-component-value.js +217 -0
- package/lib/use-lunatic/commons/get-component-value/index.js +15 -0
- package/lib/use-lunatic/commons/get-components-from-state.js +44 -0
- package/lib/use-lunatic/commons/get-data.js +90 -0
- package/lib/use-lunatic/commons/get-errors-without-empty-value.js +31 -0
- package/lib/use-lunatic/commons/index.js +123 -0
- package/lib/use-lunatic/commons/is-First-last-page.js +20 -0
- package/lib/use-lunatic/commons/is-paginated-loop.js +15 -0
- package/lib/use-lunatic/commons/load-suggesters.js +199 -0
- package/lib/use-lunatic/commons/page-tag.js +83 -0
- package/lib/use-lunatic/commons/use-components-from-state.js +49 -0
- package/lib/use-lunatic/index.js +15 -0
- package/lib/use-lunatic/initial-state.js +44 -0
- package/lib/use-lunatic/reducer/commons/index.js +41 -0
- package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +49 -0
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js +48 -0
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +41 -0
- package/lib/use-lunatic/reducer/index.js +15 -0
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +218 -0
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +165 -0
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +60 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/index.js +15 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +77 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +142 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +53 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +90 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +118 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +50 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +29 -0
- package/lib/use-lunatic/reducer/reduce-on-init.js +260 -0
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +23 -0
- package/lib/use-lunatic/reducer/reducer.js +58 -0
- package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +69 -0
- package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +100 -0
- package/lib/use-lunatic/reducer/validate-controls/index.js +23 -0
- package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +73 -0
- package/lib/use-lunatic/use-lunatic.js +215 -0
- package/lib/utils/constants/features.js +12 -0
- package/lib/utils/constants/index.js +70 -0
- package/lib/utils/constants/links.js +10 -0
- package/lib/utils/constants/missing.js +10 -0
- package/lib/utils/constants/variable-status.js +16 -0
- package/lib/utils/constants/variable-types.js +8 -0
- package/lib/utils/idb-tools/clear-store.js +52 -0
- package/lib/utils/idb-tools/create-db-opener.js +60 -0
- package/lib/utils/idb-tools/create-open-db.js +35 -0
- package/lib/utils/idb-tools/get-entity.js +25 -0
- package/lib/utils/idb-tools/get-idb.js +15 -0
- package/lib/utils/idb-tools/idb-bulk-insert.js +157 -0
- package/lib/utils/idb-tools/index.js +75 -0
- package/lib/utils/idb-tools/insert-entity.js +25 -0
- package/lib/utils/idb-tools/open-db.js +29 -0
- package/lib/utils/idb-tools/open-or-create-db.js +49 -0
- package/lib/utils/is-element.js +12 -0
- package/lib/utils/store-tools/auto-load.js +209 -0
- package/lib/utils/store-tools/clear-store-data.js +46 -0
- package/lib/utils/store-tools/clear-store-info.js +46 -0
- package/lib/utils/store-tools/constantes.js +31 -0
- package/lib/utils/store-tools/create/create.js +70 -0
- package/lib/utils/store-tools/create/index.js +23 -0
- package/lib/utils/store-tools/create/update-store-info.js +33 -0
- package/lib/utils/store-tools/get-store-count.js +29 -0
- package/lib/utils/store-tools/index.js +66 -0
- package/lib/utils/store-tools/open-or-create-store.js +60 -0
- package/lib/utils/store-tools/use-store-index.js +82 -0
- package/lib/utils/suggester-workers/append-to-index/append.js +96 -0
- package/lib/utils/suggester-workers/append-to-index/append.worker.js +31 -0
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +66 -0
- package/lib/utils/suggester-workers/append-to-index/index.js +23 -0
- package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +114 -0
- package/lib/utils/suggester-workers/append-to-index/store-messages.js +48 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +64 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +103 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +47 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +24 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +47 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +16 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +24 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +18 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +34 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +25 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +17 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +25 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +29 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +18 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +71 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +15 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +19 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +16 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/stop-words.js +9 -0
- package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +17 -0
- package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +31 -0
- package/lib/utils/suggester-workers/commons-tokenizer/index.js +79 -0
- package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +24 -0
- package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +15 -0
- package/lib/utils/suggester-workers/create-worker.js +64 -0
- package/lib/utils/suggester-workers/find-best-label/find-best-label.js +81 -0
- package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +67 -0
- package/lib/utils/suggester-workers/find-best-label/index.js +1 -0
- package/lib/utils/suggester-workers/find-best-label/tokenize.js +62 -0
- package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +26 -0
- package/lib/utils/suggester-workers/searching/compute-score.js +63 -0
- package/lib/utils/suggester-workers/searching/get-db.js +64 -0
- package/lib/utils/suggester-workers/searching/index.js +15 -0
- package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +33 -0
- package/lib/utils/suggester-workers/searching/order/index.js +33 -0
- package/lib/utils/suggester-workers/searching/query-parser/index.js +23 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +15 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +28 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +51 -0
- package/lib/utils/suggester-workers/searching/resolve-query-parser.js +73 -0
- package/lib/utils/suggester-workers/searching/search-in-index.js +25 -0
- package/lib/utils/suggester-workers/searching/searching.js +170 -0
- package/lib/utils/suggester-workers/searching/searching.worker.js +23 -0
- package/lib/utils/vtl/dataset-builder.js +28 -0
- package/lib/utils/vtl/index.js +15 -0
- package/package.json +160 -137
- package/lib/index.js.map +0 -1
- package/src/components/breadcrumb/breadcrumb.scss +0 -22
- package/src/components/breadcrumb/component.js +0 -29
- package/src/components/breadcrumb/index.js +0 -1
- package/src/components/button/button.scss +0 -26
- package/src/components/button/component.js +0 -25
- package/src/components/button/index.js +0 -1
- package/src/components/checkbox/boolean.js +0 -139
- package/src/components/checkbox/checkbox.scss +0 -43
- package/src/components/checkbox/group.js +0 -171
- package/src/components/checkbox/index.js +0 -3
- package/src/components/checkbox/one.js +0 -27
- package/src/components/components.js +0 -16
- package/src/components/datepicker/component.js +0 -10
- package/src/components/datepicker/datepicker.scss +0 -16
- package/src/components/datepicker/index.js +0 -1
- package/src/components/declarations/component.js +0 -38
- package/src/components/declarations/declarations.scss +0 -34
- package/src/components/declarations/index.js +0 -1
- package/src/components/declarations/wrappers/index.js +0 -3
- package/src/components/declarations/wrappers/input-declarations-wrapper.js +0 -164
- package/src/components/declarations/wrappers/list-declarations-wrapper.js +0 -162
- package/src/components/declarations/wrappers/simple-declarations-wrapper.js +0 -54
- package/src/components/dropdown/commons/actions.js +0 -56
- package/src/components/dropdown/commons/children-to-option.js +0 -9
- package/src/components/dropdown/commons/cleaner-callbacks.js +0 -58
- package/src/components/dropdown/commons/components/closed.icon.js +0 -24
- package/src/components/dropdown/commons/components/dropdown-container.js +0 -169
- package/src/components/dropdown/commons/components/label.js +0 -21
- package/src/components/dropdown/commons/components/opened.icon.js +0 -24
- package/src/components/dropdown/commons/components/panel.js +0 -78
- package/src/components/dropdown/commons/event-callbacks/index.js +0 -5
- package/src/components/dropdown/commons/event-callbacks/on-keydown-callback.js +0 -30
- package/src/components/dropdown/commons/event-callbacks/on-mousedown-callback.js +0 -11
- package/src/components/dropdown/commons/reducer.js +0 -149
- package/src/components/dropdown/commons/tools/index.js +0 -17
- package/src/components/dropdown/component.js +0 -117
- package/src/components/dropdown/dropdown-edit/cross.icon.js +0 -20
- package/src/components/dropdown/dropdown-edit/dropdown-edit.js +0 -174
- package/src/components/dropdown/dropdown-edit/icone.js +0 -33
- package/src/components/dropdown/dropdown-edit/index.js +0 -11
- package/src/components/dropdown/dropdown-edit/option.js +0 -62
- package/src/components/dropdown/dropdown-edit/prefix-tools.js +0 -51
- package/src/components/dropdown/dropdown-simple/dropdown.js +0 -155
- package/src/components/dropdown/dropdown-simple/index.js +0 -20
- package/src/components/dropdown/dropdown-simple/option.js +0 -15
- package/src/components/dropdown/dropdown.scss +0 -183
- package/src/components/dropdown/index.js +0 -1
- package/src/components/filter-description/component.js +0 -41
- package/src/components/filter-description/index.js +0 -1
- package/src/components/index.js +0 -4
- package/src/components/index.scss +0 -76
- package/src/components/input/index.js +0 -2
- package/src/components/input/input-number.js +0 -228
- package/src/components/input/input.js +0 -10
- package/src/components/input/input.scss +0 -27
- package/src/components/loop/build-components.js +0 -33
- package/src/components/loop/component.js +0 -94
- package/src/components/loop/index.js +0 -1
- package/src/components/loop/loop.scss +0 -17
- package/src/components/loop/wrapper.js +0 -11
- package/src/components/loop-constructor/block/block.scss +0 -10
- package/src/components/loop-constructor/block/component.js +0 -8
- package/src/components/loop-constructor/block/index.js +0 -1
- package/src/components/loop-constructor/index.js +0 -1
- package/src/components/loop-constructor/roster/component.js +0 -7
- package/src/components/loop-constructor/roster/index.js +0 -1
- package/src/components/loop-constructor/wrapper/body-component.js +0 -118
- package/src/components/loop-constructor/wrapper/build-components.js +0 -33
- package/src/components/loop-constructor/wrapper/component.js +0 -152
- package/src/components/loop-constructor/wrapper/index.js +0 -1
- package/src/components/progress-bar/component.js +0 -28
- package/src/components/progress-bar/index.js +0 -1
- package/src/components/progress-bar/progress-bar.scss +0 -54
- package/src/components/radio/component.js +0 -8
- package/src/components/radio/index.js +0 -1
- package/src/components/radio/radio.scss +0 -24
- package/src/components/sequence/component.js +0 -41
- package/src/components/sequence/index.js +0 -1
- package/src/components/sequence/sequence.scss +0 -15
- package/src/components/subsequence/component.js +0 -48
- package/src/components/subsequence/index.js +0 -1
- package/src/components/subsequence/subsequence.scss +0 -15
- package/src/components/table/index.js +0 -1
- package/src/components/table/table.js +0 -160
- package/src/components/table/table.scss +0 -23
- package/src/components/textarea/component.js +0 -10
- package/src/components/textarea/index.js +0 -1
- package/src/components/textarea/textarea.scss +0 -16
- package/src/components/tooltip/img/index.js +0 -4
- package/src/components/tooltip/index.js +0 -1
- package/src/components/tooltip/response.js +0 -42
- package/src/components/tooltip/tooltip.scss +0 -35
- package/src/constants/component-types.js +0 -1
- package/src/constants/declarations.js +0 -14
- package/src/constants/index.js +0 -4
- package/src/constants/supported-preferences.js +0 -10
- package/src/constants/value-types.js +0 -5
- package/src/constants/variable-types.js +0 -4
- package/src/stories/breadcrumb/README.md +0 -14
- package/src/stories/breadcrumb/breadcrumb.stories.js +0 -33
- package/src/stories/button/README.md +0 -14
- package/src/stories/button/button.stories.js +0 -63
- package/src/stories/checkbox-boolean/README.md +0 -27
- package/src/stories/checkbox-boolean/checkbox-boolean.stories.js +0 -33
- package/src/stories/checkbox-group/README.md +0 -29
- package/src/stories/checkbox-group/checkbox-group.stories.js +0 -81
- package/src/stories/checkbox-group/data-vtl.json +0 -89
- package/src/stories/checkbox-group/data.json +0 -89
- package/src/stories/checkbox-one/checkbox-one.stories.js +0 -77
- package/src/stories/checkbox-one/data-vtl.json +0 -33
- package/src/stories/checkbox-one/data.json +0 -33
- package/src/stories/datepicker/README.md +0 -31
- package/src/stories/datepicker/data.json +0 -28
- package/src/stories/datepicker/datepicker.stories.js +0 -65
- package/src/stories/declarations/README.md +0 -19
- package/src/stories/declarations/declarations.stories.js +0 -112
- package/src/stories/dropdown/README.md +0 -44
- package/src/stories/dropdown/data-naf.json +0 -6963
- package/src/stories/dropdown/data-props.json +0 -81
- package/src/stories/dropdown/data.json +0 -78
- package/src/stories/dropdown/dropdown.stories.js +0 -65
- package/src/stories/filter-description/README.md +0 -15
- package/src/stories/filter-description/filter-description.stories.js +0 -70
- package/src/stories/input/README.md +0 -33
- package/src/stories/input/data.json +0 -28
- package/src/stories/input/input.stories.js +0 -67
- package/src/stories/input-number/README.md +0 -37
- package/src/stories/input-number/data.json +0 -30
- package/src/stories/input-number/input-number.stories.js +0 -75
- package/src/stories/loop/README.md +0 -25
- package/src/stories/loop/loop.stories.js +0 -80
- package/src/stories/loop/with-loop/data-loop-deeper.json +0 -298
- package/src/stories/loop/with-loop/data-loop.json +0 -211
- package/src/stories/loop/with-loop/data-vqs.json +0 -1384
- package/src/stories/loop/with-loop/index.js +0 -3
- package/src/stories/loop/with-roster/data-loop-deeper.json +0 -298
- package/src/stories/loop/with-roster/data-loop.json +0 -213
- package/src/stories/loop/with-roster/data-vqs.json +0 -1383
- package/src/stories/loop/with-roster/index.js +0 -3
- package/src/stories/loop-constructor/README.md +0 -27
- package/src/stories/loop-constructor/data-loop.json +0 -66
- package/src/stories/loop-constructor/data-roster.json +0 -68
- package/src/stories/loop-constructor/loop-constructor.stories.js +0 -42
- package/src/stories/progress-bar/README.md +0 -13
- package/src/stories/progress-bar/progress-bar.stories.js +0 -24
- package/src/stories/radio/README.md +0 -31
- package/src/stories/radio/data-vtl.json +0 -32
- package/src/stories/radio/data.json +0 -32
- package/src/stories/radio/radio.stories.js +0 -81
- package/src/stories/sequence/README.md +0 -18
- package/src/stories/sequence/sequence.stories.js +0 -58
- package/src/stories/subsequence/README.md +0 -18
- package/src/stories/subsequence/subsequence.stories.js +0 -58
- package/src/stories/table/README.md +0 -29
- package/src/stories/table/data-one-axis-one-measure.json +0 -124
- package/src/stories/table/data-one-axis-two-measures.json +0 -193
- package/src/stories/table/data-one-hierarchical-axis.json +0 -204
- package/src/stories/table/data-two-axis-one-measure.json +0 -492
- package/src/stories/table/table.stories.js +0 -77
- package/src/stories/textarea/README.md +0 -33
- package/src/stories/textarea/data-forced.json +0 -28
- package/src/stories/textarea/data.json +0 -28
- package/src/stories/textarea/textarea.stories.js +0 -90
- package/src/stories/tooltip-response/README.md +0 -14
- package/src/stories/tooltip-response/tooltip.stories.js +0 -43
- package/src/stories/utils/custom-lunatic.scss +0 -787
- package/src/stories/utils/img/arrow.png +0 -0
- package/src/stories/utils/img/check_box.svg +0 -1
- package/src/stories/utils/img/check_box_outline.svg +0 -1
- package/src/stories/utils/img/lunatic-logo.png +0 -0
- package/src/stories/utils/img/menu-down.svg +0 -1
- package/src/stories/utils/img/menu-up.svg +0 -1
- package/src/stories/utils/img/radio_button_checked.svg +0 -1
- package/src/stories/utils/img/radio_button_unchecked.svg +0 -1
- package/src/stories/utils/options.js +0 -21
- package/src/stories/utils/orchestrator.js +0 -53
- 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 -40
- package/src/tests/components/checkbox-group.spec.js +0 -48
- 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 -65
- package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +0 -47
- 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 -173
- package/src/tests/components/input.spec.js +0 -18
- 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/checkbox/group.spec.js +0 -72
- package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
- 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 -60
- package/src/tests/utils/lib/loops/shared.spec.js +0 -77
- package/src/tests/utils/lib/responses.spec.js +0 -58
- 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 -86
- package/src/tests/utils/to-expose/handler/questionnaire.json +0 -154
- package/src/tests/utils/to-expose/handler/results/index.js +0 -6
- package/src/tests/utils/to-expose/handler/results/res-double.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-input-collected.json +0 -154
- package/src/tests/utils/to-expose/handler/results/res-input-edited.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-loop.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-matrix.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-responses.json +0 -157
- 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 -129
- package/src/tests/utils/to-expose/init-questionnaire/result.json +0 -162
- package/src/tests/utils/to-expose/interpret.spec.js +0 -42
- 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/lib/alphabet.js +0 -1
- package/src/utils/lib/checkbox/group.js +0 -21
- package/src/utils/lib/checkbox/index.js +0 -1
- package/src/utils/lib/decorator/index.js +0 -1
- package/src/utils/lib/decorator/title-decorator.js +0 -16
- package/src/utils/lib/index.js +0 -12
- package/src/utils/lib/label-position.js +0 -12
- package/src/utils/lib/loops/bindings.js +0 -47
- package/src/utils/lib/loops/index.js +0 -2
- package/src/utils/lib/loops/shared.js +0 -43
- package/src/utils/lib/memo-check.js +0 -24
- package/src/utils/lib/options-positioning.js +0 -9
- package/src/utils/lib/prop-types/declarations.js +0 -22
- package/src/utils/lib/prop-types/index.js +0 -5
- package/src/utils/lib/prop-types/lines.js +0 -6
- package/src/utils/lib/prop-types/options.js +0 -8
- package/src/utils/lib/prop-types/response.js +0 -6
- package/src/utils/lib/prop-types/value-type.js +0 -9
- package/src/utils/lib/responses.js +0 -9
- package/src/utils/lib/style.js +0 -10
- package/src/utils/lib/table/index.js +0 -1
- package/src/utils/lib/table/roster.js +0 -18
- package/src/utils/lib/tooltip/build-response.js +0 -23
- package/src/utils/lib/tooltip/content.js +0 -52
- package/src/utils/lib/tooltip/index.js +0 -5
- package/src/utils/to-expose/handler.js +0 -99
- package/src/utils/to-expose/hook.js +0 -65
- package/src/utils/to-expose/index.js +0 -11
- package/src/utils/to-expose/init-questionnaire.js +0 -114
- package/src/utils/to-expose/interpret.js +0 -53
- package/src/utils/to-expose/state.js +0 -58
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as lunatic from '../../components';
|
|
4
|
-
import BodyComponent from './body-component';
|
|
5
|
-
import Declarations from '../../declarations';
|
|
6
|
-
import * as U from '../../../utils/lib';
|
|
7
|
-
import * as C from '../../../constants';
|
|
8
|
-
import { interpret } from '../../../utils/to-expose';
|
|
9
|
-
|
|
10
|
-
const LoopConstructorWrapper = ({
|
|
11
|
-
id: mainId,
|
|
12
|
-
label: mainLabel,
|
|
13
|
-
components,
|
|
14
|
-
handleChange,
|
|
15
|
-
lines,
|
|
16
|
-
declarations,
|
|
17
|
-
features,
|
|
18
|
-
bindings,
|
|
19
|
-
addBtnLabel,
|
|
20
|
-
hideBtn,
|
|
21
|
-
componentType,
|
|
22
|
-
...otherProps
|
|
23
|
-
}) => {
|
|
24
|
-
const [todo, setTodo] = useState({});
|
|
25
|
-
const minLines = Math.max(
|
|
26
|
-
lines.min || 0,
|
|
27
|
-
U.getLoopConstructorInitLines(components)
|
|
28
|
-
);
|
|
29
|
-
const maxLines = lines ? lines.max : undefined;
|
|
30
|
-
|
|
31
|
-
const width = `${100 / Math.max(...components.map((row) => row.length))}%`;
|
|
32
|
-
const Button = lunatic.Button;
|
|
33
|
-
const involvedVariables = U.getInvolvedVariables(components);
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (Object.keys(todo).length !== 0) {
|
|
37
|
-
const { up, rowNumber } = todo;
|
|
38
|
-
const [key, value] = Object.entries(up)[0];
|
|
39
|
-
const previousValue = bindings[key];
|
|
40
|
-
const newValue = previousValue.map((v, i) =>
|
|
41
|
-
i === rowNumber ? value : v
|
|
42
|
-
);
|
|
43
|
-
handleChange({ [key]: newValue });
|
|
44
|
-
setTodo({});
|
|
45
|
-
}
|
|
46
|
-
}, [bindings, todo, handleChange]);
|
|
47
|
-
|
|
48
|
-
const addLine = () => {
|
|
49
|
-
const toHandle = involvedVariables.reduce(
|
|
50
|
-
(acc, { name: iv, depth }) => ({
|
|
51
|
-
...acc,
|
|
52
|
-
[iv]: [...bindings[iv], U.buildEmptyValue(depth)],
|
|
53
|
-
}),
|
|
54
|
-
{}
|
|
55
|
-
);
|
|
56
|
-
handleChange(toHandle);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const customBtnLabel =
|
|
60
|
-
(componentType === 'Loop' && interpret(features)(bindings)(mainLabel)) ||
|
|
61
|
-
addBtnLabel;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<>
|
|
65
|
-
<Declarations
|
|
66
|
-
id={mainId}
|
|
67
|
-
type={C.BEFORE_QUESTION_TEXT}
|
|
68
|
-
declarations={declarations}
|
|
69
|
-
features={features}
|
|
70
|
-
bindings={bindings}
|
|
71
|
-
/>
|
|
72
|
-
{componentType === 'RosterForLoop' && mainLabel && (
|
|
73
|
-
<label
|
|
74
|
-
htmlFor={`loops-constructor-${mainId}`}
|
|
75
|
-
id={`loops-constructor-label-${mainId}`}
|
|
76
|
-
>
|
|
77
|
-
{interpret(features)(bindings)(mainLabel)}
|
|
78
|
-
</label>
|
|
79
|
-
)}
|
|
80
|
-
<Declarations
|
|
81
|
-
id={mainId}
|
|
82
|
-
type={C.AFTER_QUESTION_TEXT}
|
|
83
|
-
declarations={declarations}
|
|
84
|
-
features={features}
|
|
85
|
-
bindings={bindings}
|
|
86
|
-
/>
|
|
87
|
-
<BodyComponent
|
|
88
|
-
mainId={mainId}
|
|
89
|
-
componentType={componentType}
|
|
90
|
-
components={components}
|
|
91
|
-
bindings={bindings}
|
|
92
|
-
width={width}
|
|
93
|
-
features={features}
|
|
94
|
-
setTodo={setTodo}
|
|
95
|
-
{...otherProps}
|
|
96
|
-
/>
|
|
97
|
-
{!hideBtn && (
|
|
98
|
-
<Button
|
|
99
|
-
label="addLine"
|
|
100
|
-
value={customBtnLabel}
|
|
101
|
-
disabled={
|
|
102
|
-
(Number.isInteger(minLines) && minLines === maxLines) ||
|
|
103
|
-
U.lastLoopChildLineIsEmpty(bindings)(involvedVariables)
|
|
104
|
-
}
|
|
105
|
-
onClick={addLine}
|
|
106
|
-
/>
|
|
107
|
-
)}
|
|
108
|
-
<Declarations
|
|
109
|
-
id={mainId}
|
|
110
|
-
type={C.DETACHABLE}
|
|
111
|
-
declarations={declarations}
|
|
112
|
-
features={features}
|
|
113
|
-
bindings={bindings}
|
|
114
|
-
/>
|
|
115
|
-
</>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
LoopConstructorWrapper.defaultProps = {
|
|
120
|
-
label: '',
|
|
121
|
-
preferences: ['COLLECTED'],
|
|
122
|
-
components: [],
|
|
123
|
-
lines: {},
|
|
124
|
-
positioning: 'DEFAULT',
|
|
125
|
-
declarations: [],
|
|
126
|
-
features: [],
|
|
127
|
-
bindings: {},
|
|
128
|
-
addBtnLabel: 'Add a line',
|
|
129
|
-
management: false,
|
|
130
|
-
hideBtn: false,
|
|
131
|
-
style: {},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
LoopConstructorWrapper.propTypes = {
|
|
135
|
-
componentType: PropTypes.string.isRequired,
|
|
136
|
-
id: PropTypes.string.isRequired,
|
|
137
|
-
label: PropTypes.string,
|
|
138
|
-
preferences: PropTypes.arrayOf(U.valueTypePropTypes),
|
|
139
|
-
components: PropTypes.array,
|
|
140
|
-
handleChange: PropTypes.func.isRequired,
|
|
141
|
-
lines: U.linesPropTypes,
|
|
142
|
-
positioning: PropTypes.oneOf(['DEFAULT', 'HORIZONTAL', 'VERTICAL']),
|
|
143
|
-
declarations: U.declarationsPropTypes,
|
|
144
|
-
features: PropTypes.arrayOf(PropTypes.string),
|
|
145
|
-
bindings: PropTypes.object,
|
|
146
|
-
addBtnLabel: PropTypes.string,
|
|
147
|
-
hideBtn: PropTypes.bool,
|
|
148
|
-
management: PropTypes.bool,
|
|
149
|
-
style: PropTypes.object,
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export default React.memo(LoopConstructorWrapper, U.areEqual);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './component';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { buildStyleObject } from '../../utils/lib';
|
|
4
|
-
import './progress-bar.scss';
|
|
5
|
-
|
|
6
|
-
const ProgressBar = ({ id, value, style }) => {
|
|
7
|
-
let controledValue = value;
|
|
8
|
-
if (value < 0) controledValue = 0;
|
|
9
|
-
if (value > 100) controledValue = 100;
|
|
10
|
-
return (
|
|
11
|
-
<div
|
|
12
|
-
id={`progress-${id}`}
|
|
13
|
-
className="progress-lunatic"
|
|
14
|
-
style={buildStyleObject(style)}
|
|
15
|
-
>
|
|
16
|
-
{`${controledValue.toFixed(0)} %`}
|
|
17
|
-
<span style={{ width: `${controledValue}%` }} />
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
ProgressBar.propTypes = {
|
|
23
|
-
id: PropTypes.string.isRequired,
|
|
24
|
-
value: PropTypes.number.isRequired,
|
|
25
|
-
style: PropTypes.object,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default ProgressBar;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './component';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
@import 'src/components/index.scss';
|
|
2
|
-
|
|
3
|
-
.progress-lunatic {
|
|
4
|
-
height: 30px;
|
|
5
|
-
position: relative;
|
|
6
|
-
background: $progress_back;
|
|
7
|
-
-moz-border-radius: 20px;
|
|
8
|
-
-webkit-border-radius: 20px;
|
|
9
|
-
border-radius: 20px;
|
|
10
|
-
padding: 5px;
|
|
11
|
-
box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
|
|
12
|
-
text-align: center;
|
|
13
|
-
font-weight: bold;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.progress-lunatic > span {
|
|
17
|
-
display: block;
|
|
18
|
-
height: 100%;
|
|
19
|
-
border-radius: 20px;
|
|
20
|
-
background-color: $main_color;
|
|
21
|
-
opacity: 0.6;
|
|
22
|
-
box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3),
|
|
23
|
-
inset 0 -2px 6px rgba(0, 0, 0, 0.4);
|
|
24
|
-
position: relative;
|
|
25
|
-
top: -18px;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.progress-lunatic > span:after {
|
|
30
|
-
content: '';
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
bottom: 0;
|
|
35
|
-
right: 0;
|
|
36
|
-
background-image: linear-gradient(
|
|
37
|
-
-45deg,
|
|
38
|
-
rgba(255, 255, 255, 0.2) 25%,
|
|
39
|
-
transparent 25%,
|
|
40
|
-
transparent 50%,
|
|
41
|
-
rgba(255, 255, 255, 0.2) 50%,
|
|
42
|
-
rgba(255, 255, 255, 0.2) 75%,
|
|
43
|
-
transparent 75%,
|
|
44
|
-
transparent
|
|
45
|
-
);
|
|
46
|
-
z-index: 1;
|
|
47
|
-
background-size: 50px 50px;
|
|
48
|
-
animation: move 2s linear infinite;
|
|
49
|
-
border-top-right-radius: 8px;
|
|
50
|
-
border-bottom-right-radius: 8px;
|
|
51
|
-
border-top-left-radius: 20px;
|
|
52
|
-
border-bottom-left-radius: 20px;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ListDeclarationsWrapper } from '../declarations/wrappers';
|
|
3
|
-
import { areEqual } from '../../utils/lib';
|
|
4
|
-
import './radio.scss';
|
|
5
|
-
|
|
6
|
-
const Radio = (props) => <ListDeclarationsWrapper type="radio" {...props} />;
|
|
7
|
-
|
|
8
|
-
export default React.memo(Radio, areEqual);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './component';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
@import 'src/components/index.scss';
|
|
2
|
-
|
|
3
|
-
.radio-group {
|
|
4
|
-
border: 0.1em solid $main_color;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.radio-lunatic {
|
|
8
|
-
margin: 0;
|
|
9
|
-
margin-right: 1em;
|
|
10
|
-
margin-left: 1em;
|
|
11
|
-
margin-top: 0.5em;
|
|
12
|
-
&:focus {
|
|
13
|
-
outline: none;
|
|
14
|
-
box-shadow: 0 0 0.3em 0.3em $main_color;
|
|
15
|
-
}
|
|
16
|
-
&:checked + label {
|
|
17
|
-
border: 0.1em solid $main_color;
|
|
18
|
-
padding: 0.3em;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.radio-modality {
|
|
23
|
-
margin-top: 1em;
|
|
24
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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 './sequence.scss';
|
|
7
|
-
|
|
8
|
-
const Sequence = ({ id, label, declarations, features, bindings, style }) => (
|
|
9
|
-
<SimpleDeclarationsWrapper
|
|
10
|
-
id={id}
|
|
11
|
-
declarations={declarations}
|
|
12
|
-
features={features}
|
|
13
|
-
bindings={bindings}
|
|
14
|
-
>
|
|
15
|
-
<div
|
|
16
|
-
aria-label={`sequence-${id}`}
|
|
17
|
-
className="sequence-lunatic"
|
|
18
|
-
style={U.buildStyleObject(style)}
|
|
19
|
-
>
|
|
20
|
-
{interpret(features)(bindings)(label)}
|
|
21
|
-
</div>
|
|
22
|
-
</SimpleDeclarationsWrapper>
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
Sequence.defaultProps = {
|
|
26
|
-
declarations: [],
|
|
27
|
-
features: [],
|
|
28
|
-
bindings: {},
|
|
29
|
-
style: {},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
Sequence.propTypes = {
|
|
33
|
-
id: PropTypes.string.isRequired,
|
|
34
|
-
label: PropTypes.string.isRequired,
|
|
35
|
-
declarations: U.declarationsPropTypes,
|
|
36
|
-
features: PropTypes.arrayOf(PropTypes.string),
|
|
37
|
-
bindings: PropTypes.object,
|
|
38
|
-
style: PropTypes.object,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default React.memo(Sequence, U.areEqual);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './component';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@import 'src/components/index.scss';
|
|
2
|
-
|
|
3
|
-
.sequence-lunatic {
|
|
4
|
-
height: 40px;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
border-radius: 0px;
|
|
7
|
-
background-color: $main_color;
|
|
8
|
-
border: 0.1em solid $main_color;
|
|
9
|
-
color: white;
|
|
10
|
-
font-weight: bold;
|
|
11
|
-
font-size: 130%;
|
|
12
|
-
padding-left: 10px;
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
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 './subsequence.scss';
|
|
7
|
-
|
|
8
|
-
const Subsequence = ({
|
|
9
|
-
id,
|
|
10
|
-
label,
|
|
11
|
-
declarations,
|
|
12
|
-
features,
|
|
13
|
-
bindings,
|
|
14
|
-
style,
|
|
15
|
-
}) => (
|
|
16
|
-
<SimpleDeclarationsWrapper
|
|
17
|
-
id={id}
|
|
18
|
-
declarations={declarations}
|
|
19
|
-
features={features}
|
|
20
|
-
bindings={bindings}
|
|
21
|
-
>
|
|
22
|
-
<div
|
|
23
|
-
aria-label={`subsequence-${id}`}
|
|
24
|
-
className="subsequence-lunatic"
|
|
25
|
-
style={U.buildStyleObject(style)}
|
|
26
|
-
>
|
|
27
|
-
{interpret(features)(bindings)(label)}
|
|
28
|
-
</div>
|
|
29
|
-
</SimpleDeclarationsWrapper>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
Subsequence.defaultProps = {
|
|
33
|
-
declarations: [],
|
|
34
|
-
features: [],
|
|
35
|
-
bindings: {},
|
|
36
|
-
style: {},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
Subsequence.propTypes = {
|
|
40
|
-
id: PropTypes.string.isRequired,
|
|
41
|
-
label: PropTypes.string.isRequired,
|
|
42
|
-
declarations: U.declarationsPropTypes,
|
|
43
|
-
features: PropTypes.arrayOf(PropTypes.string),
|
|
44
|
-
bindings: PropTypes.object,
|
|
45
|
-
style: PropTypes.object,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default React.memo(Subsequence, U.areEqual);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './component';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@import 'src/components/index.scss';
|
|
2
|
-
|
|
3
|
-
.subsequence-lunatic {
|
|
4
|
-
height: 20px;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
border-radius: 0px;
|
|
7
|
-
background-color: $main_color;
|
|
8
|
-
border: 0.1em solid $main_color;
|
|
9
|
-
color: white;
|
|
10
|
-
font-weight: bold;
|
|
11
|
-
font-size: 90%;
|
|
12
|
-
padding-left: 10px;
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './table';
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as lunatic from '../components';
|
|
4
|
-
import Declarations from '../declarations';
|
|
5
|
-
import * as U from '../../utils/lib';
|
|
6
|
-
import * as C from '../../constants';
|
|
7
|
-
import { interpret } from '../../utils/to-expose';
|
|
8
|
-
import './table.scss';
|
|
9
|
-
|
|
10
|
-
const Table = ({
|
|
11
|
-
id: tableId,
|
|
12
|
-
label: tableLabel,
|
|
13
|
-
preferences,
|
|
14
|
-
cells,
|
|
15
|
-
handleChange,
|
|
16
|
-
lines: initLines,
|
|
17
|
-
positioning,
|
|
18
|
-
declarations,
|
|
19
|
-
features,
|
|
20
|
-
bindings,
|
|
21
|
-
addBtnLabel,
|
|
22
|
-
hideBtn,
|
|
23
|
-
management,
|
|
24
|
-
}) => {
|
|
25
|
-
const minLines = initLines
|
|
26
|
-
? Math.max(initLines.min, U.getRosterInitLines(cells))
|
|
27
|
-
: undefined;
|
|
28
|
-
const maxLines = initLines ? initLines.max : undefined;
|
|
29
|
-
const [lines, setLines] = useState(minLines);
|
|
30
|
-
|
|
31
|
-
const width = `${100 / Math.max(...cells.map((line) => line.length))}%`;
|
|
32
|
-
const Button = lunatic.Button;
|
|
33
|
-
return (
|
|
34
|
-
<>
|
|
35
|
-
<Declarations
|
|
36
|
-
id={tableId}
|
|
37
|
-
type={C.BEFORE_QUESTION_TEXT}
|
|
38
|
-
declarations={declarations}
|
|
39
|
-
features={features}
|
|
40
|
-
bindings={bindings}
|
|
41
|
-
/>
|
|
42
|
-
{tableLabel && (
|
|
43
|
-
<label
|
|
44
|
-
htmlFor={`table-one-axis-${tableId}`}
|
|
45
|
-
id={`table-one-axis-label-${tableId}`}
|
|
46
|
-
>
|
|
47
|
-
{interpret(features)(bindings)(tableLabel)}
|
|
48
|
-
</label>
|
|
49
|
-
)}
|
|
50
|
-
<Declarations
|
|
51
|
-
id={tableId}
|
|
52
|
-
type={C.AFTER_QUESTION_TEXT}
|
|
53
|
-
declarations={declarations}
|
|
54
|
-
features={features}
|
|
55
|
-
bindings={bindings}
|
|
56
|
-
/>
|
|
57
|
-
<table id={`table-${tableId}`} className="table-lunatic">
|
|
58
|
-
<tbody>
|
|
59
|
-
{(minLines || minLines === 0 ? cells.slice(0, lines + 1) : cells).map(
|
|
60
|
-
(line, i) => (
|
|
61
|
-
<tr key={`table-${tableId}-line${i}`}>
|
|
62
|
-
{line.map((component, j) => {
|
|
63
|
-
const {
|
|
64
|
-
label,
|
|
65
|
-
headerCell,
|
|
66
|
-
colspan,
|
|
67
|
-
rowspan,
|
|
68
|
-
componentType,
|
|
69
|
-
...componentProps
|
|
70
|
-
} = component;
|
|
71
|
-
if (componentType) {
|
|
72
|
-
const Component = lunatic[componentType];
|
|
73
|
-
return (
|
|
74
|
-
<td
|
|
75
|
-
key={`table-${tableId}-line${i}-cell-${j}`}
|
|
76
|
-
style={{ width }}
|
|
77
|
-
>
|
|
78
|
-
<Component
|
|
79
|
-
label={label}
|
|
80
|
-
handleChange={handleChange}
|
|
81
|
-
preferences={preferences}
|
|
82
|
-
positioning={positioning}
|
|
83
|
-
management={management}
|
|
84
|
-
features={features}
|
|
85
|
-
bindings={bindings}
|
|
86
|
-
{...componentProps}
|
|
87
|
-
zIndex={cells.length - i || 0}
|
|
88
|
-
/>
|
|
89
|
-
</td>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
const cellOptions = {
|
|
93
|
-
key: `table-${tableId}-line${i}-cell-${j}`,
|
|
94
|
-
style: { width },
|
|
95
|
-
colSpan: colspan || 1,
|
|
96
|
-
rowSpan: rowspan || 1,
|
|
97
|
-
};
|
|
98
|
-
const interpretedLabel = interpret(features)(bindings)(label);
|
|
99
|
-
return headerCell ? (
|
|
100
|
-
<th {...cellOptions}>{interpretedLabel}</th>
|
|
101
|
-
) : (
|
|
102
|
-
<td {...cellOptions}>{interpretedLabel}</td>
|
|
103
|
-
);
|
|
104
|
-
})}
|
|
105
|
-
</tr>
|
|
106
|
-
)
|
|
107
|
-
)}
|
|
108
|
-
</tbody>
|
|
109
|
-
</table>
|
|
110
|
-
{Number.isInteger(minLines) && lines < maxLines && !hideBtn && (
|
|
111
|
-
<Button
|
|
112
|
-
label="addLine"
|
|
113
|
-
value={addBtnLabel}
|
|
114
|
-
onClick={() => setLines(lines + 1)}
|
|
115
|
-
/>
|
|
116
|
-
)}
|
|
117
|
-
<Declarations
|
|
118
|
-
id={tableId}
|
|
119
|
-
type={C.DETACHABLE}
|
|
120
|
-
declarations={declarations}
|
|
121
|
-
features={features}
|
|
122
|
-
bindings={bindings}
|
|
123
|
-
/>
|
|
124
|
-
</>
|
|
125
|
-
);
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
Table.defaultProps = {
|
|
129
|
-
label: '',
|
|
130
|
-
preferences: ['COLLECTED'],
|
|
131
|
-
cells: [],
|
|
132
|
-
lines: {},
|
|
133
|
-
positioning: 'DEFAULT',
|
|
134
|
-
declarations: [],
|
|
135
|
-
features: [],
|
|
136
|
-
bindings: {},
|
|
137
|
-
addBtnLabel: 'Add a line',
|
|
138
|
-
management: false,
|
|
139
|
-
hideBtn: false,
|
|
140
|
-
style: {},
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
Table.propTypes = {
|
|
144
|
-
id: PropTypes.string.isRequired,
|
|
145
|
-
label: PropTypes.string,
|
|
146
|
-
preferences: PropTypes.arrayOf(U.valueTypePropTypes),
|
|
147
|
-
cells: PropTypes.array,
|
|
148
|
-
handleChange: PropTypes.func.isRequired,
|
|
149
|
-
lines: U.linesPropTypes,
|
|
150
|
-
positioning: PropTypes.oneOf(['DEFAULT', 'HORIZONTAL', 'VERTICAL']),
|
|
151
|
-
declarations: U.declarationsPropTypes,
|
|
152
|
-
features: PropTypes.arrayOf(PropTypes.string),
|
|
153
|
-
bindings: PropTypes.object,
|
|
154
|
-
addBtnLabel: PropTypes.string,
|
|
155
|
-
hideBtn: PropTypes.bool,
|
|
156
|
-
management: PropTypes.bool,
|
|
157
|
-
style: PropTypes.object,
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export default React.memo(Table, U.areEqual);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
@import 'src/components/index.scss';
|
|
2
|
-
|
|
3
|
-
.table-lunatic {
|
|
4
|
-
table-layout: fixed;
|
|
5
|
-
border-collapse: collapse;
|
|
6
|
-
margin-top: 0.3em;
|
|
7
|
-
margin-bottom: 0.3em;
|
|
8
|
-
& td,
|
|
9
|
-
th {
|
|
10
|
-
border: 0.15em solid $main_color;
|
|
11
|
-
padding: 0.2em;
|
|
12
|
-
fieldset {
|
|
13
|
-
margin: none;
|
|
14
|
-
border: none;
|
|
15
|
-
.radio-modality {
|
|
16
|
-
margin-top: 0;
|
|
17
|
-
}
|
|
18
|
-
.checkbox-modality {
|
|
19
|
-
margin-top: 0;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InputDeclarationsWrapper } from '../declarations/wrappers';
|
|
3
|
-
import { areEqual } from '../../utils/lib';
|
|
4
|
-
import './textarea.scss';
|
|
5
|
-
|
|
6
|
-
const Textarea = (props) => (
|
|
7
|
-
<InputDeclarationsWrapper type={null} roleType="textarea" {...props} />
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
export default React.memo(Textarea, areEqual);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './component';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@import 'src/components/index.scss';
|
|
2
|
-
|
|
3
|
-
.textarea-lunatic {
|
|
4
|
-
width: 100%;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
border: solid 2px $main_color;
|
|
7
|
-
border-radius: 10px;
|
|
8
|
-
padding: 5px;
|
|
9
|
-
&:focus {
|
|
10
|
-
outline: none;
|
|
11
|
-
box-shadow: 0 0 10px $main_color;
|
|
12
|
-
}
|
|
13
|
-
&:read-only {
|
|
14
|
-
background-color: $disabled;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TooltipResponse } from './response';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as U from '../../utils/lib';
|
|
4
|
-
import * as img from './img';
|
|
5
|
-
import './tooltip.scss';
|
|
6
|
-
|
|
7
|
-
const TooltipResponse = ({ id, response }) => {
|
|
8
|
-
const [tooltipElements, setTooltipElements] = useState(() =>
|
|
9
|
-
U.buildTooltip(response)
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setTooltipElements(U.buildTooltip(response));
|
|
14
|
-
}, [response]);
|
|
15
|
-
|
|
16
|
-
const { content, imgName } = tooltipElements;
|
|
17
|
-
|
|
18
|
-
if (!content) return null;
|
|
19
|
-
return (
|
|
20
|
-
<div className="tooltip-lunatic">
|
|
21
|
-
<img id={id} alt="img-tooltip" src={img[imgName].src || img[imgName]} />
|
|
22
|
-
<span className="tooltip-text">
|
|
23
|
-
<ul>
|
|
24
|
-
{content.map(({ key, value }) => (
|
|
25
|
-
<li key={`tooltip-${id}-content-${key}`}>{`${key} : ${value}`}</li>
|
|
26
|
-
))}
|
|
27
|
-
</ul>
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
TooltipResponse.defaultProps = {
|
|
34
|
-
response: {},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
TooltipResponse.propTypes = {
|
|
38
|
-
id: PropTypes.string,
|
|
39
|
-
response: U.responsePropTypes,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default TooltipResponse;
|