@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,275 +4,237 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _executeExpression = _interopRequireDefault(require("./execute-expression"));
|
|
9
|
-
|
|
10
8
|
var _getSafetyExpression = _interopRequireDefault(require("./get-safety-expression"));
|
|
11
|
-
|
|
12
9
|
var _getExpressionsVariables = _interopRequireDefault(require("./get-expressions-variables"));
|
|
13
|
-
|
|
14
10
|
var _createMemoizer3 = _interopRequireDefault(require("./create-memoizer"));
|
|
15
|
-
|
|
16
11
|
var _createRefreshCalculated = _interopRequireDefault(require("./create-refresh-calculated"));
|
|
17
|
-
|
|
18
12
|
var _vtl = _interopRequireDefault(require("../../../utils/vtl"));
|
|
19
|
-
|
|
20
13
|
var _constants = require("../../../utils/constants");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
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); }
|
|
30
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
-
|
|
32
21
|
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."); }
|
|
33
|
-
|
|
34
22
|
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); }
|
|
35
|
-
|
|
36
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; }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
24
|
+
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; } }
|
|
40
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
|
|
42
26
|
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); }
|
|
43
|
-
|
|
44
27
|
function validateExpression(expObject) {
|
|
45
28
|
if (_typeof(expObject) === 'object') {
|
|
46
29
|
var type = expObject.type;
|
|
47
|
-
|
|
48
30
|
if (type === _constants.VTL || type === _constants.VTL_MD) {
|
|
49
31
|
return expObject;
|
|
50
32
|
}
|
|
51
33
|
}
|
|
52
|
-
|
|
53
34
|
if (typeof expObject === 'string') return {
|
|
54
35
|
value: expObject,
|
|
55
36
|
type: _constants.VTL
|
|
56
37
|
};
|
|
57
38
|
console.warn("Non-VTL compatible expression : ".concat(expObject));
|
|
58
39
|
}
|
|
59
|
-
|
|
60
40
|
function createBindings(variables) {
|
|
61
41
|
return Object.entries(variables).reduce(function (bindings, _ref) {
|
|
62
42
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
name = _ref2[0],
|
|
44
|
+
value = _ref2[1].value;
|
|
66
45
|
return _objectSpread(_objectSpread({}, bindings), {}, _defineProperty({}, name, value));
|
|
67
46
|
}, {});
|
|
68
47
|
}
|
|
48
|
+
|
|
69
49
|
/**
|
|
70
50
|
*
|
|
71
51
|
* @param {*} variables
|
|
72
52
|
* @returns
|
|
73
53
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
54
|
function createExecuteExpression(variables, features) {
|
|
77
55
|
// on aimerait map d'expression, avec les bindings
|
|
78
56
|
var bindings = createBindings(variables);
|
|
79
57
|
var tokensMap = new Map();
|
|
80
58
|
var collectedUpdated = new Map();
|
|
81
|
-
|
|
82
59
|
var _createMemoizer = (0, _createMemoizer3["default"])(),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
60
|
+
_createMemoizer2 = _slicedToArray(_createMemoizer, 2),
|
|
61
|
+
memoize = _createMemoizer2[0],
|
|
62
|
+
getMemoizedValue = _createMemoizer2[1];
|
|
87
63
|
var _createRefreshCalcula = (0, _createRefreshCalculated["default"])({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
64
|
+
variables: variables,
|
|
65
|
+
execute: execute,
|
|
66
|
+
bindings: bindings
|
|
67
|
+
}),
|
|
68
|
+
_createRefreshCalcula2 = _slicedToArray(_createRefreshCalcula, 2),
|
|
69
|
+
refreshCalculated = _createRefreshCalcula2[0],
|
|
70
|
+
setToRefreshCalculated = _createRefreshCalcula2[1];
|
|
71
|
+
|
|
95
72
|
/**
|
|
96
73
|
*
|
|
97
74
|
* @param {*} name
|
|
98
75
|
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
76
|
function pushToLazy(name) {
|
|
102
|
-
|
|
77
|
+
if (name in variables) {
|
|
78
|
+
var _variables$name$Calcu = variables[name].CalculatedLinked,
|
|
103
79
|
CalculatedLinked = _variables$name$Calcu === void 0 ? [] : _variables$name$Calcu;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
80
|
+
CalculatedLinked.forEach(function (variable) {
|
|
81
|
+
var name = variable.name;
|
|
82
|
+
setToRefreshCalculated(name, variable);
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
console.warn("".concat(name, " is not identified as varaible!"));
|
|
86
|
+
}
|
|
108
87
|
}
|
|
88
|
+
|
|
109
89
|
/**
|
|
110
90
|
*
|
|
111
91
|
* @param {*} name
|
|
112
92
|
* @param {*} value
|
|
113
93
|
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
94
|
function updateBindings(name, value) {
|
|
117
95
|
// update des bindings
|
|
118
96
|
if (name in bindings) {
|
|
119
97
|
bindings[name] = value;
|
|
120
98
|
collectedUpdated.set(name, []);
|
|
121
99
|
}
|
|
122
|
-
|
|
123
100
|
pushToLazy(name);
|
|
124
101
|
}
|
|
102
|
+
|
|
125
103
|
/**
|
|
126
104
|
*
|
|
127
105
|
* @param {*} variables
|
|
128
106
|
* @param {*} iteration
|
|
129
107
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
108
|
function setLoopBindings(variables, iteration) {
|
|
133
109
|
Object.entries(bindings).forEach(function (_ref3) {
|
|
134
110
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
111
|
+
k = _ref4[0],
|
|
112
|
+
v = _ref4[1];
|
|
138
113
|
var _variables$k = variables[k],
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
114
|
+
type = _variables$k.type,
|
|
115
|
+
value = _variables$k.value;
|
|
142
116
|
if (!Array.isArray(v) && type === _constants.COLLECTED && Array.isArray(value)) {
|
|
143
117
|
bindings[k] = value[iteration];
|
|
144
118
|
pushToLazy(k);
|
|
145
119
|
}
|
|
146
120
|
});
|
|
147
121
|
}
|
|
122
|
+
|
|
148
123
|
/**
|
|
149
124
|
*
|
|
150
125
|
* @param {*} variables
|
|
151
126
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
127
|
function resetLoopBindings(variables) {
|
|
155
128
|
Object.entries(bindings).forEach(function (_ref5) {
|
|
156
129
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
130
|
+
k = _ref6[0],
|
|
131
|
+
v = _ref6[1];
|
|
160
132
|
var _variables$k2 = variables[k],
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
133
|
+
type = _variables$k2.type,
|
|
134
|
+
value = _variables$k2.value;
|
|
164
135
|
if (type === _constants.COLLECTED && Array.isArray(value) && !Array.isArray(v)) {
|
|
165
136
|
bindings[k] = value;
|
|
166
137
|
}
|
|
167
138
|
});
|
|
168
139
|
}
|
|
169
|
-
|
|
170
140
|
function getVariablesAndCach(expression) {
|
|
171
141
|
if (tokensMap.has(expression)) {
|
|
172
142
|
return tokensMap.get(expression);
|
|
173
143
|
}
|
|
174
|
-
|
|
175
144
|
var tokens = (0, _getExpressionsVariables["default"])(expression, variables);
|
|
176
145
|
tokensMap.set(expression, tokens);
|
|
177
146
|
return tokens;
|
|
178
147
|
}
|
|
179
|
-
/**/
|
|
180
|
-
|
|
181
148
|
|
|
149
|
+
/**/
|
|
182
150
|
function collecteVariables(dependencies) {
|
|
183
151
|
if (Array.isArray(dependencies)) {
|
|
184
152
|
return dependencies.reduce(function (map, name) {
|
|
185
153
|
if (name in variables) {
|
|
186
154
|
var data = variables[name];
|
|
187
155
|
var variable = data.variable,
|
|
188
|
-
|
|
189
|
-
|
|
156
|
+
type = data.type;
|
|
190
157
|
if (!(name in map)) {
|
|
191
158
|
if (type === 'CALCULATED') {
|
|
192
159
|
var expression = variable.expression;
|
|
193
160
|
var subDependencies = getVariablesAndCach(expression);
|
|
194
161
|
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, name, _objectSpread({}, variable)), collecteVariables(subDependencies));
|
|
195
162
|
}
|
|
196
|
-
|
|
197
163
|
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, name, _objectSpread({}, variable)));
|
|
198
164
|
}
|
|
199
165
|
} else {
|
|
200
166
|
throw new Error("Unknown variable ".concat(name));
|
|
201
167
|
}
|
|
202
|
-
|
|
203
168
|
return map;
|
|
204
169
|
}, {});
|
|
205
170
|
}
|
|
206
|
-
|
|
207
171
|
return {};
|
|
208
172
|
}
|
|
209
|
-
|
|
210
173
|
function resolveUseContext(name, _ref7) {
|
|
211
174
|
var iteration = _ref7.iteration,
|
|
212
|
-
|
|
175
|
+
linksIterations = _ref7.linksIterations;
|
|
213
176
|
var value = bindings[name];
|
|
214
|
-
|
|
215
177
|
if ([_constants.X_AXIS, _constants.Y_AXIS].includes(name) && linksIterations !== undefined) {
|
|
216
178
|
pushToLazy(name);
|
|
217
|
-
|
|
218
179
|
var _linksIterations = _slicedToArray(linksIterations, 2),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
180
|
+
x = _linksIterations[0],
|
|
181
|
+
y = _linksIterations[1];
|
|
222
182
|
if (Array.isArray(value) && x < value.length) {
|
|
223
183
|
return value[name === _constants.X_AXIS ? x : y];
|
|
224
184
|
}
|
|
225
|
-
|
|
226
185
|
return null;
|
|
227
186
|
}
|
|
228
|
-
|
|
229
187
|
if (iteration !== undefined && Array.isArray(value)) {
|
|
230
188
|
pushToLazy(name);
|
|
231
|
-
|
|
232
189
|
if (iteration < value.length) {
|
|
233
190
|
return value[iteration];
|
|
234
191
|
}
|
|
235
|
-
|
|
236
192
|
return null;
|
|
237
193
|
}
|
|
238
|
-
|
|
194
|
+
if (linksIterations !== undefined) {
|
|
195
|
+
var _linksIterations2 = _slicedToArray(linksIterations, 2),
|
|
196
|
+
_x2 = _linksIterations2[0],
|
|
197
|
+
_y = _linksIterations2[1];
|
|
198
|
+
// console.log({ name, linksIterations, value });
|
|
199
|
+
if (Array.isArray(value) && _x2 < value.length) {
|
|
200
|
+
var sub = value[_x2];
|
|
201
|
+
if (Array.isArray(sub) && _y < sub.length) {
|
|
202
|
+
return sub[_y];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
239
207
|
return (0, _vtl["default"])(value);
|
|
240
208
|
}
|
|
241
|
-
|
|
242
209
|
function fillVariablesValues(map, _ref8) {
|
|
243
210
|
var iteration = _ref8.iteration,
|
|
244
|
-
|
|
211
|
+
linksIterations = _ref8.linksIterations;
|
|
245
212
|
return Object.entries(map).reduce(function (sub, _ref9) {
|
|
246
213
|
var _ref10 = _slicedToArray(_ref9, 2),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
214
|
+
name = _ref10[0],
|
|
215
|
+
_ = _ref10[1];
|
|
250
216
|
return _objectSpread(_objectSpread({}, sub), {}, _defineProperty({}, name, resolveUseContext(name, {
|
|
251
217
|
iteration: iteration,
|
|
252
218
|
linksIterations: linksIterations
|
|
253
219
|
})));
|
|
254
220
|
}, {});
|
|
255
221
|
}
|
|
222
|
+
|
|
256
223
|
/**
|
|
257
224
|
*
|
|
258
225
|
* @param {*} vtlObject
|
|
259
226
|
* @param {*} args
|
|
260
227
|
* @returns
|
|
261
228
|
*/
|
|
262
|
-
|
|
263
|
-
|
|
264
229
|
function execute(expObject) {
|
|
265
230
|
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
266
|
-
|
|
267
231
|
var _validateExpression = validateExpression((0, _getSafetyExpression["default"])(expObject)),
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
232
|
+
expression = _validateExpression.value,
|
|
233
|
+
type = _validateExpression.type;
|
|
271
234
|
var iteration = args.iteration,
|
|
272
|
-
|
|
273
|
-
|
|
235
|
+
linksIterations = args.linksIterations,
|
|
236
|
+
logging = args.logging;
|
|
274
237
|
var bindingDependencies = getVariablesAndCach(expression);
|
|
275
|
-
|
|
276
238
|
function loggingDefault(_, bindings, e) {
|
|
277
239
|
if (process.env.NODE_ENV === 'development') {
|
|
278
240
|
console.warn("VTL error : ".concat(expression), _objectSpread({}, args), {
|
|
@@ -281,7 +243,6 @@ function createExecuteExpression(variables, features) {
|
|
|
281
243
|
console.warn(e);
|
|
282
244
|
}
|
|
283
245
|
}
|
|
284
|
-
|
|
285
246
|
var vtlBindings = refreshCalculated(fillVariablesValues(collecteVariables(bindingDependencies), {
|
|
286
247
|
iteration: iteration,
|
|
287
248
|
linksIterations: linksIterations
|
|
@@ -291,18 +252,14 @@ function createExecuteExpression(variables, features) {
|
|
|
291
252
|
linksIterations: linksIterations
|
|
292
253
|
});
|
|
293
254
|
var memoized = getMemoizedValue(expression, vtlBindings);
|
|
294
|
-
|
|
295
255
|
if (memoized === undefined) {
|
|
296
256
|
var result = (0, _executeExpression["default"])(vtlBindings, expression, type, features, logging || loggingDefault);
|
|
297
257
|
memoize(expression, vtlBindings, result);
|
|
298
258
|
return result;
|
|
299
259
|
}
|
|
300
|
-
|
|
301
260
|
return memoized;
|
|
302
261
|
}
|
|
303
|
-
|
|
304
262
|
return [execute, updateBindings, setLoopBindings, resetLoopBindings];
|
|
305
263
|
}
|
|
306
|
-
|
|
307
264
|
var _default = createExecuteExpression;
|
|
308
265
|
exports["default"] = _default;
|
|
@@ -1,78 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
8
|
var _objectHash = _interopRequireDefault(require("object-hash"));
|
|
9
|
-
|
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
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; }
|
|
13
|
-
|
|
14
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; }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
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); }
|
|
18
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
|
-
|
|
20
16
|
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."); }
|
|
21
|
-
|
|
22
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); }
|
|
23
|
-
|
|
24
18
|
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; }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
19
|
+
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; } }
|
|
28
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
-
|
|
30
21
|
function createMemoizer() {
|
|
31
22
|
var expresionsMap = new Map();
|
|
32
|
-
|
|
33
23
|
function refillBindings(bindings) {
|
|
34
24
|
return Object.entries(bindings).reduce(function (map, _ref) {
|
|
35
25
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
key = _ref2[0],
|
|
27
|
+
value = _ref2[1];
|
|
39
28
|
var dataPointsValue = value === null || value === void 0 ? void 0 : value.result;
|
|
40
|
-
|
|
41
29
|
if (dataPointsValue) {
|
|
42
30
|
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, dataPointsValue));
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, key, value));
|
|
46
33
|
}, {});
|
|
47
34
|
}
|
|
48
|
-
|
|
49
35
|
function memoize(expression, bindings, value) {
|
|
50
36
|
var refill = refillBindings(bindings);
|
|
51
37
|
var hash = (0, _objectHash["default"])(refill);
|
|
52
38
|
var map = expresionsMap.get(expression);
|
|
53
|
-
|
|
54
39
|
if (!map) {
|
|
55
40
|
map = new Map();
|
|
56
41
|
expresionsMap.set(expression, map);
|
|
57
42
|
}
|
|
58
|
-
|
|
59
43
|
map.set(hash, value);
|
|
60
44
|
}
|
|
61
|
-
|
|
62
45
|
function getMemoizedValue(expression, bindings) {
|
|
63
46
|
var map = expresionsMap.get(expression);
|
|
64
|
-
|
|
65
47
|
if (map) {
|
|
66
48
|
var refill = refillBindings(bindings);
|
|
67
49
|
var hash = (0, _objectHash["default"])(refill);
|
|
68
50
|
return map.get(hash);
|
|
69
51
|
}
|
|
70
|
-
|
|
71
52
|
return undefined;
|
|
72
53
|
}
|
|
73
|
-
|
|
74
54
|
return [memoize, getMemoizedValue];
|
|
75
55
|
}
|
|
76
|
-
|
|
77
56
|
var _default = createMemoizer;
|
|
78
57
|
exports["default"] = _default;
|
|
@@ -1,63 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
8
|
var _constants = require("../../../utils/constants");
|
|
9
|
-
|
|
10
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; }
|
|
11
|
-
|
|
12
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; }
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
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); }
|
|
16
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
-
|
|
18
15
|
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
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); }
|
|
21
|
-
|
|
22
17
|
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
|
-
|
|
18
|
+
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
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
|
|
28
20
|
function createRefreshCalculated(_ref) {
|
|
29
21
|
var variables = _ref.variables,
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
execute = _ref.execute,
|
|
23
|
+
bindings = _ref.bindings;
|
|
32
24
|
var toRefreshVariables = new Map(); // variables calculées dépendantes d'une variable modifiée.
|
|
33
|
-
// à l'init, on y colle toutes les variables de calcul
|
|
34
25
|
|
|
26
|
+
// à l'init, on y colle toutes les variables de calcul
|
|
35
27
|
Object.values(variables).forEach(function (_ref2) {
|
|
36
28
|
var variable = _ref2.variable;
|
|
37
29
|
var variableType = variable.variableType,
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
name = variable.name;
|
|
40
31
|
if (variableType === _constants.CALCULATED) {
|
|
41
32
|
toRefreshVariables.set(name, variable);
|
|
42
33
|
}
|
|
43
34
|
});
|
|
44
|
-
|
|
45
35
|
function getIteration(_ref3) {
|
|
46
36
|
var name = _ref3.name,
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
iteration = _ref3.iteration,
|
|
38
|
+
linksIterations = _ref3.linksIterations;
|
|
49
39
|
if (name === _constants.X_AXIS) return linksIterations[0];
|
|
50
40
|
if (name === _constants.Y_AXIS) return linksIterations[1];
|
|
51
41
|
return iteration;
|
|
52
42
|
}
|
|
53
|
-
|
|
54
43
|
function buildValue(_ref4) {
|
|
55
44
|
var expression = _ref4.expression,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
logging = _ref4.logging,
|
|
46
|
+
shapeFrom = _ref4.shapeFrom,
|
|
47
|
+
name = _ref4.name,
|
|
48
|
+
iteration = _ref4.iteration,
|
|
49
|
+
linksIterations = _ref4.linksIterations;
|
|
61
50
|
var value = execute(expression, {
|
|
62
51
|
logging: logging,
|
|
63
52
|
iteration: shapeFrom ? getIteration({
|
|
@@ -67,7 +56,6 @@ function createRefreshCalculated(_ref) {
|
|
|
67
56
|
}) : undefined
|
|
68
57
|
});
|
|
69
58
|
if (linksIterations !== undefined) return value;
|
|
70
|
-
|
|
71
59
|
if (shapeFrom && iteration !== undefined) {
|
|
72
60
|
if (bindings[name] === undefined) {
|
|
73
61
|
var shapeVariable = bindings[shapeFrom];
|
|
@@ -80,7 +68,6 @@ function createRefreshCalculated(_ref) {
|
|
|
80
68
|
bindings[name] = initialValue;
|
|
81
69
|
return initialValue[iteration];
|
|
82
70
|
}
|
|
83
|
-
|
|
84
71
|
if (Array.isArray(bindings[name])) {
|
|
85
72
|
bindings[name][iteration] = value;
|
|
86
73
|
return bindings[name][iteration];
|
|
@@ -101,24 +88,20 @@ function createRefreshCalculated(_ref) {
|
|
|
101
88
|
bindings[name] = v;
|
|
102
89
|
return v;
|
|
103
90
|
}
|
|
104
|
-
|
|
105
91
|
bindings[name] = value;
|
|
106
92
|
return value;
|
|
107
93
|
}
|
|
108
|
-
|
|
109
94
|
function refreshCalculated(map, _ref5) {
|
|
110
95
|
var rootExpression = _ref5.rootExpression,
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
iteration = _ref5.iteration,
|
|
97
|
+
linksIterations = _ref5.linksIterations;
|
|
113
98
|
return Object.entries(map).reduce(function (sub, _ref6) {
|
|
114
99
|
var _ref7 = _slicedToArray(_ref6, 2),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
name = _ref7[0],
|
|
101
|
+
current = _ref7[1];
|
|
118
102
|
var _variables$name = variables[name],
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
variable = _variables$name.variable,
|
|
104
|
+
type = _variables$name.type;
|
|
122
105
|
if (type === _constants.CALCULATED && toRefreshVariables.has(name)) {
|
|
123
106
|
var logging = function logging(expression, bindings, e) {
|
|
124
107
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -129,9 +112,8 @@ function createRefreshCalculated(_ref) {
|
|
|
129
112
|
console.warn(e);
|
|
130
113
|
}
|
|
131
114
|
};
|
|
132
|
-
|
|
133
115
|
var expression = variable.expression,
|
|
134
|
-
|
|
116
|
+
shapeFrom = variable.shapeFrom;
|
|
135
117
|
var value = buildValue({
|
|
136
118
|
expression: expression,
|
|
137
119
|
logging: logging,
|
|
@@ -144,17 +126,13 @@ function createRefreshCalculated(_ref) {
|
|
|
144
126
|
if (iteration !== undefined) toRefreshVariables["delete"](name);
|
|
145
127
|
return _objectSpread(_objectSpread({}, sub), {}, _defineProperty({}, name, value));
|
|
146
128
|
}
|
|
147
|
-
|
|
148
129
|
return _objectSpread(_objectSpread({}, sub), {}, _defineProperty({}, name, current));
|
|
149
130
|
}, {});
|
|
150
131
|
}
|
|
151
|
-
|
|
152
132
|
function setToRefreshCalculated(name, variable) {
|
|
153
133
|
toRefreshVariables.set(name, variable);
|
|
154
134
|
}
|
|
155
|
-
|
|
156
135
|
return [refreshCalculated, setToRefreshCalculated];
|
|
157
136
|
}
|
|
158
|
-
|
|
159
137
|
var _default = createRefreshCalculated;
|
|
160
138
|
exports["default"] = _default;
|