@inseefr/lunatic 2.5.2 → 2.6.0-rc.1
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/README.fr.md +186 -0
- package/README.md +111 -94
- package/lib/components/button/lunatic-button.js +10 -13
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +0 -1
- package/lib/components/commons/components/combo-box/combo-box-content.js +1 -1
- package/lib/components/commons/components/combo-box/combo-box.js +93 -66
- package/lib/components/commons/components/combo-box/combo-box.stories.js +69 -8
- package/lib/components/commons/components/combo-box/panel/panel.js +0 -1
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +4 -1
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.spec.js +2 -4
- package/lib/components/commons/components/combo-box/selection/combo-box-label-selection.js +5 -2
- package/lib/components/commons/components/combo-box/selection/label-selection.js +4 -2
- package/lib/components/commons/components/combo-box/selection/selection.js +2 -0
- package/lib/components/commons/components/fab/fab.js +0 -1
- package/lib/components/commons/components/fieldset.js +0 -1
- package/lib/components/commons/components/lunatic-component-with-label.js +1 -3
- package/lib/components/commons/components/md-label/md-label.js +5 -1
- package/lib/components/commons/components/md-label/md-label.spec.js +15 -0
- package/lib/components/commons/components/missing/missing.js +1 -3
- package/lib/components/commons/components/variable-status/variable-status.js +2 -3
- package/lib/components/commons/create-customizable-field.js +1 -0
- package/lib/components/commons/icons/closed-icon.js +0 -2
- package/lib/components/commons/icons/cross-icon.js +0 -2
- package/lib/components/commons/index.js +0 -7
- package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +124 -0
- package/lib/components/component-set/html/{legend/legend.js → component-set-legend.js} +4 -6
- package/lib/components/component-set/html/component-set-wrapper.js +16 -0
- package/lib/components/component-set/html/component-set.js +7 -8
- package/lib/components/component-set/html/component-set.spec.js +91 -0
- package/lib/components/component-set/lunatic-component-set.js +19 -9
- package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +34 -0
- package/lib/components/datepicker/html/datepicker-input.js +0 -1
- package/lib/components/datepicker/html/datepicker.js +1 -4
- package/lib/components/datepicker/html/datepicker.spec.js +38 -0
- package/lib/components/datepicker/lunatic-datepicker.js +0 -1
- package/lib/components/dropdown/html/__snapshots__/dropdown.spec.tsx.snap +85 -0
- package/lib/components/dropdown/html/dropdown-simple/dropdown-simple.js +3 -2
- package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +0 -2
- package/lib/components/dropdown/html/dropdown-writable/dropdown-writable.js +4 -5
- package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +1 -4
- package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +1 -3
- package/lib/components/dropdown/html/dropdown.js +4 -2
- package/lib/components/dropdown/html/dropdown.spec.js +48 -0
- package/lib/components/dropdown/lunatic-dropdown.js +5 -4
- package/lib/components/duration/getDurationFromValue.js +0 -1
- package/lib/components/filter-description/component.js +0 -2
- package/lib/components/index.js +6 -5
- package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +34 -0
- package/lib/components/input/html/input.js +4 -5
- package/lib/components/input/html/input.spec.js +81 -0
- package/lib/components/input/lunatic-input.js +4 -2
- package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +38 -90
- package/lib/components/input-number/html/input-number-thousand.js +2 -0
- package/lib/components/input-number/html/input-number.js +3 -0
- package/lib/components/input-number/html/input-number.spec.js +35 -19
- package/lib/components/input-number/lunatic-input-number.js +2 -1
- package/lib/components/loop/{block-for-loop/block-for-loop.js → block-for-loop.js} +39 -64
- package/lib/components/loop/{commons/handle-row-button.js → loop-button.js} +4 -7
- package/lib/components/loop/{roster-for-loop/header.js → loop-header.js} +4 -8
- package/lib/components/loop/loop.js +19 -65
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +102 -83
- package/lib/components/loop/{commons/get-init-length.js → utils/get-initial-nb-rows.js} +6 -5
- package/lib/components/{loop/roster-for-loop/body.js → lunatic-components.js} +46 -37
- package/lib/components/modal/html/modal.js +45 -73
- package/lib/components/modal/html/modal.scss +25 -42
- package/lib/components/modal/lunatic-modal.js +33 -9
- package/lib/components/modal-controls/close-or-skip.js +0 -1
- package/lib/components/modal-controls/modal-controls.spec.js +5 -6
- package/lib/components/pairwise-links/orchestrator.js +1 -4
- package/lib/components/pairwise-links/row.js +1 -4
- package/lib/components/question-explication/html/question-explication.js +0 -1
- package/lib/components/radio/html/radio-group-content.js +4 -3
- package/lib/components/radio/html/radio-group.js +4 -2
- package/lib/components/radio/html/radio-option.js +7 -8
- package/lib/components/radio/lunatic-radio-group.js +4 -2
- package/lib/components/roundabout/components/roundabout-it-title.js +0 -2
- package/lib/components/roundabout/components/roundabout-label.js +0 -2
- package/lib/components/roundabout/lunatic-roundabout.js +1 -4
- package/lib/components/roundabout/roundabout.js +0 -1
- package/lib/components/suggester/html/notification.js +0 -1
- package/lib/components/suggester/html/suggester.js +3 -3
- package/lib/components/suggester/idb-suggester/check-store.js +3 -5
- package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -5
- package/lib/components/suggester/idb-suggester/suggester-notification.js +2 -2
- package/lib/components/suggester/lunatic-suggester.js +3 -1
- package/lib/components/suggester-loader-widget/loader-row.js +1 -4
- package/lib/components/suggester-loader-widget/loader.js +1 -3
- package/lib/components/summary/html/summary-responses.js +13 -7
- package/lib/components/summary/lunatic-summary.js +8 -4
- package/lib/components/switch/html/switch.js +0 -1
- package/lib/components/table/cell.js +0 -2
- package/lib/components/table/header.js +0 -2
- package/lib/components/table/row.js +0 -1
- package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +30 -0
- package/lib/components/textarea/html/textarea.js +5 -6
- package/lib/components/textarea/html/textarea.spec.js +38 -0
- package/lib/components/textarea/lunatic-textarea.js +4 -2
- package/lib/index.js +8 -0
- package/lib/src/components/button/lunatic-button.d.ts +5 -3
- package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +2 -2
- package/lib/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-group/checkbox-group-content.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +4 -4
- package/lib/src/components/checkbox/checkbox-group/lunatic-checkbox-group.d.ts +2 -2
- package/lib/src/components/checkbox/checkbox-one/html/checkbox-one.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-one/lunatic-checkbox-one.d.ts +1 -1
- package/lib/src/components/checkbox/commons/checkbox-option.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/combo-box-content.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/combo-box.d.ts +6 -5
- package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +30 -2
- package/lib/src/components/commons/components/combo-box/combo-box.type.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/panel/combo-box-option.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/panel/panel-container.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/panel/panel.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +3 -2
- package/lib/src/components/commons/components/combo-box/selection/combo-box-label-selection.d.ts +2 -1
- package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/selection/label-selection.d.ts +4 -3
- package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +1 -1
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +3 -2
- package/lib/src/components/commons/components/description.d.ts +1 -1
- package/lib/src/components/commons/components/dragger/dragger.d.ts +1 -1
- package/lib/src/components/commons/components/errors/errors.d.ts +1 -1
- package/lib/src/components/commons/components/fab/fab.d.ts +1 -1
- package/lib/src/components/commons/components/field-container/field-container.d.ts +1 -1
- package/lib/src/components/commons/components/fieldset.d.ts +3 -3
- package/lib/src/components/commons/components/html-table/table.d.ts +1 -1
- package/lib/src/components/commons/components/html-table/thead.d.ts +1 -1
- package/lib/src/components/commons/components/label/label.d.ts +1 -1
- package/lib/src/components/commons/components/lunatic-component-with-label.d.ts +2 -2
- package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +2 -2
- package/lib/src/components/commons/components/md-label/link.d.ts +1 -1
- package/lib/src/components/commons/components/md-label/md-label.spec.d.ts +1 -0
- package/lib/src/components/commons/components/missing/missing.d.ts +1 -1
- package/lib/src/components/commons/components/orchestrated-component.d.ts +2 -2
- package/lib/src/components/commons/components/variable-status/variable-status.d.ts +1 -1
- package/lib/src/components/commons/create-customizable-field.d.ts +1 -1
- package/lib/src/components/commons/icons/checkbox-checked-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/checkbox-unchecked-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/closed-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/cross-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/load-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/lunatic-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/network-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/on-drag-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/opened-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/radio-checked-icon.d.ts +1 -1
- package/lib/src/components/commons/icons/radio-unchecked-icon.d.ts +1 -1
- package/lib/src/components/commons/index.d.ts +0 -1
- package/lib/src/components/commons/safety-label.d.ts +1 -1
- package/lib/src/components/component-set/html/component-set-legend.d.ts +8 -0
- package/lib/src/components/component-set/html/component-set-wrapper.d.ts +6 -0
- package/lib/src/components/component-set/html/component-set.d.ts +5 -4
- package/lib/src/components/component-set/html/component-set.spec.d.ts +1 -0
- package/lib/src/components/component-set/lunatic-component-set.d.ts +3 -4
- package/lib/src/components/datepicker/html/datepicker-container.d.ts +1 -1
- package/lib/src/components/datepicker/html/datepicker-input.d.ts +1 -1
- package/lib/src/components/datepicker/html/datepicker.d.ts +3 -3
- package/lib/src/components/datepicker/html/datepicker.spec.d.ts +1 -0
- package/lib/src/components/datepicker/lunatic-datepicker.d.ts +2 -2
- package/lib/src/components/declarations/declaration.d.ts +1 -1
- package/lib/src/components/declarations/declarations-after-text.d.ts +1 -1
- package/lib/src/components/declarations/declarations-before-text.d.ts +1 -1
- package/lib/src/components/declarations/declarations-detachable.d.ts +1 -1
- package/lib/src/components/declarations/declarations.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown-simple/dropdown-simple.d.ts +2 -2
- package/lib/src/components/dropdown/html/dropdown-simple/simple-label-renderer.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown-simple/simple-option-renderer.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +5 -4
- package/lib/src/components/dropdown/html/dropdown-writable/writable-label-renderer.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown-writable/writable-option-renderer.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown.d.ts +4 -3
- package/lib/src/components/dropdown/html/dropdown.spec.d.ts +1 -0
- package/lib/src/components/dropdown/lunatic-dropdown.d.ts +2 -2
- package/lib/src/components/duration/duration.d.ts +1 -1
- package/lib/src/components/duration/durationInput.d.ts +1 -1
- package/lib/src/components/duration/formatDuration.d.ts +1 -1
- package/lib/src/components/duration/getDurationFromValue.d.ts +1 -1
- package/lib/src/components/duration/index.d.ts +1 -1
- package/lib/src/components/filter-description/component.d.ts +2 -2
- package/lib/src/components/index.d.ts +4 -4
- package/lib/src/components/input/html/input.d.ts +4 -3
- package/lib/src/components/input/html/input.spec.d.ts +1 -0
- package/lib/src/components/input/lunatic-input.d.ts +1 -1
- package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -1
- package/lib/src/components/input-number/html/input-number.d.ts +3 -2
- package/lib/src/components/input-number/lunatic-input-number.d.ts +1 -1
- package/lib/src/components/loop/{block-for-loop/block-for-loop.d.ts → block-for-loop.d.ts} +6 -4
- package/lib/src/components/loop/loop-button.d.ts +7 -0
- package/lib/src/components/loop/loop-header.d.ts +9 -0
- package/lib/src/components/loop/loop.d.ts +2 -3
- package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +7 -5
- package/lib/src/components/loop/utils/get-initial-nb-rows.d.ts +4 -0
- package/lib/src/components/lunatic-components.d.ts +13 -0
- package/lib/src/components/modal/html/modal.d.ts +10 -13
- package/lib/src/components/modal/lunatic-modal.d.ts +2 -2
- package/lib/src/components/modal-controls/close-or-skip.d.ts +1 -1
- package/lib/src/components/modal-controls/modal-container.d.ts +1 -1
- package/lib/src/components/modal-controls/modal-controls.d.ts +2 -2
- package/lib/src/components/pairwise-links/orchestrator.d.ts +1 -1
- package/lib/src/components/pairwise-links/pairwise-links.d.ts +1 -1
- package/lib/src/components/pairwise-links/row.d.ts +1 -1
- package/lib/src/components/question-explication/html/question-explication.d.ts +1 -1
- package/lib/src/components/question-explication/lunatic-question-explication.d.ts +1 -1
- package/lib/src/components/radio/html/radio-group-content.d.ts +3 -2
- package/lib/src/components/radio/html/radio-group.d.ts +3 -2
- package/lib/src/components/radio/html/radio-option.d.ts +3 -2
- package/lib/src/components/roundabout/components/roundabout-it-title.d.ts +3 -3
- package/lib/src/components/roundabout/components/roundabout-label.d.ts +3 -3
- package/lib/src/components/roundabout/lunatic-roundabout.d.ts +1 -1
- package/lib/src/components/roundabout/roundabout.d.ts +2 -2
- package/lib/src/components/sequence/html/sequence.d.ts +1 -1
- package/lib/src/components/sequence/lunatic-sequence.d.ts +2 -2
- package/lib/src/components/suggester/html/notification.d.ts +2 -2
- package/lib/src/components/suggester/html/suggester.d.ts +6 -5
- package/lib/src/components/suggester/idb-suggester/check-store.d.ts +1 -1
- package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +3 -3
- package/lib/src/components/suggester/idb-suggester/suggester-notification.d.ts +1 -1
- package/lib/src/components/suggester/idb-suggester/suggester-status.d.ts +1 -1
- package/lib/src/components/suggester/lunatic-suggester.d.ts +2 -2
- package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
- package/lib/src/components/suggester-loader-widget/loader-row.d.ts +1 -1
- package/lib/src/components/suggester-loader-widget/loader.d.ts +1 -1
- package/lib/src/components/suggester-loader-widget/tools/action-tool.d.ts +1 -1
- package/lib/src/components/suggester-loader-widget/tools/tools.d.ts +1 -1
- package/lib/src/components/suggester-loader-widget/widget.d.ts +1 -1
- package/lib/src/components/summary/html/summary-container.d.ts +1 -1
- package/lib/src/components/summary/html/summary-responses.d.ts +3 -1
- package/lib/src/components/summary/html/summary-title.d.ts +1 -1
- package/lib/src/components/summary/lunatic-summary.d.ts +3 -2
- package/lib/src/components/switch/html/switch.d.ts +3 -3
- package/lib/src/components/switch/lunatic-switch.d.ts +1 -1
- package/lib/src/components/table/cell.d.ts +1 -1
- package/lib/src/components/table/header.d.ts +1 -1
- package/lib/src/components/table/lunatic-table.d.ts +1 -1
- package/lib/src/components/table/row.d.ts +1 -1
- package/lib/src/components/table/table-orchestrator.d.ts +1 -1
- package/lib/src/components/textarea/html/textarea.d.ts +4 -3
- package/lib/src/components/textarea/html/textarea.spec.d.ts +1 -0
- package/lib/src/components/textarea/lunatic-textarea.d.ts +1 -1
- package/lib/src/components/type.d.ts +9 -6
- package/lib/src/i18n/build-dictionary.d.ts +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/use-lunatic/actions.d.ts +4 -8
- package/lib/src/use-lunatic/commons/calculated-variables.d.ts +1 -1
- package/lib/src/use-lunatic/commons/check-loops.d.ts +1 -1
- package/lib/src/use-lunatic/commons/check-pager.d.ts +1 -1
- package/lib/src/use-lunatic/commons/compile-controls.d.ts +1 -1
- package/lib/src/use-lunatic/commons/compose.d.ts +1 -1
- package/lib/src/use-lunatic/commons/create-map-pages.d.ts +2 -2
- package/lib/src/use-lunatic/commons/execute-condition-filter.d.ts +1 -1
- package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +1 -1
- package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +2 -2
- package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +3 -3
- package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +5 -2
- package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +15 -10
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +38 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-management.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-pagination.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +62 -33
- package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +1 -1
- package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +1 -1
- package/lib/src/use-lunatic/commons/get-components-from-state.d.ts +1 -2
- package/lib/src/use-lunatic/commons/get-data.d.ts +1 -1
- package/lib/src/use-lunatic/commons/get-errors-without-empty-value.d.ts +1 -1
- package/lib/src/use-lunatic/commons/getOverview.d.ts +1 -1
- package/lib/src/use-lunatic/commons/is-First-last-page.d.ts +1 -1
- package/lib/src/use-lunatic/commons/is-paginated-loop.d.ts +1 -1
- package/lib/src/use-lunatic/commons/is-roundabout.d.ts +1 -1
- package/lib/src/use-lunatic/commons/page-navigation.d.ts +2 -2
- package/lib/src/use-lunatic/commons/page-tag.d.ts +1 -1
- package/lib/src/use-lunatic/commons/page.d.ts +2 -2
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +2 -2
- package/lib/src/use-lunatic/hooks/use-loop-variables.d.ts +1 -1
- package/lib/src/use-lunatic/lunatic-context.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/commons/auto-explore-loop.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +3 -3
- package/lib/src/use-lunatic/reducer/commons/validate-condition-filter.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/overview/overview-on-change.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -4
- package/lib/src/use-lunatic/reducer/reduce-go-next-page.spec.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/reduce-go-previous-page.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/reduce-go-previous-page.spec.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/reduce-go-to-page.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-on-set-waiting.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reduce-update-state.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/reducer.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-component-control.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.d.ts +2 -2
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -1
- package/lib/src/use-lunatic/type-source.d.ts +3 -1
- package/lib/src/use-lunatic/type.d.ts +3 -3
- package/lib/src/use-lunatic/use-lunatic.d.ts +21 -15
- package/lib/src/use-lunatic/use-suggesters.d.ts +1 -1
- package/lib/src/utils/array.d.ts +8 -0
- package/lib/src/utils/dom.d.ts +14 -0
- package/lib/src/utils/is-element.d.ts +1 -1
- package/lib/src/utils/number.d.ts +5 -0
- package/lib/src/utils/number.spec.d.ts +1 -0
- package/lib/src/utils/store-tools/initStore.d.ts +1 -1
- package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +1 -1
- package/lib/src/utils/suggester-workers/searching/compute-score.d.ts +1 -1
- package/lib/stories/checkbox-one/source.json +2 -2
- package/lib/stories/component-set/component-set.stories.js +9 -9
- package/lib/stories/component-set/{data2.json → data-roundabout.json} +1 -1
- package/lib/stories/component-set/data.json +8 -1
- package/lib/stories/component-set/source-loop.json +308 -0
- package/lib/stories/component-set/source-roundabout.json +434 -0
- package/lib/stories/component-set/source.json +16 -2
- package/lib/stories/disabled/data.json +32 -0
- package/lib/{components/commons/components/combo-box/state-management/reduce-on-keydown/on-end.js → stories/disabled/disabled.stories.js} +25 -12
- package/lib/stories/disabled/source.json +382 -0
- package/lib/stories/input/source-with-question.json +9 -3
- package/lib/stories/input/source.json +6 -0
- package/lib/stories/loop/source-paginated.json +2 -2
- package/lib/stories/overview/source.json +1 -1
- package/lib/stories/overview/sourceWithHierarchy.json +10 -2
- package/lib/stories/pairwise/links-componentset.json +292 -0
- package/lib/stories/pairwise/pairwise-links.stories.js +11 -2
- package/lib/stories/question-explication/source.json +16 -16
- package/lib/stories/questionnaires/logement/source-sum.json +31805 -34611
- package/lib/stories/questionnaires/recensement/source.json +2 -2
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +4 -4
- package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +963 -847
- package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4350 -4090
- package/lib/stories/suggester/simple.json +4 -0
- package/lib/stories/summary/source.json +55 -40
- package/lib/stories/utils/orchestrator.js +11 -22
- package/lib/tests/utils/lunatic.d.ts +16 -2
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +13 -45
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +5 -1
- package/lib/use-lunatic/commons/fill-components/fill-components.js +10 -2
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +3 -0
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +66 -21
- package/lib/use-lunatic/commons/get-component-value/get-component-value.js +1 -3
- package/lib/use-lunatic/commons/page.js +6 -0
- package/lib/use-lunatic/hooks/use-loop-variables.js +1 -1
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +10 -10
- package/lib/use-lunatic/reducer/reduce-go-next-page.spec.js +13 -0
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +3 -3
- package/lib/use-lunatic/reducer/reduce-go-previous-page.spec.js +14 -0
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +3 -8
- package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +790 -924
- package/lib/use-lunatic/reducer/reducer.js +2 -2
- package/lib/use-lunatic/use-lunatic.js +5 -2
- package/lib/use-lunatic/use-lunatic.test.js +26 -0
- package/lib/utils/array.js +33 -0
- package/lib/utils/dom.js +27 -0
- package/lib/utils/number.js +30 -0
- package/lib/utils/number.spec.js +11 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +0 -2
- package/package.json +8 -3
- package/lib/components/commons/components/combo-box/state-management/actions.js +0 -79
- package/lib/components/commons/components/combo-box/state-management/index.js +0 -25
- package/lib/components/commons/components/combo-box/state-management/reduce-on-init.js +0 -38
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-down.js +0 -30
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-up.js +0 -30
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-enter.js +0 -19
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-escape.js +0 -18
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-home.js +0 -23
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/on-tab.js +0 -18
- package/lib/components/commons/components/combo-box/state-management/reduce-on-keydown/reduce-on-keydown.js +0 -40
- package/lib/components/commons/components/combo-box/state-management/reducer.js +0 -53
- package/lib/components/commons/create-row-orchestrator.js +0 -58
- package/lib/components/component-set/html/component-set-component-container.js +0 -20
- package/lib/components/component-set/html/component-set-components.js +0 -45
- package/lib/components/component-set/html/legend/index.js +0 -13
- package/lib/components/component-set/index.js +0 -13
- package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +0 -12
- package/lib/components/loop/block-for-loop/index.js +0 -13
- package/lib/components/loop/block-for-loop/row.js +0 -56
- package/lib/components/loop/commons/index.js +0 -20
- package/lib/components/loop/commons/row-component.js +0 -72
- package/lib/components/loop/index.js +0 -13
- package/lib/components/loop/roster-for-loop/index.js +0 -13
- package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +0 -12
- package/lib/components/loop/roster-for-loop/roster-table.js +0 -50
- package/lib/components/loop/roster-for-loop/row.js +0 -85
- package/lib/src/components/commons/components/combo-box/state-management/actions.d.ts +0 -78
- package/lib/src/components/commons/components/combo-box/state-management/index.d.ts +0 -9
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-init.d.ts +0 -4
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-down.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-arrow-up.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-end.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-enter.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-escape.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-home.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/on-tab.d.ts +0 -2
- package/lib/src/components/commons/components/combo-box/state-management/reduce-on-keydown/reduce-on-keydown.d.ts +0 -9
- package/lib/src/components/commons/components/combo-box/state-management/reducer.d.ts +0 -3
- package/lib/src/components/commons/create-row-orchestrator.d.ts +0 -32
- package/lib/src/components/component-set/html/component-set-component-container.d.ts +0 -6
- package/lib/src/components/component-set/html/component-set-components.d.ts +0 -7
- package/lib/src/components/component-set/html/legend/index.d.ts +0 -1
- package/lib/src/components/component-set/html/legend/legend.d.ts +0 -8
- package/lib/src/components/component-set/index.d.ts +0 -1
- package/lib/src/components/loop/block-for-loop/block-for-loop-ochestrator.d.ts +0 -51
- package/lib/src/components/loop/block-for-loop/index.d.ts +0 -1
- package/lib/src/components/loop/block-for-loop/row.d.ts +0 -23
- package/lib/src/components/loop/commons/get-init-length.d.ts +0 -2
- package/lib/src/components/loop/commons/handle-row-button.d.ts +0 -7
- package/lib/src/components/loop/commons/index.d.ts +0 -2
- package/lib/src/components/loop/commons/row-component.d.ts +0 -9
- package/lib/src/components/loop/index.d.ts +0 -1
- package/lib/src/components/loop/roster-for-loop/body.d.ts +0 -12
- package/lib/src/components/loop/roster-for-loop/header.d.ts +0 -9
- package/lib/src/components/loop/roster-for-loop/index.d.ts +0 -1
- package/lib/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.d.ts +0 -51
- package/lib/src/components/loop/roster-for-loop/roster-table.d.ts +0 -13
- package/lib/src/components/loop/roster-for-loop/row.d.ts +0 -24
- package/lib/stories/component-set/source1.json +0 -287
- package/lib/stories/component-set/source2.json +0 -413
- /package/lib/components/commons/components/combo-box/{state-management/reduce-on-keydown/keyboard-key-codes.js → keyboard-key-codes.js} +0 -0
- /package/lib/src/components/commons/components/combo-box/{state-management/reduce-on-keydown/keyboard-key-codes.d.ts → keyboard-key-codes.d.ts} +0 -0
- /package/lib/stories/component-set/{data1.json → data-loop.json} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
2
|
export declare function SummaryContainer({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
type ResponsesValue = Array<{
|
|
3
3
|
label: ReactNode;
|
|
4
4
|
value: ReactNode;
|
|
5
|
+
id: string;
|
|
5
6
|
}>;
|
|
6
7
|
declare const _default: import("react").ComponentType<{
|
|
7
8
|
sections: {
|
|
8
9
|
title?: ReactNode;
|
|
9
10
|
values?: ResponsesValue | undefined;
|
|
11
|
+
id?: string | undefined;
|
|
10
12
|
}[];
|
|
11
13
|
}>;
|
|
12
14
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { LunaticBaseProps } from '../../type';
|
|
2
|
+
import type { LunaticBaseProps } from '../../type';
|
|
3
3
|
type SummaryTitleProps = Pick<LunaticBaseProps<string>, 'label'>;
|
|
4
4
|
declare const _default: import("react").ComponentType<SummaryTitleProps>;
|
|
5
5
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { LunaticComponentProps } from '../type';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import type { LunaticComponentProps } from '../type';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
export type SummaryResponsesEntry = {
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
value: ReactNode;
|
|
6
|
+
id: string;
|
|
6
7
|
};
|
|
7
8
|
export declare function LunaticSummary(props: LunaticComponentProps<'Summary'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import './switch.scss';
|
|
3
|
-
import { LunaticError } from '../../../use-lunatic/type';
|
|
3
|
+
import type { LunaticError } from '../../../use-lunatic/type';
|
|
4
4
|
type Props = {
|
|
5
5
|
checked?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -13,5 +13,5 @@ type Props = {
|
|
|
13
13
|
label: ReactNode;
|
|
14
14
|
errors?: Record<string, LunaticError[]>;
|
|
15
15
|
};
|
|
16
|
-
declare const _default:
|
|
16
|
+
declare const _default: import("react").ComponentType<Props>;
|
|
17
17
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LunaticComponentProps } from '../type';
|
|
1
|
+
import type { LunaticComponentProps } from '../type';
|
|
2
2
|
declare function LunaticSwitch({ id, value, statusLabel, handleChange, response, preferences, declarations, missing, missingResponse, management, description, label, errors, }: LunaticComponentProps<'Switch'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default LunaticSwitch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LunaticComponentDefinition, LunaticExpression } from '../../use-lunatic/type';
|
|
2
|
-
import { LunaticBaseProps } from '../type';
|
|
2
|
+
import type { LunaticBaseProps } from '../type';
|
|
3
3
|
type Props = {
|
|
4
4
|
components: Array<LunaticComponentDefinition | {
|
|
5
5
|
label: LunaticExpression;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunaticComponentProps } from '../type';
|
|
1
|
+
import type { LunaticComponentProps } from '../type';
|
|
2
2
|
type Props = Pick<LunaticComponentProps<'Table'>, 'body' | 'id' | 'executeExpression' | 'value' | 'handleChange' | 'iteration'>;
|
|
3
3
|
declare function TableOrchestrator({ body, id, executeExpression, value: valueMap, handleChange, iteration, }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export default TableOrchestrator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import './textarea.scss';
|
|
3
|
-
import { LunaticBaseProps } from '../../type';
|
|
3
|
+
import type { LunaticBaseProps } from '../../type';
|
|
4
4
|
type Props = {
|
|
5
5
|
id?: string;
|
|
6
6
|
rows?: number;
|
|
@@ -12,6 +12,7 @@ type Props = {
|
|
|
12
12
|
value?: string | number | null;
|
|
13
13
|
description?: string;
|
|
14
14
|
errors?: LunaticBaseProps['errors'];
|
|
15
|
+
readOnly?: boolean;
|
|
15
16
|
};
|
|
16
|
-
declare const _default:
|
|
17
|
+
declare const _default: import("react").ComponentType<Props>;
|
|
17
18
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { LunaticComponentProps } from '../type';
|
|
2
|
+
import type { LunaticComponentProps } from '../type';
|
|
3
3
|
declare const LunaticTextarea: {
|
|
4
4
|
(props: LunaticComponentProps<'Textarea'>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
defaultProps: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { LunaticComponentDefinition, LunaticError, LunaticExpression, LunaticState } from '../use-lunatic/type';
|
|
2
|
-
import { CSSProperties, FunctionComponent, ReactNode } from 'react';
|
|
1
|
+
import type { LunaticComponentDefinition, LunaticError, LunaticExpression, LunaticState } from '../use-lunatic/type';
|
|
2
|
+
import type { CSSProperties, FunctionComponent, ReactNode } from 'react';
|
|
3
3
|
import { SuggesterStatus } from '../use-lunatic/use-suggesters';
|
|
4
4
|
import useLunatic from '../use-lunatic';
|
|
5
|
+
import type { FilledLunaticComponentProps } from '../use-lunatic/commons/fill-components/fill-components';
|
|
5
6
|
type Formats = 'PTnHnM' | 'PnYnM';
|
|
6
7
|
export type VtlExpression = {
|
|
7
8
|
value: string;
|
|
@@ -84,7 +85,7 @@ type ComponentPropsByType = {
|
|
|
84
85
|
Subsequence: Pick<LunaticBaseProps<string>, 'id' | 'declarations' | 'label'>;
|
|
85
86
|
Question: Pick<LunaticBaseProps<unknown>, 'label' | 'description'>;
|
|
86
87
|
ComponentSet: LunaticBaseProps<unknown> & {
|
|
87
|
-
components:
|
|
88
|
+
components: FilledLunaticComponentProps[];
|
|
88
89
|
value: Record<string, unknown>;
|
|
89
90
|
response: undefined;
|
|
90
91
|
};
|
|
@@ -94,7 +95,7 @@ type ComponentPropsByType = {
|
|
|
94
95
|
max: number;
|
|
95
96
|
};
|
|
96
97
|
iterations?: number;
|
|
97
|
-
|
|
98
|
+
getComponents: (n: number) => FilledLunaticComponentProps[];
|
|
98
99
|
executeExpression: LunaticState['executeExpression'];
|
|
99
100
|
value: Record<string, unknown[]>;
|
|
100
101
|
headers?: Array<{
|
|
@@ -108,7 +109,7 @@ type ComponentPropsByType = {
|
|
|
108
109
|
max: number;
|
|
109
110
|
};
|
|
110
111
|
iterations?: number;
|
|
111
|
-
|
|
112
|
+
getComponents: (n: number) => FilledLunaticComponentProps[];
|
|
112
113
|
executeExpression: LunaticState['executeExpression'];
|
|
113
114
|
value: Record<string, unknown[]>;
|
|
114
115
|
headers?: Array<{
|
|
@@ -258,7 +259,9 @@ type ComponentPropsByType = {
|
|
|
258
259
|
};
|
|
259
260
|
Summary: LunaticBaseProps<string | null> & {
|
|
260
261
|
sections: Array<{
|
|
262
|
+
id: string;
|
|
261
263
|
responses?: Array<{
|
|
264
|
+
id: string;
|
|
262
265
|
label: VtlExpression;
|
|
263
266
|
value: VtlExpression;
|
|
264
267
|
}>;
|
|
@@ -266,7 +269,7 @@ type ComponentPropsByType = {
|
|
|
266
269
|
iterations?: number;
|
|
267
270
|
}>;
|
|
268
271
|
};
|
|
269
|
-
|
|
272
|
+
ConfirmationModal: LunaticBaseProps<string | null> & {
|
|
270
273
|
goToPage: ReturnType<typeof useLunatic>['goToPage'];
|
|
271
274
|
page: string;
|
|
272
275
|
goNextPage: () => void;
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
+
export { LunaticComponents } from './components/lunatic-components';
|
|
2
3
|
export { default as useLunatic } from './use-lunatic';
|
|
3
4
|
export type { LunaticComponentDefinition, LunaticControl, LunaticData, LunaticValues, LunaticError, LunaticExpression, LunaticVariable, LunaticCollectedValue, LunaticStateVariable, LunaticState, } from './use-lunatic/type';
|
|
4
5
|
export type { LunaticComponentProps } from './components/type';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LunaticData, LunaticState } from './type';
|
|
2
|
-
import { LunaticSource } from './type-source';
|
|
1
|
+
import type { LunaticData, LunaticState } from './type';
|
|
2
|
+
import type { LunaticSource } from './type-source';
|
|
3
3
|
import { SuggesterStatus } from './use-suggesters';
|
|
4
4
|
export declare enum ActionKind {
|
|
5
5
|
GO_PREVIOUS_PAGE = "use-lunatic/go-previous",
|
|
@@ -72,9 +72,7 @@ export type ActionUpdateState = {
|
|
|
72
72
|
};
|
|
73
73
|
export type ActionGoNextPage = {
|
|
74
74
|
type: ActionKind.GO_NEXT_PAGE;
|
|
75
|
-
payload: {
|
|
76
|
-
block?: unknown;
|
|
77
|
-
};
|
|
75
|
+
payload: {};
|
|
78
76
|
};
|
|
79
77
|
export type ActionGoPreviousPage = {
|
|
80
78
|
type: ActionKind.GO_PREVIOUS_PAGE;
|
|
@@ -88,9 +86,7 @@ export declare const goPreviousPage: () => {
|
|
|
88
86
|
readonly type: ActionKind.GO_PREVIOUS_PAGE;
|
|
89
87
|
readonly payload: {};
|
|
90
88
|
};
|
|
91
|
-
export declare const goNextPage: (payload: {
|
|
92
|
-
block?: unknown;
|
|
93
|
-
}) => ActionGoNextPage & {
|
|
89
|
+
export declare const goNextPage: (payload: {}) => ActionGoNextPage & {
|
|
94
90
|
type: ActionKind.GO_NEXT_PAGE;
|
|
95
91
|
};
|
|
96
92
|
export declare const goToPage: (payload: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunaticState, LunaticValues } from '../type';
|
|
1
|
+
import type { LunaticState, LunaticValues } from '../type';
|
|
2
2
|
export declare const interpretAllCalculatedVariables: ({ variables, partialVariables, builtVariables, }: {
|
|
3
3
|
variables: LunaticState['variables'];
|
|
4
4
|
builtVariables: LunaticValues;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunaticError, LunaticState } from '../type';
|
|
1
|
+
import type { LunaticError, LunaticState } from '../type';
|
|
2
2
|
export type StateForControls = Pick<LunaticState, 'pager' | 'pages' | 'isInLoop' | 'executeExpression'>;
|
|
3
3
|
declare function computeErrors(state: StateForControls): {
|
|
4
4
|
currentErrors: Record<string, LunaticError[]> | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LunaticExpression, LunaticState } from '../type';
|
|
1
|
+
import type { LunaticExpression, LunaticState } from '../type';
|
|
2
2
|
declare function executeConditionFilter(filter: LunaticExpression, execute: LunaticState['executeExpression'], iteration?: number): unknown;
|
|
3
3
|
export default executeConditionFilter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunaticExpression, LunaticState } from '../../type';
|
|
1
|
+
import type { LunaticExpression, LunaticState } from '../../type';
|
|
2
2
|
export type ExpressionLogger = (expression: string | LunaticExpression, bindings: {
|
|
3
3
|
[variableName: string]: unknown;
|
|
4
4
|
}, e: unknown) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LunaticState, LunaticVariable } from '../../type';
|
|
2
|
-
import { ExpressionLogger } from './create-execute-expression';
|
|
1
|
+
import type { LunaticState, LunaticVariable } from '../../type';
|
|
2
|
+
import { type ExpressionLogger } from './create-execute-expression';
|
|
3
3
|
type Args = {
|
|
4
4
|
variables: LunaticState['variables'];
|
|
5
5
|
bindings: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { VTLBindings } from '../../type';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { VTLBindings } from '../../type';
|
|
3
3
|
/**
|
|
4
4
|
* Run a VTL expression and return the result
|
|
5
5
|
*/
|
|
6
|
-
export declare function executeVtlExpression
|
|
6
|
+
export declare function executeVtlExpression(expression: string, vtlBindings: {
|
|
7
7
|
[variableName: string]: unknown;
|
|
8
8
|
}): unknown;
|
|
9
9
|
declare function loggingDefault(expression: string, bindings: VTLBindings, e: unknown): void;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { LunaticComponentDefinition, LunaticExpression, LunaticState } from '../../type';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LunaticComponentDefinition, LunaticExpression, LunaticState } from '../../type';
|
|
3
3
|
export type DeepTranslateExpression<T> = T extends LunaticExpression ? ReactNode : T extends {
|
|
4
4
|
[k: string | number]: unknown;
|
|
5
5
|
} ? {
|
|
6
6
|
[key in keyof T]: DeepTranslateExpression<T[key]>;
|
|
7
7
|
} : T;
|
|
8
|
+
/**
|
|
9
|
+
* Fill props interpreting VTL expression
|
|
10
|
+
*/
|
|
8
11
|
declare function fillComponentExpressions(component: LunaticComponentDefinition, state: {
|
|
9
12
|
executeExpression: LunaticState['executeExpression'];
|
|
10
13
|
pager: Pick<LunaticState['pager'], 'iteration' | 'linksIterations'>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
|
-
import { DeepTranslateExpression } from './fill-component-expressions';
|
|
3
|
-
import { FilledProps as FilledValueProps } from './fill-component-value';
|
|
4
|
-
import { FilledProps as FilledHandlersProps } from './fill-from-state';
|
|
5
|
-
import { FilledProps as FilledManagementProps } from './fill-management';
|
|
6
|
-
import { FilledProps as FilledMissingResponseProps } from './fill-missing-response';
|
|
7
|
-
import { FilledProps as FilledPaginationProps } from './fill-pagination';
|
|
8
|
-
export type
|
|
1
|
+
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
|
+
import { type DeepTranslateExpression } from './fill-component-expressions';
|
|
3
|
+
import { type FilledProps as FilledValueProps } from './fill-component-value';
|
|
4
|
+
import { type FilledProps as FilledHandlersProps } from './fill-from-state';
|
|
5
|
+
import { type FilledProps as FilledManagementProps } from './fill-management';
|
|
6
|
+
import { type FilledProps as FilledMissingResponseProps } from './fill-missing-response';
|
|
7
|
+
import { type FilledProps as FilledPaginationProps } from './fill-pagination';
|
|
8
|
+
export type FilledLunaticComponentProps<T = LunaticComponentDefinition['componentType']> = DeepTranslateExpression<LunaticComponentDefinition & {
|
|
9
9
|
componentType: T;
|
|
10
|
-
}> & FilledManagementProps & FilledValueProps & FilledMissingResponseProps & FilledHandlersProps & FilledPaginationProps
|
|
11
|
-
|
|
10
|
+
}> & FilledManagementProps & FilledValueProps & FilledMissingResponseProps & FilledHandlersProps & FilledPaginationProps & {
|
|
11
|
+
conditionFilter?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Fill components with values coming from the state, and interpret VTL expression
|
|
15
|
+
*/
|
|
16
|
+
declare function fillComponents(components: LunaticComponentDefinition[], state: LunaticState): FilledLunaticComponentProps[];
|
|
12
17
|
export default fillComponents;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
1
|
+
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
2
|
export type FilledProps = {
|
|
3
3
|
handleChange: LunaticState['handleChange'];
|
|
4
4
|
executeExpression: LunaticState['executeExpression'];
|
|
@@ -8,6 +8,9 @@ export type FilledProps = {
|
|
|
8
8
|
goNextPage: LunaticState['goNextPage'];
|
|
9
9
|
goPreviousPage: LunaticState['goPreviousPage'];
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Add state data as component props
|
|
13
|
+
*/
|
|
11
14
|
declare function fillFromState(component: LunaticComponentDefinition, state: LunaticState): {
|
|
12
15
|
handleChange: (response: {
|
|
13
16
|
name: string;
|
|
@@ -712,6 +715,40 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
|
|
|
712
715
|
mandatory?: boolean | undefined;
|
|
713
716
|
page: string;
|
|
714
717
|
componentType: "CheckboxOne";
|
|
718
|
+
} | {
|
|
719
|
+
handleChange: (response: {
|
|
720
|
+
name: string;
|
|
721
|
+
}, value: any, args?: Record<string, unknown> | undefined) => void;
|
|
722
|
+
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
723
|
+
iteration?: number | undefined;
|
|
724
|
+
linksIterations?: number[] | undefined;
|
|
725
|
+
logging?: import("../execute-expression/create-execute-expression").ExpressionLogger | undefined;
|
|
726
|
+
bindingDependencies?: string[] | undefined;
|
|
727
|
+
} | undefined) => T;
|
|
728
|
+
preferences: ["COLLECTED"];
|
|
729
|
+
goToPage: (page: {
|
|
730
|
+
page: string;
|
|
731
|
+
iteration?: number | undefined;
|
|
732
|
+
nbIterations?: number | undefined;
|
|
733
|
+
subPage?: number | undefined;
|
|
734
|
+
}) => void;
|
|
735
|
+
shortcut: boolean | undefined;
|
|
736
|
+
getSuggesterStatus: (name: string) => {
|
|
737
|
+
status: import("../../use-suggesters").SuggesterStatus;
|
|
738
|
+
timestamp: number;
|
|
739
|
+
};
|
|
740
|
+
goNextPage: () => void;
|
|
741
|
+
goPreviousPage: () => void;
|
|
742
|
+
label: import("../../type-source").LabelType;
|
|
743
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
744
|
+
conditionFilter: import("../../type-source").ConditionFilterType;
|
|
745
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
746
|
+
id: string;
|
|
747
|
+
bindingDependencies?: string[] | undefined;
|
|
748
|
+
hierarchy: import("../../type-source").Hierarchy;
|
|
749
|
+
mandatory?: boolean | undefined;
|
|
750
|
+
page: string;
|
|
751
|
+
componentType: "ConfirmationModal";
|
|
715
752
|
} | {
|
|
716
753
|
handleChange: (response: {
|
|
717
754
|
name: string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
3
|
-
import { DeepTranslateExpression } from './fill-component-expressions';
|
|
2
|
+
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
3
|
+
import { type DeepTranslateExpression } from './fill-component-expressions';
|
|
4
|
+
/**
|
|
5
|
+
* Fill component specific props (RoundAbout for instance)
|
|
6
|
+
*/
|
|
4
7
|
declare function fillSpecificExpressions(component: DeepTranslateExpression<LunaticComponentDefinition>, state: LunaticState): {
|
|
8
|
+
expressions: {};
|
|
5
9
|
label: import("react").ReactNode;
|
|
6
10
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
7
11
|
conditionFilter: import("react").ReactNode;
|
|
@@ -22,8 +26,12 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
22
26
|
};
|
|
23
27
|
mandatory?: boolean | undefined;
|
|
24
28
|
page: string;
|
|
25
|
-
componentType: "
|
|
29
|
+
componentType: "Roundabout";
|
|
30
|
+
components: import("../../type-source").ComponentType[];
|
|
31
|
+
iterations: import("react").ReactNode;
|
|
32
|
+
locked: boolean;
|
|
26
33
|
} | {
|
|
34
|
+
components: import("./fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
|
|
27
35
|
label: import("react").ReactNode;
|
|
28
36
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
29
37
|
conditionFilter: import("react").ReactNode;
|
|
@@ -44,9 +52,9 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
44
52
|
};
|
|
45
53
|
mandatory?: boolean | undefined;
|
|
46
54
|
page: string;
|
|
47
|
-
componentType: "
|
|
48
|
-
gotoPage: string;
|
|
55
|
+
componentType: "ComponentSet";
|
|
49
56
|
} | {
|
|
57
|
+
getComponents: (iteration: number) => import("./fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
|
|
50
58
|
label: import("react").ReactNode;
|
|
51
59
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
52
60
|
conditionFilter: import("react").ReactNode;
|
|
@@ -105,7 +113,9 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
105
113
|
id?: string | undefined;
|
|
106
114
|
}[];
|
|
107
115
|
positioning: "HORIZONTAL";
|
|
116
|
+
value?: Record<string, unknown[]> | undefined;
|
|
108
117
|
} | {
|
|
118
|
+
getComponents: (iteration: number) => import("./fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
|
|
109
119
|
label: import("react").ReactNode;
|
|
110
120
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
111
121
|
conditionFilter: import("react").ReactNode;
|
|
@@ -137,6 +147,52 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
137
147
|
maxPage: string;
|
|
138
148
|
depth: number;
|
|
139
149
|
paginatedLoop: boolean;
|
|
150
|
+
value?: Record<string, unknown[]> | undefined;
|
|
151
|
+
} | {
|
|
152
|
+
label: import("react").ReactNode;
|
|
153
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
154
|
+
conditionFilter: import("react").ReactNode;
|
|
155
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
156
|
+
id: string;
|
|
157
|
+
bindingDependencies?: string[] | undefined;
|
|
158
|
+
hierarchy: {
|
|
159
|
+
sequence: {
|
|
160
|
+
label: import("react").ReactNode;
|
|
161
|
+
id: string;
|
|
162
|
+
page: string;
|
|
163
|
+
};
|
|
164
|
+
subSequence?: {
|
|
165
|
+
label: import("react").ReactNode;
|
|
166
|
+
id: string;
|
|
167
|
+
page: string;
|
|
168
|
+
} | undefined;
|
|
169
|
+
};
|
|
170
|
+
mandatory?: boolean | undefined;
|
|
171
|
+
page: string;
|
|
172
|
+
componentType: "Sequence";
|
|
173
|
+
} | {
|
|
174
|
+
label: import("react").ReactNode;
|
|
175
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
176
|
+
conditionFilter: import("react").ReactNode;
|
|
177
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
178
|
+
id: string;
|
|
179
|
+
bindingDependencies?: string[] | undefined;
|
|
180
|
+
hierarchy: {
|
|
181
|
+
sequence: {
|
|
182
|
+
label: import("react").ReactNode;
|
|
183
|
+
id: string;
|
|
184
|
+
page: string;
|
|
185
|
+
};
|
|
186
|
+
subSequence?: {
|
|
187
|
+
label: import("react").ReactNode;
|
|
188
|
+
id: string;
|
|
189
|
+
page: string;
|
|
190
|
+
} | undefined;
|
|
191
|
+
};
|
|
192
|
+
mandatory?: boolean | undefined;
|
|
193
|
+
page: string;
|
|
194
|
+
componentType: "Subsequence";
|
|
195
|
+
gotoPage: string;
|
|
140
196
|
} | {
|
|
141
197
|
label: import("react").ReactNode;
|
|
142
198
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
@@ -518,8 +574,7 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
518
574
|
};
|
|
519
575
|
mandatory?: boolean | undefined;
|
|
520
576
|
page: string;
|
|
521
|
-
componentType: "
|
|
522
|
-
components: import("../../type-source").ComponentType[];
|
|
577
|
+
componentType: "ConfirmationModal";
|
|
523
578
|
} | {
|
|
524
579
|
label: import("react").ReactNode;
|
|
525
580
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
@@ -544,31 +599,5 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
544
599
|
componentType: "QuestionExplication";
|
|
545
600
|
description: string;
|
|
546
601
|
bgColor?: string | undefined;
|
|
547
|
-
} | {
|
|
548
|
-
expressions: {};
|
|
549
|
-
label: import("react").ReactNode;
|
|
550
|
-
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
551
|
-
conditionFilter: import("react").ReactNode;
|
|
552
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
553
|
-
id: string;
|
|
554
|
-
bindingDependencies?: string[] | undefined;
|
|
555
|
-
hierarchy: {
|
|
556
|
-
sequence: {
|
|
557
|
-
label: import("react").ReactNode;
|
|
558
|
-
id: string;
|
|
559
|
-
page: string;
|
|
560
|
-
};
|
|
561
|
-
subSequence?: {
|
|
562
|
-
label: import("react").ReactNode;
|
|
563
|
-
id: string;
|
|
564
|
-
page: string;
|
|
565
|
-
} | undefined;
|
|
566
|
-
};
|
|
567
|
-
mandatory?: boolean | undefined;
|
|
568
|
-
page: string;
|
|
569
|
-
componentType: "Roundabout";
|
|
570
|
-
components: import("../../type-source").ComponentType[];
|
|
571
|
-
iterations: import("react").ReactNode;
|
|
572
|
-
locked: boolean;
|
|
573
602
|
};
|
|
574
603
|
export default fillSpecificExpressions;
|