@inseefr/lunatic 2.0.0-v2 → 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/lib/components/button/index.js +0 -2
- package/lib/components/button/lunatic-button.js +6 -16
- package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +8 -13
- package/lib/components/checkbox/checkbox-boolean/index.js +0 -2
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +9 -16
- package/lib/components/checkbox/checkbox-group/checkbox-group.js +21 -33
- package/lib/components/checkbox/checkbox-group/checkbox.scss +1 -0
- package/lib/components/checkbox/checkbox-group/index.js +0 -2
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +9 -15
- package/lib/components/checkbox/checkbox-one/index.js +0 -2
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +5 -14
- package/lib/components/checkbox/commons/checkbox-option.js +14 -18
- package/lib/components/checkbox/commons/checkbox-option.scss +3 -0
- package/lib/components/checkbox/commons/index.js +0 -2
- package/lib/components/checkbox/index.js +0 -4
- package/lib/components/commons/build-style-object.js +3 -14
- package/lib/components/commons/components/combo-box/combo-box-container.js +3 -9
- package/lib/components/commons/components/combo-box/combo-box-content.js +6 -19
- package/lib/components/commons/components/combo-box/combo-box.js +35 -67
- package/lib/components/commons/components/combo-box/combo-box.scss +0 -10
- package/lib/components/commons/components/combo-box/index.js +0 -2
- package/lib/components/commons/components/combo-box/panel/index.js +0 -2
- package/lib/components/commons/components/combo-box/panel/option-container.js +4 -19
- package/lib/components/commons/components/combo-box/panel/panel-container.js +3 -8
- package/lib/components/commons/components/combo-box/panel/panel.js +13 -22
- package/lib/components/commons/components/combo-box/selection/delete.js +3 -19
- package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +2 -10
- package/lib/components/commons/components/combo-box/selection/index.js +0 -2
- package/lib/components/commons/components/combo-box/selection/input.js +8 -21
- package/lib/components/commons/components/combo-box/selection/label-selection.js +8 -15
- package/lib/components/commons/components/combo-box/selection/selection-container.js +4 -9
- package/lib/components/commons/components/combo-box/selection/selection.js +12 -22
- package/lib/components/commons/components/combo-box/state-management/actions.js +6 -22
- package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +0 -4
- package/lib/components/commons/components/combo-box/state-management/index.js +0 -9
- package/lib/components/commons/components/combo-box/state-management/reducer/index.js +0 -2
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +8 -14
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +0 -2
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +4 -9
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +4 -9
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +4 -7
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +4 -7
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +1 -20
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +4 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +0 -22
- package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +10 -21
- package/lib/components/commons/components/create-lunatic-component/index.js +0 -3
- package/lib/components/commons/components/default-label-renderer.js +4 -14
- package/lib/components/commons/components/default-option-renderer.js +3 -10
- package/lib/components/commons/components/dragger/dragger.js +20 -46
- package/lib/components/commons/components/dragger/index.js +0 -2
- package/lib/components/commons/components/errors/errors.js +18 -12
- package/lib/components/commons/components/errors/index.js +0 -2
- package/lib/components/commons/components/fab/fab.js +6 -14
- package/lib/components/commons/components/fab/index.js +0 -2
- package/lib/components/commons/components/field-container/field-container.js +3 -12
- package/lib/components/commons/components/field-container/index.js +0 -2
- package/lib/components/commons/components/fieldset.js +2 -10
- package/lib/components/commons/components/fieldset.scss +2 -0
- package/lib/components/commons/components/html-table/index.js +0 -7
- package/lib/components/commons/components/html-table/table.js +3 -12
- package/lib/components/commons/components/html-table/tbody.js +3 -12
- package/lib/components/commons/components/html-table/td.js +7 -16
- package/lib/components/commons/components/html-table/th.js +6 -15
- package/lib/components/commons/components/html-table/thead.js +3 -12
- package/lib/components/commons/components/html-table/tr.js +4 -13
- package/lib/components/commons/components/is-network/index.js +0 -2
- package/lib/components/commons/components/is-network/is-network.js +8 -27
- package/lib/components/commons/components/is-network/use-online-status.js +0 -9
- package/lib/components/commons/components/label.js +5 -13
- package/lib/components/commons/components/lunatic-component.js +12 -24
- package/lib/components/commons/components/lunatic-fieldset-component.js +9 -20
- package/lib/components/commons/components/md-label/index.js +0 -2
- package/lib/components/commons/components/md-label/link.js +8 -14
- package/lib/components/commons/components/md-label/md-label.js +6 -14
- package/lib/components/commons/components/missing/index.js +0 -2
- package/lib/components/commons/components/missing/missing.js +11 -25
- package/lib/components/commons/components/nothing-to-display.js +0 -4
- package/lib/components/commons/components/orchestrated-component.js +15 -25
- package/lib/components/commons/components/variable-status/img/index.js +0 -3
- package/lib/components/commons/components/variable-status/index.js +0 -2
- package/lib/components/commons/components/variable-status/variable-status.js +18 -35
- package/lib/components/commons/create-customizable-field.js +2 -14
- package/lib/components/commons/create-row-orchestrator.js +16 -21
- package/lib/components/commons/icons/checkbox-checked.icon.js +4 -9
- package/lib/components/commons/icons/checkbox-unchecked.icon.js +4 -9
- package/lib/components/commons/icons/closed.icon.js +4 -9
- package/lib/components/commons/icons/cross.icon.js +4 -9
- package/lib/components/commons/icons/index.js +0 -11
- package/lib/components/commons/icons/load.icon.js +4 -9
- package/lib/components/commons/icons/lunatic-icon.js +1 -7
- package/lib/components/commons/icons/network.icon.js +4 -9
- package/lib/components/commons/icons/on-drag.icon.js +4 -9
- package/lib/components/commons/icons/opened.icon.js +4 -9
- package/lib/components/commons/icons/radio-checked.icon.js +4 -9
- package/lib/components/commons/icons/radio-unchecked.icon.js +4 -9
- package/lib/components/commons/index.js +0 -24
- package/lib/components/commons/prop-types/declarations.js +0 -8
- package/lib/components/commons/prop-types/index.js +0 -6
- package/lib/components/commons/prop-types/lines.js +0 -4
- package/lib/components/commons/prop-types/options.js +0 -4
- package/lib/components/commons/prop-types/response.js +0 -4
- package/lib/components/commons/prop-types/value-type.js +0 -8
- package/lib/components/commons/safety-label.js +0 -8
- package/lib/components/commons/use-document-add-event-listener.js +9 -33
- package/lib/components/commons/use-on-handle-change.js +2 -5
- package/lib/components/commons/use-options-keydown.js +1 -6
- package/lib/components/commons/use-previous.js +0 -3
- package/lib/components/components.js +8 -33
- package/lib/components/datepicker/datepicker.js +9 -17
- package/lib/components/datepicker/index.js +0 -2
- package/lib/components/datepicker/lunatic-datepicker.js +5 -15
- package/lib/components/declarations/declaration.js +2 -9
- package/lib/components/declarations/declarations-after-text.js +0 -9
- package/lib/components/declarations/declarations-before-text.js +0 -9
- package/lib/components/declarations/declarations-detachable.js +0 -9
- package/lib/components/declarations/declarations.js +8 -14
- package/lib/components/declarations/index.js +0 -8
- package/lib/components/dropdown/dropdown-simple/dropdown-simple.js +7 -14
- package/lib/components/dropdown/dropdown-simple/index.js +0 -2
- package/lib/components/dropdown/dropdown-simple/simple-label-renderer.js +3 -13
- package/lib/components/dropdown/dropdown-simple/simple-option-renderer.js +2 -9
- package/lib/components/dropdown/dropdown-writable/dropdown-writable.js +11 -31
- package/lib/components/dropdown/dropdown-writable/filter-tools/filter-options.js +1 -12
- package/lib/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +0 -11
- package/lib/components/dropdown/dropdown-writable/filter-tools/match.js +0 -5
- package/lib/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +0 -4
- package/lib/components/dropdown/dropdown-writable/index.js +0 -2
- package/lib/components/dropdown/dropdown-writable/writable-label-renderer.js +3 -13
- package/lib/components/dropdown/dropdown-writable/writable-option-renderer.js +18 -52
- package/lib/components/dropdown/dropdown.js +9 -20
- package/lib/components/dropdown/index.js +0 -2
- package/lib/components/dropdown/lunatic-dropdown.js +11 -19
- package/lib/components/filter-description/component.js +3 -6
- package/lib/components/filter-description/index.js +0 -2
- package/lib/components/index.js +0 -4
- package/lib/components/input/index.js +0 -2
- package/lib/components/input/input.js +7 -19
- package/lib/components/input/lunatic-input.js +4 -15
- package/lib/components/input-number/index.js +0 -2
- package/lib/components/input-number/input-number.js +12 -22
- package/lib/components/input-number/lunatic-input-number.js +5 -14
- package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +0 -4
- package/lib/components/loop/block-for-loop/block-for-loop.js +38 -76
- package/lib/components/loop/block-for-loop/index.js +0 -2
- package/lib/components/loop/block-for-loop/row.js +16 -30
- package/lib/components/loop/commons/get-init-length.js +0 -3
- package/lib/components/loop/commons/handle-row-button.js +2 -7
- package/lib/components/loop/commons/index.js +0 -3
- package/lib/components/loop/commons/row-component.js +17 -38
- package/lib/components/loop/index.js +0 -2
- package/lib/components/loop/loop.js +19 -29
- package/lib/components/loop/roster-for-loop/body.js +14 -26
- package/lib/components/loop/roster-for-loop/header.js +2 -9
- package/lib/components/loop/roster-for-loop/index.js +0 -2
- package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +0 -4
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +29 -58
- package/lib/components/loop/roster-for-loop/roster-table.js +10 -21
- package/lib/components/loop/roster-for-loop/row.js +16 -27
- package/lib/components/modal-controls/close-or-skip.js +7 -13
- package/lib/components/modal-controls/index.js +0 -2
- package/lib/components/modal-controls/modal-container.js +1 -6
- package/lib/components/modal-controls/modal-controls.js +6 -29
- package/lib/components/modal-controls/modal-controls.scss +15 -35
- package/lib/components/{pairwise/links → pairwise-links}/index.js +0 -2
- package/lib/components/pairwise-links/orchestrator.js +72 -0
- package/lib/components/{pairwise/links → pairwise-links}/pairwise-links.js +24 -33
- package/lib/components/{pairwise/links → pairwise-links}/row.js +51 -66
- package/lib/components/radio/index.js +0 -2
- package/lib/components/radio/lunatic-radio-group.js +9 -16
- package/lib/components/radio/radio-group.js +10 -19
- package/lib/components/radio/radio-option.js +13 -23
- package/lib/components/radio/radio.scss +3 -1
- package/lib/components/sequence/index.js +0 -2
- package/lib/components/sequence/sequence.js +5 -10
- package/lib/components/subsequence/index.js +0 -2
- package/lib/components/subsequence/subsequence.js +4 -8
- package/lib/components/suggester/check-store.js +15 -54
- package/lib/components/suggester/find-best-label/find-best-label.js +2 -14
- package/lib/components/suggester/find-best-label/index.js +0 -2
- package/lib/components/suggester/idb-suggester.js +14 -34
- package/lib/components/suggester/index.js +0 -2
- package/lib/components/suggester/lunatic-suggester.js +15 -28
- package/lib/components/suggester/searching/create-searching.js +5 -18
- package/lib/components/suggester/searching/index.js +0 -2
- package/lib/components/suggester/suggester.js +22 -56
- package/lib/components/suggester-loader-widget/index.js +0 -2
- package/lib/components/suggester-loader-widget/loader-row.js +13 -40
- package/lib/components/suggester-loader-widget/loader.js +15 -56
- package/lib/components/suggester-loader-widget/progress.js +6 -13
- package/lib/components/suggester-loader-widget/tools/action-tool.js +5 -12
- package/lib/components/suggester-loader-widget/tools/index.js +0 -3
- package/lib/components/suggester-loader-widget/tools/tools.js +0 -4
- package/lib/components/suggester-loader-widget/widget-container.js +2 -11
- package/lib/components/suggester-loader-widget/widget.js +24 -54
- package/lib/components/switch/index.js +0 -2
- package/lib/components/switch/lunatic-switch.js +5 -17
- package/lib/components/switch/switch.js +7 -21
- package/lib/components/table/cell.js +14 -39
- package/lib/components/table/components/cell.js +14 -39
- package/lib/components/table/components/header.js +4 -11
- package/lib/components/table/components/row.js +7 -13
- package/lib/components/table/components/table.js +3 -10
- package/lib/components/table/index.js +0 -2
- package/lib/components/table/lunatic-table.js +17 -34
- package/lib/components/table/table-orchestrator.js +12 -20
- package/lib/components/textarea/index.js +0 -2
- package/lib/components/textarea/lunatic-textarea.js +4 -15
- package/lib/components/textarea/textarea.js +8 -20
- package/lib/constants/declarations.js +3 -1
- package/lib/constants/event-types.js +2 -1
- package/lib/constants/index.js +0 -10
- package/lib/constants/supported-preferences.js +0 -5
- package/lib/constants/variable-types.js +2 -2
- package/lib/i18n/build-dictionary.js +5 -11
- package/lib/i18n/dictionary.js +8 -0
- package/lib/i18n/index.js +0 -6
- package/lib/index.js +0 -4
- package/lib/stories/{pairwise/block/pairwise-block.stories.js → checkboxBoolean/checkboxBoolean.stories.js} +6 -15
- package/lib/stories/checkboxBoolean/source.json +36 -0
- package/lib/stories/checkboxOne/checkboxOne.stories.js +0 -8
- package/lib/stories/custom-mui/checkbox-boolean-mui.js +4 -12
- package/lib/stories/custom-mui/checkbox-group-mui.js +9 -23
- package/lib/stories/custom-mui/checkbox-one-mui.js +0 -4
- package/lib/stories/custom-mui/index.js +0 -16
- package/lib/stories/custom-mui/input-mui.js +7 -17
- package/lib/stories/custom-mui/input-number-mui.js +7 -15
- package/lib/stories/custom-mui/radio-mui.js +7 -23
- package/lib/stories/custom-mui/suggester-mui/index.js +0 -2
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +55 -93
- package/lib/stories/custom-mui/switch-mui.js +5 -15
- package/lib/stories/custom-mui/table-mui.js +2 -10
- package/lib/stories/custom-mui/tbody-mui.js +2 -8
- package/lib/stories/custom-mui/td-mui.js +4 -10
- package/lib/stories/custom-mui/textarea-mui.js +7 -16
- package/lib/stories/custom-mui/th-mui.js +3 -9
- package/lib/stories/custom-mui/thead-mui.js +2 -8
- package/lib/stories/custom-mui/tr-mui.js +3 -10
- package/lib/stories/date-picker/datepicker.stories.js +3 -10
- package/lib/stories/date-picker/source.json +2 -51
- package/lib/stories/dropdown/dropdown.stories.js +4 -10
- package/lib/stories/filter-description/filter-description.stories.js +4 -13
- package/lib/stories/input/input.stories.js +0 -9
- package/lib/stories/input-number/input-number.stories.js +0 -9
- package/lib/stories/pairwise/data.json +12 -0
- package/lib/stories/pairwise/links.json +270 -0
- package/lib/stories/pairwise/{links/pairwise-links.stories.js → pairwise-links.stories.js} +3 -12
- package/lib/stories/paste-questionnaire/test.stories.js +4 -12
- package/lib/stories/questionnaires/logement/data.json +6 -11
- package/lib/stories/questionnaires/logement/logement.stories.js +4 -15
- 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 +4 -12
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +13 -52
- package/lib/stories/questionnaires-test/controls/boucles-n.json +74 -444
- package/lib/stories/questionnaires-test/controls/controls.stories.js +12 -24
- package/lib/stories/questionnaires-test/test.stories.js +4 -16
- package/lib/stories/radio/radio.stories.js +0 -8
- package/lib/stories/roster-for-loop/roster-for-loop.stories.js +8 -9
- package/lib/stories/roster-for-loop/source-with-header.json +127 -0
- package/lib/stories/suggester/suggester-workers.stories.js +201 -0
- package/lib/stories/suggester/suggester.stories.js +0 -10
- package/lib/stories/switch/SwitchMaterialUI.js +5 -15
- package/lib/stories/switch/switch.js +4 -27
- package/lib/stories/table/table-dynamique.json +67 -0
- package/lib/stories/table/table.stories.js +8 -16
- package/lib/stories/utils/default-arg-types.js +4 -5
- package/lib/stories/utils/orchestrator.js +61 -84
- package/lib/stories/utils/waiting/index.js +0 -2
- package/lib/stories/utils/waiting/waiting.js +1 -11
- package/lib/use-lunatic/actions.js +8 -20
- package/lib/use-lunatic/commons/calculated-variables.js +20 -44
- package/lib/use-lunatic/commons/check-loops.js +14 -38
- package/lib/use-lunatic/commons/compose.js +0 -4
- package/lib/use-lunatic/commons/create-map-pages.js +6 -27
- package/lib/use-lunatic/commons/execute-condition-filter.js +0 -7
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +64 -107
- package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +7 -28
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +23 -45
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +10 -41
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +2 -16
- package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +5 -12
- package/lib/use-lunatic/commons/execute-expression/index.js +0 -2
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +20 -46
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +4 -8
- package/lib/use-lunatic/commons/fill-components/fill-components.js +0 -13
- package/lib/use-lunatic/commons/fill-components/fill-errors.js +4 -8
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +6 -8
- package/lib/use-lunatic/commons/fill-components/fill-management.js +4 -8
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +5 -10
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +4 -6
- package/lib/use-lunatic/commons/fill-components/index.js +0 -2
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +0 -7
- package/lib/use-lunatic/commons/get-component-value/get-component-value.js +26 -66
- package/lib/use-lunatic/commons/get-component-value/index.js +0 -2
- package/lib/use-lunatic/commons/get-components-from-state.js +10 -14
- package/lib/use-lunatic/commons/get-data.js +16 -31
- package/lib/use-lunatic/commons/get-errors-without-empty-value.js +22 -0
- package/lib/use-lunatic/commons/index.js +7 -13
- package/lib/use-lunatic/commons/is-First-last-page.js +1 -3
- package/lib/use-lunatic/commons/is-paginated-loop.js +1 -3
- package/lib/use-lunatic/commons/load-suggesters.js +9 -54
- package/lib/use-lunatic/commons/page-tag.js +15 -34
- package/lib/use-lunatic/commons/use-components-from-state.js +12 -20
- package/lib/use-lunatic/index.js +0 -2
- package/lib/use-lunatic/initial-state.js +1 -3
- package/lib/use-lunatic/reducer/commons/index.js +0 -5
- package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +1 -15
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js +2 -12
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +4 -16
- package/lib/use-lunatic/reducer/index.js +0 -2
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +37 -65
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +31 -50
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +10 -20
- package/lib/use-lunatic/reducer/reduce-handle-change/index.js +0 -2
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +13 -29
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +34 -40
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +58 -30
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +13 -33
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +24 -43
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +11 -20
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +5 -9
- package/lib/use-lunatic/reducer/reduce-on-init.js +69 -104
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +4 -6
- package/lib/use-lunatic/reducer/reducer.js +0 -20
- package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +28 -27
- package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +22 -26
- package/lib/use-lunatic/reducer/validate-controls/index.js +0 -3
- package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +11 -22
- package/lib/use-lunatic/use-lunatic.js +61 -106
- package/lib/utils/constants/index.js +0 -10
- package/lib/utils/idb-tools/clear-store.js +1 -11
- package/lib/utils/idb-tools/create-db-opener.js +6 -19
- package/lib/utils/idb-tools/create-open-db.js +1 -7
- package/lib/utils/idb-tools/get-entity.js +0 -4
- package/lib/utils/idb-tools/get-idb.js +0 -2
- package/lib/utils/idb-tools/idb-bulk-insert.js +15 -38
- package/lib/utils/idb-tools/index.js +0 -11
- package/lib/utils/idb-tools/insert-entity.js +0 -4
- package/lib/utils/idb-tools/open-db.js +1 -6
- package/lib/utils/idb-tools/open-or-create-db.js +3 -10
- package/lib/utils/is-element.js +0 -2
- package/lib/utils/store-tools/auto-load.js +10 -51
- package/lib/utils/store-tools/clear-store-data.js +1 -12
- package/lib/utils/store-tools/clear-store-info.js +1 -12
- package/lib/utils/store-tools/create/create.js +1 -18
- package/lib/utils/store-tools/create/index.js +0 -3
- package/lib/utils/store-tools/create/update-store-info.js +0 -6
- package/lib/utils/store-tools/get-store-count.js +0 -5
- package/lib/utils/store-tools/index.js +0 -12
- package/lib/utils/store-tools/open-or-create-store.js +1 -11
- package/lib/utils/store-tools/use-store-index.js +5 -27
- package/lib/utils/suggester-workers/append-to-index/append.js +7 -23
- package/lib/utils/suggester-workers/append-to-index/append.worker.js +6 -10
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +3 -11
- package/lib/utils/suggester-workers/append-to-index/index.js +0 -3
- package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +10 -36
- package/lib/utils/suggester-workers/append-to-index/store-messages.js +4 -7
- package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +9 -19
- package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +16 -42
- package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +4 -15
- package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +0 -3
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +4 -15
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +0 -2
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +0 -5
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +0 -2
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +0 -9
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +0 -2
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +1 -3
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +0 -2
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +3 -9
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +0 -2
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +4 -22
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +2 -3
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +0 -3
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +0 -2
- package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +0 -3
- package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +0 -3
- package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +0 -8
- package/lib/utils/suggester-workers/commons-tokenizer/index.js +0 -10
- package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +0 -6
- package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +0 -3
- package/lib/utils/suggester-workers/create-worker.js +1 -11
- package/lib/utils/suggester-workers/find-best-label/find-best-label.js +10 -28
- package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +9 -23
- package/lib/utils/suggester-workers/find-best-label/tokenize.js +6 -23
- package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +0 -2
- package/lib/utils/suggester-workers/searching/compute-score.js +4 -16
- package/lib/utils/suggester-workers/searching/get-db.js +1 -15
- package/lib/utils/suggester-workers/searching/index.js +0 -2
- package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +0 -5
- package/lib/utils/suggester-workers/searching/order/index.js +0 -8
- package/lib/utils/suggester-workers/searching/query-parser/index.js +0 -3
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +0 -3
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +0 -2
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +4 -20
- package/lib/utils/suggester-workers/searching/resolve-query-parser.js +1 -15
- package/lib/utils/suggester-workers/searching/search-in-index.js +0 -3
- package/lib/utils/suggester-workers/searching/searching.js +6 -41
- package/lib/utils/suggester-workers/searching/searching.worker.js +4 -7
- package/lib/utils/vtl/dataset-builder.js +0 -4
- package/lib/utils/vtl/index.js +0 -2
- package/package.json +7 -4
- package/lib/components/checkbox/checkbox-group/checkbox-option.js +0 -57
- package/lib/components/checkbox/checkbox.scss +0 -1
- package/lib/components/pairwise/block/index.js +0 -15
- package/lib/components/pairwise/block/pairwise-block.js +0 -17
- package/lib/components/pairwise/index.js +0 -23
- package/lib/components/pairwise/links/links-orchestrator.js +0 -16
- package/lib/stories/pairwise/block/block.json +0 -3
- package/lib/stories/pairwise/links/data.json +0 -12
- package/lib/stories/pairwise/links/links.json +0 -141
|
@@ -4,41 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _storeTools = require("../../utils/store-tools");
|
|
9
|
-
|
|
10
8
|
var _appendToIndex = require("../../utils/suggester-workers/append-to-index");
|
|
11
|
-
|
|
12
9
|
var _excluded = ["idbVersion", "fetch"];
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
-
|
|
18
12
|
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."); }
|
|
19
|
-
|
|
20
13
|
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
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
25
|
-
|
|
15
|
+
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; } }
|
|
26
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
|
|
28
17
|
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; }
|
|
29
|
-
|
|
30
18
|
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; }
|
|
31
|
-
|
|
32
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
33
|
-
|
|
19
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
34
20
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
35
|
-
|
|
36
21
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
37
|
-
|
|
38
22
|
function prepareStore(_x, _x2) {
|
|
39
23
|
return _prepareStore.apply(this, arguments);
|
|
40
24
|
}
|
|
41
|
-
|
|
42
25
|
function _prepareStore() {
|
|
43
26
|
_prepareStore = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(storeInfo, idbVersion) {
|
|
44
27
|
var name, db;
|
|
@@ -49,32 +32,24 @@ function _prepareStore() {
|
|
|
49
32
|
name = storeInfo.name;
|
|
50
33
|
_context.next = 3;
|
|
51
34
|
return (0, _storeTools.openOrCreateStore)(name, idbVersion);
|
|
52
|
-
|
|
53
35
|
case 3:
|
|
54
36
|
db = _context.sent;
|
|
55
|
-
|
|
56
37
|
if (!db) {
|
|
57
38
|
_context.next = 12;
|
|
58
39
|
break;
|
|
59
40
|
}
|
|
60
|
-
|
|
61
41
|
_context.next = 7;
|
|
62
42
|
return (0, _storeTools.clearStoreInfo)(db);
|
|
63
|
-
|
|
64
43
|
case 7:
|
|
65
44
|
_context.next = 9;
|
|
66
45
|
return (0, _storeTools.clearStoreData)(db);
|
|
67
|
-
|
|
68
46
|
case 9:
|
|
69
47
|
_context.next = 11;
|
|
70
48
|
return (0, _storeTools.updateStoreInfo)(db, storeInfo);
|
|
71
|
-
|
|
72
49
|
case 11:
|
|
73
50
|
return _context.abrupt("return", true);
|
|
74
|
-
|
|
75
51
|
case 12:
|
|
76
52
|
return _context.abrupt("return", false);
|
|
77
|
-
|
|
78
53
|
case 13:
|
|
79
54
|
case "end":
|
|
80
55
|
return _context.stop();
|
|
@@ -84,15 +59,12 @@ function _prepareStore() {
|
|
|
84
59
|
}));
|
|
85
60
|
return _prepareStore.apply(this, arguments);
|
|
86
61
|
}
|
|
87
|
-
|
|
88
62
|
function loadOne(_x3, _x4) {
|
|
89
63
|
return _loadOne.apply(this, arguments);
|
|
90
64
|
}
|
|
91
|
-
|
|
92
65
|
function _loadOne() {
|
|
93
66
|
_loadOne = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(suggester, logging) {
|
|
94
67
|
var idbVersion, fetch, storeInfo, ready, data, _createAppendTask, _createAppendTask2, launch, terminate;
|
|
95
|
-
|
|
96
68
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
97
69
|
while (1) {
|
|
98
70
|
switch (_context2.prev = _context2.next) {
|
|
@@ -100,27 +72,21 @@ function _loadOne() {
|
|
|
100
72
|
idbVersion = suggester.idbVersion, fetch = suggester.fetch, storeInfo = _objectWithoutProperties(suggester, _excluded);
|
|
101
73
|
_context2.next = 3;
|
|
102
74
|
return prepareStore(storeInfo, idbVersion);
|
|
103
|
-
|
|
104
75
|
case 3:
|
|
105
76
|
ready = _context2.sent;
|
|
106
|
-
|
|
107
77
|
if (!ready) {
|
|
108
78
|
_context2.next = 12;
|
|
109
79
|
break;
|
|
110
80
|
}
|
|
111
|
-
|
|
112
81
|
_context2.next = 7;
|
|
113
82
|
return fetch();
|
|
114
|
-
|
|
115
83
|
case 7:
|
|
116
84
|
data = _context2.sent;
|
|
117
85
|
_createAppendTask = (0, _appendToIndex.createAppendTask)(storeInfo, idbVersion, logging), _createAppendTask2 = _slicedToArray(_createAppendTask, 2), launch = _createAppendTask2[0], terminate = _createAppendTask2[1];
|
|
118
86
|
_context2.next = 11;
|
|
119
87
|
return launch(data);
|
|
120
|
-
|
|
121
88
|
case 11:
|
|
122
89
|
terminate();
|
|
123
|
-
|
|
124
90
|
case 12:
|
|
125
91
|
case "end":
|
|
126
92
|
return _context2.stop();
|
|
@@ -130,19 +96,17 @@ function _loadOne() {
|
|
|
130
96
|
}));
|
|
131
97
|
return _loadOne.apply(this, arguments);
|
|
132
98
|
}
|
|
133
|
-
|
|
134
99
|
function loadSuggesters() {
|
|
135
100
|
return _loadSuggesters.apply(this, arguments);
|
|
136
101
|
}
|
|
137
|
-
|
|
138
102
|
function _loadSuggesters() {
|
|
139
103
|
_loadSuggesters = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
140
104
|
var suggesters,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
105
|
+
i,
|
|
106
|
+
logging,
|
|
107
|
+
suggester,
|
|
108
|
+
autoLoad,
|
|
109
|
+
_args3 = arguments;
|
|
146
110
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
147
111
|
while (1) {
|
|
148
112
|
switch (_context3.prev = _context3.next) {
|
|
@@ -150,41 +114,33 @@ function _loadSuggesters() {
|
|
|
150
114
|
suggesters = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : [];
|
|
151
115
|
_context3.prev = 1;
|
|
152
116
|
i = 0;
|
|
153
|
-
|
|
154
117
|
case 3:
|
|
155
118
|
if (!(i < suggesters.length)) {
|
|
156
119
|
_context3.next = 13;
|
|
157
120
|
break;
|
|
158
121
|
}
|
|
159
|
-
|
|
160
|
-
|
|
122
|
+
logging = function logging(message) {
|
|
123
|
+
//console.log(name, message);
|
|
161
124
|
};
|
|
162
|
-
|
|
163
125
|
suggester = suggesters[i];
|
|
164
126
|
autoLoad = suggester.autoLoad;
|
|
165
|
-
|
|
166
127
|
if (!autoLoad) {
|
|
167
128
|
_context3.next = 10;
|
|
168
129
|
break;
|
|
169
130
|
}
|
|
170
|
-
|
|
171
131
|
_context3.next = 10;
|
|
172
132
|
return loadOne(suggester, logging);
|
|
173
|
-
|
|
174
133
|
case 10:
|
|
175
134
|
i++;
|
|
176
135
|
_context3.next = 3;
|
|
177
136
|
break;
|
|
178
|
-
|
|
179
137
|
case 13:
|
|
180
138
|
return _context3.abrupt("return", true);
|
|
181
|
-
|
|
182
139
|
case 16:
|
|
183
140
|
_context3.prev = 16;
|
|
184
141
|
_context3.t0 = _context3["catch"](1);
|
|
185
142
|
console.warn("Une erreur s'est produite lors de l'initialisation des suggesters.");
|
|
186
143
|
return _context3.abrupt("return", false);
|
|
187
|
-
|
|
188
144
|
case 20:
|
|
189
145
|
case "end":
|
|
190
146
|
return _context3.stop();
|
|
@@ -194,6 +150,5 @@ function _loadSuggesters() {
|
|
|
194
150
|
}));
|
|
195
151
|
return _loadSuggesters.apply(this, arguments);
|
|
196
152
|
}
|
|
197
|
-
|
|
198
153
|
var _default = loadSuggesters;
|
|
199
154
|
exports["default"] = _default;
|
|
@@ -1,83 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getNewReachedPage = getNewReachedPage;
|
|
9
8
|
exports.getPageTag = getPageTag;
|
|
9
|
+
exports.getPagerFromPageTag = getPagerFromPageTag;
|
|
10
10
|
exports.isNewReachedPage = isNewReachedPage;
|
|
11
|
-
|
|
12
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
|
|
14
12
|
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."); }
|
|
15
|
-
|
|
16
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
17
|
-
|
|
13
|
+
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; } }
|
|
18
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
|
|
20
15
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
|
-
|
|
22
16
|
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."); }
|
|
23
|
-
|
|
24
17
|
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); }
|
|
25
|
-
|
|
26
18
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
27
|
-
|
|
28
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
-
|
|
30
20
|
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; }
|
|
31
|
-
|
|
32
|
-
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) { k++; } groups[name] = result[i[k]]; } return groups; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); return result && (result.groups = buildGroups(result, this)), result; }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } if ("function" == typeof substitution) { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[Symbol.replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); }
|
|
33
|
-
|
|
21
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) { k++; } groups[name] = result[i[k]]; } return groups; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) { result.groups = buildGroups(result, this); var indices = result.indices; indices && (indices.groups = buildGroups(indices, this)); } return result; }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { var group = groups[name]; return "$" + (Array.isArray(group) ? group.join("$") : group); })); } if ("function" == typeof substitution) { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[Symbol.replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); }
|
|
34
22
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
-
|
|
36
23
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
24
|
function getPageTag(pager) {
|
|
39
25
|
var page = pager.page,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
subPage = pager.subPage,
|
|
27
|
+
iteration = pager.iteration;
|
|
43
28
|
if (subPage !== undefined && iteration !== undefined) {
|
|
44
29
|
return "".concat(page, ".").concat(subPage + 1, "#").concat(iteration + 1);
|
|
45
30
|
}
|
|
46
|
-
|
|
47
31
|
return "".concat(page);
|
|
48
32
|
}
|
|
49
|
-
|
|
50
33
|
function getPagerFromPageTag(pageTag) {
|
|
51
34
|
var pattern = /*#__PURE__*/_wrapRegExp(/(\d+)\.?(\d+)?#?(\d+)?/g, {
|
|
52
35
|
page: 1,
|
|
53
36
|
subPagePlusUn: 2,
|
|
54
37
|
iterationPlusUn: 3
|
|
55
38
|
});
|
|
56
|
-
|
|
57
39
|
var match = _toConsumableArray(pageTag.matchAll(pattern));
|
|
58
|
-
|
|
40
|
+
if (match.length === 0) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
59
43
|
var _match = _slicedToArray(match, 1),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
_match$0$groups = _match[0].groups,
|
|
45
|
+
page = _match$0$groups.page,
|
|
46
|
+
subPagePlusUn = _match$0$groups.subPagePlusUn,
|
|
47
|
+
iterationPlusUn = _match$0$groups.iterationPlusUn;
|
|
65
48
|
return {
|
|
66
49
|
page: page,
|
|
67
50
|
subPage: subPagePlusUn - 1,
|
|
68
51
|
iteration: iterationPlusUn - 1
|
|
69
52
|
};
|
|
70
53
|
}
|
|
71
|
-
|
|
72
54
|
function isNewReachedPage(pager) {
|
|
73
55
|
var lastReachedPage = pager.lastReachedPage,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
page = pager.page,
|
|
57
|
+
subPage = pager.subPage,
|
|
58
|
+
iteration = pager.iteration;
|
|
77
59
|
var reachedPager = getPagerFromPageTag(lastReachedPage);
|
|
78
60
|
return Number.parseInt(page) > Number.parseInt(reachedPager.page) || Number.parseInt(page) === Number.parseInt(reachedPager.page) && Number.parseInt(subPage) > Number.parseInt(reachedPager.subPage) && Number.parseInt(iteration) === Number.parseInt(reachedPager.iteration) || Number.parseInt(page) === Number.parseInt(reachedPager.page) && Number.parseInt(iteration) > Number.parseInt(reachedPager.iteration);
|
|
79
61
|
}
|
|
80
|
-
|
|
81
62
|
function getNewReachedPage(pager) {
|
|
82
63
|
return isNewReachedPage(pager) ? getPageTag(pager) : pager.lastReachedPage;
|
|
83
64
|
}
|
|
@@ -4,46 +4,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _getComponentsFromState = _interopRequireDefault(require("./get-components-from-state"));
|
|
11
|
-
|
|
12
9
|
var _fillComponents = _interopRequireDefault(require("./fill-components"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
-
|
|
18
12
|
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."); }
|
|
19
|
-
|
|
20
13
|
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
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
25
|
-
|
|
15
|
+
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; } }
|
|
26
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
|
|
28
17
|
function useComponentsFromState(state) {
|
|
29
18
|
var _useState = (0, _react.useState)([]),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
componentsFilled = _useState2[0],
|
|
21
|
+
setComponentsFilled = _useState2[1];
|
|
34
22
|
(0, _react.useEffect)(function () {
|
|
35
23
|
var pager = state.pager,
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
pages = state.pages,
|
|
25
|
+
isInLoop = state.isInLoop;
|
|
38
26
|
var components = (0, _getComponentsFromState["default"])({
|
|
39
27
|
pager: pager,
|
|
40
28
|
pages: pages,
|
|
41
29
|
isInLoop: isInLoop
|
|
42
30
|
});
|
|
43
|
-
|
|
31
|
+
var filled = (0, _fillComponents["default"])(components, state);
|
|
32
|
+
var filtered = filled.filter(function (_ref) {
|
|
33
|
+
var conditionFilter = _ref.conditionFilter;
|
|
34
|
+
return conditionFilter !== undefined ? conditionFilter : true;
|
|
35
|
+
});
|
|
36
|
+
setComponentsFilled(filtered);
|
|
44
37
|
}, [state]);
|
|
45
38
|
return componentsFilled;
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
var _default = useComponentsFromState;
|
|
49
41
|
exports["default"] = _default;
|
package/lib/use-lunatic/index.js
CHANGED
|
@@ -9,7 +9,5 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
return _useLunatic["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _useLunatic = _interopRequireDefault(require("./use-lunatic"));
|
|
14
|
-
|
|
15
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../utils/constants");
|
|
9
|
-
|
|
10
8
|
var INITIAL_STATE = {
|
|
11
9
|
variables: {},
|
|
12
10
|
// map des variables du questionnaires
|
|
@@ -26,13 +24,13 @@ var INITIAL_STATE = {
|
|
|
26
24
|
subPage: undefined,
|
|
27
25
|
nbSubPages: undefined,
|
|
28
26
|
iteration: undefined,
|
|
27
|
+
shallowIteration: undefined,
|
|
29
28
|
nbIterations: undefined
|
|
30
29
|
},
|
|
31
30
|
waiting: false,
|
|
32
31
|
errors: undefined,
|
|
33
32
|
currentErrors: undefined,
|
|
34
33
|
modalErrors: undefined,
|
|
35
|
-
|
|
36
34
|
/* fonctionnalités vtl & md */
|
|
37
35
|
updateBindings: function updateBindings() {},
|
|
38
36
|
executeExpression: function executeExpression() {},
|
|
@@ -19,13 +19,9 @@ Object.defineProperty(exports, "resizeArrayVariable", {
|
|
|
19
19
|
return _resizeArrayVariable["default"];
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
22
|
var _isEmptyOnEmptyPage = _interopRequireDefault(require("./is-empty-on-empty-page"));
|
|
24
|
-
|
|
25
23
|
var _resizeArrayVariable = _interopRequireDefault(require("./resize-array-variable"));
|
|
26
|
-
|
|
27
24
|
var _validateConditionFilter = require("./validate-condition-filter");
|
|
28
|
-
|
|
29
25
|
Object.keys(_validateConditionFilter).forEach(function (key) {
|
|
30
26
|
if (key === "default" || key === "__esModule") return;
|
|
31
27
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -37,5 +33,4 @@ Object.keys(_validateConditionFilter).forEach(function (key) {
|
|
|
37
33
|
}
|
|
38
34
|
});
|
|
39
35
|
});
|
|
40
|
-
|
|
41
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -4,46 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _commons = require("../../commons");
|
|
9
|
-
|
|
10
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
|
|
12
9
|
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."); }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
17
|
-
|
|
18
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
-
|
|
20
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; }
|
|
21
|
-
|
|
22
14
|
function isOnEmptyPage(state) {
|
|
23
15
|
var executeExpression = state.executeExpression,
|
|
24
|
-
|
|
16
|
+
pager = state.pager;
|
|
25
17
|
var iteration = pager.iteration;
|
|
26
18
|
var components = (0, _commons.getComponentsFromState)(state);
|
|
27
19
|
var rest = components.reduce(function (rest, component) {
|
|
28
20
|
var conditionFilter = component.conditionFilter;
|
|
29
|
-
|
|
30
21
|
if (conditionFilter) {
|
|
31
22
|
var result = (0, _commons.executeConditionFilter)(conditionFilter, executeExpression, iteration);
|
|
32
|
-
|
|
33
23
|
if (result === true) {
|
|
34
24
|
return [].concat(_toConsumableArray(rest), [component]);
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
return rest;
|
|
39
28
|
}, []);
|
|
40
|
-
|
|
41
29
|
if (!rest.length) {
|
|
42
30
|
return true;
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
return false;
|
|
46
33
|
}
|
|
47
|
-
|
|
48
34
|
var _default = isOnEmptyPage;
|
|
49
35
|
exports["default"] = _default;
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
-
|
|
10
8
|
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."); }
|
|
11
|
-
|
|
12
9
|
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
|
-
|
|
14
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
|
-
|
|
16
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
/**
|
|
21
14
|
* certaines variables du questionnaire sont de type tableau.
|
|
22
15
|
* Il faut alors vérifier qu'elles le sont véritablement.
|
|
@@ -35,14 +28,11 @@ function resizeArrayVariable(array, length, defaultValue) {
|
|
|
35
28
|
if (index < array.length) {
|
|
36
29
|
return [].concat(_toConsumableArray(step), [array[index]]);
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
return [].concat(_toConsumableArray(step), [current]);
|
|
40
32
|
}, []);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
}
|
|
34
|
+
// do nothing
|
|
44
35
|
return array;
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
var _default = resizeArrayVariable;
|
|
48
38
|
exports["default"] = _default;
|
|
@@ -4,38 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateLoopConditionFilter = validateLoopConditionFilter;
|
|
7
|
-
|
|
8
7
|
var _commons = require("../../commons");
|
|
9
|
-
|
|
10
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
-
|
|
12
9
|
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."); }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
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; }
|
|
17
|
-
|
|
18
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
19
|
-
|
|
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; } }
|
|
20
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
|
|
22
14
|
function validateLoopConditionFilter(state, _ref) {
|
|
23
15
|
var next = _ref.next,
|
|
24
|
-
|
|
16
|
+
iteration = _ref.iteration;
|
|
25
17
|
var pages = state.pages,
|
|
26
|
-
|
|
18
|
+
executeExpression = state.executeExpression;
|
|
27
19
|
var components = pages[next].components;
|
|
28
|
-
|
|
29
20
|
var _components = _slicedToArray(components, 1),
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
loop = _components[0];
|
|
32
22
|
if (loop) {
|
|
33
23
|
var conditionFilter = loop.conditionFilter;
|
|
34
|
-
|
|
35
24
|
if (conditionFilter) {
|
|
36
25
|
return (0, _commons.executeConditionFilter)(conditionFilter, executeExpression, iteration);
|
|
37
26
|
}
|
|
38
27
|
}
|
|
39
|
-
|
|
40
28
|
return true;
|
|
41
29
|
}
|