@inseefr/lunatic 2.7.20 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/CheckboxBoolean/CheckboxBoolean.js +45 -0
- package/lib/components/{checkbox/checkbox-boolean/html/checkbox-boolean.spec.js → CheckboxBoolean/CheckboxBoolean.spec.js} +25 -14
- package/lib/components/CheckboxGroup/CheckboxGroup.js +50 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.scss +13 -0
- package/lib/components/{declarations/declarations-after-text.js → CheckboxGroup/CustomCheckboxGroup.js} +33 -11
- package/lib/components/{checkbox/checkbox-group/html/checkbox-group-content.spec.js → CheckboxGroup/CustomCheckboxGroup.spec.js} +2 -3
- package/lib/components/CheckboxOne/CheckboxOne.js +39 -0
- package/lib/components/{checkbox/checkbox-one/html/checkbox-one.spec.js → CheckboxOne/CheckboxOne.spec.js} +14 -7
- package/lib/components/{component-set/lunatic-component-set.js → ComponentSet/ComponentSet.js} +45 -33
- package/lib/components/{datepicker/html/datepicker.js → Datepicker/Datepicker.js} +27 -16
- package/lib/components/Datepicker/Datepicker.spec.js +92 -0
- package/lib/components/{datepicker/html/__snapshots__/datepicker.spec.tsx.snap → Datepicker/__snapshots__/Datepicker.spec.tsx.snap} +0 -63
- package/lib/components/Dropdown/Dropdown.js +63 -0
- package/lib/{stories/modal/modal.stories.js → components/Dropdown/Dropdown.spec.js} +40 -23
- package/lib/components/{dropdown/html/dropdown-writable/dropdown-writable.js → Dropdown/DropdownWritable.js} +10 -12
- package/lib/components/{dropdown/html/__snapshots__/dropdown.spec.tsx.snap → Dropdown/__snapshots__/Dropdown.spec.tsx.snap} +3 -3
- package/lib/components/Dropdown/helpers.js +94 -0
- package/lib/components/{dropdown/html/dropdown-simple/simple-label-renderer.js → Dropdown/renderer/SimpleLabelRenderer.js} +2 -3
- package/lib/components/{dropdown/html/dropdown-simple/simple-option-renderer.js → Dropdown/renderer/SimpleOptionRenderer.js} +2 -4
- package/lib/components/{dropdown/html/dropdown-writable/writable-label-renderer.js → Dropdown/renderer/WritableLabelRenderer.js} +2 -3
- package/lib/components/{dropdown/html/dropdown-writable/writable-option-renderer.js → Dropdown/renderer/WritableOptionRenderer.js} +6 -9
- package/lib/components/{duration/durationInput.js → Duration/Duration.js} +12 -9
- package/lib/components/{filter-description/component.js → FilterDescription/FilterDescription.js} +4 -5
- package/lib/components/{filter-description/component.spec.js → FilterDescription/FilterDescription.spec.js} +3 -5
- package/lib/components/Input/Input.js +62 -0
- package/lib/components/{input/html/input.spec.js → Input/Input.spec.js} +26 -23
- package/lib/components/InputNumber/InputNumber.js +70 -0
- package/lib/components/{input-number/html/input-number.spec.js → InputNumber/InputNumber.spec.js} +40 -46
- package/lib/components/{input-number/html/input-number-thousand.js → InputNumber/InputNumberThousand.js} +4 -5
- package/lib/components/{input-number/html/__snapshots__/input-number.spec.tsx.snap → InputNumber/__snapshots__/InputNumber.spec.tsx.snap} +3 -3
- package/lib/components/{loop/block-for-loop.js → Loop/Loop.js} +15 -19
- package/lib/components/{lunatic-components.js → LunaticComponents.js} +20 -5
- package/lib/components/{pairwise-links/pairwise-links.js → PairwiseLinks/PairwiseLinks.js} +11 -14
- package/lib/components/Question/Question.js +45 -0
- package/lib/components/Radio/Radio.js +41 -0
- package/lib/components/{loop/roster-for-loop/roster-for-loop.js → RosterForLoop/RosterForLoop.js} +31 -35
- package/lib/components/{loop/roster-for-loop/roster-for-loop.spec.js → RosterForLoop/RosterForLoop.spec.js} +2 -2
- package/lib/components/{roundabout/roundabout.js → Roundabout/CustomRoundabout.js} +12 -18
- package/lib/components/{roundabout/lunatic-roundabout.js → Roundabout/Roundabout.js} +7 -8
- package/lib/components/{roundabout/components/roundabout-it-button.js → Roundabout/RoundaboutItButton.js} +40 -41
- package/lib/components/{roundabout/components/roundabout-it-button.spec.js → Roundabout/RoundaboutItButton.spec.js} +10 -11
- package/lib/components/{roundabout/redirect.js → Roundabout/RoundaboutRedirect.js} +3 -4
- package/lib/components/Roundabout/extra.js +44 -0
- package/lib/components/{roundabout → Roundabout}/redirect.spec.js +3 -5
- package/lib/components/{roundabout → Roundabout}/roundabout.spec.js +4 -4
- package/lib/components/Sequence/Sequence.js +33 -0
- package/lib/components/Subsequence/Subsequence.js +27 -0
- package/lib/components/{subsequence/subsequence.spec.js → Subsequence/Subsequence.spec.js} +7 -28
- package/lib/components/{suggester/html/suggester.js → Suggester/CustomSuggester.js} +9 -10
- package/lib/components/Suggester/Suggester.js +77 -0
- package/lib/components/{suggester/html/default-style.scss → Suggester/Suggester.scss} +3 -3
- package/lib/components/{suggester/idb-suggester/suggester-notification.js → Suggester/SuggesterNotification.js} +16 -16
- package/lib/components/{suggester/idb-suggester/suggester-status.js → Suggester/SuggesterStatus.js} +5 -7
- package/lib/components/{suggester/searching/create-searching.js → Suggester/helpers.js} +4 -5
- package/lib/components/{summary/lunatic-summary.js → Summary/Summary.js} +72 -59
- package/lib/components/{switch/html/switch.js → Switch/Switch.js} +32 -16
- package/lib/components/Table/Table.js +65 -0
- package/lib/components/Textarea/Textarea.js +60 -0
- package/lib/components/Textarea/Textarea.spec.js +46 -0
- package/lib/components/library.js +55 -0
- package/lib/components/{button/lunatic-button.js → shared/Button/Button.js} +7 -7
- package/lib/components/{button/lunatic-button.spec.js → shared/Button/Button.spec.js} +10 -12
- package/lib/components/{commons/components/fab/fab.js → shared/Button/IconButton.js} +5 -6
- package/lib/components/{commons/components/fab/fab.scss → shared/Button/IconButton.scss} +1 -0
- package/lib/components/{commons/components/fab/fab.spec.js → shared/Button/IconButton.spec.js} +9 -9
- package/lib/components/{checkbox/commons/checkbox-option.js → shared/Checkbox/CheckboxOption.js} +9 -8
- package/lib/components/{checkbox/commons/checkbox-option.spec.js → shared/Checkbox/CheckboxOption.spec.js} +6 -7
- package/lib/components/{commons/components/combo-box/combo-box.js → shared/Combobox/Combobox.js} +26 -26
- package/lib/components/{commons/components/combo-box/combo-box.stories.js → shared/Combobox/Combobox.stories.js} +4 -5
- package/lib/components/{commons/components/combo-box/combo-box-container.js → shared/Combobox/ComboboxContainer.js} +6 -7
- package/lib/components/{commons/components/combo-box/combo-box-container.spec.js → shared/Combobox/ComboboxContainer.spec.js} +6 -8
- package/lib/components/{commons/components/combo-box/combo-box-content.js → shared/Combobox/ComboboxContent.js} +11 -13
- package/lib/components/{commons/components/combo-box/combo-box-content-box.js → shared/Combobox/ComboboxContentBox.js} +4 -6
- package/lib/components/{commons/components/combo-box/panel/combo-box-option.js → shared/Combobox/Panel/ComboboxOption.js} +4 -5
- package/lib/components/{commons/components/combo-box/panel/combo-box-option.spec.js → shared/Combobox/Panel/ComboboxOption.spec.js} +6 -8
- package/lib/components/{commons/components/combo-box/panel/option-container.js → shared/Combobox/Panel/ComboboxOptionContainer.js} +2 -2
- package/lib/components/{commons/components/combo-box/panel/option-container.spec.js → shared/Combobox/Panel/ComboboxOptionContainer.spec.js} +2 -2
- package/lib/components/{commons/components/combo-box/panel/panel.js → shared/Combobox/Panel/ComboboxPanel.js} +11 -9
- package/lib/components/{commons/components/combo-box/panel/panel.spec.js → shared/Combobox/Panel/ComboboxPanel.spec.js} +5 -5
- package/lib/components/{commons/components/combo-box/panel/panel-container.js → shared/Combobox/Panel/ComboboxPanelContainer.js} +4 -5
- package/lib/components/{commons/components/combo-box/panel/panel-container.spec.js → shared/Combobox/Panel/ComboboxPanelContainer.spec.js} +7 -8
- package/lib/components/{commons/components/combo-box/selection/clear-button.js → shared/Combobox/Selection/ComboboxClearButton.js} +8 -8
- package/lib/components/{commons/components/combo-box/selection/clear-button.spec.js → shared/Combobox/Selection/ComboboxClearButton.spec.js} +9 -9
- package/lib/components/{commons/components/combo-box/selection/input.js → shared/Combobox/Selection/ComboboxInput.js} +4 -4
- package/lib/components/{commons/components/combo-box/selection/combo-box-label-selection.js → shared/Combobox/Selection/ComboboxLabelSelection.js} +8 -11
- package/lib/components/{commons/components/combo-box/selection/combo-box-label-selection.spec.js → shared/Combobox/Selection/ComboboxLabelSelection.spec.js} +5 -7
- package/lib/components/shared/Combobox/Selection/ComboboxSelection.js +68 -0
- package/lib/components/{commons/components/combo-box/selection/selection.spec.js → shared/Combobox/Selection/ComboboxSelection.spec.js} +7 -7
- package/lib/components/{commons/components/combo-box/selection/__snapshots__/selection.spec.tsx.snap → shared/Combobox/Selection/__snapshots__/ComboboxSelection.spec.tsx.snap} +1 -9
- package/lib/components/shared/Combobox/index.js +1 -0
- package/lib/components/{commons/components/errors/errors.js → shared/ComponentErrors/ComponentErrors.js} +9 -8
- package/lib/components/shared/ComponentErrors/ComponentErrors.spec.js +44 -0
- package/lib/components/{commons/components/lunatic-component-without-label.js → shared/ComponentWrapper.js} +41 -32
- package/lib/components/shared/Declarations/Declarations.js +47 -0
- package/lib/components/{declarations/declarations.spec.js → shared/Declarations/Declarations.spec.js} +7 -8
- package/lib/components/shared/Fieldset/Fieldset.js +44 -0
- package/lib/components/shared/Fieldset/Fieldset.spec.js +37 -0
- package/lib/components/{commons/create-customizable-field.js → shared/HOC/customizedComponent.js} +7 -6
- package/lib/components/{commons/icons → shared/Icons}/index.js +4 -4
- package/lib/components/shared/Label/Label.js +36 -0
- package/lib/components/shared/Label/Label.spec.js +45 -0
- package/lib/components/shared/LabelDescription.js +21 -0
- package/lib/components/{commons/components/md-label/md-label.js → shared/MDLabel/MDLabel.js} +6 -7
- package/lib/components/{commons/components/md-label/md-label.spec.js → shared/MDLabel/MDLabel.spec.js} +8 -8
- package/lib/components/{commons/components/md-label/link.js → shared/MDLabel/MDLabelLink.js} +11 -7
- package/lib/components/{commons/components/md-label/router-link.js → shared/MDLabel/RouterLink.js} +4 -6
- package/lib/components/shared/MDLabel/generateUniqueId.js +1 -0
- package/lib/components/{commons/components/missing/missing.js → shared/Missing/Missing.js} +16 -19
- package/lib/components/{commons/components/missing/missing.spec.js → shared/Missing/Missing.spec.js} +4 -4
- package/lib/components/{modal-controls/modal-controls.js → shared/ModalControls/ModalControls.js} +46 -34
- package/lib/components/{modal-controls/modal-controls.spec.js → shared/ModalControls/ModalControls.spec.js} +4 -5
- package/lib/components/{suggester/html/notification.js → shared/Notification.js} +4 -4
- package/lib/components/shared/Radio/RadioGroup.js +67 -0
- package/lib/components/{radio/html/radio-option.js → shared/Radio/RadioOption.js} +11 -10
- package/lib/components/{radio/html/radio-option.spec.js → shared/Radio/RadioOption.spec.js} +9 -10
- package/lib/components/{commons/components/html-table/table.js → shared/Table/Table.js} +5 -5
- package/lib/components/{commons/components/html-table/table.spec.js → shared/Table/Table.spec.js} +3 -3
- package/lib/components/{table/table-header.js → shared/Table/TableHeader.js} +6 -4
- package/lib/components/{commons/components/html-table/tbody.js → shared/Table/Tbody.js} +4 -4
- package/lib/components/{commons/components/html-table/tbody.spec.js → shared/Table/Tbody.spec.js} +3 -3
- package/lib/components/{commons/components/html-table/td.js → shared/Table/Td.js} +4 -4
- package/lib/components/{commons/components/html-table/td.spec.js → shared/Table/Td.spec.js} +2 -2
- package/lib/components/{commons/components/html-table/th.js → shared/Table/Th.js} +4 -4
- package/lib/components/{commons/components/html-table/th.spec.js → shared/Table/Th.spec.js} +3 -3
- package/lib/components/{commons/components/html-table/thead.js → shared/Table/Thead.js} +4 -4
- package/lib/components/{commons/components/html-table/thead.spec.js → shared/Table/Thead.spec.js} +3 -3
- package/lib/components/{commons/components/html-table/tr.js → shared/Table/Tr.js} +4 -4
- package/lib/components/{commons/components/html-table/tr.spec.js → shared/Table/Tr.spec.js} +3 -3
- package/lib/components/{commons/components/html-table → shared/Table}/index.js +19 -12
- package/lib/components/{commons/components/variable-status/variable-status.js → shared/VariableStatus/VariableStatus.js} +9 -24
- package/lib/components/{commons/components/variable-status/variable-status.scss → shared/VariableStatus/VariableStatus.scss} +1 -1
- package/lib/components/{commons/components/variable-status/variable-status.spec.js → shared/VariableStatus/VariableStatus.spec.js} +3 -3
- package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.js +4 -3
- package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/is-network.js +2 -2
- package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader-row.js +5 -5
- package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader.js +3 -3
- package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget.js +5 -5
- package/lib/components/type-custom.js +5 -0
- package/lib/{utils/store-tools/constantes.js → constants/indexedDBStore.js} +2 -2
- package/lib/{components/commons/use-document-add-event-listener.js → hooks/useDocumentEvent.js} +3 -3
- package/lib/{components/commons/use-options-keydown.js → hooks/useListKeyboardHandler.js} +6 -4
- package/lib/{components/suggester/idb-suggester/check-store.js → hooks/useSuggesterInfo.js} +24 -69
- package/lib/index.js +24 -25
- package/lib/src/components/CheckboxBoolean/CheckboxBoolean.d.ts +6 -0
- package/lib/src/components/CheckboxGroup/CheckboxGroup.d.ts +11 -0
- package/lib/src/components/CheckboxGroup/CustomCheckboxGroup.d.ts +13 -0
- package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +12 -0
- package/lib/src/components/ComponentSet/ComponentSet.d.ts +7 -0
- package/lib/src/components/Datepicker/Datepicker.d.ts +12 -0
- package/lib/src/components/Dropdown/Dropdown.d.ts +13 -0
- package/lib/src/components/Dropdown/DropdownWritable.d.ts +17 -0
- package/lib/src/components/Dropdown/helpers.d.ts +19 -0
- package/lib/src/components/Dropdown/renderer/SimpleLabelRenderer.d.ts +8 -0
- package/lib/src/components/Dropdown/renderer/SimpleOptionRenderer.d.ts +7 -0
- package/lib/src/components/Dropdown/renderer/WritableLabelRenderer.d.ts +8 -0
- package/lib/src/components/Dropdown/renderer/WritableOptionRenderer.d.ts +8 -0
- package/lib/src/components/Duration/Duration.d.ts +8 -0
- package/lib/src/components/{filter-description/component.d.ts → FilterDescription/FilterDescription.d.ts} +2 -2
- package/lib/src/components/Input/Input.d.ts +9 -0
- package/lib/src/components/InputNumber/InputNumber.d.ts +11 -0
- package/lib/src/components/{input-number/html/input-number-thousand.d.ts → InputNumber/InputNumberThousand.d.ts} +2 -2
- package/lib/src/components/{loop/block-for-loop.d.ts → Loop/Loop.d.ts} +2 -2
- package/lib/src/components/{question → Question}/Question.d.ts +2 -2
- package/lib/src/components/{radio/lunatic-radio-group.d.ts → Radio/Radio.d.ts} +1 -2
- package/lib/src/components/{loop/roster-for-loop/roster-for-loop.d.ts → RosterForLoop/RosterForLoop.d.ts} +5 -3
- package/lib/src/components/{roundabout/roundabout.d.ts → Roundabout/CustomRoundabout.d.ts} +2 -2
- package/lib/src/components/Roundabout/Roundabout.d.ts +6 -0
- package/lib/src/components/{roundabout/components/roundabout-it-button.d.ts → Roundabout/RoundaboutItButton.d.ts} +2 -2
- package/lib/src/components/Roundabout/RoundaboutRedirect.d.ts +6 -0
- package/lib/src/components/Roundabout/extra.d.ts +14 -0
- package/lib/src/components/Sequence/Sequence.d.ts +3 -0
- package/lib/src/components/Subsequence/Subsequence.d.ts +2 -0
- package/lib/src/components/{suggester/html/suggester.d.ts → Suggester/CustomSuggester.d.ts} +6 -7
- package/lib/src/components/Suggester/Suggester.d.ts +3 -0
- package/lib/src/components/{suggester/idb-suggester/suggester-notification.d.ts → Suggester/SuggesterNotification.d.ts} +3 -3
- package/lib/src/components/{suggester/idb-suggester/suggester-status.d.ts → Suggester/SuggesterStatus.d.ts} +1 -1
- package/lib/src/components/Suggester/helpers.d.ts +6 -0
- package/lib/src/components/Summary/Summary.d.ts +25 -0
- package/lib/src/components/Switch/Switch.d.ts +10 -0
- package/lib/src/components/Table/Table.d.ts +2 -0
- package/lib/src/components/Textarea/Textarea.d.ts +11 -0
- package/lib/src/components/library.d.ts +161 -0
- package/lib/src/components/{button/lunatic-button.d.ts → shared/Button/Button.d.ts} +3 -3
- package/lib/src/components/shared/Button/IconButton.d.ts +7 -0
- package/lib/src/components/{checkbox/commons/checkbox-option.d.ts → shared/Checkbox/CheckboxOption.d.ts} +2 -3
- package/lib/src/components/shared/Combobox/Combobox.d.ts +21 -0
- package/lib/src/components/shared/Combobox/Combobox.stories.d.ts +6 -0
- package/lib/src/components/{commons/components/combo-box/combo-box-container.d.ts → shared/Combobox/ComboboxContainer.d.ts} +3 -3
- package/lib/src/components/{commons/components/combo-box/combo-box-content.d.ts → shared/Combobox/ComboboxContent.d.ts} +2 -2
- package/lib/src/components/shared/Combobox/ComboboxContentBox.d.ts +7 -0
- package/lib/src/components/shared/Combobox/ComboboxType.d.ts +50 -0
- package/lib/src/components/shared/Combobox/Panel/ComboboxOption.d.ts +8 -0
- package/lib/src/components/{commons/components/combo-box/panel/option-container.d.ts → shared/Combobox/Panel/ComboboxOptionContainer.d.ts} +1 -1
- package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.d.ts +5 -0
- package/lib/src/components/{commons/components/combo-box/panel/panel-container.d.ts → shared/Combobox/Panel/ComboboxPanelContainer.d.ts} +2 -2
- package/lib/src/components/{commons/components/combo-box/selection/clear-button.d.ts → shared/Combobox/Selection/ComboboxClearButton.d.ts} +1 -1
- package/lib/src/components/{commons/components/combo-box/selection/input.d.ts → shared/Combobox/Selection/ComboboxInput.d.ts} +1 -2
- package/lib/src/components/shared/Combobox/Selection/ComboboxLabelSelection.d.ts +11 -0
- package/lib/src/components/shared/Combobox/Selection/ComboboxSelection.d.ts +6 -0
- package/lib/src/components/shared/Combobox/index.d.ts +0 -0
- package/lib/src/components/shared/ComponentErrors/ComponentErrors.d.ts +15 -0
- package/lib/src/components/shared/ComponentWrapper.d.ts +26 -0
- package/lib/src/components/shared/Declarations/Declarations.d.ts +17 -0
- package/lib/src/components/shared/Fieldset/Fieldset.d.ts +10 -0
- package/lib/src/components/shared/HOC/customizedComponent.d.ts +5 -0
- package/lib/src/components/shared/Icons/index.d.ts +10 -0
- package/lib/src/components/shared/Label/Label.d.ts +11 -0
- package/lib/src/components/shared/LabelDescription.d.ts +7 -0
- package/lib/src/components/{commons/components/md-label/md-label.d.ts → shared/MDLabel/MDLabel.d.ts} +2 -2
- package/lib/src/components/shared/MDLabel/MDLabelLink.d.ts +8 -0
- package/lib/src/components/{commons/components/md-label/router-link.d.ts → shared/MDLabel/RouterLink.d.ts} +2 -2
- package/lib/src/components/shared/MDLabel/generateUniqueId.d.ts +0 -0
- package/lib/src/components/{commons/components/missing/missing.d.ts → shared/Missing/Missing.d.ts} +4 -4
- package/lib/src/components/shared/ModalControls/ModalControls.d.ts +11 -0
- package/lib/src/components/{suggester/html/notification.d.ts → shared/Notification.d.ts} +2 -2
- package/lib/src/components/{radio/html/radio-group.d.ts → shared/Radio/RadioGroup.d.ts} +2 -3
- package/lib/src/components/{radio/html/radio-option.d.ts → shared/Radio/RadioOption.d.ts} +1 -2
- package/lib/src/components/{commons/components/html-table/table.d.ts → shared/Table/Table.d.ts} +2 -2
- package/lib/src/components/shared/Table/TableHeader.d.ts +2 -0
- package/lib/src/components/{commons/components/html-table/tbody.d.ts → shared/Table/Tbody.d.ts} +1 -1
- package/lib/src/components/{commons/components/html-table/td.d.ts → shared/Table/Td.d.ts} +1 -1
- package/lib/src/components/{commons/components/html-table/th.d.ts → shared/Table/Th.d.ts} +1 -1
- package/lib/src/components/{commons/components/html-table/thead.d.ts → shared/Table/Thead.d.ts} +1 -1
- package/lib/src/components/{commons/components/html-table/tr.d.ts → shared/Table/Tr.d.ts} +1 -1
- package/lib/src/components/shared/Table/index.d.ts +7 -0
- package/lib/src/components/shared/VariableStatus/VariableStatus.d.ts +7 -0
- package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader-row.d.ts +1 -1
- package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/loader.d.ts +1 -1
- package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget.d.ts +1 -1
- package/lib/src/components/type-custom.d.ts +101 -0
- package/lib/src/components/type.d.ts +15 -29
- package/lib/src/{utils/store-tools/constantes.d.ts → constants/indexedDBStore.d.ts} +2 -2
- package/lib/src/hooks/useDocumentEvent.d.ts +2 -0
- package/lib/src/{components/commons/use-options-keydown.d.ts → hooks/useListKeyboardHandler.d.ts} +4 -2
- package/lib/src/hooks/useSuggesterInfo.d.ts +9 -0
- package/lib/src/i18n/index.d.ts +2 -2
- package/lib/src/i18n/inputNumberProps.d.ts +1 -1
- package/lib/src/index.d.ts +5 -3
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +19 -51
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -74
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +17 -23
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +5 -101
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +1 -3
- package/lib/src/use-lunatic/type-source.d.ts +1 -8
- package/lib/src/use-lunatic/use-lunatic.d.ts +29 -57
- package/lib/src/utils/store-tools/index.d.ts +1 -1
- package/lib/stories/behaviour/others/test.stories.js +1 -1
- package/lib/stories/checkbox-group/sourceLoop.json +1 -1
- package/lib/stories/date-picker/datepicker.stories.js +2 -3
- package/lib/stories/loop/loop.stories.js +1 -1
- package/lib/stories/loop/roster-for-loop.stories.js +1 -1
- package/lib/stories/markdown/markdown.stories.js +1 -1
- package/lib/stories/questionnaires/recensement/source.json +2 -2
- package/lib/stories/sequence/sequence.stories.js +1 -1
- package/lib/stories/suggester/source-component-set.json +54 -8
- package/lib/stories/suggester/source.json +326 -182
- package/lib/stories/suggester/suggester-workers.stories.js +5 -5
- package/lib/stories/suggester/suggester.stories.js +1 -15
- package/lib/stories/switch/switch.stories.js +1 -6
- package/lib/stories/table/table.stories.js +1 -11
- package/lib/stories/utils/orchestrator.js +25 -26
- package/lib/stories/utils/referentiel.js +5 -14
- package/lib/use-lunatic/commons/page.js +0 -5
- package/lib/use-lunatic/reducer/reduce-on-init.js +2 -2
- package/lib/utils/idb-tools/open-or-create-db.js +4 -4
- package/lib/utils/store-tools/clear-store-data.js +2 -2
- package/lib/utils/store-tools/clear-store-info.js +2 -2
- package/lib/utils/store-tools/create/create.js +2 -2
- package/lib/utils/store-tools/create/update-store-info.js +3 -3
- package/lib/utils/store-tools/get-store-count.js +3 -3
- package/lib/utils/store-tools/index.js +1 -1
- package/lib/utils/store-tools/initStore.js +4 -4
- package/lib/utils/store-tools/open-or-create-store.js +4 -4
- package/lib/utils/suggester-workers/append-to-index/append.js +2 -2
- package/lib/utils/suggester-workers/searching/search-in-index.js +2 -2
- package/lib/utils/suggester-workers/searching/searching.js +5 -5
- package/package.json +2 -5
- package/workers-release/lunatic-append-worker-0.3.0.js +1 -1
- package/workers-release/lunatic-append-worker-0.3.0.js.LICENSE.txt +0 -10
- package/workers-release/lunatic-search-worker-0.3.0.js +1 -1
- package/workers-release/lunatic-search-worker-0.3.0.js.LICENSE.txt +0 -10
- package/lib/components/button/index.js +0 -13
- package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +0 -34
- package/lib/components/checkbox/checkbox-boolean/index.js +0 -13
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +0 -58
- package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -34
- package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +0 -41
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +0 -33
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.scss +0 -12
- package/lib/components/checkbox/checkbox-group/index.js +0 -13
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +0 -71
- package/lib/components/checkbox/checkbox-one/html/checkbox-one.js +0 -34
- package/lib/components/checkbox/checkbox-one/index.js +0 -13
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +0 -61
- package/lib/components/checkbox/commons/index.js +0 -13
- package/lib/components/checkbox/index.js +0 -27
- package/lib/components/commons/components/combo-box/index.js +0 -13
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +0 -56
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.spec.js +0 -21
- package/lib/components/commons/components/combo-box/selection/label-selection.js +0 -30
- package/lib/components/commons/components/combo-box/selection/label-selection.spec.js +0 -41
- package/lib/components/commons/components/combo-box/selection/selection-container.js +0 -36
- package/lib/components/commons/components/combo-box/selection/selection-container.spec.js +0 -52
- package/lib/components/commons/components/combo-box/selection/selection.js +0 -53
- package/lib/components/commons/components/description.js +0 -52
- package/lib/components/commons/components/description.spec.js +0 -45
- package/lib/components/commons/components/errors/errors.spec.js +0 -45
- package/lib/components/commons/components/errors/index.js +0 -13
- package/lib/components/commons/components/fab/index.js +0 -13
- package/lib/components/commons/components/field-container/field-container.js +0 -26
- package/lib/components/commons/components/field-container/filed-container.spec.js +0 -37
- package/lib/components/commons/components/field-container/index.js +0 -13
- package/lib/components/commons/components/fieldset.js +0 -28
- package/lib/components/commons/components/fieldset.spec.js +0 -51
- package/lib/components/commons/components/label/index.js +0 -13
- package/lib/components/commons/components/label/label.js +0 -34
- package/lib/components/commons/components/label/label.spec.js +0 -77
- package/lib/components/commons/components/lunatic-component-with-label.js +0 -66
- package/lib/components/commons/components/md-label/generateUniqueId.js +0 -11
- package/lib/components/commons/components/md-label/index.js +0 -13
- package/lib/components/commons/components/missing/index.js +0 -13
- package/lib/components/commons/components/nothing-to-display.js +0 -15
- package/lib/components/commons/components/nothing-to-display.spec.js +0 -15
- package/lib/components/commons/components/orchestrated-component.js +0 -40
- package/lib/components/commons/components/variable-status/img/index.js +0 -20
- package/lib/components/commons/components/variable-status/index.js +0 -13
- package/lib/components/commons/index.js +0 -96
- package/lib/components/commons/safety-label.js +0 -24
- package/lib/components/commons/use-on-handle-change.js +0 -18
- package/lib/components/commons/use-on-handle-change.spec.js +0 -50
- package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +0 -126
- package/lib/components/component-set/html/component-set-legend.js +0 -28
- package/lib/components/component-set/html/component-set-wrapper.js +0 -15
- package/lib/components/component-set/html/component-set.js +0 -28
- package/lib/components/component-set/html/component-set.spec.js +0 -91
- package/lib/components/datepicker/html/datepicker.spec.js +0 -86
- package/lib/components/datepicker/index.js +0 -13
- package/lib/components/datepicker/lunatic-datepicker.js +0 -63
- package/lib/components/declarations/declaration.js +0 -21
- package/lib/components/declarations/declaration.spec.js +0 -30
- package/lib/components/declarations/declarations-before-text.js +0 -23
- package/lib/components/declarations/declarations-detachable.js +0 -23
- package/lib/components/declarations/declarations.js +0 -42
- package/lib/components/declarations/index.js +0 -43
- package/lib/components/dropdown/html/dropdown-simple/dropdown-simple.js +0 -39
- package/lib/components/dropdown/html/dropdown-simple/index.js +0 -13
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/filter-options.js +0 -28
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/filter-options.spec.js +0 -106
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/get-label.js +0 -24
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/letters-matching.js +0 -28
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/match.js +0 -21
- package/lib/components/dropdown/html/dropdown-writable/filter-tools/prepare-prefix.js +0 -15
- package/lib/components/dropdown/html/dropdown-writable/index.js +0 -13
- package/lib/components/dropdown/html/dropdown.js +0 -52
- package/lib/components/dropdown/html/dropdown.spec.js +0 -48
- package/lib/components/dropdown/index.js +0 -13
- package/lib/components/dropdown/lunatic-dropdown.js +0 -62
- package/lib/components/duration/duration.js +0 -53
- package/lib/components/duration/index.js +0 -13
- package/lib/components/filter-description/index.js +0 -13
- package/lib/components/index.js +0 -223
- package/lib/components/input/html/input.js +0 -57
- package/lib/components/input/index.js +0 -13
- package/lib/components/input/lunatic-input.js +0 -59
- package/lib/components/input-number/html/input-number.js +0 -58
- package/lib/components/input-number/index.js +0 -13
- package/lib/components/input-number/lunatic-input-number.js +0 -63
- package/lib/components/loop/loop-button.js +0 -19
- package/lib/components/loop/loop-header.js +0 -30
- package/lib/components/loop/loop.js +0 -36
- package/lib/components/modal/html/modal.js +0 -59
- package/lib/components/modal/html/modal.scss +0 -26
- package/lib/components/modal/index.js +0 -13
- package/lib/components/modal/lunatic-modal.js +0 -61
- package/lib/components/modal-controls/close-or-skip.js +0 -38
- package/lib/components/modal-controls/close-or-skip.spec.js +0 -36
- package/lib/components/modal-controls/index.js +0 -13
- package/lib/components/modal-controls/modal-container.js +0 -21
- package/lib/components/modal-controls/modal-container.spec.js +0 -23
- package/lib/components/question/Question.js +0 -49
- package/lib/components/question/index.js +0 -16
- package/lib/components/question-explication/html/question-explication.js +0 -51
- package/lib/components/question-explication/html/question-explication.scss +0 -35
- package/lib/components/question-explication/index.js +0 -13
- package/lib/components/question-explication/lunatic-question-explication.js +0 -31
- package/lib/components/question-explication/question-explication.spec.js +0 -49
- package/lib/components/questions/index.js +0 -20
- package/lib/components/questions/question-context.js +0 -34
- package/lib/components/questions/question-context.scss +0 -10
- package/lib/components/questions/question-information.js +0 -34
- package/lib/components/questions/question-information.scss +0 -19
- package/lib/components/radio/html/radio-group-content.js +0 -53
- package/lib/components/radio/html/radio-group-content.spec.js +0 -99
- package/lib/components/radio/html/radio-group.js +0 -45
- package/lib/components/radio/index.js +0 -13
- package/lib/components/radio/lunatic-radio-group.js +0 -66
- package/lib/components/roundabout/components/roundabout-container.js +0 -19
- package/lib/components/roundabout/components/roundabout-container.spec.js +0 -23
- package/lib/components/roundabout/components/roundabout-it-container.js +0 -18
- package/lib/components/roundabout/components/roundabout-it-container.spec.js +0 -23
- package/lib/components/roundabout/components/roundabout-it-title.js +0 -16
- package/lib/components/roundabout/components/roundabout-it-title.spec.js +0 -18
- package/lib/components/roundabout/components/roundabout-label.js +0 -16
- package/lib/components/roundabout/components/roundabout-label.spec.js +0 -18
- package/lib/components/roundabout/components/roundabout-pending.js +0 -17
- package/lib/components/roundabout/components/roundabout-pending.spec.js +0 -15
- package/lib/components/roundabout/index.js +0 -13
- package/lib/components/sequence/html/sequence.js +0 -28
- package/lib/components/sequence/index.js +0 -13
- package/lib/components/sequence/lunatic-sequence.js +0 -30
- package/lib/components/sequence/sequence.spec.js +0 -75
- package/lib/components/subsequence/index.js +0 -13
- package/lib/components/subsequence/subsequence.js +0 -32
- package/lib/components/suggester/find-best-label/find-best-label.js +0 -49
- package/lib/components/suggester/find-best-label/index.js +0 -13
- package/lib/components/suggester/idb-suggester/idb-suggester.js +0 -72
- package/lib/components/suggester/idb-suggester/index.js +0 -12
- package/lib/components/suggester/index.js +0 -13
- package/lib/components/suggester/lunatic-suggester.js +0 -70
- package/lib/components/suggester/searching/index.js +0 -13
- package/lib/components/summary/html/summary-container.js +0 -14
- package/lib/components/summary/html/summary-responses.js +0 -56
- package/lib/components/summary/html/summary-title.js +0 -19
- package/lib/components/summary/index.js +0 -12
- package/lib/components/switch/index.js +0 -13
- package/lib/components/switch/lunatic-switch.js +0 -63
- package/lib/components/table/lunatic-table.js +0 -72
- package/lib/components/textarea/html/textarea.js +0 -54
- package/lib/components/textarea/html/textarea.spec.js +0 -38
- package/lib/components/textarea/index.js +0 -13
- package/lib/components/textarea/lunatic-textarea.js +0 -77
- package/lib/src/components/button/index.d.ts +0 -1
- package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +0 -13
- package/lib/src/components/checkbox/checkbox-boolean/index.d.ts +0 -1
- package/lib/src/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.d.ts +0 -8
- package/lib/src/components/checkbox/checkbox-group/checkbox-group-content.d.ts +0 -8
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +0 -9
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +0 -14
- package/lib/src/components/checkbox/checkbox-group/index.d.ts +0 -1
- package/lib/src/components/checkbox/checkbox-group/lunatic-checkbox-group.d.ts +0 -11
- package/lib/src/components/checkbox/checkbox-one/html/checkbox-one.d.ts +0 -5
- package/lib/src/components/checkbox/checkbox-one/index.d.ts +0 -1
- package/lib/src/components/checkbox/checkbox-one/lunatic-checkbox-one.d.ts +0 -3
- package/lib/src/components/checkbox/commons/index.d.ts +0 -1
- package/lib/src/components/checkbox/index.d.ts +0 -3
- package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +0 -8
- package/lib/src/components/commons/components/combo-box/combo-box.d.ts +0 -23
- package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +0 -6
- package/lib/src/components/commons/components/combo-box/combo-box.type.d.ts +0 -8
- package/lib/src/components/commons/components/combo-box/index.d.ts +0 -1
- package/lib/src/components/commons/components/combo-box/panel/combo-box-option.d.ts +0 -8
- package/lib/src/components/commons/components/combo-box/panel/panel.d.ts +0 -20
- package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +0 -18
- package/lib/src/components/commons/components/combo-box/selection/combo-box-label-selection.d.ts +0 -11
- package/lib/src/components/commons/components/combo-box/selection/label-selection.d.ts +0 -21
- package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +0 -11
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +0 -13
- package/lib/src/components/commons/components/description.d.ts +0 -22
- package/lib/src/components/commons/components/errors/errors.d.ts +0 -11
- package/lib/src/components/commons/components/errors/index.d.ts +0 -1
- package/lib/src/components/commons/components/fab/fab.d.ts +0 -7
- package/lib/src/components/commons/components/fab/index.d.ts +0 -1
- package/lib/src/components/commons/components/field-container/field-container.d.ts +0 -6
- package/lib/src/components/commons/components/field-container/index.d.ts +0 -1
- package/lib/src/components/commons/components/fieldset.d.ts +0 -13
- package/lib/src/components/commons/components/html-table/index.d.ts +0 -6
- package/lib/src/components/commons/components/label/index.d.ts +0 -1
- package/lib/src/components/commons/components/label/label.d.ts +0 -14
- package/lib/src/components/commons/components/lunatic-component-with-label.d.ts +0 -12
- package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +0 -12
- package/lib/src/components/commons/components/md-label/generateUniqueId.d.ts +0 -1
- package/lib/src/components/commons/components/md-label/index.d.ts +0 -1
- package/lib/src/components/commons/components/md-label/link.d.ts +0 -7
- package/lib/src/components/commons/components/missing/index.d.ts +0 -1
- package/lib/src/components/commons/components/nothing-to-display.d.ts +0 -2
- package/lib/src/components/commons/components/orchestrated-component.d.ts +0 -8
- package/lib/src/components/commons/components/variable-status/img/index.d.ts +0 -2
- package/lib/src/components/commons/components/variable-status/index.d.ts +0 -1
- package/lib/src/components/commons/components/variable-status/variable-status.d.ts +0 -16
- package/lib/src/components/commons/create-customizable-field.d.ts +0 -3
- package/lib/src/components/commons/icons/index.d.ts +0 -10
- package/lib/src/components/commons/index.d.ts +0 -13
- package/lib/src/components/commons/safety-label.d.ts +0 -3
- package/lib/src/components/commons/use-document-add-event-listener.d.ts +0 -2
- package/lib/src/components/commons/use-on-handle-change.d.ts +0 -12
- package/lib/src/components/component-set/html/component-set-legend.d.ts +0 -8
- package/lib/src/components/component-set/html/component-set-wrapper.d.ts +0 -6
- package/lib/src/components/component-set/html/component-set.d.ts +0 -10
- package/lib/src/components/component-set/lunatic-component-set.d.ts +0 -3
- package/lib/src/components/datepicker/html/datepicker.d.ts +0 -18
- package/lib/src/components/datepicker/index.d.ts +0 -1
- package/lib/src/components/datepicker/lunatic-datepicker.d.ts +0 -10
- package/lib/src/components/declarations/declaration.d.ts +0 -6
- package/lib/src/components/declarations/declarations-after-text.d.ts +0 -4
- package/lib/src/components/declarations/declarations-before-text.d.ts +0 -4
- package/lib/src/components/declarations/declarations-detachable.d.ts +0 -4
- package/lib/src/components/declarations/declarations.d.ts +0 -15
- package/lib/src/components/declarations/index.d.ts +0 -4
- package/lib/src/components/dropdown/html/dropdown-simple/dropdown-simple.d.ts +0 -3
- package/lib/src/components/dropdown/html/dropdown-simple/index.d.ts +0 -1
- package/lib/src/components/dropdown/html/dropdown-simple/simple-label-renderer.d.ts +0 -8
- package/lib/src/components/dropdown/html/dropdown-simple/simple-option-renderer.d.ts +0 -7
- package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +0 -17
- package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/filter-options.d.ts +0 -6
- package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/get-label.d.ts +0 -9
- package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/letters-matching.d.ts +0 -2
- package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/match.d.ts +0 -2
- package/lib/src/components/dropdown/html/dropdown-writable/filter-tools/prepare-prefix.d.ts +0 -2
- package/lib/src/components/dropdown/html/dropdown-writable/index.d.ts +0 -1
- package/lib/src/components/dropdown/html/dropdown-writable/writable-label-renderer.d.ts +0 -8
- package/lib/src/components/dropdown/html/dropdown-writable/writable-option-renderer.d.ts +0 -8
- package/lib/src/components/dropdown/html/dropdown.d.ts +0 -12
- package/lib/src/components/dropdown/html/dropdown.spec.d.ts +0 -1
- package/lib/src/components/dropdown/index.d.ts +0 -1
- package/lib/src/components/dropdown/lunatic-dropdown.d.ts +0 -3
- package/lib/src/components/duration/duration.d.ts +0 -4
- package/lib/src/components/duration/durationInput.d.ts +0 -11
- package/lib/src/components/duration/index.d.ts +0 -1
- package/lib/src/components/filter-description/component.spec.d.ts +0 -1
- package/lib/src/components/filter-description/index.d.ts +0 -1
- package/lib/src/components/index.d.ts +0 -31
- package/lib/src/components/input/html/input.d.ts +0 -17
- package/lib/src/components/input/html/input.spec.d.ts +0 -1
- package/lib/src/components/input/index.d.ts +0 -1
- package/lib/src/components/input/lunatic-input.d.ts +0 -3
- package/lib/src/components/input-number/html/input-number.d.ts +0 -20
- package/lib/src/components/input-number/html/input-number.spec.d.ts +0 -1
- package/lib/src/components/input-number/index.d.ts +0 -1
- package/lib/src/components/input-number/lunatic-input-number.d.ts +0 -3
- package/lib/src/components/loop/loop-button.d.ts +0 -7
- package/lib/src/components/loop/loop-header.d.ts +0 -9
- package/lib/src/components/loop/loop.d.ts +0 -2
- package/lib/src/components/loop/roster-for-loop/roster-for-loop.spec.d.ts +0 -1
- package/lib/src/components/modal/html/modal.d.ts +0 -11
- package/lib/src/components/modal/index.d.ts +0 -1
- package/lib/src/components/modal/lunatic-modal.d.ts +0 -3
- package/lib/src/components/modal-controls/close-or-skip.d.ts +0 -8
- package/lib/src/components/modal-controls/close-or-skip.spec.d.ts +0 -1
- package/lib/src/components/modal-controls/index.d.ts +0 -1
- package/lib/src/components/modal-controls/modal-container.d.ts +0 -3
- package/lib/src/components/modal-controls/modal-container.spec.d.ts +0 -1
- package/lib/src/components/modal-controls/modal-controls.d.ts +0 -11
- package/lib/src/components/modal-controls/modal-controls.spec.d.ts +0 -1
- package/lib/src/components/question/index.d.ts +0 -1
- package/lib/src/components/question-explication/html/question-explication.d.ts +0 -7
- package/lib/src/components/question-explication/index.d.ts +0 -1
- package/lib/src/components/question-explication/lunatic-question-explication.d.ts +0 -3
- package/lib/src/components/question-explication/question-explication.spec.d.ts +0 -1
- package/lib/src/components/questions/index.d.ts +0 -2
- package/lib/src/components/questions/question-context.d.ts +0 -4
- package/lib/src/components/questions/question-information.d.ts +0 -4
- package/lib/src/components/radio/html/radio-group-content.d.ts +0 -19
- package/lib/src/components/radio/html/radio-group-content.spec.d.ts +0 -1
- package/lib/src/components/radio/html/radio-option.spec.d.ts +0 -1
- package/lib/src/components/radio/index.d.ts +0 -1
- package/lib/src/components/roundabout/components/roundabout-container.d.ts +0 -6
- package/lib/src/components/roundabout/components/roundabout-container.spec.d.ts +0 -1
- package/lib/src/components/roundabout/components/roundabout-it-button.spec.d.ts +0 -1
- package/lib/src/components/roundabout/components/roundabout-it-container.d.ts +0 -5
- package/lib/src/components/roundabout/components/roundabout-it-container.spec.d.ts +0 -1
- package/lib/src/components/roundabout/components/roundabout-it-title.d.ts +0 -5
- package/lib/src/components/roundabout/components/roundabout-it-title.spec.d.ts +0 -1
- package/lib/src/components/roundabout/components/roundabout-label.d.ts +0 -5
- package/lib/src/components/roundabout/components/roundabout-label.spec.d.ts +0 -1
- package/lib/src/components/roundabout/components/roundabout-pending.d.ts +0 -3
- package/lib/src/components/roundabout/components/roundabout-pending.spec.d.ts +0 -1
- package/lib/src/components/roundabout/index.d.ts +0 -1
- package/lib/src/components/roundabout/lunatic-roundabout.d.ts +0 -6
- package/lib/src/components/roundabout/redirect.d.ts +0 -6
- package/lib/src/components/sequence/html/sequence.d.ts +0 -5
- package/lib/src/components/sequence/index.d.ts +0 -1
- package/lib/src/components/sequence/lunatic-sequence.d.ts +0 -3
- package/lib/src/components/sequence/sequence.spec.d.ts +0 -1
- package/lib/src/components/subsequence/index.d.ts +0 -1
- package/lib/src/components/subsequence/subsequence.d.ts +0 -3
- package/lib/src/components/subsequence/subsequence.spec.d.ts +0 -1
- package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +0 -2
- package/lib/src/components/suggester/find-best-label/index.d.ts +0 -1
- package/lib/src/components/suggester/idb-suggester/check-store.d.ts +0 -11
- package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +0 -9
- package/lib/src/components/suggester/idb-suggester/index.d.ts +0 -1
- package/lib/src/components/suggester/index.d.ts +0 -1
- package/lib/src/components/suggester/lunatic-suggester.d.ts +0 -3
- package/lib/src/components/suggester/searching/create-searching.d.ts +0 -7
- package/lib/src/components/suggester/searching/index.d.ts +0 -1
- package/lib/src/components/summary/html/summary-container.d.ts +0 -2
- package/lib/src/components/summary/html/summary-responses.d.ts +0 -14
- package/lib/src/components/summary/html/summary-title.d.ts +0 -5
- package/lib/src/components/summary/index.d.ts +0 -1
- package/lib/src/components/summary/lunatic-summary.d.ts +0 -8
- package/lib/src/components/switch/html/switch.d.ts +0 -18
- package/lib/src/components/switch/index.d.ts +0 -1
- package/lib/src/components/switch/lunatic-switch.d.ts +0 -3
- package/lib/src/components/table/lunatic-table.d.ts +0 -3
- package/lib/src/components/table/table-header.d.ts +0 -11
- package/lib/src/components/textarea/html/textarea.d.ts +0 -19
- package/lib/src/components/textarea/html/textarea.spec.d.ts +0 -1
- package/lib/src/components/textarea/index.d.ts +0 -1
- package/lib/src/components/textarea/lunatic-textarea.d.ts +0 -18
- package/lib/src/use-lunatic/reducer/reduce-go-next-page.spec.d.ts +0 -1
- package/lib/src/use-lunatic/reducer/reduce-go-previous-page.spec.d.ts +0 -1
- package/lib/stories/custom-mui/checkbox-boolean-mui.js +0 -31
- package/lib/stories/custom-mui/checkbox-group-mui.js +0 -67
- package/lib/stories/custom-mui/checkbox-one-mui.js +0 -15
- package/lib/stories/custom-mui/index.js +0 -111
- package/lib/stories/custom-mui/input-mui.js +0 -51
- package/lib/stories/custom-mui/input-number-mui.js +0 -39
- package/lib/stories/custom-mui/radio-mui.js +0 -61
- package/lib/stories/custom-mui/suggester-mui/index.js +0 -13
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +0 -301
- package/lib/stories/custom-mui/switch-mui.js +0 -46
- package/lib/stories/custom-mui/table-mui.js +0 -27
- package/lib/stories/custom-mui/tbody-mui.js +0 -22
- package/lib/stories/custom-mui/td-mui.js +0 -24
- package/lib/stories/custom-mui/textarea-mui.js +0 -42
- package/lib/stories/custom-mui/th-mui.js +0 -23
- package/lib/stories/custom-mui/thead-mui.js +0 -22
- package/lib/stories/custom-mui/tr-mui.js +0 -32
- package/lib/stories/modal/source.json +0 -97
- package/lib/stories/question-context/question-context.stories.js +0 -31
- package/lib/stories/question-context/source.json +0 -13
- package/lib/stories/question-explication/question-explication.stories.js +0 -31
- package/lib/stories/question-explication/source.json +0 -17
- package/lib/stories/question-information/question-information.stories.js +0 -32
- package/lib/stories/question-information/source.json +0 -14
- package/lib/stories/suggester/simple.json +0 -168
- package/lib/tests/utils/lunatic.d.ts +0 -25
- package/lib/use-lunatic/reducer/reduce-go-next-page.spec.js +0 -13
- package/lib/use-lunatic/reducer/reduce-go-previous-page.spec.js +0 -14
- /package/lib/components/{checkbox/checkbox-one/html/checkbox-one.scss → CheckboxOne/CheckboxOne.scss} +0 -0
- /package/lib/components/{datepicker/html/datepicker.scss → Datepicker/Datepicker.scss} +0 -0
- /package/lib/components/{datepicker/html → Datepicker}/DatepickerField.js +0 -0
- /package/lib/components/{dropdown/html/dropdown.scss → Dropdown/Dropdown.scss} +0 -0
- /package/lib/components/{duration/duration.scss → Duration/Duration.scss} +0 -0
- /package/lib/components/{duration → Duration}/durationUtils.js +0 -0
- /package/lib/components/{duration → Duration}/formatDuration.js +0 -0
- /package/lib/components/{duration → Duration}/formatDuration.spec.js +0 -0
- /package/lib/components/{duration → Duration}/getDurationFromValue.js +0 -0
- /package/lib/components/{input/html/input.scss → Input/Input.scss} +0 -0
- /package/lib/components/{input/html/__snapshots__/input.spec.tsx.snap → Input/__snapshots__/Input.spec.tsx.snap} +0 -0
- /package/lib/components/{input-number/html/input-number.scss → InputNumber/InputNumber.scss} +0 -0
- /package/lib/components/{loop → Loop}/constant.js +0 -0
- /package/lib/components/{radio/radio.scss → Radio/Radio.scss} +0 -0
- /package/lib/components/{loop/roster-for-loop/roster.scss → RosterForLoop/RosterForLoop.scss} +0 -0
- /package/lib/components/{loop/roster-for-loop/__snapshots__/roster-for-loop.spec.tsx.snap → RosterForLoop/__snapshots__/RosterForLoop.spec.tsx.snap} +0 -0
- /package/lib/components/{roundabout/components/roundabout.scss → Roundabout/Roundabout.scss} +0 -0
- /package/lib/components/{sequence/html/sequence.scss → Sequence/Sequence.scss} +0 -0
- /package/lib/components/{suggester/html → Suggester/icons}/alert-icon.svg +0 -0
- /package/lib/components/{suggester/html → Suggester/icons}/wait-icon.svg +0 -0
- /package/lib/components/{suggester/html → Suggester/icons}/warn-icon.svg +0 -0
- /package/lib/components/{switch/html → Switch}/switch.scss +0 -0
- /package/lib/components/{textarea/html/textarea.scss → Textarea/Textarea.scss} +0 -0
- /package/lib/components/{textarea/html/__snapshots__/textarea.spec.tsx.snap → Textarea/__snapshots__/Textarea.spec.tsx.snap} +0 -0
- /package/lib/components/{button/button.scss → shared/Button/Button.scss} +0 -0
- /package/lib/components/{button/__snapshots__/lunatic-button.spec.tsx.snap → shared/Button/__snapshots__/Button.spec.tsx.snap} +0 -0
- /package/lib/components/{checkbox/commons/checkbox-option.scss → shared/Checkbox/CheckboxOption.scss} +0 -0
- /package/lib/components/{checkbox/commons → shared/Checkbox}/getShortcutKey.js +0 -0
- /package/lib/components/{commons/components/combo-box/combo-box.scss → shared/Combobox/Combobox.scss} +0 -0
- /package/lib/components/{commons/components/combo-box/combo-box.type.js → shared/Combobox/ComboboxType.js} +0 -0
- /package/lib/components/{commons/components/combo-box/keyboard-key-codes.js → shared/Combobox/constants.js} +0 -0
- /package/lib/components/{commons/components/errors/errors.scss → shared/ComponentErrors/ComponentErrors.scss} +0 -0
- /package/lib/components/{declarations/declarations.scss → shared/Declarations/Declarations.scss} +0 -0
- /package/lib/components/{commons/components/fieldset.scss → shared/Fieldset/Fieldset.scss} +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/checkbox-checked-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/checkbox-unchecked-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/closed-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/cross-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/icon-props.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/load-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/lunatic-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/lunatic-icon.scss +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/network-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/on-drag-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/opened-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/radio-checked-icon.js +0 -0
- /package/lib/components/{commons/icons → shared/Icons}/radio-unchecked-icon.js +0 -0
- /package/lib/components/{commons/components/label/label.scss → shared/Label/Label.scss} +0 -0
- /package/lib/components/{commons/components/missing/missing.scss → shared/Missing/Missing.scss} +0 -0
- /package/lib/components/{modal-controls/modal-controls.scss → shared/ModalControls/ModalControls.scss} +0 -0
- /package/lib/components/{radio/html/radio-group.scss → shared/Radio/RadioGroup.scss} +0 -0
- /package/lib/components/{commons/components/html-table/table.scss → shared/Table/Table.scss} +0 -0
- /package/lib/components/{commons/components/variable-status/img → shared/VariableStatus/icons}/edited.png +0 -0
- /package/lib/components/{commons/components/variable-status/img → shared/VariableStatus/icons}/forced.png +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.scss +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.spec.js +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/dragger/index.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/index.js +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/index.js +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/is-network.spec.js +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/use-online-status.js +0 -0
- /package/lib/components/{commons/components → shared/suggester-loader-widget}/is-network/use-online-status.spec.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/progress.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/action-tool.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/index.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/tools.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget-container.js +0 -0
- /package/lib/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget.scss +0 -0
- /package/lib/src/components/{button/lunatic-button.spec.d.ts → CheckboxBoolean/CheckboxBoolean.spec.d.ts} +0 -0
- /package/lib/src/components/{checkbox/checkbox-boolean/html/checkbox-boolean.spec.d.ts → CheckboxGroup/CustomCheckboxGroup.spec.d.ts} +0 -0
- /package/lib/src/components/{checkbox/checkbox-group/html/checkbox-group-content.spec.d.ts → CheckboxOne/CheckboxOne.spec.d.ts} +0 -0
- /package/lib/src/components/{checkbox/checkbox-one/html/checkbox-one.spec.d.ts → Datepicker/Datepicker.spec.d.ts} +0 -0
- /package/lib/src/components/{datepicker/html → Datepicker}/DatepickerField.d.ts +0 -0
- /package/lib/src/components/{checkbox/commons/checkbox-option.spec.d.ts → Dropdown/Dropdown.spec.d.ts} +0 -0
- /package/lib/src/components/{duration → Duration}/durationUtils.d.ts +0 -0
- /package/lib/src/components/{duration → Duration}/formatDuration.d.ts +0 -0
- /package/lib/src/components/{duration → Duration}/formatDuration.spec.d.ts +0 -0
- /package/lib/src/components/{duration → Duration}/getDurationFromValue.d.ts +0 -0
- /package/lib/src/components/{commons/components/combo-box/combo-box-container.spec.d.ts → FilterDescription/FilterDescription.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/panel/combo-box-option.spec.d.ts → Input/Input.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/panel/option-container.spec.d.ts → InputNumber/InputNumber.spec.d.ts} +0 -0
- /package/lib/src/components/{loop → Loop}/constant.d.ts +0 -0
- /package/lib/src/components/{lunatic-components.d.ts → LunaticComponents.d.ts} +0 -0
- /package/lib/src/components/{pairwise-links/pairwise-links.d.ts → PairwiseLinks/PairwiseLinks.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/panel/panel-container.spec.d.ts → RosterForLoop/RosterForLoop.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/panel/panel.spec.d.ts → Roundabout/RoundaboutItButton.spec.d.ts} +0 -0
- /package/lib/src/components/{roundabout → Roundabout}/redirect.spec.d.ts +0 -0
- /package/lib/src/components/{roundabout → Roundabout}/roundabout.spec.d.ts +0 -0
- /package/lib/src/components/{commons/components/combo-box/selection/LabelOrInput.spec.d.ts → Subsequence/Subsequence.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/selection/clear-button.spec.d.ts → Textarea/Textarea.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/selection/combo-box-label-selection.spec.d.ts → shared/Button/Button.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/selection/label-selection.spec.d.ts → shared/Button/IconButton.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/selection/selection-container.spec.d.ts → shared/Checkbox/CheckboxOption.spec.d.ts} +0 -0
- /package/lib/src/components/{checkbox/commons → shared/Checkbox}/getShortcutKey.d.ts +0 -0
- /package/lib/src/components/{commons/components/combo-box/selection/selection.spec.d.ts → shared/Combobox/ComboboxContainer.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/description.spec.d.ts → shared/Combobox/Panel/ComboboxOption.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/dragger/dragger.spec.d.ts → shared/Combobox/Panel/ComboboxOptionContainer.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/errors/errors.spec.d.ts → shared/Combobox/Panel/ComboboxPanel.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/fab/fab.spec.d.ts → shared/Combobox/Panel/ComboboxPanelContainer.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/field-container/filed-container.spec.d.ts → shared/Combobox/Selection/ComboboxClearButton.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/fieldset.spec.d.ts → shared/Combobox/Selection/ComboboxLabelSelection.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/html-table/table.spec.d.ts → shared/Combobox/Selection/ComboboxSelection.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/combo-box/keyboard-key-codes.d.ts → shared/Combobox/constants.d.ts} +0 -0
- /package/lib/src/components/{commons/components/html-table/tbody.spec.d.ts → shared/ComponentErrors/ComponentErrors.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/html-table/td.spec.d.ts → shared/Declarations/Declarations.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/html-table/th.spec.d.ts → shared/Fieldset/Fieldset.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/checkbox-checked-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/checkbox-unchecked-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/closed-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/cross-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/icon-props.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/load-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/lunatic-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/network-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/on-drag-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/opened-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/radio-checked-icon.d.ts +0 -0
- /package/lib/src/components/{commons/icons → shared/Icons}/radio-unchecked-icon.d.ts +0 -0
- /package/lib/src/components/{commons/components/html-table/thead.spec.d.ts → shared/Label/Label.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/html-table/tr.spec.d.ts → shared/MDLabel/MDLabel.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/is-network/is-network.spec.d.ts → shared/Missing/Missing.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/is-network/use-online-status.spec.d.ts → shared/ModalControls/ModalControls.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/label/label.spec.d.ts → shared/Radio/RadioOption.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/md-label/md-label.spec.d.ts → shared/Table/Table.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/missing/missing.spec.d.ts → shared/Table/Tbody.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/nothing-to-display.spec.d.ts → shared/Table/Td.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components/variable-status/variable-status.spec.d.ts → shared/Table/Th.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/use-on-handle-change.spec.d.ts → shared/Table/Thead.spec.d.ts} +0 -0
- /package/lib/src/components/{component-set/html/component-set.spec.d.ts → shared/Table/Tr.spec.d.ts} +0 -0
- /package/lib/src/components/{datepicker/html/datepicker.spec.d.ts → shared/VariableStatus/VariableStatus.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/dragger/dragger.d.ts +0 -0
- /package/lib/src/components/{declarations/declaration.spec.d.ts → shared/suggester-loader-widget/dragger/dragger.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/dragger/index.d.ts +0 -0
- /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/index.d.ts +0 -0
- /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/is-network/index.d.ts +0 -0
- /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/is-network/is-network.d.ts +0 -0
- /package/lib/src/components/{declarations/declarations.spec.d.ts → shared/suggester-loader-widget/is-network/is-network.spec.d.ts} +0 -0
- /package/lib/src/components/{commons/components → shared/suggester-loader-widget}/is-network/use-online-status.d.ts +0 -0
- /package/lib/src/components/{dropdown/html/dropdown-writable/filter-tools/filter-options.spec.d.ts → shared/suggester-loader-widget/is-network/use-online-status.spec.d.ts} +0 -0
- /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/progress.d.ts +0 -0
- /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/action-tool.d.ts +0 -0
- /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/index.d.ts +0 -0
- /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/tools/tools.d.ts +0 -0
- /package/lib/src/components/{suggester-loader-widget → shared/suggester-loader-widget}/widget-container.d.ts +0 -0
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
6
|
+
exports.ComboboxPanel = ComboboxPanel;
|
|
7
|
+
var _ComboboxOptionContainer = require("./ComboboxOptionContainer");
|
|
8
|
+
var _ComboboxPanelContainer = require("./ComboboxPanelContainer");
|
|
9
|
+
var _ComboboxOption = require("./ComboboxOption");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Floating menu containing selectable options
|
|
13
|
+
*/
|
|
14
|
+
function ComboboxPanel(_ref) {
|
|
13
15
|
var OptionRender = _ref.optionRenderer,
|
|
14
16
|
_ref$options = _ref.options,
|
|
15
17
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
@@ -20,14 +22,14 @@ function Panel(_ref) {
|
|
|
20
22
|
search = _ref.search,
|
|
21
23
|
onSelect = _ref.onSelect;
|
|
22
24
|
var visibleOptions = expanded ? options : [];
|
|
23
|
-
var ComboBoxOptionComponent = OptionRender !== null && OptionRender !== void 0 ? OptionRender :
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
25
|
+
var ComboBoxOptionComponent = OptionRender !== null && OptionRender !== void 0 ? OptionRender : _ComboboxOption.ComboboxOption;
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanelContainer.ComboboxPanelContainer, {
|
|
25
27
|
expanded: expanded,
|
|
26
28
|
focused: focused,
|
|
27
29
|
id: "".concat(id, "-list"),
|
|
28
30
|
children: visibleOptions.map(function (option, index) {
|
|
29
31
|
var _option$id;
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxOptionContainer.ComboboxOptionContainer, {
|
|
31
33
|
index: index.toString(),
|
|
32
34
|
selected: selectedIndex === index,
|
|
33
35
|
onSelect: onSelect,
|
|
@@ -4,8 +4,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
var _react = require("@testing-library/react");
|
|
5
5
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
6
6
|
var _vitest = require("vitest");
|
|
7
|
-
var
|
|
8
|
-
var _function = require("
|
|
7
|
+
var _ComboboxPanel = require("./ComboboxPanel");
|
|
8
|
+
var _function = require("../../../../utils/function");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
@@ -29,7 +29,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
(0, _vitest.it)('renders null when expanded is false', function () {
|
|
32
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
32
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanel.ComboboxPanel, {
|
|
33
33
|
options: options,
|
|
34
34
|
expanded: false,
|
|
35
35
|
optionRenderer: optionRenderer,
|
|
@@ -38,7 +38,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
38
38
|
(0, _vitest.expect)(_react.screen.queryByRole('option')).not.toBeInTheDocument();
|
|
39
39
|
});
|
|
40
40
|
(0, _vitest.it)('renders the options when expanded is true', function () {
|
|
41
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
41
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanel.ComboboxPanel, {
|
|
42
42
|
optionRenderer: optionRenderer,
|
|
43
43
|
options: options,
|
|
44
44
|
focused: false,
|
|
@@ -85,7 +85,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
85
85
|
while (1) switch (_context.prev = _context.next) {
|
|
86
86
|
case 0:
|
|
87
87
|
handleSelect = _vitest.vi.fn();
|
|
88
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
88
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanel.ComboboxPanel, {
|
|
89
89
|
optionRenderer: optionRenderer,
|
|
90
90
|
options: options,
|
|
91
91
|
focused: false,
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.ComboboxPanelContainer = void 0;
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
-
var
|
|
8
|
+
var _customizedComponent = require("../../HOC/customizedComponent");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
function
|
|
11
|
+
var ComboboxPanelContainer = exports.ComboboxPanelContainer = (0, _customizedComponent.customizedComponent)('ComboboxPanelContainer', function (_ref) {
|
|
12
12
|
var children = _ref.children,
|
|
13
13
|
focused = _ref.focused,
|
|
14
14
|
expanded = _ref.expanded,
|
|
@@ -23,5 +23,4 @@ function PanelContainer(_ref) {
|
|
|
23
23
|
role: "listbox",
|
|
24
24
|
children: children
|
|
25
25
|
});
|
|
26
|
-
}
|
|
27
|
-
var _default = exports["default"] = (0, _createCustomizableField["default"])(PanelContainer, 'ComboboxPanelContainer');
|
|
26
|
+
});
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = require("@testing-library/react");
|
|
4
4
|
var _vitest = require("vitest");
|
|
5
|
-
var
|
|
5
|
+
var _ComboboxPanelContainer = require("./ComboboxPanelContainer");
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
-
|
|
8
|
-
(0, _vitest.describe)('PanelContainer', function () {
|
|
7
|
+
(0, _vitest.describe)('ComboboxPanelContainer', function () {
|
|
9
8
|
(0, _vitest.it)('should render children', function () {
|
|
10
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
9
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ComboboxPanelContainer.ComboboxPanelContainer, {
|
|
11
10
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
12
11
|
children: "Item 1"
|
|
13
12
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
@@ -21,7 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
21
20
|
});
|
|
22
21
|
(0, _vitest.it)('should set the id attribute', function () {
|
|
23
22
|
var id = 'test-panel';
|
|
24
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
23
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanelContainer.ComboboxPanelContainer, {
|
|
25
24
|
id: id,
|
|
26
25
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
27
26
|
children: "Item 1"
|
|
@@ -30,7 +29,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
30
29
|
(0, _vitest.expect)(_react.screen.getByRole('listbox')).toHaveAttribute('id', "lunatic-combo-box-panel-".concat(id));
|
|
31
30
|
});
|
|
32
31
|
(0, _vitest.it)('should set the aria-label attribute', function () {
|
|
33
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
32
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanelContainer.ComboboxPanelContainer, {
|
|
34
33
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
35
34
|
children: "Item 1"
|
|
36
35
|
})
|
|
@@ -38,7 +37,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
38
37
|
(0, _vitest.expect)(_react.screen.getByRole('listbox')).toHaveAttribute('aria-label', 'suggestions');
|
|
39
38
|
});
|
|
40
39
|
(0, _vitest.it)('should set the focused class when focused prop is true', function () {
|
|
41
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
40
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanelContainer.ComboboxPanelContainer, {
|
|
42
41
|
focused: true,
|
|
43
42
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
44
43
|
children: "Item 1"
|
|
@@ -47,7 +46,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
47
46
|
(0, _vitest.expect)(_react.screen.getByRole('listbox')).toHaveClass('focused');
|
|
48
47
|
});
|
|
49
48
|
(0, _vitest.it)('should set the expanded class when expanded prop is true', function () {
|
|
50
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
49
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxPanelContainer.ComboboxPanelContainer, {
|
|
51
50
|
expanded: true,
|
|
52
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
53
52
|
children: "Item 1"
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ComboboxClearButton = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _Icons = require("../../Icons");
|
|
10
|
+
var _customizedComponent = require("../../HOC/customizedComponent");
|
|
11
|
+
var _IconButton = require("../../Button/IconButton");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
14
|
function isDisabled(search) {
|
|
@@ -24,7 +24,7 @@ function createOnKeyDown(onClick) {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function LunaticComboboxClearButton(_ref) {
|
|
28
28
|
var className = _ref.className,
|
|
29
29
|
search = _ref.search,
|
|
30
30
|
onClick = _ref.onClick,
|
|
@@ -35,15 +35,15 @@ function ClearButtonComponent(_ref) {
|
|
|
35
35
|
if (!editable) {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.IconButton, {
|
|
39
39
|
className: (0, _classnames["default"])('mini', 'lunatic-combo-box-fab', className),
|
|
40
40
|
title: "delete",
|
|
41
41
|
onClick: onClick,
|
|
42
42
|
disabled: isDisabled(search),
|
|
43
43
|
onKeyDown: onKeyDown,
|
|
44
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.CrossIcon, {
|
|
45
45
|
className: "lunatic-combo-box-icon"
|
|
46
46
|
})
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
var
|
|
49
|
+
var ComboboxClearButton = exports.ComboboxClearButton = (0, _customizedComponent.customizedComponent)('ComboboxClearButton', LunaticComboboxClearButton);
|
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
var _react = require("@testing-library/react");
|
|
5
5
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
6
6
|
var _vitest = require("vitest");
|
|
7
|
-
var
|
|
7
|
+
var _ComboboxClearButton = require("./ComboboxClearButton");
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
10
|
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
@@ -18,7 +18,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
18
18
|
onClickMock.mockClear();
|
|
19
19
|
});
|
|
20
20
|
(0, _vitest.it)('should not render when editable is false', function () {
|
|
21
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
21
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
22
22
|
editable: false
|
|
23
23
|
}));
|
|
24
24
|
(0, _vitest.expect)(_react.screen.queryByRole('button')).not.toBeInTheDocument();
|
|
@@ -27,7 +27,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
27
27
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
30
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
31
31
|
editable: true,
|
|
32
32
|
search: search,
|
|
33
33
|
onClick: onClickMock
|
|
@@ -46,7 +46,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
46
46
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
47
47
|
while (1) switch (_context2.prev = _context2.next) {
|
|
48
48
|
case 0:
|
|
49
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
49
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
50
50
|
editable: true,
|
|
51
51
|
search: "",
|
|
52
52
|
onClick: onClickMock
|
|
@@ -64,7 +64,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
64
64
|
(0, _vitest.it)('should call onClick when the Enter key is pressed and search is not empty', function () {
|
|
65
65
|
var search = 'test';
|
|
66
66
|
var onClick = _vitest.vi.fn();
|
|
67
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
67
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
68
68
|
search: search,
|
|
69
69
|
onClick: onClick,
|
|
70
70
|
editable: true
|
|
@@ -79,7 +79,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
79
79
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
80
80
|
while (1) switch (_context3.prev = _context3.next) {
|
|
81
81
|
case 0:
|
|
82
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
82
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
83
83
|
editable: true,
|
|
84
84
|
search: "",
|
|
85
85
|
onClick: onClickMock
|
|
@@ -95,7 +95,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
95
95
|
}, _callee3);
|
|
96
96
|
})));
|
|
97
97
|
(0, _vitest.it)('should apply the className prop', function () {
|
|
98
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
98
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
99
99
|
className: className,
|
|
100
100
|
editable: true,
|
|
101
101
|
search: search,
|
|
@@ -104,7 +104,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
104
104
|
(0, _vitest.expect)(_react.screen.getByRole('button')).toHaveClass(className);
|
|
105
105
|
});
|
|
106
106
|
(0, _vitest.it)('should be disabled when search is empty', function () {
|
|
107
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
107
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
108
108
|
editable: true,
|
|
109
109
|
search: "",
|
|
110
110
|
onClick: onClickMock
|
|
@@ -112,7 +112,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
112
112
|
(0, _vitest.expect)(_react.screen.getByRole('button')).toBeDisabled();
|
|
113
113
|
});
|
|
114
114
|
(0, _vitest.it)('should not be disabled when search is not empty', function () {
|
|
115
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
115
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxClearButton.ComboboxClearButton, {
|
|
116
116
|
editable: true,
|
|
117
117
|
search: search,
|
|
118
118
|
onClick: onClickMock
|
|
@@ -4,15 +4,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports.ComboboxInput = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
10
|
+
var _customizedComponent = require("../../HOC/customizedComponent");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
-
function
|
|
15
|
+
function LunaticComboboxInput(_ref) {
|
|
16
16
|
var placeholder = _ref.placeholder,
|
|
17
17
|
disabled = _ref.disabled,
|
|
18
18
|
onChange = _ref.onChange,
|
|
@@ -54,4 +54,4 @@ function Input(_ref) {
|
|
|
54
54
|
onKeyDown: onKeydown
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
var
|
|
57
|
+
var ComboboxInput = exports.ComboboxInput = (0, _customizedComponent.customizedComponent)('ComboboxInput', LunaticComboboxInput);
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.ComboboxLabelSelection = void 0;
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
-
var
|
|
8
|
+
var _customizedComponent = require("../../HOC/customizedComponent");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
function isPlaceholder(option, search) {
|
|
12
|
-
return !option && (!search || search.length === 0);
|
|
13
|
-
}
|
|
14
11
|
function getContent(option, search, placeholder) {
|
|
15
12
|
if (option) {
|
|
16
13
|
var id = option.id,
|
|
@@ -23,7 +20,7 @@ function getContent(option, search, placeholder) {
|
|
|
23
20
|
}
|
|
24
21
|
return placeholder !== null && placeholder !== void 0 ? placeholder : '';
|
|
25
22
|
}
|
|
26
|
-
function
|
|
23
|
+
var LunaticComboBoxLabelSelection = function LunaticComboBoxLabelSelection(_ref) {
|
|
27
24
|
var option = _ref.option,
|
|
28
25
|
placeholder = _ref.placeholder,
|
|
29
26
|
search = _ref.search,
|
|
@@ -31,7 +28,7 @@ function ComboBoxLabelSelection(_ref) {
|
|
|
31
28
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
32
29
|
_ref$readOnly = _ref.readOnly,
|
|
33
30
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
34
|
-
var
|
|
31
|
+
var isPlaceholder = !option && (!search || search.length === 0);
|
|
35
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
36
33
|
className: (0, _classnames["default"])('lunatic-combo-box-selected', {
|
|
37
34
|
disabled: disabled,
|
|
@@ -39,11 +36,11 @@ function ComboBoxLabelSelection(_ref) {
|
|
|
39
36
|
}),
|
|
40
37
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
41
38
|
className: (0, _classnames["default"])({
|
|
42
|
-
placeholder:
|
|
43
|
-
selection: !
|
|
39
|
+
placeholder: isPlaceholder,
|
|
40
|
+
selection: !isPlaceholder
|
|
44
41
|
}),
|
|
45
42
|
children: getContent(option, search, placeholder)
|
|
46
43
|
})
|
|
47
44
|
});
|
|
48
|
-
}
|
|
49
|
-
var
|
|
45
|
+
};
|
|
46
|
+
var ComboboxLabelSelection = exports.ComboboxLabelSelection = (0, _customizedComponent.customizedComponent)('ComboboxLabelSelection', LunaticComboBoxLabelSelection);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _react =
|
|
4
|
-
var
|
|
5
|
-
var _comboBoxLabelSelection = _interopRequireDefault(require("./combo-box-label-selection"));
|
|
3
|
+
var _react = require("@testing-library/react");
|
|
4
|
+
var _ComboboxLabelSelection = require("./ComboboxLabelSelection");
|
|
6
5
|
var _vitest = require("vitest");
|
|
7
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
7
|
(0, _vitest.describe)('DefaultLabelRenderer', function () {
|
|
10
8
|
(0, _vitest.describe)('DefaultLabelRenderer', function () {
|
|
11
9
|
var option = {
|
|
@@ -14,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
14
12
|
label: 'Label'
|
|
15
13
|
};
|
|
16
14
|
(0, _vitest.it)('should render with selected option', function () {
|
|
17
|
-
var _render = (0,
|
|
15
|
+
var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxLabelSelection.ComboboxLabelSelection, {
|
|
18
16
|
option: option,
|
|
19
17
|
placeholder: "Select an option"
|
|
20
18
|
})),
|
|
@@ -23,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
23
21
|
(0, _vitest.expect)(getByText(expectedContent)).toBeInTheDocument();
|
|
24
22
|
});
|
|
25
23
|
(0, _vitest.it)('should render with placeholder', function () {
|
|
26
|
-
var _render2 = (0,
|
|
24
|
+
var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxLabelSelection.ComboboxLabelSelection, {
|
|
27
25
|
option: null,
|
|
28
26
|
placeholder: "Select an option"
|
|
29
27
|
})),
|
|
@@ -31,7 +29,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
31
29
|
(0, _vitest.expect)(getByText('Select an option')).toBeInTheDocument();
|
|
32
30
|
});
|
|
33
31
|
(0, _vitest.it)('should render with search value', function () {
|
|
34
|
-
var _render3 = (0,
|
|
32
|
+
var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxLabelSelection.ComboboxLabelSelection, {
|
|
35
33
|
option: null,
|
|
36
34
|
search: "Search value",
|
|
37
35
|
placeholder: "Select an option"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ComboboxSelection = ComboboxSelection;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _ComboboxLabelSelection = require("./ComboboxLabelSelection");
|
|
9
|
+
var _ComboboxInput = require("./ComboboxInput");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
+
/**
|
|
13
|
+
* Label displayed when a value is selected in the ComboBox
|
|
14
|
+
* This label can either be an input (when editable or expanded) or a simple span
|
|
15
|
+
*/
|
|
16
|
+
function ComboboxSelection(_ref) {
|
|
17
|
+
var labelRenderer = _ref.labelRenderer,
|
|
18
|
+
placeholder = _ref.placeholder,
|
|
19
|
+
search = _ref.search,
|
|
20
|
+
expanded = _ref.expanded,
|
|
21
|
+
disabled = _ref.disabled,
|
|
22
|
+
readOnly = _ref.readOnly,
|
|
23
|
+
focused = _ref.focused,
|
|
24
|
+
_onChange = _ref.onChange,
|
|
25
|
+
selectedIndex = _ref.selectedIndex,
|
|
26
|
+
options = _ref.options,
|
|
27
|
+
editable = _ref.editable,
|
|
28
|
+
labelId = _ref.labelId,
|
|
29
|
+
id = _ref.id,
|
|
30
|
+
classNamePrefix = _ref.classNamePrefix,
|
|
31
|
+
invalid = _ref.invalid;
|
|
32
|
+
var showLabel = !editable || !expanded;
|
|
33
|
+
var selectedOption = selectedIndex !== undefined ? options[selectedIndex] : undefined;
|
|
34
|
+
var LabelSelectionComponent = labelRenderer !== null && labelRenderer !== void 0 ? labelRenderer : _ComboboxLabelSelection.ComboboxLabelSelection;
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
36
|
+
id: id,
|
|
37
|
+
className: (0, _classnames["default"])("".concat(classNamePrefix !== null && classNamePrefix !== void 0 ? classNamePrefix : 'lunatic', "-combo-box-selection"), {
|
|
38
|
+
focused: focused,
|
|
39
|
+
disabled: disabled
|
|
40
|
+
}),
|
|
41
|
+
role: "combobox",
|
|
42
|
+
"aria-controls": 'todo',
|
|
43
|
+
"aria-haspopup": "listbox",
|
|
44
|
+
"aria-expanded": expanded,
|
|
45
|
+
"aria-autocomplete": "list",
|
|
46
|
+
"aria-owns": id,
|
|
47
|
+
"aria-labelledby": labelId,
|
|
48
|
+
children: showLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelSelectionComponent, {
|
|
49
|
+
option: selectedOption,
|
|
50
|
+
placeholder: placeholder,
|
|
51
|
+
search: search,
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
readOnly: readOnly
|
|
54
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxInput.ComboboxInput, {
|
|
55
|
+
invalid: invalid,
|
|
56
|
+
id: "combobox-input-".concat(id),
|
|
57
|
+
className: "lunatic-combo-box-input",
|
|
58
|
+
onChange: function onChange(e) {
|
|
59
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
60
|
+
},
|
|
61
|
+
value: search,
|
|
62
|
+
placeholder: placeholder,
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
readOnly: readOnly,
|
|
65
|
+
focused: focused
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _react = require("@testing-library/react");
|
|
4
|
-
var
|
|
4
|
+
var _ComboboxSelection = require("./ComboboxSelection");
|
|
5
5
|
var _vitest = require("vitest");
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var options = [{
|
|
@@ -16,14 +16,14 @@ var options = [{
|
|
|
16
16
|
}];
|
|
17
17
|
(0, _vitest.describe)('Selection component', function () {
|
|
18
18
|
(0, _vitest.it)('should render correctly with default props', function () {
|
|
19
|
-
var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
19
|
+
var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
|
|
20
20
|
options: options
|
|
21
21
|
})),
|
|
22
22
|
container = _render.container;
|
|
23
23
|
(0, _vitest.expect)(container.firstChild).toMatchSnapshot();
|
|
24
24
|
});
|
|
25
25
|
(0, _vitest.it)('should render correctly when it is editable', function () {
|
|
26
|
-
var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
26
|
+
var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
|
|
27
27
|
options: options,
|
|
28
28
|
editable: true
|
|
29
29
|
})),
|
|
@@ -31,7 +31,7 @@ var options = [{
|
|
|
31
31
|
(0, _vitest.expect)(container.firstChild).toMatchSnapshot();
|
|
32
32
|
});
|
|
33
33
|
(0, _vitest.it)('should render correctly when it is expanded', function () {
|
|
34
|
-
var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
34
|
+
var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
|
|
35
35
|
options: options,
|
|
36
36
|
expanded: true
|
|
37
37
|
})),
|
|
@@ -39,7 +39,7 @@ var options = [{
|
|
|
39
39
|
(0, _vitest.expect)(container.firstChild).toMatchSnapshot();
|
|
40
40
|
});
|
|
41
41
|
(0, _vitest.it)('should render correctly when it is disabled', function () {
|
|
42
|
-
var _render4 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
42
|
+
var _render4 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
|
|
43
43
|
options: options,
|
|
44
44
|
disabled: true,
|
|
45
45
|
placeholder: "hello!"
|
|
@@ -48,7 +48,7 @@ var options = [{
|
|
|
48
48
|
(0, _vitest.expect)(container.firstChild).toMatchSnapshot();
|
|
49
49
|
});
|
|
50
50
|
(0, _vitest.it)('should render the selected option when there is a selection', function () {
|
|
51
|
-
var _render5 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
51
|
+
var _render5 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
|
|
52
52
|
options: options,
|
|
53
53
|
selectedIndex: 0,
|
|
54
54
|
expanded: false
|
|
@@ -57,7 +57,7 @@ var options = [{
|
|
|
57
57
|
(0, _vitest.expect)(getByText('apple - Apple')).toBeInTheDocument();
|
|
58
58
|
});
|
|
59
59
|
(0, _vitest.it)('should not render the input when it is not editable', function () {
|
|
60
|
-
var _render6 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
60
|
+
var _render6 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComboboxSelection.ComboboxSelection, {
|
|
61
61
|
options: options,
|
|
62
62
|
placeholder: "Search fruits",
|
|
63
63
|
editable: false
|
|
@@ -5,9 +5,7 @@ exports[`Selection component > should render correctly when it is disabled 1`] =
|
|
|
5
5
|
aria-autocomplete="list"
|
|
6
6
|
aria-controls="todo"
|
|
7
7
|
aria-haspopup="listbox"
|
|
8
|
-
|
|
9
|
-
class="lunatic-combo-box-selection"
|
|
10
|
-
id="idUndefined"
|
|
8
|
+
class="lunatic-combo-box-selection disabled"
|
|
11
9
|
role="combobox"
|
|
12
10
|
>
|
|
13
11
|
<div
|
|
@@ -27,9 +25,7 @@ exports[`Selection component > should render correctly when it is editable 1`] =
|
|
|
27
25
|
aria-autocomplete="list"
|
|
28
26
|
aria-controls="todo"
|
|
29
27
|
aria-haspopup="listbox"
|
|
30
|
-
aria-owns="idUndefined"
|
|
31
28
|
class="lunatic-combo-box-selection"
|
|
32
|
-
id="idUndefined"
|
|
33
29
|
role="combobox"
|
|
34
30
|
>
|
|
35
31
|
<div
|
|
@@ -48,9 +44,7 @@ exports[`Selection component > should render correctly when it is expanded 1`] =
|
|
|
48
44
|
aria-controls="todo"
|
|
49
45
|
aria-expanded="true"
|
|
50
46
|
aria-haspopup="listbox"
|
|
51
|
-
aria-owns="idUndefined"
|
|
52
47
|
class="lunatic-combo-box-selection"
|
|
53
|
-
id="idUndefined"
|
|
54
48
|
role="combobox"
|
|
55
49
|
>
|
|
56
50
|
<div
|
|
@@ -68,9 +62,7 @@ exports[`Selection component > should render correctly with default props 1`] =
|
|
|
68
62
|
aria-autocomplete="list"
|
|
69
63
|
aria-controls="todo"
|
|
70
64
|
aria-haspopup="listbox"
|
|
71
|
-
aria-owns="idUndefined"
|
|
72
65
|
class="lunatic-combo-box-selection"
|
|
73
|
-
id="idUndefined"
|
|
74
66
|
role="combobox"
|
|
75
67
|
>
|
|
76
68
|
<div
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|