@inseefr/lunatic 2.0.4-v2 → 2.0.5-v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/button/index.js +0 -2
- package/lib/components/button/lunatic-button.js +4 -18
- package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +5 -12
- package/lib/components/checkbox/checkbox-boolean/index.js +0 -2
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -15
- package/lib/components/checkbox/checkbox-group/checkbox-group.js +14 -26
- package/lib/components/checkbox/checkbox-group/index.js +0 -2
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +6 -13
- package/lib/components/checkbox/checkbox-one/index.js +0 -2
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +1 -13
- package/lib/components/checkbox/commons/checkbox-option.js +7 -20
- 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 +2 -13
- 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 +30 -64
- 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 +1 -8
- package/lib/components/commons/components/combo-box/selection/index.js +0 -2
- package/lib/components/commons/components/combo-box/selection/input.js +7 -20
- package/lib/components/commons/components/combo-box/selection/label-selection.js +6 -13
- 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 +2 -21
- 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 +0 -5
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +0 -5
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +0 -5
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +0 -5
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +4 -13
- 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 +0 -8
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +0 -8
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +0 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +0 -5
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +0 -5
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +0 -6
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +0 -5
- 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 +0 -5
- 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 +19 -45
- package/lib/components/commons/components/dragger/index.js +0 -2
- package/lib/components/commons/components/errors/errors.js +3 -17
- 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 +1 -9
- package/lib/components/commons/components/html-table/index.js +0 -7
- package/lib/components/commons/components/html-table/table.js +2 -11
- package/lib/components/commons/components/html-table/tbody.js +2 -11
- package/lib/components/commons/components/html-table/td.js +6 -15
- package/lib/components/commons/components/html-table/th.js +5 -14
- package/lib/components/commons/components/html-table/thead.js +2 -11
- package/lib/components/commons/components/html-table/tr.js +3 -12
- package/lib/components/commons/components/is-network/index.js +0 -2
- package/lib/components/commons/components/is-network/is-network.js +7 -26
- package/lib/components/commons/components/is-network/use-online-status.js +0 -9
- package/lib/components/commons/components/label.js +4 -12
- 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 +2 -13
- 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 +13 -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 +17 -34
- package/lib/components/commons/create-customizable-field.js +1 -12
- package/lib/components/commons/create-row-orchestrator.js +14 -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 +4 -31
- 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 +7 -18
- package/lib/components/datepicker/index.js +0 -2
- package/lib/components/datepicker/lunatic-datepicker.js +1 -13
- package/lib/components/declarations/declaration.js +1 -8
- 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 +6 -16
- 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 +10 -30
- 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 +14 -50
- package/lib/components/dropdown/dropdown.js +8 -19
- package/lib/components/dropdown/index.js +0 -2
- package/lib/components/dropdown/lunatic-dropdown.js +8 -17
- package/lib/components/filter-description/component.js +1 -7
- 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 +6 -18
- package/lib/components/input/lunatic-input.js +1 -14
- package/lib/components/input-number/index.js +0 -2
- package/lib/components/input-number/input-number.js +9 -20
- package/lib/components/input-number/lunatic-input-number.js +1 -12
- 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 +28 -61
- package/lib/components/loop/block-for-loop/index.js +0 -2
- package/lib/components/loop/block-for-loop/row.js +13 -29
- 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 +16 -37
- 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 +10 -24
- 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 +21 -51
- package/lib/components/loop/roster-for-loop/roster-table.js +10 -21
- package/lib/components/loop/roster-for-loop/row.js +13 -26
- package/lib/components/modal-controls/close-or-skip.js +3 -10
- package/lib/components/modal-controls/index.js +0 -2
- package/lib/components/modal-controls/modal-container.js +0 -5
- package/lib/components/modal-controls/modal-controls.js +5 -28
- package/lib/components/modal-controls/modal-controls.scss +7 -6
- package/lib/components/{pairwise/links → pairwise-links}/index.js +0 -2
- package/lib/components/pairwise-links/orchestrator.js +69 -0
- package/lib/components/{pairwise/links → pairwise-links}/pairwise-links.js +20 -27
- package/lib/components/{pairwise/links → pairwise-links}/row.js +50 -65
- package/lib/components/radio/index.js +0 -2
- package/lib/components/radio/lunatic-radio-group.js +6 -14
- package/lib/components/radio/radio-group.js +6 -13
- package/lib/components/radio/radio-option.js +9 -23
- package/lib/components/sequence/index.js +0 -2
- package/lib/components/sequence/sequence.js +3 -11
- package/lib/components/subsequence/index.js +0 -2
- package/lib/components/subsequence/subsequence.js +2 -9
- package/lib/components/suggester/check-store.js +13 -47
- 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 +13 -33
- package/lib/components/suggester/index.js +0 -2
- package/lib/components/suggester/lunatic-suggester.js +13 -27
- 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 +19 -53
- package/lib/components/suggester-loader-widget/index.js +0 -2
- package/lib/components/suggester-loader-widget/loader-row.js +12 -39
- package/lib/components/suggester-loader-widget/loader.js +14 -55
- 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 +20 -52
- package/lib/components/switch/index.js +0 -2
- package/lib/components/switch/lunatic-switch.js +5 -17
- package/lib/components/switch/switch.js +6 -20
- 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 +13 -33
- package/lib/components/table/table-orchestrator.js +12 -20
- package/lib/components/textarea/index.js +0 -2
- package/lib/components/textarea/lunatic-textarea.js +1 -14
- package/lib/components/textarea/textarea.js +7 -19
- 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 +2 -10
- package/lib/i18n/index.js +0 -6
- package/lib/index.js +0 -4
- package/lib/stories/checkboxBoolean/checkboxBoolean.stories.js +0 -8
- 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 +54 -92
- 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 +0 -9
- package/lib/stories/dropdown/dropdown.stories.js +0 -9
- package/lib/stories/filter-description/filter-description.stories.js +0 -12
- 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 +4 -5
- package/lib/stories/pairwise/links.json +81 -18
- package/lib/stories/pairwise/pairwise-links.stories.js +0 -9
- package/lib/stories/paste-questionnaire/test.stories.js +0 -11
- package/lib/stories/questionnaires/logement/logement.stories.js +0 -14
- package/lib/stories/questionnaires/recensement/data.json +12 -0
- package/lib/stories/questionnaires/recensement/recensement.stories.js +55 -0
- package/lib/stories/questionnaires/recensement/source.json +15202 -0
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +0 -11
- package/lib/stories/questionnaires-test/controls/controls.stories.js +0 -15
- package/lib/stories/questionnaires-test/test.stories.js +0 -15
- package/lib/stories/radio/radio.stories.js +0 -8
- package/lib/stories/roster-for-loop/roster-for-loop.stories.js +0 -8
- package/lib/stories/suggester/suggester-workers.stories.js +11 -52
- package/lib/stories/suggester/suggester.stories.js +0 -10
- package/lib/stories/switch/SwitchMaterialUI.js +5 -15
- package/lib/stories/switch/switch.js +3 -26
- package/lib/stories/table/table.stories.js +0 -16
- package/lib/stories/utils/default-arg-types.js +0 -4
- package/lib/stories/utils/orchestrator.js +60 -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 +15 -42
- package/lib/use-lunatic/commons/check-loops.js +9 -36
- package/lib/use-lunatic/commons/compose.js +0 -4
- package/lib/use-lunatic/commons/create-map-pages.js +2 -26
- package/lib/use-lunatic/commons/execute-condition-filter.js +0 -7
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +52 -101
- package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +2 -26
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +18 -43
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +3 -38
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +2 -16
- package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +2 -11
- package/lib/use-lunatic/commons/execute-expression/index.js +0 -2
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +15 -43
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +0 -7
- package/lib/use-lunatic/commons/fill-components/fill-components.js +0 -13
- package/lib/use-lunatic/commons/fill-components/fill-errors.js +0 -7
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -7
- package/lib/use-lunatic/commons/fill-components/fill-management.js +0 -7
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +1 -9
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +0 -5
- 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 +22 -64
- package/lib/use-lunatic/commons/get-component-value/index.js +0 -2
- package/lib/use-lunatic/commons/get-components-from-state.js +3 -10
- package/lib/use-lunatic/commons/get-data.js +11 -29
- package/lib/use-lunatic/commons/get-errors-without-empty-value.js +2 -11
- package/lib/use-lunatic/commons/index.js +0 -14
- 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 +8 -53
- package/lib/use-lunatic/commons/page-tag.js +10 -33
- package/lib/use-lunatic/commons/use-components-from-state.js +5 -18
- package/lib/use-lunatic/index.js +0 -2
- package/lib/use-lunatic/initial-state.js +0 -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 +3 -15
- package/lib/use-lunatic/reducer/index.js +0 -2
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +17 -55
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +25 -48
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +4 -18
- package/lib/use-lunatic/reducer/reduce-handle-change/index.js +0 -2
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +8 -27
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +24 -40
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +53 -28
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +9 -32
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +19 -41
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +7 -19
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +1 -8
- package/lib/use-lunatic/reducer/reduce-on-init.js +50 -96
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +0 -5
- package/lib/use-lunatic/reducer/reducer.js +0 -20
- package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +9 -21
- package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +7 -26
- package/lib/use-lunatic/reducer/validate-controls/index.js +0 -3
- package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +7 -20
- package/lib/use-lunatic/use-lunatic.js +57 -104
- 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 +11 -37
- 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 +9 -50
- 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 +4 -26
- 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 +5 -34
- package/lib/utils/suggester-workers/append-to-index/store-messages.js +0 -6
- package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +0 -19
- package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +11 -40
- package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +0 -14
- 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 +0 -14
- 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 +1 -21
- 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 +5 -26
- 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 +5 -22
- package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +0 -2
- package/lib/utils/suggester-workers/searching/compute-score.js +0 -15
- 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 +2 -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 +2 -39
- 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 +4 -2
- package/lib/components/pairwise/index.js +0 -15
- package/lib/components/pairwise/links/orchestrator.js +0 -16
|
@@ -4,60 +4,46 @@ 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
|
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
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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
15
|
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
|
-
|
|
26
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
|
|
28
17
|
function createRefreshCalculated(_ref) {
|
|
29
18
|
var variables = _ref.variables,
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
execute = _ref.execute,
|
|
20
|
+
bindings = _ref.bindings;
|
|
32
21
|
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
22
|
|
|
23
|
+
// à l'init, on y colle toutes les variables de calcul
|
|
35
24
|
Object.values(variables).forEach(function (_ref2) {
|
|
36
25
|
var variable = _ref2.variable;
|
|
37
26
|
var variableType = variable.variableType,
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
name = variable.name;
|
|
40
28
|
if (variableType === _constants.CALCULATED) {
|
|
41
29
|
toRefreshVariables.set(name, variable);
|
|
42
30
|
}
|
|
43
31
|
});
|
|
44
|
-
|
|
45
32
|
function getIteration(_ref3) {
|
|
46
33
|
var name = _ref3.name,
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
iteration = _ref3.iteration,
|
|
35
|
+
linksIterations = _ref3.linksIterations;
|
|
49
36
|
if (name === _constants.X_AXIS) return linksIterations[0];
|
|
50
37
|
if (name === _constants.Y_AXIS) return linksIterations[1];
|
|
51
38
|
return iteration;
|
|
52
39
|
}
|
|
53
|
-
|
|
54
40
|
function buildValue(_ref4) {
|
|
55
41
|
var expression = _ref4.expression,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
logging = _ref4.logging,
|
|
43
|
+
shapeFrom = _ref4.shapeFrom,
|
|
44
|
+
name = _ref4.name,
|
|
45
|
+
iteration = _ref4.iteration,
|
|
46
|
+
linksIterations = _ref4.linksIterations;
|
|
61
47
|
var value = execute(expression, {
|
|
62
48
|
logging: logging,
|
|
63
49
|
iteration: shapeFrom ? getIteration({
|
|
@@ -67,7 +53,6 @@ function createRefreshCalculated(_ref) {
|
|
|
67
53
|
}) : undefined
|
|
68
54
|
});
|
|
69
55
|
if (linksIterations !== undefined) return value;
|
|
70
|
-
|
|
71
56
|
if (shapeFrom && iteration !== undefined) {
|
|
72
57
|
if (bindings[name] === undefined) {
|
|
73
58
|
var shapeVariable = bindings[shapeFrom];
|
|
@@ -80,7 +65,6 @@ function createRefreshCalculated(_ref) {
|
|
|
80
65
|
bindings[name] = initialValue;
|
|
81
66
|
return initialValue[iteration];
|
|
82
67
|
}
|
|
83
|
-
|
|
84
68
|
if (Array.isArray(bindings[name])) {
|
|
85
69
|
bindings[name][iteration] = value;
|
|
86
70
|
return bindings[name][iteration];
|
|
@@ -101,24 +85,20 @@ function createRefreshCalculated(_ref) {
|
|
|
101
85
|
bindings[name] = v;
|
|
102
86
|
return v;
|
|
103
87
|
}
|
|
104
|
-
|
|
105
88
|
bindings[name] = value;
|
|
106
89
|
return value;
|
|
107
90
|
}
|
|
108
|
-
|
|
109
91
|
function refreshCalculated(map, _ref5) {
|
|
110
92
|
var rootExpression = _ref5.rootExpression,
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
iteration = _ref5.iteration,
|
|
94
|
+
linksIterations = _ref5.linksIterations;
|
|
113
95
|
return Object.entries(map).reduce(function (sub, _ref6) {
|
|
114
96
|
var _ref7 = _slicedToArray(_ref6, 2),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
97
|
+
name = _ref7[0],
|
|
98
|
+
current = _ref7[1];
|
|
118
99
|
var _variables$name = variables[name],
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
100
|
+
variable = _variables$name.variable,
|
|
101
|
+
type = _variables$name.type;
|
|
122
102
|
if (type === _constants.CALCULATED && toRefreshVariables.has(name)) {
|
|
123
103
|
var logging = function logging(expression, bindings, e) {
|
|
124
104
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -129,9 +109,8 @@ function createRefreshCalculated(_ref) {
|
|
|
129
109
|
console.warn(e);
|
|
130
110
|
}
|
|
131
111
|
};
|
|
132
|
-
|
|
133
112
|
var expression = variable.expression,
|
|
134
|
-
|
|
113
|
+
shapeFrom = variable.shapeFrom;
|
|
135
114
|
var value = buildValue({
|
|
136
115
|
expression: expression,
|
|
137
116
|
logging: logging,
|
|
@@ -144,17 +123,13 @@ function createRefreshCalculated(_ref) {
|
|
|
144
123
|
if (iteration !== undefined) toRefreshVariables["delete"](name);
|
|
145
124
|
return _objectSpread(_objectSpread({}, sub), {}, _defineProperty({}, name, value));
|
|
146
125
|
}
|
|
147
|
-
|
|
148
126
|
return _objectSpread(_objectSpread({}, sub), {}, _defineProperty({}, name, current));
|
|
149
127
|
}, {});
|
|
150
128
|
}
|
|
151
|
-
|
|
152
129
|
function setToRefreshCalculated(name, variable) {
|
|
153
130
|
toRefreshVariables.set(name, variable);
|
|
154
131
|
}
|
|
155
|
-
|
|
156
132
|
return [refreshCalculated, setToRefreshCalculated];
|
|
157
133
|
}
|
|
158
|
-
|
|
159
134
|
var _default = createRefreshCalculated;
|
|
160
135
|
exports["default"] = _default;
|
|
@@ -5,79 +5,52 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
exports.executeVtlExpression = executeVtlExpression;
|
|
8
|
-
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
var _trevas = require("@inseefr/trevas");
|
|
12
|
-
|
|
13
10
|
var _mdLabel = _interopRequireDefault(require("../../../components/commons/components/md-label"));
|
|
14
|
-
|
|
15
11
|
var _vtl = _interopRequireDefault(require("../../../utils/vtl"));
|
|
16
|
-
|
|
17
12
|
var _constants = require("../../../utils/constants");
|
|
18
|
-
|
|
19
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
|
-
|
|
21
14
|
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; }
|
|
22
|
-
|
|
23
15
|
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; }
|
|
24
|
-
|
|
25
16
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
-
|
|
27
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
28
|
-
|
|
29
18
|
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."); }
|
|
30
|
-
|
|
31
19
|
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); }
|
|
32
|
-
|
|
33
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; }
|
|
34
|
-
|
|
35
21
|
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; }
|
|
36
|
-
|
|
37
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
38
|
-
|
|
39
23
|
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); }
|
|
40
|
-
|
|
41
24
|
function isDataSet(result) {
|
|
42
25
|
return result && _typeof(result) === 'object' && result.dataPoints;
|
|
43
26
|
}
|
|
44
|
-
|
|
45
27
|
function extractDataSetResult(dataSet) {
|
|
46
28
|
var dataPoints = dataSet.dataPoints;
|
|
47
|
-
|
|
48
29
|
if (dataPoints) {
|
|
49
30
|
var result = dataPoints.result;
|
|
50
31
|
return result;
|
|
51
32
|
}
|
|
52
|
-
|
|
53
33
|
return undefined;
|
|
54
34
|
}
|
|
55
|
-
|
|
56
35
|
function executeVtlExpression(expression, vtlBindings) {
|
|
57
36
|
var legalVtlBindings = Object.entries(vtlBindings).reduce(function (acc, _ref) {
|
|
58
37
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
k = _ref2[0],
|
|
39
|
+
v = _ref2[1];
|
|
62
40
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, k, (0, _vtl["default"])(v)));
|
|
63
41
|
}, {});
|
|
64
42
|
var result = (0, _trevas.interpret)(expression, legalVtlBindings);
|
|
65
|
-
|
|
66
43
|
if (isDataSet(result)) {
|
|
67
44
|
return extractDataSetResult(result);
|
|
68
45
|
}
|
|
69
|
-
|
|
70
46
|
if (result === null) {
|
|
71
47
|
return null;
|
|
72
48
|
}
|
|
73
|
-
|
|
74
49
|
if (_typeof(result) === 'object') {
|
|
75
50
|
return expression;
|
|
76
51
|
}
|
|
77
|
-
|
|
78
52
|
return result;
|
|
79
53
|
}
|
|
80
|
-
|
|
81
54
|
function executeVTL(expression, vtlBindings, logging) {
|
|
82
55
|
if (expression) {
|
|
83
56
|
try {
|
|
@@ -87,22 +60,16 @@ function executeVTL(expression, vtlBindings, logging) {
|
|
|
87
60
|
return expression;
|
|
88
61
|
}
|
|
89
62
|
}
|
|
90
|
-
|
|
91
63
|
return '';
|
|
92
64
|
}
|
|
93
|
-
|
|
94
65
|
function loggingDefault(expression, bindings, e) {
|
|
95
66
|
if (process.env.NODE_ENV === 'development') {
|
|
96
67
|
console.warn("VTL error : ".concat(expression), bindings);
|
|
97
68
|
console.warn(e);
|
|
98
69
|
}
|
|
99
70
|
}
|
|
100
|
-
|
|
101
|
-
function executeExpression(vtlBindings, expression, type, features
|
|
102
|
-
/* VTL, MD */
|
|
103
|
-
) {
|
|
71
|
+
function executeExpression(vtlBindings, expression, type, features /* VTL, MD */) {
|
|
104
72
|
var logging = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : loggingDefault;
|
|
105
|
-
|
|
106
73
|
if (features.includes(_constants.VTL) && type.includes(_constants.VTL)) {
|
|
107
74
|
var vtl = executeVTL(expression, vtlBindings, logging);
|
|
108
75
|
if (features.includes(_constants.MD) && type.includes(_constants.MD)) return /*#__PURE__*/_react["default"].createElement(_mdLabel["default"], {
|
|
@@ -110,9 +77,7 @@ function executeExpression(vtlBindings, expression, type, features
|
|
|
110
77
|
});
|
|
111
78
|
return vtl;
|
|
112
79
|
}
|
|
113
|
-
|
|
114
80
|
return expression;
|
|
115
81
|
}
|
|
116
|
-
|
|
117
82
|
var _default = executeExpression;
|
|
118
83
|
exports["default"] = _default;
|
|
@@ -4,48 +4,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _vtl = require("@inseefr/vtl-2.0-antlr-tools");
|
|
9
|
-
|
|
10
8
|
var _antlr = _interopRequireDefault(require("antlr4"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
-
|
|
16
11
|
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."); }
|
|
17
|
-
|
|
18
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
-
|
|
20
13
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
|
-
|
|
22
14
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
-
|
|
24
15
|
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
16
|
function getExpressionVariables(expression, variables) {
|
|
27
17
|
try {
|
|
28
18
|
var chars = new _antlr["default"].InputStream(expression);
|
|
29
19
|
var lexer = new _vtl.VtlLexer(chars);
|
|
30
20
|
return lexer.getAllTokens().reduce(function (array, _ref) {
|
|
31
21
|
var start = _ref.start,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
stop = _ref.stop,
|
|
23
|
+
type = _ref.type;
|
|
35
24
|
if (type === 234) {
|
|
36
25
|
var token = expression.substr(start, stop - start + 1);
|
|
37
|
-
|
|
38
26
|
if (array.indexOf(token) === -1 && token in variables) {
|
|
39
27
|
return [].concat(_toConsumableArray(array), [token]);
|
|
40
28
|
}
|
|
41
29
|
}
|
|
42
|
-
|
|
43
30
|
return array;
|
|
44
31
|
}, []);
|
|
45
32
|
} catch (e) {
|
|
46
33
|
return [];
|
|
47
34
|
}
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
var _default = getExpressionVariables;
|
|
51
37
|
exports["default"] = _default;
|
|
@@ -4,34 +4,25 @@ 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
|
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
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
12
|
function getSafetyExpression(expression) {
|
|
19
13
|
if (typeof expression === 'string') {
|
|
20
14
|
return {
|
|
21
15
|
value: expression,
|
|
22
16
|
type: _constants.VTL
|
|
23
17
|
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
}
|
|
19
|
+
// TODO: fix into model and supress this block
|
|
27
20
|
if (_typeof(expression) === 'object' && 'value' in expression && !('type' in expression)) {
|
|
28
21
|
return _objectSpread(_objectSpread({}, expression), {}, {
|
|
29
22
|
type: _constants.VTL
|
|
30
23
|
});
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
return expression;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
27
|
var _default = getSafetyExpression;
|
|
37
28
|
exports["default"] = _default;
|
|
@@ -9,7 +9,5 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
return _createExecuteExpression["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _createExecuteExpression = _interopRequireDefault(require("./create-execute-expression"));
|
|
14
|
-
|
|
15
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -4,38 +4,23 @@ 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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
-
|
|
14
10
|
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
15
|
-
|
|
16
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
|
|
18
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
-
|
|
24
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
-
|
|
26
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
|
|
30
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
-
|
|
32
19
|
var VTL_ATTRIBUTES = ['label', 'responses.label', 'hierarchy.label', 'hierarchy.subSequence.label', 'hierarchy.sequence.label', 'declarations.label', 'controls.control', 'controls.errorMessage', 'options.label', 'lines.min', 'lines.max', 'iterations', 'xAxisIterations', 'yAxisIterations', 'body.label', 'header.label', 'conditionFilter'];
|
|
33
|
-
|
|
34
20
|
function createCrawl(_ref) {
|
|
35
21
|
var executeExpression = _ref.executeExpression,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
iteration = _ref.iteration,
|
|
23
|
+
linksIterations = _ref.linksIterations;
|
|
39
24
|
/**
|
|
40
25
|
*
|
|
41
26
|
* @param {*} object
|
|
@@ -49,12 +34,12 @@ function createCrawl(_ref) {
|
|
|
49
34
|
linksIterations: linksIterations
|
|
50
35
|
})));
|
|
51
36
|
}
|
|
52
|
-
|
|
53
37
|
function buildCrawlEntry(entry, path) {
|
|
54
38
|
return Array.isArray(entry) ? entry.map(function (e) {
|
|
55
39
|
return crawl(path, e);
|
|
56
40
|
}) : crawl(path, entry);
|
|
57
41
|
}
|
|
42
|
+
|
|
58
43
|
/**
|
|
59
44
|
*
|
|
60
45
|
* @param {*} object
|
|
@@ -62,66 +47,55 @@ function createCrawl(_ref) {
|
|
|
62
47
|
* @param {*} path
|
|
63
48
|
* @returns
|
|
64
49
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
50
|
function crawlArray(object, path) {
|
|
68
51
|
var _path = _toArray(path),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
step = _path[0],
|
|
53
|
+
rest = _path.slice(1);
|
|
72
54
|
return object[step].reduce(function (stack, entry) {
|
|
73
55
|
var flattedEntry = buildCrawlEntry(entry, rest);
|
|
74
56
|
return _objectSpread(_objectSpread({}, stack), {}, _defineProperty({}, step, [].concat(_toConsumableArray(stack[step]), [flattedEntry])));
|
|
75
57
|
}, _objectSpread(_objectSpread({}, object), {}, _defineProperty({}, step, [])));
|
|
76
58
|
}
|
|
59
|
+
|
|
77
60
|
/**
|
|
78
61
|
*
|
|
79
62
|
* @param {*} object
|
|
80
63
|
* @param {*} path
|
|
81
64
|
* @returns
|
|
82
65
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
66
|
function crawlObject(object, path) {
|
|
86
67
|
var _path2 = _toArray(path),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
step = _path2[0],
|
|
69
|
+
rest = _path2.slice(1);
|
|
90
70
|
return _objectSpread(_objectSpread({}, object), {}, _defineProperty({}, step, crawl(rest, object[step])));
|
|
91
71
|
}
|
|
72
|
+
|
|
92
73
|
/**
|
|
93
74
|
*
|
|
94
75
|
* @param {*} path
|
|
95
76
|
* @param {*} object
|
|
96
77
|
* @returns
|
|
97
78
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
79
|
function crawl(path, object) {
|
|
101
80
|
var _path3 = _toArray(path),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
step = _path3[0],
|
|
82
|
+
rest = _path3.slice(1);
|
|
105
83
|
if (step in object && rest.length === 0) {
|
|
106
84
|
return executeAndFillObject(object, step);
|
|
107
85
|
} else if (step in object) {
|
|
108
86
|
if (Array.isArray(object[step])) {
|
|
109
87
|
return crawlArray(object, path);
|
|
110
88
|
}
|
|
111
|
-
|
|
112
89
|
return crawlObject(object, path);
|
|
113
90
|
}
|
|
114
|
-
|
|
115
91
|
return object;
|
|
116
92
|
}
|
|
117
|
-
|
|
118
93
|
return crawl;
|
|
119
94
|
}
|
|
120
|
-
|
|
121
95
|
function fillAttributes(component, _ref2) {
|
|
122
96
|
var executeExpression = _ref2.executeExpression,
|
|
123
|
-
|
|
124
|
-
|
|
97
|
+
iteration = _ref2.iteration,
|
|
98
|
+
linksIterations = _ref2.linksIterations;
|
|
125
99
|
var crawl = createCrawl({
|
|
126
100
|
executeExpression: executeExpression,
|
|
127
101
|
iteration: iteration,
|
|
@@ -132,18 +106,16 @@ function fillAttributes(component, _ref2) {
|
|
|
132
106
|
return _objectSpread(_objectSpread({}, step), crawl(path, step, fullStringPath));
|
|
133
107
|
}, _objectSpread({}, component));
|
|
134
108
|
}
|
|
135
|
-
|
|
136
109
|
function fillComponentExpressions(component, state) {
|
|
137
110
|
var pager = state.pager,
|
|
138
|
-
|
|
111
|
+
executeExpression = state.executeExpression;
|
|
139
112
|
var iteration = pager.iteration,
|
|
140
|
-
|
|
113
|
+
linksIterations = pager.linksIterations;
|
|
141
114
|
return fillAttributes(component, {
|
|
142
115
|
executeExpression: executeExpression,
|
|
143
116
|
iteration: iteration,
|
|
144
117
|
linksIterations: linksIterations
|
|
145
118
|
});
|
|
146
119
|
}
|
|
147
|
-
|
|
148
120
|
var _default = fillComponentExpressions;
|
|
149
121
|
exports["default"] = _default;
|
|
@@ -4,23 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _getComponentValue = _interopRequireDefault(require("../get-component-value"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
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; }
|
|
13
|
-
|
|
14
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; }
|
|
15
|
-
|
|
16
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
|
|
18
12
|
function fillComponentValue(component, state) {
|
|
19
13
|
var value = (0, _getComponentValue["default"])(component, state);
|
|
20
14
|
return _objectSpread(_objectSpread({}, component), {}, {
|
|
21
15
|
value: value
|
|
22
16
|
});
|
|
23
17
|
}
|
|
24
|
-
|
|
25
18
|
var _default = fillComponentValue;
|
|
26
19
|
exports["default"] = _default;
|
|
@@ -4,28 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _fillComponentExpressions = _interopRequireDefault(require("./fill-component-expressions"));
|
|
9
|
-
|
|
10
8
|
var _fillErrors = _interopRequireDefault(require("./fill-errors"));
|
|
11
|
-
|
|
12
9
|
var _fillFromState = _interopRequireDefault(require("./fill-from-state"));
|
|
13
|
-
|
|
14
10
|
var _fillComponentValue = _interopRequireDefault(require("./fill-component-value"));
|
|
15
|
-
|
|
16
11
|
var _fillPagination = _interopRequireDefault(require("./fill-pagination"));
|
|
17
|
-
|
|
18
12
|
var _fillMissingResponse = _interopRequireDefault(require("./fill-missing-response"));
|
|
19
|
-
|
|
20
13
|
var _fillManagement = _interopRequireDefault(require("./fill-management"));
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
15
|
function compose() {
|
|
25
16
|
for (var _len = arguments.length, fill = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
17
|
fill[_key] = arguments[_key];
|
|
27
18
|
}
|
|
28
|
-
|
|
29
19
|
return fill.reduce(function (a, b) {
|
|
30
20
|
return function (cmp, state) {
|
|
31
21
|
return b(a(cmp, state), state);
|
|
@@ -34,14 +24,11 @@ function compose() {
|
|
|
34
24
|
return c;
|
|
35
25
|
});
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
var fillComponent = compose(_fillErrors["default"], _fillFromState["default"], _fillComponentExpressions["default"], _fillPagination["default"], _fillComponentValue["default"], _fillMissingResponse["default"], _fillManagement["default"]);
|
|
39
|
-
|
|
40
28
|
function fillComponents(components, state) {
|
|
41
29
|
return components.map(function (component) {
|
|
42
30
|
return fillComponent(component, state);
|
|
43
31
|
});
|
|
44
32
|
}
|
|
45
|
-
|
|
46
33
|
var _default = fillComponents;
|
|
47
34
|
exports["default"] = _default;
|
|
@@ -4,17 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
|
|
10
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
|
|
12
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
|
|
14
10
|
function fillErrors(component, state) {
|
|
15
11
|
var errors = state.errors;
|
|
16
12
|
var id = component.id;
|
|
17
|
-
|
|
18
13
|
if (errors) {
|
|
19
14
|
// TODO only keep criticality info
|
|
20
15
|
if (id in errors) {
|
|
@@ -23,9 +18,7 @@ function fillErrors(component, state) {
|
|
|
23
18
|
});
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
return component;
|
|
28
22
|
}
|
|
29
|
-
|
|
30
23
|
var _default = fillErrors;
|
|
31
24
|
exports["default"] = _default;
|
|
@@ -4,23 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
|
|
10
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
|
|
12
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
|
|
14
10
|
function fillFromState(component, state) {
|
|
15
11
|
var handleChange = state.handleChange,
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
executeExpression = state.executeExpression,
|
|
13
|
+
preferences = state.preferences;
|
|
18
14
|
return _objectSpread(_objectSpread({}, component), {}, {
|
|
19
15
|
handleChange: handleChange,
|
|
20
16
|
executeExpression: executeExpression,
|
|
21
17
|
preferences: preferences
|
|
22
18
|
});
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
var _default = fillFromState;
|
|
26
21
|
exports["default"] = _default;
|