@inseefr/lunatic 2.3.1 → 2.4.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +169 -22
- package/lib/components/button/__snapshots__/lunatic-button.spec.jsx.snap +80 -0
- package/lib/components/button/button.scss +24 -0
- package/lib/components/button/index.js +13 -0
- package/lib/components/button/lunatic-button.js +56 -0
- package/lib/components/button/lunatic-button.spec.js +87 -0
- package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +55 -0
- package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.spec.js +57 -0
- package/lib/components/checkbox/checkbox-boolean/index.js +13 -0
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +58 -0
- package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +41 -0
- package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +51 -0
- package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.spec.js +44 -0
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +52 -0
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.scss +12 -0
- package/lib/components/checkbox/checkbox-group/index.js +13 -0
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +64 -0
- package/lib/components/checkbox/checkbox-one/html/checkbox-one.js +54 -0
- package/lib/components/checkbox/checkbox-one/html/checkbox-one.scss +19 -0
- package/lib/components/checkbox/checkbox-one/html/checkbox-one.spec.js +51 -0
- package/lib/components/checkbox/checkbox-one/index.js +13 -0
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +58 -0
- package/lib/components/checkbox/commons/checkbox-option.js +89 -0
- package/lib/components/checkbox/commons/checkbox-option.scss +19 -0
- package/lib/components/checkbox/commons/checkbox-option.spec.js +71 -0
- package/lib/components/checkbox/commons/getShortcutKey.js +11 -0
- package/lib/components/checkbox/commons/index.js +13 -0
- package/lib/components/checkbox/index.js +27 -0
- package/lib/components/commons/build-style-object.js +25 -0
- package/lib/components/commons/components/combo-box/combo-box-container.js +33 -0
- package/lib/components/commons/components/combo-box/combo-box-container.spec.js +45 -0
- package/lib/components/commons/components/combo-box/combo-box-content.js +63 -0
- package/lib/components/commons/components/combo-box/combo-box.js +199 -0
- package/lib/components/commons/components/combo-box/combo-box.scss +206 -0
- package/lib/components/commons/components/combo-box/index.js +13 -0
- package/lib/components/commons/components/combo-box/panel/index.js +13 -0
- package/lib/components/commons/components/combo-box/panel/option-container.js +61 -0
- package/lib/components/commons/components/combo-box/panel/option-container.spec.js +27 -0
- package/lib/components/commons/components/combo-box/panel/panel-container.js +28 -0
- package/lib/components/commons/components/combo-box/panel/panel-container.spec.js +59 -0
- package/lib/components/commons/components/combo-box/panel/panel.js +63 -0
- package/lib/components/commons/components/combo-box/panel/panel.spec.js +93 -0
- package/lib/components/commons/components/combo-box/selection/__snapshots__/selection.spec.jsx.snap +81 -0
- package/lib/components/commons/components/combo-box/selection/delete.js +55 -0
- package/lib/components/commons/components/combo-box/selection/delete.spec.js +88 -0
- package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +29 -0
- package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.spec.js +57 -0
- package/lib/components/commons/components/combo-box/selection/index.js +13 -0
- package/lib/components/commons/components/combo-box/selection/input.js +56 -0
- package/lib/components/commons/components/combo-box/selection/label-selection.js +32 -0
- package/lib/components/commons/components/combo-box/selection/label-selection.spec.js +45 -0
- package/lib/components/commons/components/combo-box/selection/selection-container.js +39 -0
- package/lib/components/commons/components/combo-box/selection/selection-container.spec.js +53 -0
- package/lib/components/commons/components/combo-box/selection/selection.js +60 -0
- package/lib/components/commons/components/combo-box/selection/selection.spec.js +104 -0
- package/lib/components/commons/components/combo-box/state-management/actions.js +82 -0
- package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +16 -0
- package/lib/components/commons/components/combo-box/state-management/index.js +33 -0
- package/lib/components/commons/components/combo-box/state-management/initial-state.js +14 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/index.js +13 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +21 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +38 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +13 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/keyboard-key-codes.js +18 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +32 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +32 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +25 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +21 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +25 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +20 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +40 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +22 -0
- package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +41 -0
- package/lib/components/commons/components/default-label-renderer.js +47 -0
- package/lib/components/commons/components/default-label-renderer.spec.js +43 -0
- package/lib/components/commons/components/default-option-renderer.js +44 -0
- package/lib/components/commons/components/default-option-renderer.spec.js +65 -0
- package/lib/components/commons/components/description.js +52 -0
- package/lib/components/commons/components/description.spec.js +45 -0
- package/lib/components/commons/components/dragger/dragger.js +95 -0
- package/lib/components/commons/components/dragger/dragger.scss +8 -0
- package/lib/components/commons/components/dragger/dragger.spec.js +80 -0
- package/lib/components/commons/components/dragger/index.js +13 -0
- package/lib/components/commons/components/errors/errors.js +53 -0
- package/lib/components/commons/components/errors/errors.scss +5 -0
- package/lib/components/commons/components/errors/errors.spec.js +40 -0
- package/lib/components/commons/components/errors/index.js +13 -0
- package/lib/components/commons/components/fab/fab.js +50 -0
- package/lib/components/commons/components/fab/fab.scss +32 -0
- package/lib/components/commons/components/fab/fab.spec.js +76 -0
- package/lib/components/commons/components/fab/index.js +13 -0
- package/lib/components/commons/components/field-container/field-container.js +41 -0
- package/lib/components/commons/components/field-container/filed-container.spec.js +37 -0
- package/lib/components/commons/components/field-container/index.js +13 -0
- package/lib/components/commons/components/fieldset.js +30 -0
- package/lib/components/commons/components/fieldset.scss +5 -0
- package/lib/components/commons/components/fieldset.spec.js +51 -0
- package/lib/components/commons/components/html-table/index.js +48 -0
- package/lib/components/commons/components/html-table/table.js +32 -0
- package/lib/components/commons/components/html-table/table.scss +27 -0
- package/lib/components/commons/components/html-table/table.spec.js +25 -0
- package/lib/components/commons/components/html-table/tbody.js +32 -0
- package/lib/components/commons/components/html-table/tbody.spec.js +34 -0
- package/lib/components/commons/components/html-table/td.js +43 -0
- package/lib/components/commons/components/html-table/td.spec.js +43 -0
- package/lib/components/commons/components/html-table/th.js +41 -0
- package/lib/components/commons/components/html-table/th.spec.js +46 -0
- package/lib/components/commons/components/html-table/thead.js +31 -0
- package/lib/components/commons/components/html-table/thead.spec.js +30 -0
- package/lib/components/commons/components/html-table/tr.js +33 -0
- package/lib/components/commons/components/html-table/tr.spec.js +45 -0
- package/lib/components/commons/components/is-network/index.js +13 -0
- package/lib/components/commons/components/is-network/is-network.js +53 -0
- package/lib/components/commons/components/is-network/is-network.spec.js +34 -0
- package/lib/components/commons/components/is-network/use-online-status.js +46 -0
- package/lib/components/commons/components/is-network/use-online-status.spec.js +45 -0
- package/lib/components/commons/components/label/index.js +13 -0
- package/lib/components/commons/components/label/label.js +35 -0
- package/lib/components/commons/components/label/label.scss +6 -0
- package/lib/components/commons/components/label/label.spec.js +78 -0
- package/lib/components/commons/components/lunatic-component-with-label.js +88 -0
- package/lib/components/commons/components/lunatic-component-without-label.js +87 -0
- package/lib/components/commons/components/md-label/index.js +13 -0
- package/lib/components/commons/components/md-label/link.js +54 -0
- package/lib/components/commons/components/md-label/md-label.js +45 -0
- package/lib/components/commons/components/missing/index.js +13 -0
- package/lib/components/commons/components/missing/missing.js +87 -0
- package/lib/components/commons/components/missing/missing.scss +30 -0
- package/lib/components/commons/components/missing/missing.spec.js +81 -0
- package/lib/components/commons/components/nothing-to-display.js +16 -0
- package/lib/components/commons/components/nothing-to-display.spec.js +16 -0
- package/lib/components/commons/components/orchestrated-component.js +62 -0
- package/lib/components/commons/components/variable-status/img/index.js +20 -0
- package/lib/components/commons/components/variable-status/index.js +13 -0
- package/lib/components/commons/components/variable-status/variable-status.js +85 -0
- package/lib/components/commons/components/variable-status/variable-status.scss +39 -0
- package/lib/components/commons/components/variable-status/variable-status.spec.js +24 -0
- package/lib/components/commons/create-customizable-field.js +29 -0
- package/lib/components/commons/create-row-orchestrator.js +51 -0
- package/lib/components/commons/icons/checkbox-checked.icon.js +39 -0
- package/lib/components/commons/icons/checkbox-unchecked.icon.js +39 -0
- package/lib/components/commons/icons/closed.icon.js +36 -0
- package/lib/components/commons/icons/cross.icon.js +36 -0
- package/lib/components/commons/icons/index.js +76 -0
- package/lib/components/commons/icons/load.icon.js +36 -0
- package/lib/components/commons/icons/lunatic-icon.js +21 -0
- package/lib/components/commons/icons/lunatic-icon.scss +3 -0
- package/lib/components/commons/icons/network.icon.js +36 -0
- package/lib/components/commons/icons/on-drag.icon.js +36 -0
- package/lib/components/commons/icons/opened.icon.js +36 -0
- package/lib/components/commons/icons/radio-checked.icon.js +39 -0
- package/lib/components/commons/icons/radio-unchecked.icon.js +39 -0
- package/lib/components/commons/index.js +131 -0
- package/lib/components/commons/prop-types/declarations.js +19 -0
- package/lib/components/commons/prop-types/index.js +41 -0
- package/lib/components/commons/prop-types/lines.js +13 -0
- package/lib/components/commons/prop-types/options.js +13 -0
- package/lib/components/commons/prop-types/response.js +13 -0
- package/lib/components/commons/prop-types/value-type.js +14 -0
- package/lib/components/commons/safety-label.js +26 -0
- package/lib/components/commons/use-document-add-event-listener.js +84 -0
- package/lib/components/commons/use-on-handle-change.js +19 -0
- package/lib/components/commons/use-on-handle-change.spec.js +46 -0
- package/lib/components/commons/use-options-keydown.js +24 -0
- package/lib/components/commons/use-previous.js +16 -0
- package/lib/components/components.js +171 -0
- package/lib/components/datepicker/html/datepicker-container.js +18 -0
- package/lib/components/datepicker/html/datepicker-input.js +37 -0
- package/lib/components/datepicker/html/datepicker.js +69 -0
- package/lib/components/datepicker/html/datepicker.scss +1 -0
- package/lib/components/datepicker/index.js +13 -0
- package/lib/components/datepicker/lunatic-datepicker.js +61 -0
- package/lib/components/declarations/declaration.js +22 -0
- package/lib/components/declarations/declaration.spec.js +30 -0
- package/lib/components/declarations/declarations-after-text.js +25 -0
- package/lib/components/declarations/declarations-before-text.js +25 -0
- package/lib/components/declarations/declarations-detachable.js +25 -0
- package/lib/components/declarations/declarations.js +50 -0
- package/lib/components/declarations/declarations.scss +36 -0
- package/lib/components/declarations/declarations.spec.js +79 -0
- package/lib/components/declarations/index.js +43 -0
- package/lib/components/dropdown/html/dropdown-simple/dropdown-simple.js +39 -0
- package/lib/components/dropdown/html/dropdown-simple/index.js +13 -0
- package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +46 -0
- package/lib/components/dropdown/html/dropdown-simple/simple-option-renderer.js +45 -0
- package/lib/components/dropdown/html/dropdown-writable/dropdown-writable.js +62 -0
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/filter-options.js +37 -0
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/get-label.js +24 -0
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/letters-matching.js +29 -0
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/match.js +22 -0
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/prepare-prefix.js +13 -0
- package/lib/components/dropdown/html/dropdown-writable/index.js +13 -0
- package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +52 -0
- package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +146 -0
- package/lib/components/dropdown/html/dropdown.js +51 -0
- package/lib/components/dropdown/html/dropdown.scss +41 -0
- package/lib/components/dropdown/index.js +13 -0
- package/lib/components/dropdown/lunatic-dropdown.js +75 -0
- package/lib/components/filter-description/component.js +22 -0
- package/lib/components/filter-description/component.spec.js +23 -0
- package/lib/components/filter-description/index.js +13 -0
- package/lib/components/index.js +28 -0
- package/lib/components/index.scss +136 -0
- package/lib/components/input/html/input.js +79 -0
- package/lib/components/input/html/input.scss +42 -0
- package/lib/components/input/index.js +13 -0
- package/lib/components/input/lunatic-input.js +57 -0
- package/lib/components/input-number/html/__snapshots__/inpute-number.spec.jsx.snap +92 -0
- package/lib/components/input-number/html/input-number-default.js +78 -0
- package/lib/components/input-number/html/input-number-thousand.js +54 -0
- package/lib/components/input-number/html/input-number.js +102 -0
- package/lib/components/input-number/html/input-number.scss +11 -0
- package/lib/components/input-number/html/inpute-number.spec.js +110 -0
- package/lib/components/input-number/index.js +13 -0
- package/lib/components/input-number/lunatic-input-number.js +64 -0
- package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +12 -0
- package/lib/components/loop/block-for-loop/block-for-loop.js +140 -0
- package/lib/components/loop/block-for-loop/index.js +13 -0
- package/lib/components/loop/block-for-loop/row.js +66 -0
- package/lib/components/loop/commons/get-init-length.js +16 -0
- package/lib/components/loop/commons/handle-row-button.js +22 -0
- package/lib/components/loop/commons/index.js +20 -0
- package/lib/components/loop/commons/row-component.js +70 -0
- package/lib/components/loop/index.js +13 -0
- package/lib/components/loop/loop.js +82 -0
- package/lib/components/loop/roster-for-loop/body.js +56 -0
- package/lib/components/loop/roster-for-loop/header.js +34 -0
- package/lib/components/loop/roster-for-loop/index.js +13 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +12 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +124 -0
- package/lib/components/loop/roster-for-loop/roster-table.js +48 -0
- package/lib/components/loop/roster-for-loop/roster.scss +42 -0
- package/lib/components/loop/roster-for-loop/row.js +73 -0
- package/lib/components/modal-controls/close-or-skip.js +41 -0
- package/lib/components/modal-controls/close-or-skip.spec.js +52 -0
- package/lib/components/modal-controls/index.js +13 -0
- package/lib/components/modal-controls/modal-container.js +22 -0
- package/lib/components/modal-controls/modal-container.spec.js +24 -0
- package/lib/components/modal-controls/modal-controls.js +78 -0
- package/lib/components/modal-controls/modal-controls.scss +48 -0
- package/lib/components/modal-controls/modal-controls.spec.js +77 -0
- package/lib/components/pairwise-links/index.js +13 -0
- package/lib/components/pairwise-links/orchestrator.js +70 -0
- package/lib/components/pairwise-links/pairwise-links.js +65 -0
- package/lib/components/pairwise-links/row.js +78 -0
- package/lib/components/radio/html/dist/radio-group.css +12 -0
- package/lib/components/radio/html/radio-group-content.js +45 -0
- package/lib/components/radio/html/radio-group-content.spec.js +86 -0
- package/lib/components/radio/html/radio-group.js +67 -0
- package/lib/components/radio/html/radio-group.scss +21 -0
- package/lib/components/radio/html/radio-option.js +105 -0
- package/lib/components/radio/html/radio-option.spec.js +80 -0
- package/lib/components/radio/index.js +13 -0
- package/lib/components/radio/lunatic-radio-group.js +64 -0
- package/lib/components/radio/radio-group.js +48 -0
- package/lib/components/radio/radio.scss +19 -0
- package/lib/components/roundabout/components/roundabout-container.js +20 -0
- package/lib/components/roundabout/components/roundabout-container.spec.js +23 -0
- package/lib/components/roundabout/components/roundabout-it-button.js +80 -0
- package/lib/components/roundabout/components/roundabout-it-button.spec.js +102 -0
- package/lib/components/roundabout/components/roundabout-it-container.js +19 -0
- package/lib/components/roundabout/components/roundabout-it-container.spec.js +23 -0
- package/lib/components/roundabout/components/roundabout-it-title.js +19 -0
- package/lib/components/roundabout/components/roundabout-it-title.spec.js +18 -0
- package/lib/components/roundabout/components/roundabout-label.js +19 -0
- package/lib/components/roundabout/components/roundabout-label.spec.js +18 -0
- package/lib/components/roundabout/components/roundabout-pending.js +18 -0
- package/lib/components/roundabout/components/roundabout-pending.spec.js +15 -0
- package/lib/components/roundabout/components/roundabout.scss +16 -0
- package/lib/components/roundabout/index.js +13 -0
- package/lib/components/roundabout/lunatic-roundabout.js +62 -0
- package/lib/components/roundabout/redirect.js +23 -0
- package/lib/components/roundabout/redirect.spec.js +19 -0
- package/lib/components/roundabout/roundabout.js +89 -0
- package/lib/components/roundabout/roundabout.spec.js +71 -0
- package/lib/components/sequence/index.js +13 -0
- package/lib/components/sequence/sequence.js +37 -0
- package/lib/components/sequence/sequence.scss +10 -0
- package/lib/components/sequence/sequence.spec.js +79 -0
- package/lib/components/subsequence/index.js +13 -0
- package/lib/components/subsequence/subsequence.js +35 -0
- package/lib/components/subsequence/subsequence.spec.js +79 -0
- package/lib/components/suggester/find-best-label/find-best-label.js +55 -0
- package/lib/components/suggester/find-best-label/index.js +13 -0
- package/lib/components/suggester/html/alert-icon.svg +2 -0
- package/lib/components/suggester/html/default-style.scss +175 -0
- package/lib/components/suggester/html/notification.js +31 -0
- package/lib/components/suggester/html/suggester.js +142 -0
- package/lib/components/suggester/html/wait-icon.svg +17 -0
- package/lib/components/suggester/html/warn-icon.svg +1 -0
- package/lib/components/suggester/idb-suggester/check-store.js +107 -0
- package/lib/components/suggester/idb-suggester/dist/index.dev.js +12 -0
- package/lib/components/suggester/idb-suggester/idb-suggester.js +90 -0
- package/lib/components/suggester/idb-suggester/index.js +12 -0
- package/lib/components/suggester/idb-suggester/suggester-notification.js +61 -0
- package/lib/components/suggester/idb-suggester/suggester-status.js +52 -0
- package/lib/components/suggester/index.js +13 -0
- package/lib/components/suggester/lunatic-suggester.js +106 -0
- package/lib/components/suggester/searching/create-searching.js +73 -0
- package/lib/components/suggester/searching/index.js +13 -0
- package/lib/components/suggester-loader-widget/index.js +13 -0
- package/lib/components/suggester-loader-widget/loader-row.js +129 -0
- package/lib/components/suggester-loader-widget/loader.js +136 -0
- package/lib/components/suggester-loader-widget/progress.js +41 -0
- package/lib/components/suggester-loader-widget/tools/action-tool.js +30 -0
- package/lib/components/suggester-loader-widget/tools/index.js +20 -0
- package/lib/components/suggester-loader-widget/tools/tools.js +18 -0
- package/lib/components/suggester-loader-widget/widget-container.js +44 -0
- package/lib/components/suggester-loader-widget/widget.js +145 -0
- package/lib/components/suggester-loader-widget/widget.scss +176 -0
- package/lib/components/switch/html/switch.js +95 -0
- package/lib/components/switch/html/switch.scss +47 -0
- package/lib/components/switch/index.js +13 -0
- package/lib/components/switch/lunatic-switch.js +66 -0
- package/lib/components/table/cell.js +102 -0
- package/lib/components/table/header.js +40 -0
- package/lib/components/table/index.js +13 -0
- package/lib/components/table/lunatic-table.js +97 -0
- package/lib/components/table/row.js +43 -0
- package/lib/components/table/table-orchestrator.js +48 -0
- package/lib/components/textarea/html/textarea.js +54 -0
- package/lib/components/textarea/html/textarea.scss +8 -0
- package/lib/components/textarea/index.js +13 -0
- package/lib/components/textarea/lunatic-textarea.js +72 -0
- package/lib/components/type.js +5 -0
- package/lib/constants/component-types.js +8 -0
- package/lib/constants/declarations.js +28 -0
- package/lib/constants/event-types.js +29 -0
- package/lib/constants/index.js +60 -0
- package/lib/constants/supported-preferences.js +13 -0
- package/lib/constants/value-types.js +16 -0
- package/lib/constants/variable-types.js +12 -0
- package/lib/dist/index.dev.js +31 -0
- package/lib/i18n/build-dictionary.js +59 -0
- package/lib/i18n/dictionary.js +34 -0
- package/lib/i18n/index.js +28 -0
- package/lib/i18n/inputNumberProps.js +20 -0
- package/lib/index.js +28 -33
- package/lib/insee.d.js +1 -0
- package/lib/src/components/commons/components/md-label/index.d.ts +1 -0
- package/lib/src/components/commons/components/md-label/link.d.ts +7 -0
- package/lib/src/components/commons/components/md-label/md-label.d.ts +8 -0
- package/lib/src/components/type.d.ts +195 -0
- package/lib/src/constants/component-types.d.ts +1 -0
- package/lib/src/constants/declarations.d.ts +9 -0
- package/lib/src/constants/event-types.d.ts +10 -0
- package/lib/src/constants/index.d.ts +5 -0
- package/lib/src/constants/supported-preferences.d.ts +1 -0
- package/lib/src/constants/value-types.d.ts +5 -0
- package/lib/src/constants/variable-types.d.ts +2 -0
- package/lib/src/i18n/build-dictionary.d.ts +24 -0
- package/lib/src/i18n/dictionary.d.ts +37 -0
- package/lib/src/i18n/index.d.ts +7 -0
- package/lib/src/i18n/inputNumberProps.d.ts +13 -0
- package/lib/src/index.d.ts +3 -0
- package/lib/src/type.utils.d.ts +1 -0
- package/lib/src/use-lunatic/actions.d.ts +289 -0
- package/lib/src/use-lunatic/commons/calculated-variables.d.ts +8 -0
- package/lib/src/use-lunatic/commons/check-loops.d.ts +3 -0
- package/lib/src/use-lunatic/commons/check-pager.d.ts +5 -0
- package/lib/src/use-lunatic/commons/compile-controls.d.ts +7 -0
- package/lib/src/use-lunatic/commons/compose.d.ts +3 -0
- package/lib/src/use-lunatic/commons/create-map-pages.d.ts +7 -0
- package/lib/src/use-lunatic/commons/execute-condition-filter.d.ts +3 -0
- package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +9 -0
- package/lib/src/use-lunatic/commons/execute-expression/create-memoizer.d.ts +8 -0
- package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +24 -0
- package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +11 -0
- package/lib/src/use-lunatic/commons/execute-expression/execute-expression.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.d.ts +7 -0
- package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +6 -0
- package/lib/src/use-lunatic/commons/execute-expression/index.d.ts +1 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +9 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +6 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +12 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +699 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-management.d.ts +6 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +11 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-pagination.d.ts +9 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +571 -0
- package/lib/src/use-lunatic/commons/fill-components/index.d.ts +1 -0
- package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +6 -0
- package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +6 -0
- package/lib/src/use-lunatic/commons/get-component-value/index.d.ts +1 -0
- package/lib/src/use-lunatic/commons/get-components-from-state.d.ts +7 -0
- package/lib/src/use-lunatic/commons/get-data.d.ts +26 -0
- package/lib/src/use-lunatic/commons/get-errors-without-empty-value.d.ts +6 -0
- package/lib/src/use-lunatic/commons/getOverview.d.ts +19 -0
- package/lib/src/use-lunatic/commons/index.d.ts +13 -0
- package/lib/src/use-lunatic/commons/is-First-last-page.d.ts +6 -0
- package/lib/src/use-lunatic/commons/is-paginated-loop.d.ts +6 -0
- package/lib/src/use-lunatic/commons/is-roundabout.d.ts +2 -0
- package/lib/src/use-lunatic/commons/page-tag.d.ts +12 -0
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +4 -0
- package/lib/src/use-lunatic/hooks/use-loop-variables.d.ts +5 -0
- package/lib/src/use-lunatic/index.d.ts +1 -0
- package/lib/src/use-lunatic/initial-state.d.ts +3 -0
- package/lib/src/use-lunatic/lunatic-context.d.ts +31 -0
- package/lib/src/use-lunatic/reducer/commons/index.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/commons/is-empty-on-empty-page.d.ts +3 -0
- package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +12 -0
- package/lib/src/use-lunatic/reducer/commons/resize-array-variable.d.ts +5 -0
- package/lib/src/use-lunatic/reducer/commons/validate-condition-filter.d.ts +6 -0
- package/lib/src/use-lunatic/reducer/index.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/overview/overview-on-change.d.ts +2 -0
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +99 -0
- package/lib/src/use-lunatic/reducer/reduce-go-next-page.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-go-previous-page.d.ts +3 -0
- package/lib/src/use-lunatic/reducer/reduce-go-to-page.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/index.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +7 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +15 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +7 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +14 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +9 -0
- package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +15 -0
- package/lib/src/use-lunatic/reducer/reduce-on-set-waiting.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-roundabout.d.ts +99 -0
- package/lib/src/use-lunatic/reducer/reduce-update-state.d.ts +3 -0
- package/lib/src/use-lunatic/reducer/reducer.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/validate-controls/validation-utils.d.ts +6 -0
- package/lib/src/use-lunatic/type-source.d.ts +281 -0
- package/lib/src/use-lunatic/type.d.ts +143 -0
- package/lib/src/use-lunatic/use-lunatic.d.ts +84 -0
- package/lib/src/use-lunatic/use-lunatic.test.d.ts +1 -0
- package/lib/src/use-lunatic/use-suggesters.d.ts +19 -0
- package/lib/src/utils/constants/features.d.ts +3 -0
- package/lib/src/utils/constants/index.d.ts +5 -0
- package/lib/src/utils/constants/links.d.ts +2 -0
- package/lib/src/utils/constants/missing.d.ts +2 -0
- package/lib/src/utils/constants/variable-status.d.ts +5 -0
- package/lib/src/utils/constants/variable-types.d.ts +1 -0
- package/lib/src/utils/idb-tools/clear-store.d.ts +2 -0
- package/lib/src/utils/idb-tools/get-idb.d.ts +2 -0
- package/lib/src/utils/idb-tools/insert-entity.d.ts +2 -0
- package/lib/src/utils/is-element.d.ts +3 -0
- package/lib/src/utils/is-object.d.ts +4 -0
- package/lib/src/utils/object.d.ts +4 -0
- package/lib/src/utils/store-tools/constantes.d.ts +21 -0
- package/lib/src/utils/store-tools/initStore.d.ts +2 -0
- package/lib/src/utils/store-tools/open-or-create-store.d.ts +2 -0
- package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +7 -0
- package/lib/src/utils/suggester-workers/create-worker-ts.d.ts +1 -0
- package/lib/src/utils/to-number.d.ts +4 -0
- package/lib/src/utils/vtl/dataset-builder.d.ts +5 -0
- package/lib/src/utils/vtl/index.d.ts +1 -0
- package/lib/stories/Introduction.stories.mdx +114 -0
- package/lib/stories/checkbox-boolean/checkboxBoolean.stories.js +34 -0
- package/lib/stories/checkbox-boolean/source.json +58 -0
- package/lib/stories/checkbox-group/checkbox-group.stories.js +34 -0
- package/lib/stories/checkbox-group/source.json +86 -0
- package/lib/stories/checkbox-one/checkboxOne.stories.js +43 -0
- package/lib/stories/checkbox-one/source.json +52 -0
- package/lib/stories/checkboxGroup/checkboxGroup.stories.js +43 -0
- package/lib/stories/checkboxGroup/source.json +403 -0
- package/lib/stories/custom-mui/checkbox-boolean-mui.js +32 -0
- package/lib/stories/custom-mui/checkbox-group-mui.js +68 -0
- package/lib/stories/custom-mui/checkbox-one-mui.js +16 -0
- package/lib/stories/custom-mui/index.js +111 -0
- package/lib/stories/custom-mui/input-mui.js +52 -0
- package/lib/stories/custom-mui/input-number-mui.js +40 -0
- package/lib/stories/custom-mui/radio-mui.js +62 -0
- package/lib/stories/custom-mui/suggester-mui/index.js +13 -0
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +304 -0
- package/lib/stories/custom-mui/switch-mui.js +47 -0
- package/lib/stories/custom-mui/table-mui.js +28 -0
- package/lib/stories/custom-mui/tbody-mui.js +23 -0
- package/lib/stories/custom-mui/td-mui.js +25 -0
- package/lib/stories/custom-mui/textarea-mui.js +43 -0
- package/lib/stories/custom-mui/th-mui.js +24 -0
- package/lib/stories/custom-mui/thead-mui.js +23 -0
- package/lib/stories/custom-mui/tr-mui.js +33 -0
- package/lib/stories/date-picker/data.json +3 -0
- package/lib/stories/date-picker/datepicker.stories.js +38 -0
- package/lib/stories/date-picker/source.json +110 -0
- package/lib/stories/declaration/data.json +1 -0
- package/lib/stories/declaration/input.stories.js +36 -0
- package/lib/stories/declaration/source.json +74 -0
- package/lib/stories/dropdown/data.json +16 -0
- package/lib/stories/dropdown/dropdown.stories.js +39 -0
- package/lib/stories/dropdown/source.json +158 -0
- package/lib/stories/filter-description/filter-description.stories.js +50 -0
- package/lib/stories/filter-description/source-options.json +81 -0
- package/lib/stories/filter-description/source.json +11 -0
- package/lib/stories/input/data.json +1 -0
- package/lib/stories/input/input.stories.js +36 -0
- package/lib/stories/input/source.json +91 -0
- package/lib/stories/input-number/input-number.stories.js +56 -0
- package/lib/stories/input-number/source-euros.json +37 -0
- package/lib/stories/input-number/source-thansand.json +34 -0
- package/lib/stories/input-number/source.json +33 -0
- package/lib/stories/loop/block-for-loop.stories.js +41 -0
- package/lib/stories/loop/roster-for-loop.stories.js +34 -0
- package/lib/stories/loop/source-bloc.json +114 -0
- package/lib/stories/loop/source-roster.json +114 -0
- package/lib/stories/loop/source-with-header.json +127 -0
- package/lib/stories/overview/data.json +1 -0
- package/lib/stories/overview/overview.stories.js +37 -0
- package/lib/stories/overview/source.json +28 -0
- package/lib/stories/overview/sourceWithHierarchy.json +6290 -0
- package/lib/stories/pairwise/data.json +12 -0
- package/lib/stories/pairwise/links.json +270 -0
- package/lib/stories/pairwise/pairwise-links.stories.js +137 -0
- package/lib/stories/paste-questionnaire/source.json +6290 -0
- package/lib/stories/paste-questionnaire/test.stories.js +84 -0
- package/lib/stories/questionnaires/logement/data.json +2686 -0
- package/lib/stories/questionnaires/logement/logement.stories.js +76 -0
- package/lib/stories/questionnaires/logement/source-sequence.json +34181 -0
- package/lib/stories/questionnaires/logement/source-sum.json +34612 -0
- package/lib/stories/questionnaires/logement/source.json +34191 -0
- package/lib/stories/questionnaires/recensement/data.json +12 -0
- package/lib/stories/questionnaires/recensement/recensement.stories.js +52 -0
- package/lib/stories/questionnaires/recensement/source.json +15190 -0
- package/lib/stories/questionnaires/rp/data.json +5 -0
- package/lib/stories/questionnaires/rp/rp.stories.js +37 -0
- package/lib/stories/questionnaires/rp/source.json +262 -0
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +553 -0
- package/lib/stories/questionnaires/simpsons/source.json +6296 -0
- package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +848 -0
- package/lib/stories/questionnaires-test/V2_MinMaxSum_Boucles.json +509 -0
- package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4091 -0
- package/lib/stories/questionnaires-test/V2_TCMRallyeGames.json +2892 -0
- package/lib/stories/questionnaires-test/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +666 -0
- package/lib/stories/questionnaires-test/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +1966 -0
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees2_PasPageFin.json +709 -0
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +533 -0
- package/lib/stories/questionnaires-test/controls/boucles-n.json +202 -0
- package/lib/stories/questionnaires-test/controls/controls.stories.js +97 -0
- package/lib/stories/questionnaires-test/test-dylan.json +558 -0
- package/lib/stories/questionnaires-test/test.stories.js +93 -0
- package/lib/stories/radio/radio.stories.js +43 -0
- package/lib/stories/radio/source.json +51 -0
- package/lib/stories/roundabout/data.json +25 -0
- package/lib/stories/roundabout/roundabout.stories.js +36 -0
- package/lib/stories/roundabout/source.json +273 -0
- package/lib/stories/suggester/simple.json +146 -0
- package/lib/stories/suggester/source.json +254 -0
- package/lib/stories/suggester/suggester-workers.stories.js +208 -0
- package/lib/stories/suggester/suggester.stories.js +84 -0
- package/lib/stories/switch/README.md +31 -0
- package/lib/stories/switch/data-forced.json +48 -0
- package/lib/stories/switch/source.json +80 -0
- package/lib/stories/switch/switch.stories.js +39 -0
- package/lib/stories/table/data-roster.json +1 -0
- package/lib/stories/table/data.json +1 -0
- package/lib/stories/table/source-roster.json +513 -0
- package/lib/stories/table/source.json +31 -0
- package/lib/stories/table/table-dynamique.json +67 -0
- package/lib/stories/table/table.stories.js +63 -0
- package/lib/stories/textarea/data.json +1 -0
- package/lib/stories/textarea/source.json +51 -0
- package/lib/stories/textarea/textarea.stories.js +36 -0
- package/lib/stories/utils/custom-lunatic.scss +28 -0
- package/lib/stories/utils/default-arg-types.js +22 -0
- package/lib/stories/utils/options.js +32 -0
- package/lib/stories/utils/orchestrator.js +263 -0
- package/lib/stories/utils/orchestrator.scss +5 -0
- package/lib/stories/utils/overview.js +54 -0
- package/lib/stories/utils/overview.scss +30 -0
- package/lib/stories/utils/waiting/index.js +13 -0
- package/lib/stories/utils/waiting/preloader.svg +1 -0
- package/lib/stories/utils/waiting/waiting.js +33 -0
- package/lib/stories/utils/waiting/waiting.scss +21 -0
- package/lib/tests/utils/lunatic.d.ts +11 -0
- package/lib/type.utils.js +5 -0
- package/lib/use-lunatic/actions.js +60 -0
- package/lib/use-lunatic/commons/calculated-variables.js +104 -0
- package/lib/use-lunatic/commons/check-loops.js +99 -0
- package/lib/use-lunatic/commons/check-pager.js +24 -0
- package/lib/use-lunatic/commons/compile-controls.js +72 -0
- package/lib/use-lunatic/commons/compose.js +20 -0
- package/lib/use-lunatic/commons/create-map-pages.js +81 -0
- package/lib/use-lunatic/commons/execute-condition-filter.js +27 -0
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +268 -0
- package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +63 -0
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +148 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +91 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.spec.js +38 -0
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +40 -0
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.spec.js +31 -0
- package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +35 -0
- package/lib/use-lunatic/commons/execute-expression/index.js +13 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +111 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +42 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +22 -0
- package/lib/use-lunatic/commons/fill-components/fill-components.js +45 -0
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +30 -0
- package/lib/use-lunatic/commons/fill-components/fill-management.js +23 -0
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +35 -0
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +24 -0
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +46 -0
- package/lib/use-lunatic/commons/fill-components/index.js +13 -0
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +28 -0
- package/lib/use-lunatic/commons/get-component-value/get-component-value.js +176 -0
- package/lib/use-lunatic/commons/get-component-value/index.js +13 -0
- package/lib/use-lunatic/commons/get-components-from-state.js +47 -0
- package/lib/use-lunatic/commons/get-data.js +80 -0
- package/lib/use-lunatic/commons/get-errors-without-empty-value.js +25 -0
- package/lib/use-lunatic/commons/getOverview.js +40 -0
- package/lib/use-lunatic/commons/index.js +109 -0
- package/lib/use-lunatic/commons/is-First-last-page.js +18 -0
- package/lib/use-lunatic/commons/is-paginated-loop.js +11 -0
- package/lib/use-lunatic/commons/is-roundabout.js +10 -0
- package/lib/use-lunatic/commons/load-suggesters.js +158 -0
- package/lib/use-lunatic/commons/page-tag.js +72 -0
- package/lib/use-lunatic/commons/use-components-from-state.js +41 -0
- package/lib/use-lunatic/hooks/use-loop-variables.js +26 -0
- package/lib/use-lunatic/index.js +13 -0
- package/lib/use-lunatic/initial-state.js +49 -0
- package/lib/use-lunatic/lunatic-context.js +83 -0
- package/lib/use-lunatic/reducer/commons/index.js +44 -0
- package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +32 -0
- package/lib/use-lunatic/reducer/commons/is-loop-component.js +10 -0
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js +32 -0
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +29 -0
- package/lib/use-lunatic/reducer/index.js +13 -0
- package/lib/use-lunatic/reducer/overview/overview-on-change.js +49 -0
- package/lib/use-lunatic/reducer/overview/overview-on-init.js +104 -0
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +181 -0
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +146 -0
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +79 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +926 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/index.js +13 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +72 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.js +46 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +115 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +89 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +88 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +113 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +44 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +28 -0
- package/lib/use-lunatic/reducer/reduce-on-init.js +238 -0
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +21 -0
- package/lib/use-lunatic/reducer/reduce-roundabout.js +29 -0
- package/lib/use-lunatic/reducer/reduce-update-state.js +22 -0
- package/lib/use-lunatic/reducer/reducer.js +37 -0
- package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +62 -0
- package/lib/use-lunatic/type-source.js +24 -0
- package/lib/use-lunatic/type.js +5 -0
- package/lib/use-lunatic/use-lunatic.js +189 -0
- package/lib/use-lunatic/use-lunatic.test.js +168 -0
- package/lib/use-lunatic/use-suggesters.js +158 -0
- package/lib/utils/constants/alphabet.js +8 -0
- package/lib/utils/constants/features.js +12 -0
- package/lib/utils/constants/index.js +60 -0
- package/lib/utils/constants/links.js +10 -0
- package/lib/utils/constants/missing.js +10 -0
- package/lib/utils/constants/variable-status.js +16 -0
- package/lib/utils/constants/variable-types.js +8 -0
- package/lib/utils/idb-tools/clear-store.js +40 -0
- package/lib/utils/idb-tools/create-db-opener.js +47 -0
- package/lib/utils/idb-tools/create-open-db.js +29 -0
- package/lib/utils/idb-tools/get-entity.js +21 -0
- package/lib/utils/idb-tools/get-idb.js +13 -0
- package/lib/utils/idb-tools/idb-bulk-insert.js +134 -0
- package/lib/utils/idb-tools/index.js +64 -0
- package/lib/utils/idb-tools/insert-entity.js +21 -0
- package/lib/utils/idb-tools/open-db.js +24 -0
- package/lib/utils/idb-tools/open-or-create-db.js +42 -0
- package/lib/utils/is-element.js +10 -0
- package/lib/utils/is-object.js +13 -0
- package/lib/utils/object.js +31 -0
- package/lib/utils/store-tools/auto-load.js +162 -0
- package/lib/utils/store-tools/clear-store-data.js +33 -0
- package/lib/utils/store-tools/clear-store-info.js +33 -0
- package/lib/utils/store-tools/constantes.js +31 -0
- package/lib/utils/store-tools/create/create.js +51 -0
- package/lib/utils/store-tools/create/index.js +20 -0
- package/lib/utils/store-tools/create/update-store-info.js +27 -0
- package/lib/utils/store-tools/get-store-count.js +24 -0
- package/lib/utils/store-tools/index.js +54 -0
- package/lib/utils/store-tools/initStore.js +56 -0
- package/lib/utils/store-tools/open-or-create-store.js +52 -0
- package/lib/utils/store-tools/use-store-index.js +58 -0
- package/lib/utils/suggester-workers/append-to-index/append.js +78 -0
- package/lib/utils/suggester-workers/append-to-index/append.worker.js +33 -0
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +66 -0
- package/lib/utils/suggester-workers/append-to-index/dist/append.worker.dev.js +37 -0
- package/lib/utils/suggester-workers/append-to-index/dist/create-append-task.js +69 -0
- package/lib/utils/suggester-workers/append-to-index/dist/index.dev.js +24 -0
- package/lib/utils/suggester-workers/append-to-index/index.js +20 -0
- package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +88 -0
- package/lib/utils/suggester-workers/append-to-index/store-messages.js +45 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +54 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +77 -0
- package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +36 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +21 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +36 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +15 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +19 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +17 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +25 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +24 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +15 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +24 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +17 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +53 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +15 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +16 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +15 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +20 -0
- package/lib/utils/suggester-workers/commons-tokenizer/filters/stop-words.js +9 -0
- package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +14 -0
- package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +23 -0
- package/lib/utils/suggester-workers/commons-tokenizer/index.js +69 -0
- package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +18 -0
- package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +12 -0
- package/lib/utils/suggester-workers/create-worker-ts.js +54 -0
- package/lib/utils/suggester-workers/create-worker.js +54 -0
- package/lib/utils/suggester-workers/find-best-label/find-best-label.js +63 -0
- package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +53 -0
- package/lib/utils/suggester-workers/find-best-label/index.js +1 -0
- package/lib/utils/suggester-workers/find-best-label/tokenize.js +45 -0
- package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +25 -0
- package/lib/utils/suggester-workers/searching/compute-score.js +36 -0
- package/lib/utils/suggester-workers/searching/get-db.js +48 -0
- package/lib/utils/suggester-workers/searching/index.js +13 -0
- package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +28 -0
- package/lib/utils/suggester-workers/searching/order/index.js +25 -0
- package/lib/utils/suggester-workers/searching/query-parser/index.js +20 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +12 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +27 -0
- package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +35 -0
- package/lib/utils/suggester-workers/searching/resolve-query-parser.js +57 -0
- package/lib/utils/suggester-workers/searching/search-in-index.js +22 -0
- package/lib/utils/suggester-workers/searching/searching.js +141 -0
- package/lib/utils/suggester-workers/searching/searching.worker.js +20 -0
- package/lib/utils/to-number.js +18 -0
- package/lib/utils/vtl/dataset-builder.js +27 -0
- package/lib/utils/vtl/index.js +13 -0
- package/package.json +164 -143
- package/lib/index.js.map +0 -1
- package/src/components/breadcrumb/breadcrumb.scss +0 -20
- package/src/components/breadcrumb/component.js +0 -29
- package/src/components/breadcrumb/index.js +0 -1
- package/src/components/button/button.scss +0 -24
- package/src/components/button/component.js +0 -25
- package/src/components/button/index.js +0 -1
- package/src/components/checkbox/boolean.js +0 -152
- package/src/components/checkbox/checkbox.scss +0 -71
- package/src/components/checkbox/group.js +0 -187
- package/src/components/checkbox/index.js +0 -3
- package/src/components/checkbox/one.js +0 -10
- package/src/components/components.js +0 -17
- package/src/components/datepicker/component.js +0 -10
- package/src/components/datepicker/datepicker.scss +0 -1
- package/src/components/datepicker/index.js +0 -1
- package/src/components/declarations/component.js +0 -38
- package/src/components/declarations/declarations.scss +0 -38
- package/src/components/declarations/index.js +0 -1
- package/src/components/declarations/wrappers/index.js +0 -3
- package/src/components/declarations/wrappers/input-declarations-wrapper.js +0 -229
- package/src/components/declarations/wrappers/list-declarations-wrapper.js +0 -203
- package/src/components/declarations/wrappers/simple-declarations-wrapper.js +0 -54
- package/src/components/dropdown/commons/actions.js +0 -56
- package/src/components/dropdown/commons/children-to-option.js +0 -9
- package/src/components/dropdown/commons/cleaner-callbacks.js +0 -58
- package/src/components/dropdown/commons/components/closed.icon.js +0 -24
- package/src/components/dropdown/commons/components/dropdown-container.js +0 -29
- package/src/components/dropdown/commons/components/dropdown-field.js +0 -46
- package/src/components/dropdown/commons/components/dropdown.js +0 -183
- package/src/components/dropdown/commons/components/label.js +0 -28
- package/src/components/dropdown/commons/components/opened.icon.js +0 -24
- package/src/components/dropdown/commons/components/panel.js +0 -78
- package/src/components/dropdown/commons/event-callbacks/index.js +0 -5
- package/src/components/dropdown/commons/event-callbacks/on-keydown-callback.js +0 -29
- package/src/components/dropdown/commons/event-callbacks/on-mousedown-callback.js +0 -11
- package/src/components/dropdown/commons/reducer.js +0 -149
- package/src/components/dropdown/commons/tools/index.js +0 -17
- package/src/components/dropdown/component.js +0 -125
- package/src/components/dropdown/dropdown-edit/cross.icon.js +0 -20
- package/src/components/dropdown/dropdown-edit/dropdown-edit.js +0 -190
- package/src/components/dropdown/dropdown-edit/icone.js +0 -33
- package/src/components/dropdown/dropdown-edit/index.js +0 -11
- package/src/components/dropdown/dropdown-edit/option.js +0 -62
- package/src/components/dropdown/dropdown-edit/prefix-tools.js +0 -51
- package/src/components/dropdown/dropdown-simple/dropdown.js +0 -155
- package/src/components/dropdown/dropdown-simple/index.js +0 -20
- package/src/components/dropdown/dropdown-simple/option.js +0 -15
- package/src/components/dropdown/dropdown.scss +0 -175
- package/src/components/dropdown/index.js +0 -1
- package/src/components/filter-description/component.js +0 -41
- package/src/components/filter-description/index.js +0 -1
- package/src/components/icon/assets/checkbox-checked.js +0 -16
- package/src/components/icon/assets/checkbox-unchecked.js +0 -16
- package/src/components/icon/assets/index.js +0 -4
- package/src/components/icon/assets/radio-checked.js +0 -16
- package/src/components/icon/assets/radio-unchecked.js +0 -16
- package/src/components/icon/component.js +0 -33
- package/src/components/icon/icon.scss +0 -13
- package/src/components/icon/index.js +0 -1
- package/src/components/index.js +0 -4
- package/src/components/index.scss +0 -141
- package/src/components/input/index.js +0 -2
- package/src/components/input/input-number.js +0 -44
- package/src/components/input/input.js +0 -10
- package/src/components/input/input.scss +0 -35
- package/src/components/loop/component.js +0 -105
- package/src/components/loop/index.js +0 -1
- package/src/components/loop/loop.scss +0 -11
- package/src/components/loop/paginated-component.js +0 -205
- package/src/components/loop/wrapper.js +0 -15
- package/src/components/loop-constructor/block/block.scss +0 -8
- package/src/components/loop-constructor/block/component.js +0 -8
- package/src/components/loop-constructor/block/index.js +0 -1
- package/src/components/loop-constructor/index.js +0 -1
- package/src/components/loop-constructor/roster/component.js +0 -7
- package/src/components/loop-constructor/roster/index.js +0 -1
- package/src/components/loop-constructor/wrapper/body-component.js +0 -118
- package/src/components/loop-constructor/wrapper/build-components.js +0 -33
- package/src/components/loop-constructor/wrapper/component.js +0 -154
- package/src/components/loop-constructor/wrapper/index.js +0 -1
- package/src/components/progress-bar/component.js +0 -28
- package/src/components/progress-bar/index.js +0 -1
- package/src/components/progress-bar/progress-bar.scss +0 -52
- package/src/components/radio/component.js +0 -8
- package/src/components/radio/index.js +0 -1
- package/src/components/radio/radio.scss +0 -57
- package/src/components/sequence/component.js +0 -41
- package/src/components/sequence/index.js +0 -1
- package/src/components/sequence/sequence.scss +0 -8
- package/src/components/subsequence/component.js +0 -47
- package/src/components/subsequence/index.js +0 -1
- package/src/components/suggester/component.js +0 -103
- package/src/components/suggester/index.js +0 -1
- package/src/components/table/index.js +0 -1
- package/src/components/table/table.js +0 -162
- package/src/components/table/table.scss +0 -24
- package/src/components/textarea/component.js +0 -10
- package/src/components/textarea/index.js +0 -1
- package/src/components/textarea/textarea.scss +0 -6
- package/src/components/tooltip/img/index.js +0 -4
- package/src/components/tooltip/index.js +0 -1
- package/src/components/tooltip/response.js +0 -52
- package/src/components/tooltip/tooltip.scss +0 -27
- package/src/constants/component-types.js +0 -1
- package/src/constants/declarations.js +0 -14
- package/src/constants/index.js +0 -4
- package/src/constants/supported-preferences.js +0 -10
- package/src/constants/value-types.js +0 -5
- package/src/constants/variable-types.js +0 -4
- package/src/stories/breadcrumb/README.md +0 -14
- package/src/stories/breadcrumb/breadcrumb.stories.js +0 -19
- package/src/stories/button/README.md +0 -14
- package/src/stories/button/button.stories.js +0 -27
- package/src/stories/checkbox-boolean/README.md +0 -27
- package/src/stories/checkbox-boolean/checkbox-boolean.stories.js +0 -30
- package/src/stories/checkbox-boolean/data.json +0 -48
- package/src/stories/checkbox-group/README.md +0 -29
- package/src/stories/checkbox-group/checkbox-group.stories.js +0 -35
- package/src/stories/checkbox-group/data-vtl.json +0 -89
- package/src/stories/checkbox-group/data.json +0 -89
- package/src/stories/checkbox-one/README.md +0 -31
- package/src/stories/checkbox-one/checkbox-one.stories.js +0 -32
- package/src/stories/checkbox-one/data-vtl.json +0 -33
- package/src/stories/checkbox-one/data.json +0 -33
- package/src/stories/datepicker/README.md +0 -31
- package/src/stories/datepicker/data.json +0 -28
- package/src/stories/datepicker/datepicker.stories.js +0 -36
- package/src/stories/declarations/README.md +0 -19
- package/src/stories/declarations/declarations.stories.js +0 -112
- package/src/stories/dropdown/README.md +0 -44
- package/src/stories/dropdown/data-naf.json +0 -6963
- package/src/stories/dropdown/data-props.json +0 -81
- package/src/stories/dropdown/data.json +0 -78
- package/src/stories/dropdown/dropdown.stories.js +0 -65
- package/src/stories/filter-description/README.md +0 -15
- package/src/stories/filter-description/filter-description.stories.js +0 -53
- package/src/stories/input/README.md +0 -33
- package/src/stories/input/data.json +0 -28
- package/src/stories/input/input.stories.js +0 -44
- package/src/stories/input-number/README.md +0 -37
- package/src/stories/input-number/data.json +0 -30
- package/src/stories/input-number/input-number.stories.js +0 -53
- package/src/stories/loop/README.md +0 -25
- package/src/stories/loop/loop.stories.js +0 -80
- package/src/stories/loop/with-loop/data-loop-deeper.json +0 -298
- package/src/stories/loop/with-loop/data-loop.json +0 -211
- package/src/stories/loop/with-loop/data-vqs.json +0 -1384
- package/src/stories/loop/with-loop/index.js +0 -3
- package/src/stories/loop/with-roster/data-loop-deeper.json +0 -298
- package/src/stories/loop/with-roster/data-loop.json +0 -213
- package/src/stories/loop/with-roster/data-vqs.json +0 -1383
- package/src/stories/loop/with-roster/index.js +0 -3
- package/src/stories/loop-constructor/README.md +0 -27
- package/src/stories/loop-constructor/data-input.json +0 -64
- package/src/stories/loop-constructor/data-loop.json +0 -66
- package/src/stories/loop-constructor/data-roster.json +0 -68
- package/src/stories/loop-constructor/loop-constructor.stories.js +0 -59
- package/src/stories/pagination/deeper-loop.json +0 -327
- package/src/stories/pagination/pagination.stories.js +0 -57
- package/src/stories/pagination/simple-loop.json +0 -277
- package/src/stories/pagination/simpsons-question.json +0 -4262
- package/src/stories/pagination/simpsons-sequence.json +0 -4362
- package/src/stories/progress-bar/README.md +0 -13
- package/src/stories/progress-bar/progress-bar.stories.js +0 -24
- package/src/stories/questionnaire/fat.json +0 -6558
- package/src/stories/questionnaire/questionnaire.stories.js +0 -25
- package/src/stories/radio/README.md +0 -31
- package/src/stories/radio/data-vtl.json +0 -32
- package/src/stories/radio/data.json +0 -32
- package/src/stories/radio/radio.stories.js +0 -35
- package/src/stories/sequence/README.md +0 -18
- package/src/stories/sequence/sequence.stories.js +0 -28
- package/src/stories/subsequence/README.md +0 -18
- package/src/stories/subsequence/subsequence.stories.js +0 -28
- package/src/stories/suggester/README.md +0 -29
- package/src/stories/suggester/data-vtl.json +0 -28
- package/src/stories/suggester/data.json +0 -28
- package/src/stories/suggester/suggester.stories.js +0 -38
- package/src/stories/table/README.md +0 -29
- package/src/stories/table/data-default.json +0 -19
- package/src/stories/table/data-one-axis-one-measure.json +0 -124
- package/src/stories/table/data-one-axis-two-measures.json +0 -193
- package/src/stories/table/data-one-hierarchical-axis.json +0 -204
- package/src/stories/table/data-roster.json +0 -471
- package/src/stories/table/data-two-axis-one-measure.json +0 -492
- package/src/stories/table/table.stories.js +0 -77
- package/src/stories/textarea/README.md +0 -33
- package/src/stories/textarea/data-forced.json +0 -28
- package/src/stories/textarea/data.json +0 -28
- package/src/stories/textarea/textarea.stories.js +0 -67
- package/src/stories/tooltip-response/README.md +0 -14
- package/src/stories/tooltip-response/md-link.json +0 -31
- package/src/stories/tooltip-response/md-tooltip.json +0 -31
- package/src/stories/tooltip-response/tooltip.stories.js +0 -83
- package/src/stories/utils/custom-lunatic.scss +0 -23
- package/src/stories/utils/img/arrow.png +0 -0
- package/src/stories/utils/img/check_box.svg +0 -1
- package/src/stories/utils/img/check_box_outline.svg +0 -1
- package/src/stories/utils/img/lunatic-logo.png +0 -0
- package/src/stories/utils/img/menu-down.svg +0 -1
- package/src/stories/utils/img/menu-up.svg +0 -1
- package/src/stories/utils/img/radio_button_checked.svg +0 -1
- package/src/stories/utils/img/radio_button_unchecked.svg +0 -1
- package/src/stories/utils/options.js +0 -25
- package/src/stories/utils/orchestrator.js +0 -83
- package/src/tests/components/breadcrumb.spec.js +0 -13
- package/src/tests/components/button.spec.js +0 -11
- package/src/tests/components/checkbox-boolean.spec.js +0 -45
- package/src/tests/components/checkbox-group.spec.js +0 -53
- package/src/tests/components/checkbox-one.spec.js +0 -32
- package/src/tests/components/datepicker.spec.js +0 -22
- package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +0 -67
- package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +0 -52
- package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +0 -21
- package/src/tests/components/declarations.spec.js +0 -46
- package/src/tests/components/input-number.spec.js +0 -194
- package/src/tests/components/input.spec.js +0 -18
- package/src/tests/components/progress-bar.spec.js +0 -15
- package/src/tests/components/radio.spec.js +0 -27
- package/src/tests/components/sequence.spec.js +0 -9
- package/src/tests/components/subsequence.spec.js +0 -9
- package/src/tests/components/table.spec.js +0 -11
- package/src/tests/components/textarea.spec.js +0 -18
- package/src/tests/components/tooltip.spec.js +0 -25
- package/src/tests/setup/setupTests.js +0 -4
- package/src/tests/utils/lib/alphabet.spec.js +0 -36
- package/src/tests/utils/lib/checkbox/group.spec.js +0 -72
- package/src/tests/utils/lib/decorator/title-decorator.spec.js +0 -12
- package/src/tests/utils/lib/items-positioning.spec.js +0 -17
- package/src/tests/utils/lib/label-position.spec.js +0 -22
- package/src/tests/utils/lib/loops/bindings.spec.js +0 -60
- package/src/tests/utils/lib/loops/shared.spec.js +0 -78
- package/src/tests/utils/lib/pagination/shared.spec.js +0 -42
- package/src/tests/utils/lib/responses.spec.js +0 -64
- package/src/tests/utils/lib/style.spec.js +0 -26
- package/src/tests/utils/lib/table/roster.spec.js +0 -25
- package/src/tests/utils/lib/tooltip/build-response.spec.js +0 -95
- package/src/tests/utils/lib/tooltip/content.spec.js +0 -109
- package/src/tests/utils/to-expose/handler/handler.spec.js +0 -86
- package/src/tests/utils/to-expose/handler/questionnaire.json +0 -154
- package/src/tests/utils/to-expose/handler/results/index.js +0 -6
- package/src/tests/utils/to-expose/handler/results/res-double.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-input-collected.json +0 -154
- package/src/tests/utils/to-expose/handler/results/res-input-edited.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-loop.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-matrix.json +0 -157
- package/src/tests/utils/to-expose/handler/results/res-responses.json +0 -157
- package/src/tests/utils/to-expose/init-questionnaire/data.json +0 -12
- package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +0 -19
- package/src/tests/utils/to-expose/init-questionnaire/questionnaire.json +0 -129
- package/src/tests/utils/to-expose/init-questionnaire/result.json +0 -162
- package/src/tests/utils/to-expose/interpret/interpret.spec.js +0 -66
- package/src/tests/utils/to-expose/state/questionnaire.json +0 -61
- package/src/tests/utils/to-expose/state/results.js +0 -78
- package/src/tests/utils/to-expose/state/state.spec.js +0 -59
- package/src/utils/lib/alphabet.js +0 -1
- package/src/utils/lib/checkbox/group.js +0 -21
- package/src/utils/lib/checkbox/index.js +0 -1
- package/src/utils/lib/decorator/index.js +0 -1
- package/src/utils/lib/decorator/title-decorator.js +0 -16
- package/src/utils/lib/index.js +0 -13
- package/src/utils/lib/label-position.js +0 -12
- package/src/utils/lib/loops/bindings.js +0 -53
- package/src/utils/lib/loops/build-components.js +0 -33
- package/src/utils/lib/loops/index.js +0 -3
- package/src/utils/lib/loops/shared.js +0 -43
- package/src/utils/lib/memo-check.js +0 -24
- package/src/utils/lib/options-positioning.js +0 -9
- package/src/utils/lib/pagination/flow.js +0 -2
- package/src/utils/lib/pagination/index.js +0 -2
- package/src/utils/lib/pagination/navigation/index.js +0 -1
- package/src/utils/lib/pagination/navigation/shared.js +0 -107
- package/src/utils/lib/prop-types/declarations.js +0 -22
- package/src/utils/lib/prop-types/index.js +0 -5
- package/src/utils/lib/prop-types/lines.js +0 -6
- package/src/utils/lib/prop-types/options.js +0 -8
- package/src/utils/lib/prop-types/response.js +0 -6
- package/src/utils/lib/prop-types/value-type.js +0 -9
- package/src/utils/lib/responses.js +0 -9
- package/src/utils/lib/style.js +0 -10
- package/src/utils/lib/table/index.js +0 -1
- package/src/utils/lib/table/roster.js +0 -23
- package/src/utils/lib/tooltip/build-response.js +0 -41
- package/src/utils/lib/tooltip/content.js +0 -55
- package/src/utils/lib/tooltip/index.js +0 -6
- package/src/utils/to-expose/handler.js +0 -99
- package/src/utils/to-expose/hook.js +0 -153
- package/src/utils/to-expose/index.js +0 -11
- package/src/utils/to-expose/init-questionnaire.js +0 -116
- package/src/utils/to-expose/interpret/index.js +0 -1
- package/src/utils/to-expose/interpret/main.js +0 -36
- package/src/utils/to-expose/interpret/md.js +0 -42
- package/src/utils/to-expose/interpret/vtl.js +0 -43
- package/src/utils/to-expose/state.js +0 -58
- /package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/edited.png +0 -0
- /package/{src/components/tooltip → lib/components/commons/components/variable-status}/img/forced.png +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxPage": "4",
|
|
3
|
+
"suggesters": [
|
|
4
|
+
{
|
|
5
|
+
"name": "naf-rev2",
|
|
6
|
+
"fields": [
|
|
7
|
+
{
|
|
8
|
+
"name": "label",
|
|
9
|
+
"rules": ["[\\w]+"],
|
|
10
|
+
"language": "French",
|
|
11
|
+
"min": 2
|
|
12
|
+
},
|
|
13
|
+
{ "name": "id" }
|
|
14
|
+
],
|
|
15
|
+
"queryParser": {
|
|
16
|
+
"type": "tokenized",
|
|
17
|
+
"params": { "language": "French", "pattern": "[\\w.]+" }
|
|
18
|
+
},
|
|
19
|
+
"version": "1"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "naf-rev2-stop",
|
|
23
|
+
"fields": [
|
|
24
|
+
{
|
|
25
|
+
"name": "label",
|
|
26
|
+
"rules": ["[\\w]+"],
|
|
27
|
+
"language": "French",
|
|
28
|
+
"min": 2
|
|
29
|
+
},
|
|
30
|
+
{ "name": "id" }
|
|
31
|
+
],
|
|
32
|
+
"queryParser": {
|
|
33
|
+
"type": "tokenized",
|
|
34
|
+
"params": { "language": "French", "pattern": "[\\w.]+" }
|
|
35
|
+
},
|
|
36
|
+
"version": "1"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "cog-communes",
|
|
40
|
+
"fields": [
|
|
41
|
+
{ "name": "label", "rules": "soft" },
|
|
42
|
+
{ "name": "nccenr", "rules": "soft" },
|
|
43
|
+
{ "name": "id", "rules": "soft" }
|
|
44
|
+
],
|
|
45
|
+
"queryParser": { "type": "soft" },
|
|
46
|
+
"version": "1"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"components": [
|
|
50
|
+
{
|
|
51
|
+
"id": "nn",
|
|
52
|
+
"componentType": "InputNumber",
|
|
53
|
+
"mandatory": false,
|
|
54
|
+
"min": 1,
|
|
55
|
+
"max": 4,
|
|
56
|
+
"decimals": 0,
|
|
57
|
+
"label": { "value": "\"Number of inhabitants\"", "type": "VTL|MD" },
|
|
58
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
59
|
+
"response": {
|
|
60
|
+
"name": "NUM"
|
|
61
|
+
},
|
|
62
|
+
"page": "1"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "idLoop",
|
|
66
|
+
"label": { "value": "\"Boucle individu\"", "type": "VTL|MD" },
|
|
67
|
+
"componentType": "Loop",
|
|
68
|
+
"iterations": { "value": "cast(NUM, integer)", "type": "VTL" },
|
|
69
|
+
"paginatedLoop": false,
|
|
70
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
71
|
+
"loopDependencies": ["NUM"],
|
|
72
|
+
"page": "2",
|
|
73
|
+
"components": [
|
|
74
|
+
{
|
|
75
|
+
"id": "k3ym6x16",
|
|
76
|
+
"label": { "value": "\"Prénom :\"", "type": "VTL|MD" },
|
|
77
|
+
"componentType": "Input",
|
|
78
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
79
|
+
"mandatory": false,
|
|
80
|
+
"response": {
|
|
81
|
+
"name": "PRENOM"
|
|
82
|
+
},
|
|
83
|
+
"page": "2"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "idLoopInd",
|
|
89
|
+
"label": { "value": "\"Boucle individu\"", "type": "VTL|MD" },
|
|
90
|
+
"componentType": "Loop",
|
|
91
|
+
"iterations": { "value": "count(PRENOM)", "type": "VTL" },
|
|
92
|
+
"paginatedLoop": true,
|
|
93
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
94
|
+
"loopDependencies": ["PRENOM"],
|
|
95
|
+
"page": "3",
|
|
96
|
+
"maxPage": "3",
|
|
97
|
+
"components": [
|
|
98
|
+
{
|
|
99
|
+
"id": "k3ym61vfzzzzzzzzzzzz",
|
|
100
|
+
"componentType": "Sequence",
|
|
101
|
+
"label": {
|
|
102
|
+
"value": "\"Questionnaire de : \" || PRENOM",
|
|
103
|
+
"type": "VTL|MD"
|
|
104
|
+
},
|
|
105
|
+
"conditionFilter": {
|
|
106
|
+
"value": "not(isnull(PRENOM))",
|
|
107
|
+
"type": "VTL"
|
|
108
|
+
},
|
|
109
|
+
"page": "3.1"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "sugg1",
|
|
113
|
+
"componentType": "Suggester",
|
|
114
|
+
"mandatory": false,
|
|
115
|
+
"label": {
|
|
116
|
+
"value": "PRENOM || \" what's your favorite NAF code? (default stop words)\"",
|
|
117
|
+
"type": "VTL|MD"
|
|
118
|
+
},
|
|
119
|
+
"storeName": "naf-rev2",
|
|
120
|
+
"conditionFilter": {
|
|
121
|
+
"value": "not(isnull(PRENOM))",
|
|
122
|
+
"type": "VTL"
|
|
123
|
+
},
|
|
124
|
+
"response": {
|
|
125
|
+
"name": "NAF"
|
|
126
|
+
},
|
|
127
|
+
"page": "3.2"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "sugg2",
|
|
131
|
+
"componentType": "Suggester",
|
|
132
|
+
"mandatory": false,
|
|
133
|
+
"label": "PRENOM || \" what's your favorite NAF code? (without stop words)\"",
|
|
134
|
+
"storeName": "naf-rev2-stop",
|
|
135
|
+
"conditionFilter": {
|
|
136
|
+
"value": "not(isnull(PRENOM))",
|
|
137
|
+
"type": "VTL"
|
|
138
|
+
},
|
|
139
|
+
"response": {
|
|
140
|
+
"name": "NAF_STOP"
|
|
141
|
+
},
|
|
142
|
+
"page": "3.2",
|
|
143
|
+
"declarations": [
|
|
144
|
+
{
|
|
145
|
+
"id": "kb9hi4j0-krnoclfe",
|
|
146
|
+
"declarationType": "INSTRUCTION",
|
|
147
|
+
"position": "BEFORE_QUESTION_TEXT",
|
|
148
|
+
"label": {
|
|
149
|
+
"value": "\"Test declaration before\"",
|
|
150
|
+
"type": "VTL|MD"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "kb9hi4j0-krnoclfe",
|
|
155
|
+
"declarationType": "HELP",
|
|
156
|
+
"position": "AFTER_QUESTION_TEXT",
|
|
157
|
+
"label": {
|
|
158
|
+
"value": "\"Test description from declaration\"",
|
|
159
|
+
"type": "VTL|MD"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "sugg-communes",
|
|
166
|
+
"componentType": "Suggester",
|
|
167
|
+
"mandatory": false,
|
|
168
|
+
"label": {
|
|
169
|
+
"value": "PRENOM || \" what's your favorite city?\"",
|
|
170
|
+
"type": "VTL|MD"
|
|
171
|
+
},
|
|
172
|
+
"storeName": "cog-communes",
|
|
173
|
+
"conditionFilter": {
|
|
174
|
+
"value": "not(isnull(PRENOM))",
|
|
175
|
+
"type": "VTL"
|
|
176
|
+
},
|
|
177
|
+
"response": {
|
|
178
|
+
"name": "CITY"
|
|
179
|
+
},
|
|
180
|
+
"page": "3.3"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "kk",
|
|
186
|
+
"componentType": "Sequence",
|
|
187
|
+
"label": { "value": "\"END\"", "type": "VTL|MD" },
|
|
188
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
189
|
+
"page": "4"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"variables": [
|
|
193
|
+
{
|
|
194
|
+
"variableType": "COLLECTED",
|
|
195
|
+
"name": "NUM",
|
|
196
|
+
"componentRef": "nn",
|
|
197
|
+
"values": {
|
|
198
|
+
"PREVIOUS": null,
|
|
199
|
+
"COLLECTED": null,
|
|
200
|
+
"FORCED": null,
|
|
201
|
+
"EDITED": null,
|
|
202
|
+
"INPUTED": null
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"variableType": "COLLECTED",
|
|
207
|
+
"name": "PRENOM",
|
|
208
|
+
"componentRef": "idLoop",
|
|
209
|
+
"values": {
|
|
210
|
+
"PREVIOUS": [null],
|
|
211
|
+
"COLLECTED": [null],
|
|
212
|
+
"FORCED": [null],
|
|
213
|
+
"EDITED": [null],
|
|
214
|
+
"INPUTED": [null]
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"variableType": "COLLECTED",
|
|
219
|
+
"name": "NAF",
|
|
220
|
+
"componentRef": "idLoopInd",
|
|
221
|
+
"values": {
|
|
222
|
+
"PREVIOUS": [null],
|
|
223
|
+
"COLLECTED": [null],
|
|
224
|
+
"FORCED": [null],
|
|
225
|
+
"EDITED": [null],
|
|
226
|
+
"INPUTED": [null]
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"variableType": "COLLECTED",
|
|
231
|
+
"name": "NAF_STOP",
|
|
232
|
+
"componentRef": "idLoopInd",
|
|
233
|
+
"values": {
|
|
234
|
+
"PREVIOUS": [null],
|
|
235
|
+
"COLLECTED": [null],
|
|
236
|
+
"FORCED": [null],
|
|
237
|
+
"EDITED": [null],
|
|
238
|
+
"INPUTED": [null]
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"variableType": "COLLECTED",
|
|
243
|
+
"name": "CITY",
|
|
244
|
+
"componentRef": "idLoopInd",
|
|
245
|
+
"values": {
|
|
246
|
+
"PREVIOUS": [null],
|
|
247
|
+
"COLLECTED": [null],
|
|
248
|
+
"FORCED": [null],
|
|
249
|
+
"EDITED": [null],
|
|
250
|
+
"INPUTED": [null]
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.Default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
10
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
11
|
+
var _idbTools = require("../../utils/idb-tools");
|
|
12
|
+
var _storeTools = require("../../utils/store-tools");
|
|
13
|
+
var _appendToIndex = _interopRequireDefault(require("../../utils/suggester-workers/append-to-index"));
|
|
14
|
+
var _searching = _interopRequireDefault(require("../../utils/suggester-workers/searching"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
27
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
28
|
+
var stories = {
|
|
29
|
+
title: 'Components/Suggester-workers',
|
|
30
|
+
component: _orchestrator["default"],
|
|
31
|
+
argTypes: _defaultArgTypes["default"]
|
|
32
|
+
};
|
|
33
|
+
var _default = stories;
|
|
34
|
+
exports["default"] = _default;
|
|
35
|
+
function fetchNaf() {
|
|
36
|
+
return fetch('/naf-rev2.json').then(function (r) {
|
|
37
|
+
return r.json();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function fetchFake() {
|
|
41
|
+
return fetch('/fake-nomenclature.json').then(function (r) {
|
|
42
|
+
return r.json();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
var infoFake = {
|
|
46
|
+
name: 'fake',
|
|
47
|
+
fields: [{
|
|
48
|
+
name: 'tags',
|
|
49
|
+
rules: ['[\\w]+'],
|
|
50
|
+
language: 'French',
|
|
51
|
+
min: 3
|
|
52
|
+
}],
|
|
53
|
+
queryParser: {
|
|
54
|
+
type: 'tokenized',
|
|
55
|
+
params: {
|
|
56
|
+
language: 'French',
|
|
57
|
+
pattern: '[\\w.]+'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
version: '1'
|
|
61
|
+
};
|
|
62
|
+
var infoNaf = {
|
|
63
|
+
name: 'naf-rev2',
|
|
64
|
+
fields: [{
|
|
65
|
+
name: 'label',
|
|
66
|
+
rules: ['[\\w]+'],
|
|
67
|
+
language: 'French',
|
|
68
|
+
min: 3
|
|
69
|
+
}, {
|
|
70
|
+
name: 'id'
|
|
71
|
+
}],
|
|
72
|
+
queryParser: {
|
|
73
|
+
type: 'tokenized',
|
|
74
|
+
params: {
|
|
75
|
+
language: 'French',
|
|
76
|
+
pattern: '[\\w.]+'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
version: '1'
|
|
80
|
+
};
|
|
81
|
+
function loadOne(_x, _x2) {
|
|
82
|
+
return _loadOne.apply(this, arguments);
|
|
83
|
+
}
|
|
84
|
+
function _loadOne() {
|
|
85
|
+
_loadOne = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(info, fetchIt) {
|
|
86
|
+
var name, rubriques, db;
|
|
87
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
88
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
89
|
+
case 0:
|
|
90
|
+
name = info.name;
|
|
91
|
+
_context2.next = 3;
|
|
92
|
+
return fetchIt();
|
|
93
|
+
case 3:
|
|
94
|
+
rubriques = _context2.sent;
|
|
95
|
+
_context2.next = 6;
|
|
96
|
+
return (0, _idbTools.openOnCreateDb)(name);
|
|
97
|
+
case 6:
|
|
98
|
+
db = _context2.sent;
|
|
99
|
+
_context2.next = 9;
|
|
100
|
+
return (0, _idbTools.clearDb)(db, _storeTools.CONSTANTES.STORE_DATA_NAME);
|
|
101
|
+
case 9:
|
|
102
|
+
_context2.next = 11;
|
|
103
|
+
return (0, _idbTools.clearDb)(db, _storeTools.CONSTANTES.STORE_INFO_NAME);
|
|
104
|
+
case 11:
|
|
105
|
+
_context2.next = 13;
|
|
106
|
+
return (0, _appendToIndex["default"])(info, '1', rubriques, console.log);
|
|
107
|
+
case 13:
|
|
108
|
+
_context2.next = 15;
|
|
109
|
+
return (0, _idbTools.insertEntity)(db, _storeTools.CONSTANTES.STORE_INFO_NAME, info);
|
|
110
|
+
case 15:
|
|
111
|
+
case "end":
|
|
112
|
+
return _context2.stop();
|
|
113
|
+
}
|
|
114
|
+
}, _callee2);
|
|
115
|
+
}));
|
|
116
|
+
return _loadOne.apply(this, arguments);
|
|
117
|
+
}
|
|
118
|
+
function Search(_ref) {
|
|
119
|
+
var storeInfo = _ref.storeInfo,
|
|
120
|
+
_ref$version = _ref.version,
|
|
121
|
+
version = _ref$version === void 0 ? '1' : _ref$version,
|
|
122
|
+
_ref$max = _ref.max,
|
|
123
|
+
max = _ref$max === void 0 ? 30 : _ref$max,
|
|
124
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
125
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue;
|
|
126
|
+
var name = storeInfo.name,
|
|
127
|
+
order = storeInfo.order;
|
|
128
|
+
var _useState = (0, _react.useState)(defaultValue),
|
|
129
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
130
|
+
value = _useState2[0],
|
|
131
|
+
setValue = _useState2[1];
|
|
132
|
+
var onClick = (0, _react.useCallback)(function () {
|
|
133
|
+
function doIt() {
|
|
134
|
+
return _doIt.apply(this, arguments);
|
|
135
|
+
}
|
|
136
|
+
function _doIt() {
|
|
137
|
+
_doIt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
138
|
+
var results;
|
|
139
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
140
|
+
while (1) switch (_context.prev = _context.next) {
|
|
141
|
+
case 0:
|
|
142
|
+
_context.next = 2;
|
|
143
|
+
return (0, _searching["default"])(value, {
|
|
144
|
+
name: name,
|
|
145
|
+
version: version,
|
|
146
|
+
max: max,
|
|
147
|
+
order: order
|
|
148
|
+
});
|
|
149
|
+
case 2:
|
|
150
|
+
results = _context.sent;
|
|
151
|
+
console.log(results);
|
|
152
|
+
case 4:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context.stop();
|
|
155
|
+
}
|
|
156
|
+
}, _callee);
|
|
157
|
+
}));
|
|
158
|
+
return _doIt.apply(this, arguments);
|
|
159
|
+
}
|
|
160
|
+
if (value.length) {
|
|
161
|
+
doIt();
|
|
162
|
+
}
|
|
163
|
+
}, [value, name, version, max, order]);
|
|
164
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
165
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
166
|
+
type: "search",
|
|
167
|
+
value: value,
|
|
168
|
+
onChange: function onChange(e) {
|
|
169
|
+
return setValue(e.target.value);
|
|
170
|
+
}
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
172
|
+
type: "button",
|
|
173
|
+
onClick: onClick,
|
|
174
|
+
value: "Search!"
|
|
175
|
+
})]
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
var Template = function Template(args) {
|
|
179
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
180
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
|
|
181
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
183
|
+
type: "button",
|
|
184
|
+
value: "load NAF",
|
|
185
|
+
onClick: function onClick() {
|
|
186
|
+
return loadOne(infoNaf, fetchNaf);
|
|
187
|
+
}
|
|
188
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Search, {
|
|
189
|
+
storeInfo: infoNaf,
|
|
190
|
+
defaultValue: "culture du tabac"
|
|
191
|
+
})]
|
|
192
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
193
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
194
|
+
type: "button",
|
|
195
|
+
value: "load FAKE",
|
|
196
|
+
onClick: function onClick() {
|
|
197
|
+
return loadOne(infoFake, fetchFake);
|
|
198
|
+
}
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Search, {
|
|
200
|
+
storeInfo: infoFake,
|
|
201
|
+
defaultValue: "madame"
|
|
202
|
+
})]
|
|
203
|
+
})]
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
var Default = Template.bind({});
|
|
208
|
+
exports.Default = Default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Simple = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
10
|
+
var _simple = _interopRequireDefault(require("./simple"));
|
|
11
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
15
|
+
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); }
|
|
16
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
17
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
+
var stories = {
|
|
24
|
+
title: 'Components/Suggester',
|
|
25
|
+
component: _orchestrator["default"],
|
|
26
|
+
argTypes: _defaultArgTypes["default"]
|
|
27
|
+
};
|
|
28
|
+
var _default = stories;
|
|
29
|
+
exports["default"] = _default;
|
|
30
|
+
var Template = function Template(args) {
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
32
|
+
};
|
|
33
|
+
var Default = Template.bind({});
|
|
34
|
+
exports.Default = Default;
|
|
35
|
+
function getReferentiel(_x) {
|
|
36
|
+
return _getReferentiel.apply(this, arguments);
|
|
37
|
+
}
|
|
38
|
+
function _getReferentiel() {
|
|
39
|
+
_getReferentiel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(name) {
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
_context.t0 = name;
|
|
44
|
+
_context.next = _context.t0 === 'naf-rev2-stop' ? 3 : _context.t0 === 'naf-rev2' ? 3 : _context.t0 === 'cog-communes' ? 4 : 5;
|
|
45
|
+
break;
|
|
46
|
+
case 3:
|
|
47
|
+
return _context.abrupt("return", fetch('https://inseefr.github.io/Lunatic/storybook/naf-rev2.json').then(function (r) {
|
|
48
|
+
return r.json();
|
|
49
|
+
}));
|
|
50
|
+
case 4:
|
|
51
|
+
return _context.abrupt("return", fetch('https://inseefr.github.io/Lunatic/storybook/communes-2019.json').then(function (r) {
|
|
52
|
+
return r.json();
|
|
53
|
+
}));
|
|
54
|
+
case 5:
|
|
55
|
+
throw new Error("Unkonw r\xE9f\xE9rentiel ".concat(name));
|
|
56
|
+
case 6:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
59
|
+
}
|
|
60
|
+
}, _callee);
|
|
61
|
+
}));
|
|
62
|
+
return _getReferentiel.apply(this, arguments);
|
|
63
|
+
}
|
|
64
|
+
Default.args = {
|
|
65
|
+
id: 'suggester',
|
|
66
|
+
source: _source["default"],
|
|
67
|
+
autoSuggesterLoading: true,
|
|
68
|
+
getReferentiel: getReferentiel,
|
|
69
|
+
pagination: true
|
|
70
|
+
};
|
|
71
|
+
var Simple = Template.bind({});
|
|
72
|
+
exports.Simple = Simple;
|
|
73
|
+
Simple.args = {
|
|
74
|
+
source: _simple["default"],
|
|
75
|
+
getReferentiel: getReferentiel,
|
|
76
|
+
autoSuggesterLoading: true,
|
|
77
|
+
missing: {
|
|
78
|
+
table: {
|
|
79
|
+
disable: false
|
|
80
|
+
},
|
|
81
|
+
control: 'boolean',
|
|
82
|
+
defaultValue: true
|
|
83
|
+
}
|
|
84
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# CheckboxOne component
|
|
2
|
+
|
|
3
|
+
## Props
|
|
4
|
+
|
|
5
|
+
| Props | Type | Default value | Required | Description |
|
|
6
|
+
| :-------------: | :----: | :--------------------------------------: | :------: | --------------------------------------- |
|
|
7
|
+
| id | string | - | ✓ | Id of the checkbox |
|
|
8
|
+
| label | string | "" | | Fieldset label of the checkbox |
|
|
9
|
+
| preferences \* | array | ["COLLECTED"] | | Preferences to manage checkbox response |
|
|
10
|
+
| response \* | object | {} | | Response concerned by the component |
|
|
11
|
+
| options \* | array | - | ✓ | Options of the checkbox |
|
|
12
|
+
| handleChange | func | - | ✓ | Handler of the checkbox |
|
|
13
|
+
| disabled | bool | false | | Is the checkbox options disabled |
|
|
14
|
+
| focused | bool | false | | Is the checkbox options focused |
|
|
15
|
+
| positioning \* | string | "DEFAULT" | | Checkbox options positioning |
|
|
16
|
+
| declarations \* | array | [] | | Declarations of the checkbox |
|
|
17
|
+
| features | array | [ ] | | Component features for labels |
|
|
18
|
+
| bindings | object | [ ] | | Questionnaire bindings |
|
|
19
|
+
| management | bool | false | | Management mode of the checkbox |
|
|
20
|
+
| style \* | object | { fieldsetStyle: {}, modalityStyle: {} } | | Style of the checkbox |
|
|
21
|
+
|
|
22
|
+
- `preferences` props has to be an ordered array of `COLLECTED`, `FORCED` or `EDITED`
|
|
23
|
+
- `response` props has to be a shape of `{name: string, values: object}`
|
|
24
|
+
- `options` props has to be an array made by objects with a shape of `{label: string, value: string}`
|
|
25
|
+
- `positioning` props has to be one of `DEFAULT`, `HORIZONTAL` or `VERTICAL`
|
|
26
|
+
- `declarations` are documented in the `Declarations` component
|
|
27
|
+
- `style` props has to be composed of `fieldsetStyle` and `modalityStyle`
|
|
28
|
+
|
|
29
|
+
## Styles
|
|
30
|
+
|
|
31
|
+
**CheckboxOne** component has for classes `checkbox-group-list`, `checkbox-modality` and `checkbox-lunatic`.
|