@inseefr/lunatic 2.0.0-rc9 → 2.0.0-v2test
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 +13 -0
- package/lib/components/button/lunatic-button.js +52 -0
- package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +29 -0
- package/lib/components/checkbox/checkbox-boolean/index.js +13 -0
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +40 -0
- package/lib/components/checkbox/checkbox-group/checkbox-group.js +84 -0
- package/lib/components/checkbox/checkbox-group/checkbox.scss +4 -0
- package/lib/components/checkbox/checkbox-group/index.js +13 -0
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +35 -0
- package/lib/components/checkbox/checkbox-one/index.js +13 -0
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +27 -0
- package/lib/components/checkbox/commons/checkbox-option.js +55 -0
- package/lib/components/checkbox/commons/checkbox-option.scss +3 -0
- package/lib/components/checkbox/commons/index.js +13 -0
- package/lib/components/checkbox/index.js +27 -0
- package/lib/components/commons/build-style-object.js +25 -0
- package/lib/components/commons/components/combo-box/combo-box-container.js +31 -0
- package/lib/components/commons/components/combo-box/combo-box-content.js +60 -0
- package/lib/components/commons/components/combo-box/combo-box.js +190 -0
- package/lib/components/commons/components/combo-box/combo-box.scss +205 -0
- package/lib/components/commons/components/combo-box/index.js +13 -0
- package/lib/components/commons/components/combo-box/panel/index.js +13 -0
- package/lib/components/commons/components/combo-box/panel/option-container.js +62 -0
- package/lib/components/commons/components/combo-box/panel/panel-container.js +26 -0
- package/lib/components/commons/components/combo-box/panel/panel.js +61 -0
- package/lib/components/commons/components/combo-box/selection/delete.js +53 -0
- package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +22 -0
- package/lib/components/commons/components/combo-box/selection/index.js +13 -0
- package/lib/components/commons/components/combo-box/selection/input.js +55 -0
- package/lib/components/commons/components/combo-box/selection/label-selection.js +32 -0
- package/lib/components/commons/components/combo-box/selection/selection-container.js +35 -0
- package/lib/components/commons/components/combo-box/selection/selection.js +61 -0
- package/lib/components/commons/components/combo-box/state-management/actions.js +82 -0
- package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +16 -0
- package/lib/components/commons/components/combo-box/state-management/index.js +33 -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 +13 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +21 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +40 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +13 -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 +32 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +32 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +25 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +21 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +25 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +40 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +41 -0
- package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +64 -0
- package/lib/components/commons/components/create-lunatic-component/index.js +11 -0
- package/lib/components/commons/components/default-label-renderer.js +44 -0
- package/lib/components/commons/components/default-option-renderer.js +36 -0
- package/lib/components/commons/components/dragger/dragger.js +92 -0
- package/lib/components/commons/components/dragger/dragger.scss +8 -0
- package/lib/components/commons/components/dragger/index.js +13 -0
- package/lib/components/commons/components/errors/errors.js +41 -0
- package/lib/components/commons/components/errors/errors.scss +5 -0
- package/lib/components/commons/components/errors/index.js +13 -0
- package/lib/components/commons/components/fab/fab.js +48 -0
- package/lib/components/commons/components/fab/fab.scss +32 -0
- package/lib/components/commons/components/fab/index.js +13 -0
- package/lib/components/commons/components/field-container/field-container.js +39 -0
- package/lib/components/commons/components/field-container/field-container.scss +0 -0
- package/lib/components/commons/components/field-container/index.js +13 -0
- package/lib/components/commons/components/fieldset.js +18 -0
- package/lib/components/commons/components/fieldset.scss +5 -0
- package/lib/components/commons/components/html-table/index.js +48 -0
- package/lib/components/commons/components/html-table/table.js +29 -0
- package/lib/components/commons/components/html-table/tbody.js +29 -0
- package/lib/components/commons/components/html-table/td.js +41 -0
- package/lib/components/commons/components/html-table/th.js +39 -0
- package/lib/components/commons/components/html-table/thead.js +29 -0
- package/lib/components/commons/components/html-table/tr.js +31 -0
- package/lib/components/commons/components/is-network/index.js +13 -0
- package/lib/components/commons/components/is-network/is-network.js +51 -0
- package/lib/components/commons/components/is-network/use-online-status.js +46 -0
- package/lib/components/commons/components/label.js +27 -0
- package/lib/components/commons/components/lunatic-component.js +55 -0
- package/lib/components/commons/components/lunatic-fieldset-component.js +49 -0
- package/lib/components/commons/components/md-label/index.js +13 -0
- package/lib/components/commons/components/md-label/link.js +51 -0
- package/lib/components/commons/components/md-label/md-label.js +44 -0
- package/lib/components/commons/components/missing/index.js +13 -0
- package/lib/components/commons/components/missing/missing.js +76 -0
- package/lib/components/commons/components/missing/missing.scss +30 -0
- package/lib/components/commons/components/nothing-to-display.js +13 -0
- package/lib/components/commons/components/orchestrated-component.js +59 -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 +20 -0
- package/lib/components/commons/components/variable-status/index.js +13 -0
- package/lib/components/commons/components/variable-status/variable-status.js +78 -0
- package/lib/components/commons/components/variable-status/variable-status.scss +39 -0
- package/lib/components/commons/create-customizable-field.js +26 -0
- package/lib/components/commons/create-row-orchestrator.js +53 -0
- package/lib/components/commons/icons/checkbox-checked.icon.js +36 -0
- package/lib/components/commons/icons/checkbox-unchecked.icon.js +36 -0
- package/lib/components/commons/icons/closed.icon.js +33 -0
- package/lib/components/commons/icons/cross.icon.js +33 -0
- package/lib/components/commons/icons/index.js +76 -0
- package/lib/components/commons/icons/load.icon.js +33 -0
- package/lib/components/commons/icons/lunatic-icon.js +19 -0
- package/lib/components/commons/icons/lunatic-icon.scss +3 -0
- package/lib/components/commons/icons/network.icon.js +33 -0
- package/lib/components/commons/icons/on-drag.icon.js +33 -0
- package/lib/components/commons/icons/opened.icon.js +33 -0
- package/lib/components/commons/icons/radio-checked.icon.js +36 -0
- package/lib/components/commons/icons/radio-unchecked.icon.js +36 -0
- package/lib/components/commons/index.js +138 -0
- package/lib/components/commons/prop-types/declarations.js +19 -0
- package/lib/components/commons/prop-types/index.js +41 -0
- package/lib/components/commons/prop-types/lines.js +13 -0
- package/lib/components/commons/prop-types/options.js +13 -0
- package/lib/components/commons/prop-types/response.js +13 -0
- package/lib/components/commons/prop-types/value-type.js +14 -0
- package/lib/components/commons/safety-label.js +26 -0
- package/lib/components/commons/use-document-add-event-listener.js +84 -0
- package/lib/components/commons/use-on-handle-change.js +19 -0
- package/lib/components/commons/use-options-keydown.js +24 -0
- package/lib/components/commons/use-previous.js +16 -0
- package/lib/components/components.js +163 -0
- package/lib/components/datepicker/datepicker.js +45 -0
- package/lib/components/datepicker/datepicker.scss +1 -0
- package/lib/components/datepicker/index.js +13 -0
- package/lib/components/datepicker/lunatic-datepicker.js +27 -0
- package/lib/components/declarations/declaration.js +19 -0
- package/lib/components/declarations/declarations-after-text.js +20 -0
- package/lib/components/declarations/declarations-before-text.js +20 -0
- package/lib/components/declarations/declarations-detachable.js +20 -0
- package/lib/components/declarations/declarations.js +51 -0
- package/lib/components/declarations/declarations.scss +36 -0
- package/lib/components/declarations/index.js +43 -0
- package/lib/components/dropdown/dropdown-simple/dropdown-simple.js +36 -0
- package/lib/components/dropdown/dropdown-simple/index.js +13 -0
- package/lib/components/dropdown/dropdown-simple/simple-label-renderer.js +43 -0
- package/lib/components/dropdown/dropdown-simple/simple-option-renderer.js +35 -0
- package/lib/components/dropdown/dropdown-writable/dropdown-writable.js +59 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/filter-options.js +36 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +29 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/match.js +22 -0
- package/lib/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +13 -0
- package/lib/components/dropdown/dropdown-writable/index.js +13 -0
- package/lib/components/dropdown/dropdown-writable/writable-label-renderer.js +43 -0
- package/lib/components/dropdown/dropdown-writable/writable-option-renderer.js +136 -0
- package/lib/components/dropdown/dropdown.js +47 -0
- package/lib/components/dropdown/dropdown.scss +41 -0
- package/lib/components/dropdown/index.js +13 -0
- package/lib/components/dropdown/lunatic-dropdown.js +53 -0
- package/lib/components/filter-description/component.js +20 -0
- package/lib/components/filter-description/index.js +13 -0
- package/lib/components/index.js +28 -0
- package/lib/components/index.scss +136 -0
- package/lib/components/input/index.js +13 -0
- package/lib/components/input/input.js +49 -0
- package/lib/components/input/input.scss +32 -0
- package/lib/components/input/lunatic-input.js +30 -0
- package/lib/components/input-number/index.js +13 -0
- package/lib/components/input-number/input-number.js +51 -0
- package/lib/components/input-number/input-number.scss +7 -0
- package/lib/components/input-number/lunatic-input-number.js +26 -0
- package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +12 -0
- package/lib/components/loop/block-for-loop/block-for-loop.js +140 -0
- package/lib/components/loop/block-for-loop/index.js +13 -0
- package/lib/components/loop/block-for-loop/row.js +68 -0
- package/lib/components/loop/commons/get-init-length.js +16 -0
- package/lib/components/loop/commons/handle-row-button.js +20 -0
- package/lib/components/loop/commons/index.js +20 -0
- package/lib/components/loop/commons/row-component.js +65 -0
- package/lib/components/loop/index.js +13 -0
- package/lib/components/loop/loop.js +84 -0
- package/lib/components/loop/roster-for-loop/body.js +57 -0
- package/lib/components/loop/roster-for-loop/header.js +35 -0
- package/lib/components/loop/roster-for-loop/index.js +13 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +12 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +124 -0
- package/lib/components/loop/roster-for-loop/roster-table.js +50 -0
- package/lib/components/loop/roster-for-loop/roster.scss +42 -0
- package/lib/components/loop/roster-for-loop/row.js +75 -0
- package/lib/components/modal-controls/close-or-skip.js +40 -0
- package/lib/components/modal-controls/index.js +13 -0
- package/lib/components/modal-controls/modal-container.js +19 -0
- package/lib/components/modal-controls/modal-controls.js +71 -0
- package/lib/components/modal-controls/modal-controls.scss +48 -0
- package/lib/components/pairwise-links/index.js +13 -0
- package/lib/components/pairwise-links/orchestrator.js +72 -0
- package/lib/components/pairwise-links/pairwise-links.js +68 -0
- package/lib/components/pairwise-links/row.js +80 -0
- package/lib/components/radio/index.js +13 -0
- package/lib/components/radio/lunatic-radio-group.js +37 -0
- package/lib/components/radio/radio-group.js +41 -0
- package/lib/components/radio/radio-option.js +80 -0
- package/lib/components/radio/radio.scss +66 -0
- package/lib/components/sequence/index.js +13 -0
- package/lib/components/sequence/sequence.js +33 -0
- package/lib/components/sequence/sequence.scss +10 -0
- package/lib/components/subsequence/index.js +13 -0
- package/lib/components/subsequence/subsequence.js +31 -0
- package/lib/components/suggester/check-store.js +115 -0
- package/lib/components/suggester/default-style.scss +125 -0
- package/lib/components/suggester/find-best-label/find-best-label.js +55 -0
- package/lib/components/suggester/find-best-label/index.js +13 -0
- package/lib/components/suggester/idb-suggester.js +75 -0
- package/lib/components/suggester/index.js +13 -0
- package/lib/components/suggester/lunatic-suggester.js +80 -0
- package/lib/components/suggester/searching/create-searching.js +75 -0
- package/lib/components/suggester/searching/index.js +13 -0
- package/lib/components/suggester/suggester.js +138 -0
- package/lib/components/suggester-loader-widget/index.js +13 -0
- package/lib/components/suggester-loader-widget/loader-row.js +123 -0
- package/lib/components/suggester-loader-widget/loader.js +139 -0
- package/lib/components/suggester-loader-widget/progress.js +38 -0
- package/lib/components/suggester-loader-widget/tools/action-tool.js +28 -0
- package/lib/components/suggester-loader-widget/tools/index.js +20 -0
- package/lib/components/suggester-loader-widget/tools/tools.js +16 -0
- package/lib/components/suggester-loader-widget/widget-container.js +39 -0
- package/lib/components/suggester-loader-widget/widget.js +140 -0
- package/lib/components/suggester-loader-widget/widget.scss +176 -0
- package/lib/components/switch/index.js +13 -0
- package/lib/components/switch/lunatic-switch.js +47 -0
- package/lib/components/switch/switch.js +78 -0
- package/lib/components/switch/switch.scss +47 -0
- package/lib/components/table/cell.js +88 -0
- package/lib/components/table/components/cell.js +88 -0
- package/lib/components/table/components/header.js +41 -0
- package/lib/components/table/components/row.js +41 -0
- package/lib/components/table/components/table.js +31 -0
- package/lib/components/table/components/table.scss +27 -0
- package/lib/components/table/index.js +13 -0
- package/lib/components/table/lunatic-table.js +77 -0
- package/lib/components/table/table-orchestrator.js +47 -0
- package/lib/components/textarea/index.js +13 -0
- package/lib/components/textarea/lunatic-textarea.js +39 -0
- package/lib/components/textarea/textarea.js +42 -0
- package/lib/components/textarea/textarea.scss +8 -0
- package/lib/constants/component-types.js +8 -0
- package/lib/constants/declarations.js +28 -0
- package/lib/constants/event-types.js +29 -0
- package/lib/constants/index.js +60 -0
- package/lib/constants/supported-preferences.js +13 -0
- package/lib/constants/value-types.js +16 -0
- package/lib/constants/variable-types.js +12 -0
- package/lib/i18n/build-dictionary.js +50 -0
- package/lib/i18n/dictionary.js +34 -0
- package/lib/i18n/index.js +13 -0
- package/lib/index.js +21 -4040
- package/lib/stories/Introduction.stories.mdx +114 -0
- package/lib/stories/checkboxBoolean/checkboxBoolean.stories.js +27 -0
- package/lib/stories/checkboxBoolean/source.json +36 -0
- package/lib/stories/checkboxOne/checkboxOne.stories.js +27 -0
- package/lib/stories/checkboxOne/source.json +36 -0
- package/lib/stories/custom-mui/checkbox-boolean-mui.js +31 -0
- package/lib/stories/custom-mui/checkbox-group-mui.js +66 -0
- package/lib/stories/custom-mui/checkbox-one-mui.js +13 -0
- package/lib/stories/custom-mui/index.js +111 -0
- package/lib/stories/custom-mui/input-mui.js +51 -0
- package/lib/stories/custom-mui/input-number-mui.js +39 -0
- package/lib/stories/custom-mui/radio-mui.js +59 -0
- package/lib/stories/custom-mui/suggester-mui/index.js +13 -0
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +290 -0
- package/lib/stories/custom-mui/switch-mui.js +41 -0
- package/lib/stories/custom-mui/table-mui.js +25 -0
- package/lib/stories/custom-mui/tbody-mui.js +21 -0
- package/lib/stories/custom-mui/td-mui.js +23 -0
- package/lib/stories/custom-mui/textarea-mui.js +42 -0
- package/lib/stories/custom-mui/th-mui.js +22 -0
- package/lib/stories/custom-mui/thead-mui.js +21 -0
- package/lib/stories/custom-mui/tr-mui.js +31 -0
- package/lib/stories/date-picker/data.json +3 -0
- package/lib/stories/date-picker/datepicker.stories.js +31 -0
- package/lib/stories/date-picker/source.json +91 -0
- package/lib/stories/dropdown/data.json +16 -0
- package/lib/stories/dropdown/dropdown.stories.js +32 -0
- package/lib/stories/dropdown/source.json +122 -0
- package/lib/stories/filter-description/filter-description.stories.js +49 -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 +29 -0
- package/lib/stories/input/source.json +28 -0
- package/lib/stories/input-number/input-number.stories.js +34 -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 +12 -0
- package/lib/stories/pairwise/links.json +270 -0
- package/lib/stories/pairwise/pairwise-links.stories.js +30 -0
- package/lib/stories/paste-questionnaire/source.json +6290 -0
- package/lib/stories/paste-questionnaire/test.stories.js +83 -0
- package/lib/stories/questionnaires/logement/data.json +2686 -0
- package/lib/stories/questionnaires/logement/logement.stories.js +75 -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/recensement/data.json +12 -0
- package/lib/stories/questionnaires/recensement/recensement.stories.js +58 -0
- package/lib/stories/questionnaires/recensement/source.json +15202 -0
- package/lib/stories/questionnaires/rp/data.json +5 -0
- package/lib/stories/questionnaires/rp/rp.stories.js +36 -0
- package/lib/stories/questionnaires/rp/source.json +262 -0
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +63 -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 +96 -0
- package/lib/stories/questionnaires-test/test-dylan.json +558 -0
- package/lib/stories/questionnaires-test/test.stories.js +92 -0
- package/lib/stories/radio/radio.stories.js +27 -0
- package/lib/stories/radio/source.json +36 -0
- package/lib/stories/roster-for-loop/roster-for-loop.stories.js +34 -0
- package/lib/stories/roster-for-loop/source-with-header.json +127 -0
- package/lib/stories/roster-for-loop/source.json +114 -0
- package/lib/stories/suggester/source.json +234 -0
- package/lib/stories/suggester/suggester-workers.stories.js +201 -0
- package/lib/stories/suggester/suggester.stories.js +49 -0
- package/{src/stories/checkbox-one → lib/stories/switch}/README.md +31 -31
- package/lib/stories/switch/SwitchMaterialUI.js +41 -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 +85 -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-dynamique.json +67 -0
- package/lib/stories/table/table.stories.js +57 -0
- package/lib/stories/utils/custom-lunatic.scss +28 -0
- package/lib/stories/utils/default-arg-types.js +22 -0
- package/lib/stories/utils/options.js +32 -0
- package/lib/stories/utils/orchestrator.js +165 -0
- package/lib/stories/utils/waiting/index.js +13 -0
- package/lib/stories/utils/waiting/preloader.svg +1 -0
- package/lib/stories/utils/waiting/waiting.js +30 -0
- package/lib/stories/utils/waiting/waiting.scss +21 -0
- package/lib/tests/sample.spec.js +7 -0
- package/lib/use-lunatic/actions.js +90 -0
- package/lib/use-lunatic/commons/calculated-variables.js +100 -0
- package/lib/use-lunatic/commons/check-loops.js +87 -0
- package/lib/use-lunatic/commons/compose.js +24 -0
- package/lib/use-lunatic/commons/create-map-pages.js +87 -0
- package/lib/use-lunatic/commons/execute-condition-filter.js +27 -0
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +265 -0
- package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +57 -0
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +138 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +87 -0
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +37 -0
- package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +30 -0
- package/lib/use-lunatic/commons/execute-expression/index.js +13 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +123 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +22 -0
- package/lib/use-lunatic/commons/fill-components/fill-components.js +34 -0
- package/lib/use-lunatic/commons/fill-components/fill-errors.js +27 -0
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +24 -0
- package/lib/use-lunatic/commons/fill-components/fill-management.js +23 -0
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +32 -0
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +21 -0
- package/lib/use-lunatic/commons/fill-components/index.js +13 -0
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +25 -0
- package/lib/use-lunatic/commons/get-component-value/get-component-value.js +177 -0
- package/lib/use-lunatic/commons/get-component-value/index.js +13 -0
- package/lib/use-lunatic/commons/get-components-from-state.js +40 -0
- package/lib/use-lunatic/commons/get-data.js +75 -0
- package/lib/use-lunatic/commons/get-errors-without-empty-value.js +22 -0
- package/lib/use-lunatic/commons/index.js +109 -0
- package/lib/use-lunatic/commons/is-First-last-page.js +18 -0
- package/lib/use-lunatic/commons/is-paginated-loop.js +13 -0
- package/lib/use-lunatic/commons/load-suggesters.js +154 -0
- package/lib/use-lunatic/commons/page-tag.js +64 -0
- package/lib/use-lunatic/commons/use-components-from-state.js +41 -0
- package/lib/use-lunatic/index.js +13 -0
- package/lib/use-lunatic/initial-state.js +41 -0
- package/lib/use-lunatic/reducer/commons/index.js +36 -0
- package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +35 -0
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js +38 -0
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +29 -0
- package/lib/use-lunatic/reducer/index.js +13 -0
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +183 -0
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +145 -0
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +50 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/index.js +13 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +61 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +129 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +81 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +70 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +99 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +41 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +25 -0
- package/lib/use-lunatic/reducer/reduce-on-init.js +225 -0
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +21 -0
- package/lib/use-lunatic/reducer/reducer.js +38 -0
- package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +60 -0
- package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +84 -0
- package/lib/use-lunatic/reducer/validate-controls/index.js +20 -0
- package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +60 -0
- package/lib/use-lunatic/use-lunatic.js +170 -0
- package/lib/utils/constants/features.js +12 -0
- package/lib/utils/constants/index.js +60 -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 +42 -0
- package/lib/utils/idb-tools/create-db-opener.js +47 -0
- package/lib/utils/idb-tools/create-open-db.js +29 -0
- package/lib/utils/idb-tools/get-entity.js +21 -0
- package/lib/utils/idb-tools/get-idb.js +13 -0
- package/lib/utils/idb-tools/idb-bulk-insert.js +134 -0
- package/lib/utils/idb-tools/index.js +64 -0
- package/lib/utils/idb-tools/insert-entity.js +21 -0
- package/lib/utils/idb-tools/open-db.js +24 -0
- package/lib/utils/idb-tools/open-or-create-db.js +42 -0
- package/lib/utils/is-element.js +10 -0
- package/lib/utils/store-tools/auto-load.js +168 -0
- package/lib/utils/store-tools/clear-store-data.js +35 -0
- package/lib/utils/store-tools/clear-store-info.js +35 -0
- package/lib/utils/store-tools/constantes.js +31 -0
- package/lib/utils/store-tools/create/create.js +53 -0
- package/lib/utils/store-tools/create/index.js +20 -0
- package/lib/utils/store-tools/create/update-store-info.js +27 -0
- package/lib/utils/store-tools/get-store-count.js +24 -0
- package/lib/utils/store-tools/index.js +54 -0
- package/lib/utils/store-tools/open-or-create-store.js +50 -0
- package/lib/utils/store-tools/use-store-index.js +60 -0
- package/lib/utils/suggester-workers/append-to-index/append.js +80 -0
- package/lib/utils/suggester-workers/append-to-index/append.worker.js +27 -0
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +58 -0
- package/lib/utils/suggester-workers/append-to-index/index.js +20 -0
- package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +88 -0
- package/lib/utils/suggester-workers/append-to-index/store-messages.js +45 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +54 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +77 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +36 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +21 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +36 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +14 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +19 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +16 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +25 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +15 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +16 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +53 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +14 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +16 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +14 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +20 -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 +14 -0
- package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/index.js +69 -0
- package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +18 -0
- package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +12 -0
- package/lib/utils/suggester-workers/create-worker.js +54 -0
- package/lib/utils/suggester-workers/find-best-label/find-best-label.js +63 -0
- package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +53 -0
- package/lib/utils/suggester-workers/find-best-label/index.js +1 -0
- package/lib/utils/suggester-workers/find-best-label/tokenize.js +45 -0
- package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +24 -0
- package/lib/utils/suggester-workers/searching/compute-score.js +51 -0
- package/lib/utils/suggester-workers/searching/get-db.js +50 -0
- package/lib/utils/suggester-workers/searching/index.js +13 -0
- package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +28 -0
- package/lib/utils/suggester-workers/searching/order/index.js +25 -0
- package/lib/utils/suggester-workers/searching/query-parser/index.js +20 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +12 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +26 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +35 -0
- package/lib/utils/suggester-workers/searching/resolve-query-parser.js +59 -0
- package/lib/utils/suggester-workers/searching/search-in-index.js +22 -0
- package/lib/utils/suggester-workers/searching/searching.js +135 -0
- package/lib/utils/suggester-workers/searching/searching.worker.js +20 -0
- package/lib/utils/vtl/dataset-builder.js +24 -0
- package/lib/utils/vtl/index.js +13 -0
- package/package.json +163 -140
- 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 -168
- package/src/components/checkbox/index.js +0 -3
- package/src/components/checkbox/one.js +0 -27
- package/src/components/components.js +0 -15
- 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 -162
- package/src/components/declarations/wrappers/list-declarations-wrapper.js +0 -159
- 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/loops/index.js +0 -2
- package/src/components/loops/loop/build-components.js +0 -33
- package/src/components/loops/loop/component.js +0 -88
- package/src/components/loops/loop/index.js +0 -1
- package/src/components/loops/loop/loop.scss +0 -17
- package/src/components/loops/roster/build-components.js +0 -26
- package/src/components/loops/roster/component.js +0 -199
- package/src/components/loops/roster/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/loops/README.md +0 -29
- package/src/stories/loops/custom-lunatic.scss +0 -786
- package/src/stories/loops/data-loop-deeper.json +0 -298
- package/src/stories/loops/data-loop.json +0 -213
- package/src/stories/loops/data-roster.json +0 -69
- package/src/stories/loops/img/arrow.png +0 -0
- package/src/stories/loops/img/check_box.svg +0 -1
- package/src/stories/loops/img/check_box_outline.svg +0 -1
- package/src/stories/loops/img/lunatic-logo.png +0 -0
- package/src/stories/loops/img/menu-down.svg +0 -1
- package/src/stories/loops/img/menu-up.svg +0 -1
- package/src/stories/loops/img/radio_button_checked.svg +0 -1
- package/src/stories/loops/img/radio_button_unchecked.svg +0 -1
- package/src/stories/loops/loop.stories.js +0 -56
- package/src/stories/loops/vqs.json +0 -846
- 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.json +0 -28
- package/src/stories/textarea/textarea.stories.js +0 -67
- package/src/stories/tooltip-response/README.md +0 -14
- package/src/stories/tooltip-response/tooltip.stories.js +0 -43
- package/src/stories/utils/options.js +0 -21
- package/src/stories/utils/orchestrator.js +0 -52
- 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 -55
- package/src/utils/to-expose/index.js +0 -10
- package/src/utils/to-expose/init-questionnaire.js +0 -114
- package/src/utils/to-expose/interpret.js +0 -32
- package/src/utils/to-expose/state.js +0 -58
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _reduceCleaning = _interopRequireDefault(require("./reduce-cleaning"));
|
|
9
|
+
var _excluded = ["value"];
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
19
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
24
|
+
function buildMissingValue(state, oldValue) {
|
|
25
|
+
var iteration = state.pager.iteration;
|
|
26
|
+
// Root question
|
|
27
|
+
if (iteration === undefined) return null;
|
|
28
|
+
// Loop question
|
|
29
|
+
var newValue = _toConsumableArray(oldValue);
|
|
30
|
+
newValue[iteration] = null;
|
|
31
|
+
return newValue;
|
|
32
|
+
}
|
|
33
|
+
function reduceMissing(state, action) {
|
|
34
|
+
var name = action.payload.response.name;
|
|
35
|
+
var missingBlock = state.missingBlock;
|
|
36
|
+
if (name in missingBlock) {
|
|
37
|
+
var variables = state.variables,
|
|
38
|
+
updateBindings = state.updateBindings;
|
|
39
|
+
var toClean = missingBlock[name];
|
|
40
|
+
var delta = toClean.reduce(function (acc, variableName) {
|
|
41
|
+
var _variables$variableNa = variables[variableName],
|
|
42
|
+
value = _variables$variableNa.value,
|
|
43
|
+
rest = _objectWithoutProperties(_variables$variableNa, _excluded);
|
|
44
|
+
updateBindings(variableName, null);
|
|
45
|
+
var newValue = buildMissingValue(state, value);
|
|
46
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, variableName, _objectSpread(_objectSpread({}, rest), {}, {
|
|
47
|
+
value: newValue
|
|
48
|
+
})));
|
|
49
|
+
}, {});
|
|
50
|
+
var newStateAfterMissing = _objectSpread(_objectSpread({}, state), {}, {
|
|
51
|
+
variables: _objectSpread(_objectSpread({}, variables), delta)
|
|
52
|
+
});
|
|
53
|
+
// If missing clean variable which is also into cleaning case,
|
|
54
|
+
// we have to handle theses cleanings
|
|
55
|
+
// To check: do we have with this trick or triggering handle change action?
|
|
56
|
+
var newStateAfterCleaning = toClean.reduce(function (acc, v) {
|
|
57
|
+
return (0, _reduceCleaning["default"])(acc, {
|
|
58
|
+
payload: {
|
|
59
|
+
response: {
|
|
60
|
+
name: v
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}, newStateAfterMissing);
|
|
65
|
+
return newStateAfterCleaning;
|
|
66
|
+
}
|
|
67
|
+
return state;
|
|
68
|
+
}
|
|
69
|
+
var _default = reduceMissing;
|
|
70
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _commons = require("../../commons");
|
|
8
|
+
var _commons2 = require("../commons");
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
+
function reduceResizingVariables(_ref) {
|
|
22
|
+
var size = _ref.size,
|
|
23
|
+
variableArray = _ref.variableArray,
|
|
24
|
+
variables = _ref.variables,
|
|
25
|
+
executeExpression = _ref.executeExpression,
|
|
26
|
+
updateBindings = _ref.updateBindings;
|
|
27
|
+
if (size !== undefined) {
|
|
28
|
+
var sizeValue = executeExpression((0, _commons.getCompatibleVTLExpression)(size));
|
|
29
|
+
return variableArray.reduce(function (acc, v) {
|
|
30
|
+
var value = variables[v].value;
|
|
31
|
+
var newValue = (0, _commons2.resizeArrayVariable)(value, sizeValue, null);
|
|
32
|
+
updateBindings(v, newValue);
|
|
33
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, v, _objectSpread(_objectSpread({}, variables[v]), {}, {
|
|
34
|
+
value: newValue
|
|
35
|
+
})));
|
|
36
|
+
}, {});
|
|
37
|
+
}
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
function reduceResizingLinksVariables(_ref2) {
|
|
41
|
+
var sizeForLinksVariables = _ref2.sizeForLinksVariables,
|
|
42
|
+
linksVariables = _ref2.linksVariables,
|
|
43
|
+
variables = _ref2.variables,
|
|
44
|
+
executeExpression = _ref2.executeExpression,
|
|
45
|
+
updateBindings = _ref2.updateBindings;
|
|
46
|
+
if (Array.isArray(sizeForLinksVariables)) {
|
|
47
|
+
var _sizeForLinksVariable = sizeForLinksVariables.map(function (s) {
|
|
48
|
+
return executeExpression((0, _commons.getCompatibleVTLExpression)(s));
|
|
49
|
+
}),
|
|
50
|
+
_sizeForLinksVariable2 = _slicedToArray(_sizeForLinksVariable, 2),
|
|
51
|
+
xSize = _sizeForLinksVariable2[0],
|
|
52
|
+
ySize = _sizeForLinksVariable2[1];
|
|
53
|
+
return linksVariables.reduce(function (acc, v) {
|
|
54
|
+
var value = variables[v].value;
|
|
55
|
+
var newValue = (0, _commons2.resizeArrayVariable)(value.map(function (i) {
|
|
56
|
+
return (0, _commons2.resizeArrayVariable)(i, ySize, null);
|
|
57
|
+
}), xSize, new Array(ySize).fill(null));
|
|
58
|
+
updateBindings(v, newValue);
|
|
59
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, v, _objectSpread(_objectSpread({}, variables[v]), {}, {
|
|
60
|
+
value: newValue
|
|
61
|
+
})));
|
|
62
|
+
}, {});
|
|
63
|
+
}
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
function reduceResizing(state, action) {
|
|
67
|
+
var name = action.payload.response.name;
|
|
68
|
+
var resizing = state.resizing,
|
|
69
|
+
variables = state.variables,
|
|
70
|
+
updateBindings = state.updateBindings;
|
|
71
|
+
if (name in resizing) {
|
|
72
|
+
var _resizing$name = resizing[name],
|
|
73
|
+
size = _resizing$name.size,
|
|
74
|
+
variableArray = _resizing$name.variables,
|
|
75
|
+
sizeForLinksVariables = _resizing$name.sizeForLinksVariables,
|
|
76
|
+
linksVariables = _resizing$name.linksVariables;
|
|
77
|
+
var executeExpression = state.executeExpression;
|
|
78
|
+
var newLinksVariables = reduceResizingLinksVariables({
|
|
79
|
+
sizeForLinksVariables: sizeForLinksVariables,
|
|
80
|
+
linksVariables: linksVariables,
|
|
81
|
+
variables: variables,
|
|
82
|
+
executeExpression: executeExpression,
|
|
83
|
+
updateBindings: updateBindings
|
|
84
|
+
});
|
|
85
|
+
var newVariables = reduceResizingVariables({
|
|
86
|
+
size: size,
|
|
87
|
+
variableArray: variableArray,
|
|
88
|
+
variables: variables,
|
|
89
|
+
executeExpression: executeExpression,
|
|
90
|
+
updateBindings: updateBindings
|
|
91
|
+
});
|
|
92
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
93
|
+
variables: _objectSpread(_objectSpread(_objectSpread({}, variables), newLinksVariables), newVariables)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return state;
|
|
97
|
+
}
|
|
98
|
+
var _default = reduceResizing;
|
|
99
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _commons = require("../commons");
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
+
function reduceVariablesArray(variables, _ref) {
|
|
21
|
+
var name = _ref.name,
|
|
22
|
+
value = _ref.value,
|
|
23
|
+
index = _ref.index,
|
|
24
|
+
length = _ref.length;
|
|
25
|
+
if (name in variables) {
|
|
26
|
+
var variable = variables[name];
|
|
27
|
+
var previousValue = variable.value;
|
|
28
|
+
|
|
29
|
+
// validation de la valeur courante : si pas un tableau ou si la taille du tableau a changé
|
|
30
|
+
var valueNext = (0, _commons.resizeArrayVariable)(_toConsumableArray(previousValue), length);
|
|
31
|
+
|
|
32
|
+
// value affectation
|
|
33
|
+
valueNext[index] = value;
|
|
34
|
+
return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
|
|
35
|
+
value: valueNext
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
return variables;
|
|
39
|
+
}
|
|
40
|
+
var _default = reduceVariablesArray;
|
|
41
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
function reduceVariablesSimple(variables, _ref) {
|
|
14
|
+
var name = _ref.name,
|
|
15
|
+
value = _ref.value;
|
|
16
|
+
if (name in variables) {
|
|
17
|
+
var variable = variables[name];
|
|
18
|
+
return _objectSpread(_objectSpread({}, variables), {}, _defineProperty({}, name, _objectSpread(_objectSpread({}, variable), {}, {
|
|
19
|
+
value: value
|
|
20
|
+
})));
|
|
21
|
+
}
|
|
22
|
+
return variables;
|
|
23
|
+
}
|
|
24
|
+
var _default = reduceVariablesSimple;
|
|
25
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _commons = require("../commons");
|
|
8
|
+
var _pageTag = require("../commons/page-tag");
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
25
|
+
/* à bouger d'ici */
|
|
26
|
+
|
|
27
|
+
function getInitalValueFromCollected(variable) {
|
|
28
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
|
+
var values = variable.values,
|
|
30
|
+
name = variable.name;
|
|
31
|
+
var fromData;
|
|
32
|
+
if (name in data) {
|
|
33
|
+
var _data$name = data[name],
|
|
34
|
+
COLLECTED = _data$name.COLLECTED,
|
|
35
|
+
FORCED = _data$name.FORCED;
|
|
36
|
+
fromData = COLLECTED || FORCED;
|
|
37
|
+
}
|
|
38
|
+
if (values) {
|
|
39
|
+
var _COLLECTED = values.COLLECTED,
|
|
40
|
+
_FORCED = values.FORCED;
|
|
41
|
+
return fromData || _FORCED || _COLLECTED;
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
function getInitialValueFromExternal(variable) {
|
|
46
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
47
|
+
var name = variable.name;
|
|
48
|
+
if (name in data) {
|
|
49
|
+
return data[name];
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
function getInitialValue(variable) {
|
|
54
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
55
|
+
var COLLECTED = data.COLLECTED,
|
|
56
|
+
EXTERNAL = data.EXTERNAL,
|
|
57
|
+
CALCULATED = data.CALCULATED;
|
|
58
|
+
var variableType = variable.variableType;
|
|
59
|
+
switch (variableType) {
|
|
60
|
+
case 'COLLECTED':
|
|
61
|
+
return getInitalValueFromCollected(variable, COLLECTED);
|
|
62
|
+
case 'EXTERNAL':
|
|
63
|
+
return getInitialValueFromExternal(variable, EXTERNAL);
|
|
64
|
+
case 'CALCULATED':
|
|
65
|
+
return getInitialValueFromExternal(variable, CALCULATED);
|
|
66
|
+
default:
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function appendToArrayMap(map, key, entry) {
|
|
71
|
+
if (key in map) {
|
|
72
|
+
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, [].concat(_toConsumableArray(map[key]), [entry])));
|
|
73
|
+
}
|
|
74
|
+
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, [entry]));
|
|
75
|
+
}
|
|
76
|
+
function appendToObjectMap(map, key, object) {
|
|
77
|
+
if (key in map) {
|
|
78
|
+
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, _objectSpread(_objectSpread({}, map[key]), object)));
|
|
79
|
+
}
|
|
80
|
+
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, object));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @param {*} source
|
|
86
|
+
* @param {*} data
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
function createVariables(source, data) {
|
|
90
|
+
var _source$variables = source.variables,
|
|
91
|
+
variables = _source$variables === void 0 ? [] : _source$variables;
|
|
92
|
+
var _variables$reduce = variables.reduce(function (_ref, variable) {
|
|
93
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
94
|
+
mapType = _ref2[0],
|
|
95
|
+
mapVar = _ref2[1];
|
|
96
|
+
var type = variable.variableType,
|
|
97
|
+
name = variable.name;
|
|
98
|
+
return [appendToArrayMap(mapType, type, variable), appendToObjectMap(mapVar, name, {
|
|
99
|
+
variable: variable,
|
|
100
|
+
type: type,
|
|
101
|
+
value: getInitialValue(variable, data)
|
|
102
|
+
})];
|
|
103
|
+
}, [{}, {}]),
|
|
104
|
+
_variables$reduce2 = _slicedToArray(_variables$reduce, 2),
|
|
105
|
+
mapVariablesTypes = _variables$reduce2[0],
|
|
106
|
+
mapVariables = _variables$reduce2[1];
|
|
107
|
+
//
|
|
108
|
+
var _mapVariablesTypes$CA = mapVariablesTypes.CALCULATED,
|
|
109
|
+
CALCULATED = _mapVariablesTypes$CA === void 0 ? [] : _mapVariablesTypes$CA;
|
|
110
|
+
CALCULATED.forEach(function (calculated) {
|
|
111
|
+
var _calculated$bindingDe = calculated.bindingDependencies,
|
|
112
|
+
bindingDependencies = _calculated$bindingDe === void 0 ? [] : _calculated$bindingDe;
|
|
113
|
+
bindingDependencies.forEach(function (name) {
|
|
114
|
+
if (name in mapVariables) {
|
|
115
|
+
var variable = mapVariables[name];
|
|
116
|
+
var CalculatedLinked = variable.CalculatedLinked;
|
|
117
|
+
if (CalculatedLinked) {
|
|
118
|
+
CalculatedLinked.push(calculated);
|
|
119
|
+
} else {
|
|
120
|
+
variable.CalculatedLinked = [calculated];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
return mapVariables;
|
|
126
|
+
}
|
|
127
|
+
/* */
|
|
128
|
+
|
|
129
|
+
function checkInLoop(state, initialPager) {
|
|
130
|
+
var pager = state.pager,
|
|
131
|
+
pages = state.pages,
|
|
132
|
+
executeExpression = state.executeExpression;
|
|
133
|
+
var page = pager.page;
|
|
134
|
+
if (page in pages) {
|
|
135
|
+
var _pages$page = pages[page],
|
|
136
|
+
isLoop = _pages$page.isLoop,
|
|
137
|
+
subPages = _pages$page.subPages,
|
|
138
|
+
iterations = _pages$page.iterations,
|
|
139
|
+
loopDependencies = _pages$page.loopDependencies;
|
|
140
|
+
if (isLoop) {
|
|
141
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
142
|
+
isInLoop: true,
|
|
143
|
+
pager: _objectSpread(_objectSpread({}, pager), {}, {
|
|
144
|
+
subPage: initialPager.subPage || 0,
|
|
145
|
+
nbSubPages: subPages.length,
|
|
146
|
+
iteration: initialPager.iteration || 0,
|
|
147
|
+
nbIterations: executeExpression(iterations, {
|
|
148
|
+
iteration: undefined,
|
|
149
|
+
bindingDependencies: loopDependencies
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return state;
|
|
156
|
+
}
|
|
157
|
+
function reduceOnInit(state, action) {
|
|
158
|
+
var payload = action.payload;
|
|
159
|
+
var source = payload.source,
|
|
160
|
+
data = payload.data,
|
|
161
|
+
initialPage = payload.initialPage,
|
|
162
|
+
features = payload.features,
|
|
163
|
+
handleChange = payload.handleChange,
|
|
164
|
+
preferences = payload.preferences,
|
|
165
|
+
savingType = payload.savingType,
|
|
166
|
+
management = payload.management,
|
|
167
|
+
activeControls = payload.activeControls;
|
|
168
|
+
if (source && data) {
|
|
169
|
+
var variables = createVariables(source, data); // map des variables
|
|
170
|
+
var _createExecuteExpress = (0, _commons.createExecuteExpression)(variables, features),
|
|
171
|
+
_createExecuteExpress2 = _slicedToArray(_createExecuteExpress, 4),
|
|
172
|
+
executeExpression = _createExecuteExpress2[0],
|
|
173
|
+
updateBindings = _createExecuteExpress2[1],
|
|
174
|
+
setLoopBindings = _createExecuteExpress2[2],
|
|
175
|
+
resetLoopBindings = _createExecuteExpress2[3];
|
|
176
|
+
var pages = (0, _commons.checkLoops)((0, _commons.createMapPages)(source));
|
|
177
|
+
var maxPage = source.maxPage,
|
|
178
|
+
_source$cleaning = source.cleaning,
|
|
179
|
+
cleaning = _source$cleaning === void 0 ? {} : _source$cleaning,
|
|
180
|
+
_source$missingBlock = source.missingBlock,
|
|
181
|
+
missingBlock = _source$missingBlock === void 0 ? {} : _source$missingBlock,
|
|
182
|
+
_source$resizing = source.resizing,
|
|
183
|
+
resizing = _source$resizing === void 0 ? {} : _source$resizing;
|
|
184
|
+
var initialPager = (0, _pageTag.getPagerFromPageTag)(initialPage);
|
|
185
|
+
if (!initialPager) {
|
|
186
|
+
initialPager = {
|
|
187
|
+
page: 1
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
var pager = {
|
|
191
|
+
page: initialPager.page,
|
|
192
|
+
maxPage: maxPage,
|
|
193
|
+
subPage: undefined,
|
|
194
|
+
nbSubPages: undefined,
|
|
195
|
+
iteration: undefined,
|
|
196
|
+
nbIterations: undefined,
|
|
197
|
+
lastReachedPage: initialPage
|
|
198
|
+
};
|
|
199
|
+
var _isFirstLastPage = (0, _commons.isFirstLastPage)(pager),
|
|
200
|
+
isFirstPage = _isFirstLastPage.isFirstPage,
|
|
201
|
+
isLastPage = _isFirstLastPage.isLastPage;
|
|
202
|
+
return checkInLoop(_objectSpread(_objectSpread({}, state), {}, {
|
|
203
|
+
cleaning: cleaning,
|
|
204
|
+
missingBlock: missingBlock,
|
|
205
|
+
resizing: resizing,
|
|
206
|
+
variables: variables,
|
|
207
|
+
pages: pages,
|
|
208
|
+
isFirstPage: isFirstPage,
|
|
209
|
+
isLastPage: isLastPage,
|
|
210
|
+
pager: pager,
|
|
211
|
+
executeExpression: executeExpression,
|
|
212
|
+
updateBindings: updateBindings,
|
|
213
|
+
setLoopBindings: setLoopBindings,
|
|
214
|
+
resetLoopBindings: resetLoopBindings,
|
|
215
|
+
handleChange: handleChange,
|
|
216
|
+
preferences: preferences,
|
|
217
|
+
management: management,
|
|
218
|
+
savingType: savingType,
|
|
219
|
+
activeControls: activeControls
|
|
220
|
+
}), initialPager);
|
|
221
|
+
}
|
|
222
|
+
return state;
|
|
223
|
+
}
|
|
224
|
+
var _default = reduceOnInit;
|
|
225
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
function reduceOnSetWaiting(state, action) {
|
|
14
|
+
var payload = action.payload;
|
|
15
|
+
var status = payload.status;
|
|
16
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
17
|
+
waiting: status
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
var _default = reduceOnSetWaiting;
|
|
21
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _reduceOnInit = _interopRequireDefault(require("./reduce-on-init"));
|
|
9
|
+
var _reduceGoPreviousPage = _interopRequireDefault(require("./reduce-go-previous-page"));
|
|
10
|
+
var _reduceGoNextPage = _interopRequireDefault(require("./reduce-go-next-page"));
|
|
11
|
+
var _reduceGoToPage = _interopRequireDefault(require("./reduce-go-to-page"));
|
|
12
|
+
var _reduceHandleChange = _interopRequireDefault(require("./reduce-handle-change"));
|
|
13
|
+
var _reduceOnSetWaiting = _interopRequireDefault(require("./reduce-on-set-waiting"));
|
|
14
|
+
var actions = _interopRequireWildcard(require("../actions"));
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
|
+
function reducer(state, action) {
|
|
19
|
+
var type = action.type;
|
|
20
|
+
switch (type) {
|
|
21
|
+
case actions.ON_INIT:
|
|
22
|
+
return (0, _reduceOnInit["default"])(state, action);
|
|
23
|
+
case actions.GO_PREVIOUS_PAGE:
|
|
24
|
+
return (0, _reduceGoPreviousPage["default"])(state, action);
|
|
25
|
+
case actions.GO_NEXT_PAGE:
|
|
26
|
+
return (0, _reduceGoNextPage["default"])(state, action);
|
|
27
|
+
case actions.GO_TO_PAGE:
|
|
28
|
+
return (0, _reduceGoToPage["default"])(state, action);
|
|
29
|
+
case actions.HANDLE_CHANGE:
|
|
30
|
+
return (0, _reduceHandleChange["default"])(state, action);
|
|
31
|
+
case actions.ON_SET_WAITING:
|
|
32
|
+
return (0, _reduceOnSetWaiting["default"])(state, action);
|
|
33
|
+
default:
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
var _default = reducer;
|
|
38
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _validationUtils = require("./validation-utils");
|
|
8
|
+
var _commons = require("../../commons");
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
function validateComponents(state, components) {
|
|
16
|
+
var pager = state.pager;
|
|
17
|
+
return components.reduce(function (errors, component) {
|
|
18
|
+
var controls = component.controls,
|
|
19
|
+
componentType = component.componentType,
|
|
20
|
+
id = component.id;
|
|
21
|
+
if (Array.isArray(controls)) {
|
|
22
|
+
var componentErrors = (0, _validationUtils.resolveComponentControls)(state, controls);
|
|
23
|
+
var shallowIteration = pager.shallowIteration;
|
|
24
|
+
var idC = shallowIteration !== undefined ? "".concat(id, "-").concat(shallowIteration) : id;
|
|
25
|
+
return _objectSpread(_objectSpread({}, errors), {}, _defineProperty({}, idC, componentErrors));
|
|
26
|
+
}
|
|
27
|
+
//Thanks to init which split basic Loops, we only go into unPaginatedLoops
|
|
28
|
+
if (['Loop', 'RosterForLoop'].includes(componentType)) {
|
|
29
|
+
var _components = component.components;
|
|
30
|
+
var recurs = validateComponents(state, _components);
|
|
31
|
+
return _objectSpread(_objectSpread(_objectSpread({}, (state.errors || {})[(0, _commons.getPageTag)(pager)] || {}), errors), recurs);
|
|
32
|
+
}
|
|
33
|
+
// If no error we remove the possible previous errors
|
|
34
|
+
return {};
|
|
35
|
+
}, {});
|
|
36
|
+
}
|
|
37
|
+
function createControlsReducer(reducer) {
|
|
38
|
+
// Nothing to init
|
|
39
|
+
return function (state, action) {
|
|
40
|
+
var activeControls = state.activeControls;
|
|
41
|
+
var updatedState = reducer(state, action);
|
|
42
|
+
if (!activeControls || state.pager.lastReachedPage !== updatedState.pager.lastReachedPage)
|
|
43
|
+
//if no active controls or is the first time we reach the page
|
|
44
|
+
return _objectSpread(_objectSpread({}, updatedState), {}, {
|
|
45
|
+
currentErrors: undefined
|
|
46
|
+
});
|
|
47
|
+
var components = (0, _commons.getComponentsFromState)(updatedState);
|
|
48
|
+
var pager = updatedState.pager;
|
|
49
|
+
var _state$errors = state.errors,
|
|
50
|
+
errors = _state$errors === void 0 ? {} : _state$errors;
|
|
51
|
+
var pageTag = (0, _commons.getPageTag)(pager);
|
|
52
|
+
var e = _objectSpread(_objectSpread({}, errors), {}, _defineProperty({}, pageTag, validateComponents(updatedState, components)));
|
|
53
|
+
return _objectSpread(_objectSpread({}, updatedState), {}, {
|
|
54
|
+
errors: e,
|
|
55
|
+
currentErrors: e[pageTag]
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var _default = createControlsReducer;
|
|
60
|
+
exports["default"] = _default;
|