@inseefr/lunatic 3.4.5-rc.0 → 3.4.6-rc.0
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/esm/components/Accordion/Accordion.d.ts +7 -0
- package/esm/components/Accordion/Accordion.js +6 -0
- package/esm/components/Accordion/Accordion.js.map +1 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.d.ts +10 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.js +19 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.js.map +1 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.spec.d.ts +1 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.spec.js +37 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.spec.js.map +1 -0
- package/esm/components/CheckboxGroup/CheckboxGroup.d.ts +2 -0
- package/esm/components/CheckboxGroup/CheckboxGroup.js +7 -0
- package/esm/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.d.ts +7 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.js +17 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.spec.d.ts +1 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.spec.js +45 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.spec.js.map +1 -0
- package/esm/components/CheckboxOne/CheckboxOne.d.ts +5 -0
- package/esm/components/CheckboxOne/CheckboxOne.js +10 -0
- package/esm/components/CheckboxOne/CheckboxOne.js.map +1 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.d.ts +1 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.js +24 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.js.map +1 -0
- package/esm/components/Datepicker/Datepicker.d.ts +9 -0
- package/esm/components/Datepicker/Datepicker.js +66 -0
- package/esm/components/Datepicker/Datepicker.js.map +1 -0
- package/esm/components/Datepicker/Datepicker.spec.d.ts +1 -0
- package/esm/components/Datepicker/Datepicker.spec.js +75 -0
- package/esm/components/Datepicker/Datepicker.spec.js.map +1 -0
- package/esm/components/Datepicker/DatepickerField.d.ts +12 -0
- package/esm/components/Datepicker/DatepickerField.js +13 -0
- package/esm/components/Datepicker/DatepickerField.js.map +1 -0
- package/esm/components/Dropdown/Dropdown.d.ts +9 -0
- package/esm/components/Dropdown/Dropdown.js +15 -0
- package/esm/components/Dropdown/Dropdown.js.map +1 -0
- package/esm/components/Dropdown/Dropdown.spec.d.ts +1 -0
- package/esm/components/Dropdown/Dropdown.spec.js +38 -0
- package/esm/components/Dropdown/Dropdown.spec.js.map +1 -0
- package/esm/components/Dropdown/renderer/SimpleLabelRenderer.d.ts +8 -0
- package/esm/components/Dropdown/renderer/SimpleLabelRenderer.js +19 -0
- package/esm/components/Dropdown/renderer/SimpleLabelRenderer.js.map +1 -0
- package/esm/components/Dropdown/renderer/SimpleOptionRenderer.d.ts +7 -0
- package/esm/components/Dropdown/renderer/SimpleOptionRenderer.js +10 -0
- package/esm/components/Dropdown/renderer/SimpleOptionRenderer.js.map +1 -0
- package/esm/components/Duration/Duration.d.ts +9 -0
- package/esm/components/Duration/Duration.js +34 -0
- package/esm/components/Duration/Duration.js.map +1 -0
- package/esm/components/Duration/durationUtils.d.ts +47 -0
- package/esm/components/Duration/durationUtils.js +26 -0
- package/esm/components/Duration/durationUtils.js.map +1 -0
- package/esm/components/Duration/formatDuration.d.ts +2 -0
- package/esm/components/Duration/formatDuration.js +18 -0
- package/esm/components/Duration/formatDuration.js.map +1 -0
- package/esm/components/Duration/formatDuration.spec.d.ts +1 -0
- package/esm/components/Duration/formatDuration.spec.js +16 -0
- package/esm/components/Duration/formatDuration.spec.js.map +1 -0
- package/esm/components/Duration/getDurationFromValue.d.ts +8 -0
- package/esm/components/Duration/getDurationFromValue.js +36 -0
- package/esm/components/Duration/getDurationFromValue.js.map +1 -0
- package/esm/components/FilterDescription/FilterDescription.d.ts +7 -0
- package/esm/components/FilterDescription/FilterDescription.js +3 -0
- package/esm/components/FilterDescription/FilterDescription.js.map +1 -0
- package/esm/components/FilterDescription/FilterDescription.spec.d.ts +1 -0
- package/esm/components/FilterDescription/FilterDescription.spec.js +16 -0
- package/esm/components/FilterDescription/FilterDescription.spec.js.map +1 -0
- package/esm/components/Input/Input.d.ts +9 -0
- package/esm/components/Input/Input.js +15 -0
- package/esm/components/Input/Input.js.map +1 -0
- package/esm/components/Input/Input.spec.d.ts +1 -0
- package/esm/components/Input/Input.spec.js +52 -0
- package/esm/components/Input/Input.spec.js.map +1 -0
- package/esm/components/InputNumber/InputNumber.d.ts +9 -0
- package/esm/components/InputNumber/InputNumber.js +15 -0
- package/esm/components/InputNumber/InputNumber.js.map +1 -0
- package/esm/components/InputNumber/InputNumber.spec.d.ts +1 -0
- package/esm/components/InputNumber/InputNumber.spec.js +76 -0
- package/esm/components/InputNumber/InputNumber.spec.js.map +1 -0
- package/esm/components/InputNumber/InputNumberThousand.d.ts +14 -0
- package/esm/components/InputNumber/InputNumberThousand.js +20 -0
- package/esm/components/InputNumber/InputNumberThousand.js.map +1 -0
- package/esm/components/Loop/Loop.d.ts +15 -0
- package/esm/components/Loop/Loop.js +56 -0
- package/esm/components/Loop/Loop.js.map +1 -0
- package/esm/components/Loop/constant.d.ts +4 -0
- package/esm/components/Loop/constant.js +10 -0
- package/esm/components/Loop/constant.js.map +1 -0
- package/esm/components/LunaticComponents.d.ts +22 -0
- package/esm/components/LunaticComponents.js +83 -0
- package/esm/components/LunaticComponents.js.map +1 -0
- package/esm/components/PairwiseLinks/PairwiseLinks.d.ts +2 -0
- package/esm/components/PairwiseLinks/PairwiseLinks.js +42 -0
- package/esm/components/PairwiseLinks/PairwiseLinks.js.map +1 -0
- package/esm/components/Question/Question.d.ts +9 -0
- package/esm/components/Question/Question.js +16 -0
- package/esm/components/Question/Question.js.map +1 -0
- package/esm/components/Radio/Radio.d.ts +9 -0
- package/esm/components/Radio/Radio.js +10 -0
- package/esm/components/Radio/Radio.js.map +1 -0
- package/esm/components/RosterForLoop/RosterForLoop.d.ts +5 -0
- package/esm/components/RosterForLoop/RosterForLoop.js +63 -0
- package/esm/components/RosterForLoop/RosterForLoop.js.map +1 -0
- package/esm/components/RosterForLoop/RosterForLoop.spec.d.ts +1 -0
- package/esm/components/RosterForLoop/RosterForLoop.spec.js +28 -0
- package/esm/components/RosterForLoop/RosterForLoop.spec.js.map +1 -0
- package/esm/components/Roundabout/CustomRoundabout.d.ts +16 -0
- package/esm/components/Roundabout/CustomRoundabout.js +31 -0
- package/esm/components/Roundabout/CustomRoundabout.js.map +1 -0
- package/esm/components/Roundabout/Roundabout.d.ts +5 -0
- package/esm/components/Roundabout/Roundabout.js +28 -0
- package/esm/components/Roundabout/Roundabout.js.map +1 -0
- package/esm/components/Roundabout/roundabout.spec.d.ts +1 -0
- package/esm/components/Roundabout/roundabout.spec.js +47 -0
- package/esm/components/Roundabout/roundabout.spec.js.map +1 -0
- package/esm/components/Sequence/Sequence.d.ts +3 -0
- package/esm/components/Sequence/Sequence.js +9 -0
- package/esm/components/Sequence/Sequence.js.map +1 -0
- package/esm/components/Subsequence/Subsequence.d.ts +3 -0
- package/esm/components/Subsequence/Subsequence.js +9 -0
- package/esm/components/Subsequence/Subsequence.js.map +1 -0
- package/esm/components/Subsequence/Subsequence.spec.d.ts +1 -0
- package/esm/components/Subsequence/Subsequence.spec.js +43 -0
- package/esm/components/Subsequence/Subsequence.spec.js.map +1 -0
- package/esm/components/Suggester/CustomSuggester.d.ts +29 -0
- package/esm/components/Suggester/CustomSuggester.js +19 -0
- package/esm/components/Suggester/CustomSuggester.js.map +1 -0
- package/esm/components/Suggester/Suggester.d.ts +2 -0
- package/esm/components/Suggester/Suggester.js +104 -0
- package/esm/components/Suggester/Suggester.js.map +1 -0
- package/esm/components/Suggester/SuggesterNotification.d.ts +9 -0
- package/esm/components/Suggester/SuggesterNotification.js +15 -0
- package/esm/components/Suggester/SuggesterNotification.js.map +1 -0
- package/esm/components/Suggester/SuggesterType.d.ts +5 -0
- package/esm/components/Suggester/SuggesterType.js +2 -0
- package/esm/components/Suggester/SuggesterType.js.map +1 -0
- package/esm/components/Suggester/useSuggestions.d.ts +17 -0
- package/esm/components/Suggester/useSuggestions.js +85 -0
- package/esm/components/Suggester/useSuggestions.js.map +1 -0
- package/esm/components/Summary/Summary.d.ts +25 -0
- package/esm/components/Summary/Summary.js +65 -0
- package/esm/components/Summary/Summary.js.map +1 -0
- package/esm/components/Switch/Switch.d.ts +20 -0
- package/esm/components/Switch/Switch.js +30 -0
- package/esm/components/Switch/Switch.js.map +1 -0
- package/esm/components/Table/Table.d.ts +2 -0
- package/esm/components/Table/Table.js +9 -0
- package/esm/components/Table/Table.js.map +1 -0
- package/esm/components/Text/Text.d.ts +2 -0
- package/esm/components/Text/Text.js +4 -0
- package/esm/components/Text/Text.js.map +1 -0
- package/esm/components/Textarea/Textarea.d.ts +9 -0
- package/esm/components/Textarea/Textarea.js +14 -0
- package/esm/components/Textarea/Textarea.js.map +1 -0
- package/esm/components/Textarea/Textarea.spec.d.ts +1 -0
- package/esm/components/Textarea/Textarea.spec.js +31 -0
- package/esm/components/Textarea/Textarea.spec.js.map +1 -0
- package/esm/components/library.d.ts +73 -0
- package/esm/components/library.js +52 -0
- package/esm/components/library.js.map +1 -0
- package/esm/components/shared/Button/Button.d.ts +14 -0
- package/esm/components/shared/Button/Button.js +13 -0
- package/esm/components/shared/Button/Button.js.map +1 -0
- package/esm/components/shared/Button/Button.spec.d.ts +1 -0
- package/esm/components/shared/Button/Button.spec.js +51 -0
- package/esm/components/shared/Button/Button.spec.js.map +1 -0
- package/esm/components/shared/Button/IconButton.d.ts +6 -0
- package/esm/components/shared/Button/IconButton.js +7 -0
- package/esm/components/shared/Button/IconButton.js.map +1 -0
- package/esm/components/shared/Button/IconButton.spec.d.ts +1 -0
- package/esm/components/shared/Button/IconButton.spec.js +53 -0
- package/esm/components/shared/Button/IconButton.spec.js.map +1 -0
- package/esm/components/shared/Checkbox/CheckboxOption.d.ts +15 -0
- package/esm/components/shared/Checkbox/CheckboxOption.js +26 -0
- package/esm/components/shared/Checkbox/CheckboxOption.js.map +1 -0
- package/esm/components/shared/Checkbox/CheckboxOption.spec.d.ts +1 -0
- package/esm/components/shared/Checkbox/CheckboxOption.spec.js +52 -0
- package/esm/components/shared/Checkbox/CheckboxOption.spec.js.map +1 -0
- package/esm/components/shared/Checkbox/getShortcutKey.d.ts +1 -0
- package/esm/components/shared/Checkbox/getShortcutKey.js +3 -0
- package/esm/components/shared/Checkbox/getShortcutKey.js.map +1 -0
- package/esm/components/shared/Combobox/Combobox.d.ts +25 -0
- package/esm/components/shared/Combobox/Combobox.js +97 -0
- package/esm/components/shared/Combobox/Combobox.js.map +1 -0
- package/esm/components/shared/Combobox/Combobox.stories.d.ts +6 -0
- package/esm/components/shared/Combobox/Combobox.stories.js +47 -0
- package/esm/components/shared/Combobox/Combobox.stories.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContainer.d.ts +11 -0
- package/esm/components/shared/Combobox/ComboboxContainer.js +6 -0
- package/esm/components/shared/Combobox/ComboboxContainer.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContainer.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/ComboboxContainer.spec.js +24 -0
- package/esm/components/shared/Combobox/ComboboxContainer.spec.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContent.d.ts +10 -0
- package/esm/components/shared/Combobox/ComboboxContent.js +35 -0
- package/esm/components/shared/Combobox/ComboboxContent.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContentBox.d.ts +7 -0
- package/esm/components/shared/Combobox/ComboboxContentBox.js +7 -0
- package/esm/components/shared/Combobox/ComboboxContentBox.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxType.d.ts +51 -0
- package/esm/components/shared/Combobox/ComboboxType.js +2 -0
- package/esm/components/shared/Combobox/ComboboxType.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.d.ts +7 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.js +15 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.spec.js +33 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.d.ts +8 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.js +36 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js +18 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.d.ts +5 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.js +30 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.spec.js +57 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.d.ts +8 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.js +8 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js +31 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.d.ts +8 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.js +28 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.spec.js +53 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxInput.d.ts +11 -0
- package/esm/components/shared/Combobox/Selection/ComboboxInput.js +21 -0
- package/esm/components/shared/Combobox/Selection/ComboboxInput.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.d.ts +10 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.js +31 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js +27 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.d.ts +6 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.js +18 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.spec.js +36 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.spec.js.map +1 -0
- package/esm/components/shared/Combobox/constants.d.ts +9 -0
- package/esm/components/shared/Combobox/constants.js +10 -0
- package/esm/components/shared/Combobox/constants.js.map +1 -0
- package/esm/components/shared/Combobox/index.d.ts +0 -0
- package/esm/components/shared/Combobox/index.js +2 -0
- package/esm/components/shared/Combobox/index.js.map +1 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.d.ts +14 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.js +24 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.js.map +1 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.spec.d.ts +1 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.spec.js +40 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.spec.js.map +1 -0
- package/esm/components/shared/ComponentWrapper.d.ts +25 -0
- package/esm/components/shared/ComponentWrapper.js +28 -0
- package/esm/components/shared/ComponentWrapper.js.map +1 -0
- package/esm/components/shared/Declarations/Declarations.d.ts +16 -0
- package/esm/components/shared/Declarations/Declarations.js +14 -0
- package/esm/components/shared/Declarations/Declarations.js.map +1 -0
- package/esm/components/shared/Declarations/Declarations.spec.d.ts +1 -0
- package/esm/components/shared/Declarations/Declarations.spec.js +66 -0
- package/esm/components/shared/Declarations/Declarations.spec.js.map +1 -0
- package/esm/components/shared/Fieldset/Fieldset.d.ts +9 -0
- package/esm/components/shared/Fieldset/Fieldset.js +28 -0
- package/esm/components/shared/Fieldset/Fieldset.js.map +1 -0
- package/esm/components/shared/Fieldset/Fieldset.spec.d.ts +1 -0
- package/esm/components/shared/Fieldset/Fieldset.spec.js +25 -0
- package/esm/components/shared/Fieldset/Fieldset.spec.js.map +1 -0
- package/esm/components/shared/HOC/slottableComponent.d.ts +101 -0
- package/esm/components/shared/HOC/slottableComponent.js +31 -0
- package/esm/components/shared/HOC/slottableComponent.js.map +1 -0
- package/esm/components/shared/Icons/checkbox-checked-icon.d.ts +2 -0
- package/esm/components/shared/Icons/checkbox-checked-icon.js +6 -0
- package/esm/components/shared/Icons/checkbox-checked-icon.js.map +1 -0
- package/esm/components/shared/Icons/checkbox-disabled-icon.d.ts +2 -0
- package/esm/components/shared/Icons/checkbox-disabled-icon.js +6 -0
- package/esm/components/shared/Icons/checkbox-disabled-icon.js.map +1 -0
- package/esm/components/shared/Icons/checkbox-unchecked-icon.d.ts +2 -0
- package/esm/components/shared/Icons/checkbox-unchecked-icon.js +6 -0
- package/esm/components/shared/Icons/checkbox-unchecked-icon.js.map +1 -0
- package/esm/components/shared/Icons/closed-icon.d.ts +2 -0
- package/esm/components/shared/Icons/closed-icon.js +6 -0
- package/esm/components/shared/Icons/closed-icon.js.map +1 -0
- package/esm/components/shared/Icons/cross-icon.d.ts +2 -0
- package/esm/components/shared/Icons/cross-icon.js +6 -0
- package/esm/components/shared/Icons/cross-icon.js.map +1 -0
- package/esm/components/shared/Icons/icon-props.d.ts +5 -0
- package/esm/components/shared/Icons/icon-props.js +2 -0
- package/esm/components/shared/Icons/icon-props.js.map +1 -0
- package/esm/components/shared/Icons/index.d.ts +10 -0
- package/esm/components/shared/Icons/index.js +11 -0
- package/esm/components/shared/Icons/index.js.map +1 -0
- package/esm/components/shared/Icons/load-icon.d.ts +2 -0
- package/esm/components/shared/Icons/load-icon.js +6 -0
- package/esm/components/shared/Icons/load-icon.js.map +1 -0
- package/esm/components/shared/Icons/lunatic-icon.d.ts +4 -0
- package/esm/components/shared/Icons/lunatic-icon.js +6 -0
- package/esm/components/shared/Icons/lunatic-icon.js.map +1 -0
- package/esm/components/shared/Icons/network-icon.d.ts +2 -0
- package/esm/components/shared/Icons/network-icon.js +6 -0
- package/esm/components/shared/Icons/network-icon.js.map +1 -0
- package/esm/components/shared/Icons/on-drag-icon.d.ts +2 -0
- package/esm/components/shared/Icons/on-drag-icon.js +6 -0
- package/esm/components/shared/Icons/on-drag-icon.js.map +1 -0
- package/esm/components/shared/Icons/opened-icon.d.ts +2 -0
- package/esm/components/shared/Icons/opened-icon.js +6 -0
- package/esm/components/shared/Icons/opened-icon.js.map +1 -0
- package/esm/components/shared/Icons/radio-checked-icon.d.ts +3 -0
- package/esm/components/shared/Icons/radio-checked-icon.js +7 -0
- package/esm/components/shared/Icons/radio-checked-icon.js.map +1 -0
- package/esm/components/shared/Icons/radio-unchecked-icon.d.ts +2 -0
- package/esm/components/shared/Icons/radio-unchecked-icon.js +6 -0
- package/esm/components/shared/Icons/radio-unchecked-icon.js.map +1 -0
- package/esm/components/shared/Label/Label.d.ts +10 -0
- package/esm/components/shared/Label/Label.js +15 -0
- package/esm/components/shared/Label/Label.js.map +1 -0
- package/esm/components/shared/Label/Label.spec.d.ts +1 -0
- package/esm/components/shared/Label/Label.spec.js +19 -0
- package/esm/components/shared/Label/Label.spec.js.map +1 -0
- package/esm/components/shared/LabelDescription.d.ts +7 -0
- package/esm/components/shared/LabelDescription.js +11 -0
- package/esm/components/shared/LabelDescription.js.map +1 -0
- package/esm/components/shared/MDLabel/MDLabel.d.ts +5 -0
- package/esm/components/shared/MDLabel/MDLabel.js +20 -0
- package/esm/components/shared/MDLabel/MDLabel.js.map +1 -0
- package/esm/components/shared/MDLabel/MDLabel.spec.d.ts +1 -0
- package/esm/components/shared/MDLabel/MDLabel.spec.js +107 -0
- package/esm/components/shared/MDLabel/MDLabel.spec.js.map +1 -0
- package/esm/components/shared/MDLabel/MarkdownLink.d.ts +7 -0
- package/esm/components/shared/MDLabel/MarkdownLink.js +14 -0
- package/esm/components/shared/MDLabel/MarkdownLink.js.map +1 -0
- package/esm/components/shared/MDLabel/RouterLink.d.ts +6 -0
- package/esm/components/shared/MDLabel/RouterLink.js +7 -0
- package/esm/components/shared/MDLabel/RouterLink.js.map +1 -0
- package/esm/components/shared/Missing/Missing.d.ts +14 -0
- package/esm/components/shared/Missing/Missing.js +52 -0
- package/esm/components/shared/Missing/Missing.js.map +1 -0
- package/esm/components/shared/Missing/Missing.spec.d.ts +1 -0
- package/esm/components/shared/Missing/Missing.spec.js +45 -0
- package/esm/components/shared/Missing/Missing.spec.js.map +1 -0
- package/esm/components/shared/ModalControls/ModalControls.d.ts +10 -0
- package/esm/components/shared/ModalControls/ModalControls.js +29 -0
- package/esm/components/shared/ModalControls/ModalControls.js.map +1 -0
- package/esm/components/shared/ModalControls/ModalControls.spec.d.ts +1 -0
- package/esm/components/shared/ModalControls/ModalControls.spec.js +61 -0
- package/esm/components/shared/ModalControls/ModalControls.spec.js.map +1 -0
- package/esm/components/shared/Notification.d.ts +8 -0
- package/esm/components/shared/Notification.js +8 -0
- package/esm/components/shared/Notification.js.map +1 -0
- package/esm/components/shared/Radio/RadioGroup.d.ts +7 -0
- package/esm/components/shared/Radio/RadioGroup.js +23 -0
- package/esm/components/shared/Radio/RadioGroup.js.map +1 -0
- package/esm/components/shared/Radio/RadioOption.d.ts +17 -0
- package/esm/components/shared/Radio/RadioOption.js +38 -0
- package/esm/components/shared/Radio/RadioOption.js.map +1 -0
- package/esm/components/shared/Radio/RadioOption.spec.d.ts +1 -0
- package/esm/components/shared/Radio/RadioOption.spec.js +46 -0
- package/esm/components/shared/Radio/RadioOption.spec.js.map +1 -0
- package/esm/components/shared/Table/Table.d.ts +8 -0
- package/esm/components/shared/Table/Table.js +13 -0
- package/esm/components/shared/Table/Table.js.map +1 -0
- package/esm/components/shared/Table/Table.spec.d.ts +1 -0
- package/esm/components/shared/Table/Table.spec.js +15 -0
- package/esm/components/shared/Table/Table.spec.js.map +1 -0
- package/esm/components/shared/Table/TableHeader.d.ts +2 -0
- package/esm/components/shared/Table/TableHeader.js +14 -0
- package/esm/components/shared/Table/TableHeader.js.map +1 -0
- package/esm/components/shared/Table/Tbody.d.ts +6 -0
- package/esm/components/shared/Table/Tbody.js +8 -0
- package/esm/components/shared/Table/Tbody.js.map +1 -0
- package/esm/components/shared/Table/Tbody.spec.d.ts +1 -0
- package/esm/components/shared/Table/Tbody.spec.js +22 -0
- package/esm/components/shared/Table/Tbody.spec.js.map +1 -0
- package/esm/components/shared/Table/Td.d.ts +11 -0
- package/esm/components/shared/Table/Td.js +8 -0
- package/esm/components/shared/Table/Td.js.map +1 -0
- package/esm/components/shared/Table/Td.spec.d.ts +1 -0
- package/esm/components/shared/Table/Td.spec.js +21 -0
- package/esm/components/shared/Table/Td.spec.js.map +1 -0
- package/esm/components/shared/Table/Th.d.ts +10 -0
- package/esm/components/shared/Table/Th.js +8 -0
- package/esm/components/shared/Table/Th.js.map +1 -0
- package/esm/components/shared/Table/Th.spec.d.ts +1 -0
- package/esm/components/shared/Table/Th.spec.js +25 -0
- package/esm/components/shared/Table/Th.spec.js.map +1 -0
- package/esm/components/shared/Table/Thead.d.ts +6 -0
- package/esm/components/shared/Table/Thead.js +8 -0
- package/esm/components/shared/Table/Thead.js.map +1 -0
- package/esm/components/shared/Table/Thead.spec.d.ts +1 -0
- package/esm/components/shared/Table/Thead.spec.js +12 -0
- package/esm/components/shared/Table/Thead.spec.js.map +1 -0
- package/esm/components/shared/Table/Tr.d.ts +7 -0
- package/esm/components/shared/Table/Tr.js +8 -0
- package/esm/components/shared/Table/Tr.js.map +1 -0
- package/esm/components/shared/Table/Tr.spec.d.ts +1 -0
- package/esm/components/shared/Table/Tr.spec.js +19 -0
- package/esm/components/shared/Table/Tr.spec.js.map +1 -0
- package/esm/components/shared/Table/index.d.ts +7 -0
- package/esm/components/shared/Table/index.js +8 -0
- package/esm/components/shared/Table/index.js.map +1 -0
- package/esm/components/type.d.ts +305 -0
- package/esm/components/type.js +2 -0
- package/esm/components/type.js.map +1 -0
- package/esm/constants/component-types.d.ts +1 -0
- package/esm/constants/component-types.js +2 -0
- package/esm/constants/component-types.js.map +1 -0
- package/esm/constants/declarations.d.ts +9 -0
- package/esm/constants/declarations.js +12 -0
- package/esm/constants/declarations.js.map +1 -0
- package/esm/constants/event-types.d.ts +10 -0
- package/esm/constants/event-types.js +13 -0
- package/esm/constants/event-types.js.map +1 -0
- package/esm/constants/index.d.ts +5 -0
- package/esm/constants/index.js +6 -0
- package/esm/constants/index.js.map +1 -0
- package/esm/constants/indexedDBStore.d.ts +21 -0
- package/esm/constants/indexedDBStore.js +19 -0
- package/esm/constants/indexedDBStore.js.map +1 -0
- package/esm/constants/supported-preferences.d.ts +1 -0
- package/esm/constants/supported-preferences.js +10 -0
- package/esm/constants/supported-preferences.js.map +1 -0
- package/esm/constants/value-types.d.ts +5 -0
- package/esm/constants/value-types.js +6 -0
- package/esm/constants/value-types.js.map +1 -0
- package/esm/constants/variable-types.d.ts +2 -0
- package/esm/constants/variable-types.js +5 -0
- package/esm/constants/variable-types.js.map +1 -0
- package/esm/hooks/use-auto-focus.d.ts +6 -0
- package/esm/hooks/use-auto-focus.js +19 -0
- package/esm/hooks/use-auto-focus.js.map +1 -0
- package/esm/hooks/use-track-changes.d.ts +11 -0
- package/esm/hooks/use-track-changes.js +41 -0
- package/esm/hooks/use-track-changes.js.map +1 -0
- package/esm/hooks/use-why-render.d.ts +4 -0
- package/esm/hooks/use-why-render.js +14 -0
- package/esm/hooks/use-why-render.js.map +1 -0
- package/esm/hooks/useDebounce.d.ts +4 -0
- package/esm/hooks/useDebounce.js +24 -0
- package/esm/hooks/useDebounce.js.map +1 -0
- package/esm/hooks/useDocumentEvent.d.ts +2 -0
- package/esm/hooks/useDocumentEvent.js +18 -0
- package/esm/hooks/useDocumentEvent.js.map +1 -0
- package/esm/hooks/useKeyboardKey.d.ts +4 -0
- package/esm/hooks/useKeyboardKey.js +25 -0
- package/esm/hooks/useKeyboardKey.js.map +1 -0
- package/esm/hooks/useListKeyboardHandler.d.ts +11 -0
- package/esm/hooks/useListKeyboardHandler.js +28 -0
- package/esm/hooks/useListKeyboardHandler.js.map +1 -0
- package/esm/hooks/useRefSync.d.ts +4 -0
- package/esm/hooks/useRefSync.js +10 -0
- package/esm/hooks/useRefSync.js.map +1 -0
- package/esm/i18n/build-dictionary.d.ts +24 -0
- package/esm/i18n/build-dictionary.js +37 -0
- package/esm/i18n/build-dictionary.js.map +1 -0
- package/esm/i18n/dictionary.d.ts +57 -0
- package/esm/i18n/dictionary.js +27 -0
- package/esm/i18n/dictionary.js.map +1 -0
- package/esm/i18n/index.d.ts +7 -0
- package/esm/i18n/index.js +13 -0
- package/esm/i18n/index.js.map +1 -0
- package/esm/i18n/inputNumberProps.d.ts +13 -0
- package/esm/i18n/inputNumberProps.js +7 -0
- package/esm/i18n/inputNumberProps.js.map +1 -0
- package/esm/index.d.ts +14 -0
- package/esm/index.js +12 -0
- package/esm/index.js.map +1 -0
- package/esm/tests/setup.d.ts +1 -0
- package/esm/tests/setup.js +18 -0
- package/esm/tests/setup.js.map +1 -0
- package/esm/tests/utils/lunatic.d.ts +19 -0
- package/esm/tests/utils/lunatic.js +31 -0
- package/esm/tests/utils/lunatic.js.map +1 -0
- package/esm/tests/utils/timer.d.ts +1 -0
- package/esm/tests/utils/timer.js +4 -0
- package/esm/tests/utils/timer.js.map +1 -0
- package/esm/tsconfig-esm.tsbuildinfo +1 -0
- package/esm/type.source.d.ts +408 -0
- package/esm/type.source.js +7 -0
- package/esm/type.source.js.map +1 -0
- package/esm/type.utils.d.ts +5 -0
- package/esm/type.utils.js +2 -0
- package/esm/type.utils.js.map +1 -0
- package/esm/use-lunatic/actions.d.ts +50 -0
- package/esm/use-lunatic/actions.js +26 -0
- package/esm/use-lunatic/actions.js.map +1 -0
- package/esm/use-lunatic/commons/check-loops.d.ts +30 -0
- package/esm/use-lunatic/commons/check-loops.js +63 -0
- package/esm/use-lunatic/commons/check-loops.js.map +1 -0
- package/esm/use-lunatic/commons/check-pager.d.ts +5 -0
- package/esm/use-lunatic/commons/check-pager.js +17 -0
- package/esm/use-lunatic/commons/check-pager.js.map +1 -0
- package/esm/use-lunatic/commons/compile-controls.d.ts +9 -0
- package/esm/use-lunatic/commons/compile-controls.js +156 -0
- package/esm/use-lunatic/commons/compile-controls.js.map +1 -0
- package/esm/use-lunatic/commons/component.d.ts +22 -0
- package/esm/use-lunatic/commons/component.js +22 -0
- package/esm/use-lunatic/commons/component.js.map +1 -0
- package/esm/use-lunatic/commons/create-map-pages.d.ts +6 -0
- package/esm/use-lunatic/commons/create-map-pages.js +58 -0
- package/esm/use-lunatic/commons/create-map-pages.js.map +1 -0
- package/esm/use-lunatic/commons/execute-condition-filter.d.ts +3 -0
- package/esm/use-lunatic/commons/execute-condition-filter.js +11 -0
- package/esm/use-lunatic/commons/execute-condition-filter.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +34 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js +149 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +83 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.d.ts +25 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.js +41 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -0
- package/esm/use-lunatic/commons/get-compatible-vtl-expression.d.ts +7 -0
- package/esm/use-lunatic/commons/get-compatible-vtl-expression.js +19 -0
- package/esm/use-lunatic/commons/get-compatible-vtl-expression.js.map +1 -0
- package/esm/use-lunatic/commons/get-components-from-state.d.ts +5 -0
- package/esm/use-lunatic/commons/get-components-from-state.js +22 -0
- package/esm/use-lunatic/commons/get-components-from-state.js.map +1 -0
- package/esm/use-lunatic/commons/index.d.ts +6 -0
- package/esm/use-lunatic/commons/index.js +7 -0
- package/esm/use-lunatic/commons/index.js.map +1 -0
- package/esm/use-lunatic/commons/is-First-last-page.d.ts +6 -0
- package/esm/use-lunatic/commons/is-First-last-page.js +8 -0
- package/esm/use-lunatic/commons/is-First-last-page.js.map +1 -0
- package/esm/use-lunatic/commons/is-paginated-loop.d.ts +6 -0
- package/esm/use-lunatic/commons/is-paginated-loop.js +5 -0
- package/esm/use-lunatic/commons/is-paginated-loop.js.map +1 -0
- package/esm/use-lunatic/commons/is-roundabout.d.ts +2 -0
- package/esm/use-lunatic/commons/is-roundabout.js +5 -0
- package/esm/use-lunatic/commons/is-roundabout.js.map +1 -0
- package/esm/use-lunatic/commons/page-navigation.d.ts +7 -0
- package/esm/use-lunatic/commons/page-navigation.js +95 -0
- package/esm/use-lunatic/commons/page-navigation.js.map +1 -0
- package/esm/use-lunatic/commons/page-navigation.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/page-navigation.spec.js +136 -0
- package/esm/use-lunatic/commons/page-navigation.spec.js.map +1 -0
- package/esm/use-lunatic/commons/page-tag.d.ts +23 -0
- package/esm/use-lunatic/commons/page-tag.js +56 -0
- package/esm/use-lunatic/commons/page-tag.js.map +1 -0
- package/esm/use-lunatic/commons/page-tag.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/page-tag.spec.js +38 -0
- package/esm/use-lunatic/commons/page-tag.spec.js.map +1 -0
- package/esm/use-lunatic/commons/page.d.ts +11 -0
- package/esm/use-lunatic/commons/page.js +35 -0
- package/esm/use-lunatic/commons/page.js.map +1 -0
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +7 -0
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +55 -0
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -0
- package/esm/use-lunatic/commons/variables/behaviours/missing-behaviour.d.ts +7 -0
- package/esm/use-lunatic/commons/variables/behaviours/missing-behaviour.js +26 -0
- package/esm/use-lunatic/commons/variables/behaviours/missing-behaviour.js.map +1 -0
- package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.d.ts +7 -0
- package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +62 -0
- package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.js.map +1 -0
- package/esm/use-lunatic/commons/variables/errors.d.ts +19 -0
- package/esm/use-lunatic/commons/variables/errors.js +28 -0
- package/esm/use-lunatic/commons/variables/errors.js.map +1 -0
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.d.ts +3 -0
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.js +53 -0
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +90 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +349 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +438 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -0
- package/esm/use-lunatic/hooks/use-loop-variables.d.ts +5 -0
- package/esm/use-lunatic/hooks/use-loop-variables.js +18 -0
- package/esm/use-lunatic/hooks/use-loop-variables.js.map +1 -0
- package/esm/use-lunatic/hooks/use-page-has-response.d.ts +6 -0
- package/esm/use-lunatic/hooks/use-page-has-response.js +89 -0
- package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -0
- package/esm/use-lunatic/hooks/useOverview.d.ts +16 -0
- package/esm/use-lunatic/hooks/useOverview.js +92 -0
- package/esm/use-lunatic/hooks/useOverview.js.map +1 -0
- package/esm/use-lunatic/hooks/useWarnDepChange.d.ts +6 -0
- package/esm/use-lunatic/hooks/useWarnDepChange.js +17 -0
- package/esm/use-lunatic/hooks/useWarnDepChange.js.map +1 -0
- package/esm/use-lunatic/logger/ConsoleLogger.d.ts +5 -0
- package/esm/use-lunatic/logger/ConsoleLogger.js +12 -0
- package/esm/use-lunatic/logger/ConsoleLogger.js.map +1 -0
- package/esm/use-lunatic/logger/type.d.ts +9 -0
- package/esm/use-lunatic/logger/type.js +2 -0
- package/esm/use-lunatic/logger/type.js.map +1 -0
- package/esm/use-lunatic/lunatic-context.d.ts +28 -0
- package/esm/use-lunatic/lunatic-context.js +44 -0
- package/esm/use-lunatic/lunatic-context.js.map +1 -0
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +291 -0
- package/esm/use-lunatic/props/getComponentTypeProps.js +165 -0
- package/esm/use-lunatic/props/getComponentTypeProps.js.map +1 -0
- package/esm/use-lunatic/props/propIterations.d.ts +7 -0
- package/esm/use-lunatic/props/propIterations.js +26 -0
- package/esm/use-lunatic/props/propIterations.js.map +1 -0
- package/esm/use-lunatic/props/propMissingResponse.d.ts +9 -0
- package/esm/use-lunatic/props/propMissingResponse.js +13 -0
- package/esm/use-lunatic/props/propMissingResponse.js.map +1 -0
- package/esm/use-lunatic/props/propOptions.d.ts +37 -0
- package/esm/use-lunatic/props/propOptions.js +75 -0
- package/esm/use-lunatic/props/propOptions.js.map +1 -0
- package/esm/use-lunatic/props/propOptions.spec.d.ts +1 -0
- package/esm/use-lunatic/props/propOptions.spec.js +57 -0
- package/esm/use-lunatic/props/propOptions.spec.js.map +1 -0
- package/esm/use-lunatic/props/propValue.d.ts +6 -0
- package/esm/use-lunatic/props/propValue.js +29 -0
- package/esm/use-lunatic/props/propValue.js.map +1 -0
- package/esm/use-lunatic/props/propValue.spec.d.ts +1 -0
- package/esm/use-lunatic/props/propValue.spec.js +54 -0
- package/esm/use-lunatic/props/propValue.spec.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.d.ts +5 -0
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.js +52 -0
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/index.d.ts +2 -0
- package/esm/use-lunatic/reducer/commons/index.js +3 -0
- package/esm/use-lunatic/reducer/commons/index.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/resize-array-variable.d.ts +5 -0
- package/esm/use-lunatic/reducer/commons/resize-array-variable.js +21 -0
- package/esm/use-lunatic/reducer/commons/resize-array-variable.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/validate-condition-filter.d.ts +6 -0
- package/esm/use-lunatic/reducer/commons/validate-condition-filter.js +12 -0
- package/esm/use-lunatic/reducer/commons/validate-condition-filter.js.map +1 -0
- package/esm/use-lunatic/reducer/controls/check-base-control.d.ts +2 -0
- package/esm/use-lunatic/reducer/controls/check-base-control.js +35 -0
- package/esm/use-lunatic/reducer/controls/check-base-control.js.map +1 -0
- package/esm/use-lunatic/reducer/controls/check-roundabout-control.d.ts +9 -0
- package/esm/use-lunatic/reducer/controls/check-roundabout-control.js +22 -0
- package/esm/use-lunatic/reducer/controls/check-roundabout-control.js.map +1 -0
- package/esm/use-lunatic/reducer/overview/overviewOnInit.d.ts +6 -0
- package/esm/use-lunatic/reducer/overview/overviewOnInit.js +50 -0
- package/esm/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -0
- package/esm/use-lunatic/reducer/reduce-go-next-page.js +62 -0
- package/esm/use-lunatic/reducer/reduce-go-next-page.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-go-previous-page.d.ts +2 -0
- package/esm/use-lunatic/reducer/reduce-go-previous-page.js +31 -0
- package/esm/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-go-to-page.d.ts +3 -0
- package/esm/use-lunatic/reducer/reduce-go-to-page.js +55 -0
- package/esm/use-lunatic/reducer/reduce-go-to-page.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-handle-changes.d.ts +6 -0
- package/esm/use-lunatic/reducer/reduce-handle-changes.js +26 -0
- package/esm/use-lunatic/reducer/reduce-handle-changes.js.map +1 -0
- package/esm/use-lunatic/reducer/reducer.d.ts +3 -0
- package/esm/use-lunatic/reducer/reducer.js +20 -0
- package/esm/use-lunatic/reducer/reducer.js.map +1 -0
- package/esm/use-lunatic/reducer/reducerInitializer.d.ts +14 -0
- package/esm/use-lunatic/reducer/reducerInitializer.js +130 -0
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -0
- package/esm/use-lunatic/replace-component-sequence.d.ts +36 -0
- package/esm/use-lunatic/replace-component-sequence.js +19 -0
- package/esm/use-lunatic/replace-component-sequence.js.map +1 -0
- package/esm/use-lunatic/type.d.ts +166 -0
- package/esm/use-lunatic/type.js +2 -0
- package/esm/use-lunatic/type.js.map +1 -0
- package/esm/use-lunatic/use-lunatic.d.ts +37 -0
- package/esm/use-lunatic/use-lunatic.js +140 -0
- package/esm/use-lunatic/use-lunatic.js.map +1 -0
- package/esm/utils/array.d.ts +32 -0
- package/esm/utils/array.js +107 -0
- package/esm/utils/array.js.map +1 -0
- package/esm/utils/array.spec.d.ts +1 -0
- package/esm/utils/array.spec.js +42 -0
- package/esm/utils/array.spec.js.map +1 -0
- package/esm/utils/constants/alphabet.d.ts +1 -0
- package/esm/utils/constants/alphabet.js +2 -0
- package/esm/utils/constants/alphabet.js.map +1 -0
- package/esm/utils/constants/features.d.ts +4 -0
- package/esm/utils/constants/features.js +5 -0
- package/esm/utils/constants/features.js.map +1 -0
- package/esm/utils/constants/index.d.ts +5 -0
- package/esm/utils/constants/index.js +6 -0
- package/esm/utils/constants/index.js.map +1 -0
- package/esm/utils/constants/links.d.ts +2 -0
- package/esm/utils/constants/links.js +3 -0
- package/esm/utils/constants/links.js.map +1 -0
- package/esm/utils/constants/missing.d.ts +2 -0
- package/esm/utils/constants/missing.js +3 -0
- package/esm/utils/constants/missing.js.map +1 -0
- package/esm/utils/constants/variable-status.d.ts +5 -0
- package/esm/utils/constants/variable-status.js +6 -0
- package/esm/utils/constants/variable-status.js.map +1 -0
- package/esm/utils/constants/variable-types.d.ts +1 -0
- package/esm/utils/constants/variable-types.js +2 -0
- package/esm/utils/constants/variable-types.js.map +1 -0
- package/esm/utils/dom.d.ts +14 -0
- package/esm/utils/dom.js +23 -0
- package/esm/utils/dom.js.map +1 -0
- package/esm/utils/env.d.ts +1 -0
- package/esm/utils/env.js +13 -0
- package/esm/utils/env.js.map +1 -0
- package/esm/utils/function.d.ts +5 -0
- package/esm/utils/function.js +23 -0
- package/esm/utils/function.js.map +1 -0
- package/esm/utils/is-element.d.ts +3 -0
- package/esm/utils/is-element.js +6 -0
- package/esm/utils/is-element.js.map +1 -0
- package/esm/utils/is-object.d.ts +4 -0
- package/esm/utils/is-object.js +7 -0
- package/esm/utils/is-object.js.map +1 -0
- package/esm/utils/logger.d.ts +6 -0
- package/esm/utils/logger.js +15 -0
- package/esm/utils/logger.js.map +1 -0
- package/esm/utils/number.d.ts +9 -0
- package/esm/utils/number.js +32 -0
- package/esm/utils/number.js.map +1 -0
- package/esm/utils/number.spec.d.ts +1 -0
- package/esm/utils/number.spec.js +10 -0
- package/esm/utils/number.spec.js.map +1 -0
- package/esm/utils/object.d.ts +6 -0
- package/esm/utils/object.js +27 -0
- package/esm/utils/object.js.map +1 -0
- package/esm/utils/search/SearchInterface.d.ts +12 -0
- package/esm/utils/search/SearchInterface.js +2 -0
- package/esm/utils/search/SearchInterface.js.map +1 -0
- package/esm/utils/search/SearchMinisearch.d.ts +11 -0
- package/esm/utils/search/SearchMinisearch.js +39 -0
- package/esm/utils/search/SearchMinisearch.js.map +1 -0
- package/esm/utils/search/SuggestersDatabase.d.ts +15 -0
- package/esm/utils/search/SuggestersDatabase.js +38 -0
- package/esm/utils/search/SuggestersDatabase.js.map +1 -0
- package/esm/utils/search/melauto.d.ts +15 -0
- package/esm/utils/search/melauto.js +44 -0
- package/esm/utils/search/melauto.js.map +1 -0
- package/esm/utils/search/tokenizer.d.ts +14 -0
- package/esm/utils/search/tokenizer.js +57 -0
- package/esm/utils/search/tokenizer.js.map +1 -0
- package/esm/utils/to-number.d.ts +4 -0
- package/esm/utils/to-number.js +13 -0
- package/esm/utils/to-number.js.map +1 -0
- package/esm/utils/variables.d.ts +5 -0
- package/esm/utils/variables.js +21 -0
- package/esm/utils/variables.js.map +1 -0
- package/esm/utils/variables.spec.d.ts +1 -0
- package/esm/utils/variables.spec.js +83 -0
- package/esm/utils/variables.spec.js.map +1 -0
- package/esm/utils/vtl.d.ts +14 -0
- package/esm/utils/vtl.js +93 -0
- package/esm/utils/vtl.js.map +1 -0
- package/package.json +750 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
export function SimpleOptionRenderer({ option, selected }) {
|
|
4
|
+
const { value, label } = option;
|
|
5
|
+
if (label && typeof label === 'string' && label.length) {
|
|
6
|
+
return (_jsxs("div", { className: classnames('lunatic-dropdown-option', { selected }), children: [_jsx("span", { className: "id", children: value }), _jsx("span", { children: "\u00A0\u2014\u00A0" }), _jsx("span", { className: "label", children: label })] }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsx("div", { className: classnames('lunatic-dropdown-option', { selected }), children: _jsx("span", { className: "id", children: label }) }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=SimpleOptionRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleOptionRenderer.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/renderer/SimpleOptionRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAQpC,MAAM,UAAU,oBAAoB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAS;IAC/D,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEhC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACxD,OAAO,CACN,eAAK,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,aAClE,eAAM,SAAS,EAAC,IAAI,YAAE,KAAK,GAAQ,EACnC,gDAAiC,EACjC,eAAM,SAAS,EAAC,OAAO,YAAE,KAAK,GAAQ,IACjC,CACN,CAAC;IACH,CAAC;IACD,OAAO,CACN,cAAK,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,YAClE,eAAM,SAAS,EAAC,IAAI,YAAE,KAAK,GAAQ,GAC9B,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LunaticComponentProps } from '../type';
|
|
2
|
+
import type { LunaticError } from '../../use-lunatic/type';
|
|
3
|
+
export declare function Duration({ handleChanges, response, errors, ...props }: LunaticComponentProps<'Duration'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
type CustomProps = Omit<LunaticComponentProps<'Duration'>, 'response' | 'handleChanges' | 'errors'> & {
|
|
5
|
+
onChange: (v: string | null) => void;
|
|
6
|
+
errors?: LunaticError[];
|
|
7
|
+
};
|
|
8
|
+
export declare const CustomDuration: import("react").ComponentType<CustomProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { getDurationFromValue } from './getDurationFromValue';
|
|
4
|
+
import { clampDuration, labelByUnit, propsByUnit } from './durationUtils';
|
|
5
|
+
import { formatDuration } from './formatDuration';
|
|
6
|
+
import classnames from 'classnames';
|
|
7
|
+
import { objectKeys } from '../../utils/object';
|
|
8
|
+
import { slottableComponent } from '../shared/HOC/slottableComponent';
|
|
9
|
+
import { ComponentErrors, getComponentErrors, } from '../shared/ComponentErrors/ComponentErrors';
|
|
10
|
+
import { Declarations } from '../shared/Declarations/Declarations';
|
|
11
|
+
export function Duration({ handleChanges, response, errors, ...props }) {
|
|
12
|
+
return (_jsx(CustomDuration, { ...props, onChange: (value) => handleChanges([{ name: response.name, value }]), errors: getComponentErrors(errors, props.id) }));
|
|
13
|
+
}
|
|
14
|
+
export const CustomDuration = slottableComponent('Duration', (props) => {
|
|
15
|
+
const { errors, value, label, format, onChange, declarations, id } = props;
|
|
16
|
+
// We need to keep an internal state since one field can be empty (null value in duration)
|
|
17
|
+
// but we still send "0" and we don't want the field to display "0"
|
|
18
|
+
const [duration, setDuration] = useState(getDurationFromValue(value, format));
|
|
19
|
+
// Generate handler for a specific unit field (year, month...)
|
|
20
|
+
const changeHandler = (unit) => (e) => {
|
|
21
|
+
if (!e.target.checkValidity()) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const fieldValue = clampDuration(Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber, unit);
|
|
25
|
+
const newDuration = { ...duration, [unit]: fieldValue };
|
|
26
|
+
onChange(formatDuration(newDuration));
|
|
27
|
+
setDuration(newDuration);
|
|
28
|
+
};
|
|
29
|
+
return (_jsxs("fieldset", { className: classnames('lunatic-input'), children: [label && _jsx("legend", { children: label }), _jsx(Declarations, { type: "AFTER_QUESTION_TEXT", declarations: declarations, id: id }), _jsx("div", { className: "duration-fields", children: objectKeys(duration).map((unit) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return (_jsxs("div", { className: "duration-field", children: [_jsx("label", { htmlFor: `${unit}Input`, className: "input-label", children: labelByUnit[unit] }), _jsx("input", { id: `${unit}Input`, type: "number", value: (_a = duration[unit]) !== null && _a !== void 0 ? _a : '', className: "input-field", onChange: changeHandler(unit), ...propsByUnit[unit] })] }, unit));
|
|
32
|
+
}) }), _jsx(ComponentErrors, { errors: errors })] }));
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=Duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Duration.js","sourceRoot":"","sources":["../../../src/components/Duration/Duration.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EACN,eAAe,EACf,kBAAkB,GAClB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,MAAM,UAAU,QAAQ,CAAC,EACxB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EAC2B;IACnC,OAAO,CACN,KAAC,c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AAC,aAC9C,KAAK,IAAI,2BAAS,KAAK,GAAU,EAClC,KAAC,YAAY,IACZ,IAAI,EAAC,qBAAqB,EAC1B,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,EAAE,GACL,EACF,cAAK,SAAS,EAAC,iBAAiB,YAC9B,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;;oBAAC,OAAA,CACnC,eAAK,SAAS,EAAC,gBAAgB,aAC9B,gBAAO,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,SAAS,EAAC,aAAa,YACrD,WAAW,CAAC,IAAI,CAAC,GACX,EACR,gBACC,EAAE,EAAE,GAAG,IAAI,OAAO,EAClB,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,mCAAI,EAAE,EAC3B,SAAS,EAAC,aAAa,EACvB,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,KACzB,WAAW,CAAC,IAAI,CAAC,GACpB,KAXkC,IAAI,CAYnC,CACN,CAAA;iBAAA,CAAC,GACG,EACN,KAAC,eAAe,IAAC,MAAM,EAAE,MAAM,GAAI,IACzB,CACX,CAAC;AACH,CAAC,CACD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type DurationValue = {
|
|
2
|
+
hours?: number | null;
|
|
3
|
+
minutes?: number | null;
|
|
4
|
+
years?: number | null;
|
|
5
|
+
months?: number | null;
|
|
6
|
+
};
|
|
7
|
+
export type Formats = 'PTnHnM' | 'PnYnM';
|
|
8
|
+
export declare const propsByUnit: {
|
|
9
|
+
hours: {
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
size: number;
|
|
13
|
+
style: {
|
|
14
|
+
width: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
minutes: {
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
size: number;
|
|
21
|
+
style: {
|
|
22
|
+
width: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
months: {
|
|
26
|
+
min: number;
|
|
27
|
+
max: number;
|
|
28
|
+
size: number;
|
|
29
|
+
style: {
|
|
30
|
+
width: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
years: {
|
|
34
|
+
min: number;
|
|
35
|
+
size: number;
|
|
36
|
+
style: {
|
|
37
|
+
width: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const labelByUnit: {
|
|
42
|
+
hours: string;
|
|
43
|
+
minutes: string;
|
|
44
|
+
months: string;
|
|
45
|
+
years: string;
|
|
46
|
+
};
|
|
47
|
+
export declare function clampDuration(value: number | null, unit: keyof typeof propsByUnit): number | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const propsByUnit = {
|
|
2
|
+
hours: { min: 0, max: 99, size: 2, style: { width: '2.5em' } },
|
|
3
|
+
minutes: { min: 0, max: 59, size: 2, style: { width: '2.5em' } },
|
|
4
|
+
months: { min: 0, max: 11, size: 2, style: { width: '2.5em' } },
|
|
5
|
+
years: { min: 0, size: 4, style: { width: '4em' } },
|
|
6
|
+
};
|
|
7
|
+
export const labelByUnit = {
|
|
8
|
+
hours: 'Heures :',
|
|
9
|
+
minutes: 'Minutes :',
|
|
10
|
+
months: 'Mois : ',
|
|
11
|
+
years: 'Années :',
|
|
12
|
+
};
|
|
13
|
+
export function clampDuration(value, unit) {
|
|
14
|
+
if (value === null) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
const props = propsByUnit[unit];
|
|
18
|
+
if (value < props.min) {
|
|
19
|
+
return props.min;
|
|
20
|
+
}
|
|
21
|
+
if ('max' in props && value > props.max) {
|
|
22
|
+
return props.max;
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=durationUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dur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,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const formatDuration = (duration) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const prefix = 'hours' in duration && 'minutes' in duration ? 'PT' : 'P';
|
|
4
|
+
// The duration has no numeric value (all nulls), then return null
|
|
5
|
+
if (Object.values(duration).filter((v) => v !== null).length === 0) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
// Recreate unit so we can control the unit order for formatting
|
|
9
|
+
const units = ['years', 'months', 'hours', 'minutes'];
|
|
10
|
+
let durationParts = '';
|
|
11
|
+
for (const unit of units) {
|
|
12
|
+
if (unit in duration) {
|
|
13
|
+
durationParts += ((_a = duration[unit]) !== null && _a !== void 0 ? _a : 0) + unit[0].toUpperCase();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return prefix + durationParts;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=formatDuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDuration.js","sourceRoot":"","sources":["../../../src/components/Duration/formatDuration.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAuB,EAAiB,EAAE;;IACxE,MAAM,MAAM,GAAG,OAAO,IAAI,QAAQ,IAAI,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IACzE,kEAAkE;IAClE,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpE,OAAO,IAAI,CAAC;IACb,CAAC;IAED,gEAAgE;IAChE,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;IAC/D,IAAI,aAAa,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,IAAI,IAAI,QAAQ,EAAE,CAAC;YACtB,aAAa,IAAI,CAAC,MAAA,QAAQ,CAAC,IAAI,CAAC,mCAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAChE,CAAC;IACF,CAAC;IACD,OAAO,MAAM,GAAG,aAAa,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { formatDuration } from './formatDuration';
|
|
3
|
+
describe('formatDuration', () => {
|
|
4
|
+
it('should format time correctly', () => {
|
|
5
|
+
expect(formatDuration({ hours: 12, minutes: 15 })).toEqual('PT12H15M');
|
|
6
|
+
expect(formatDuration({ hours: 14, minutes: 50 })).toEqual('PT14H50M');
|
|
7
|
+
expect(formatDuration({ hours: null, minutes: null })).toEqual(null);
|
|
8
|
+
});
|
|
9
|
+
it('should format date correctly', () => {
|
|
10
|
+
expect(formatDuration({ years: 12, months: 15 })).toEqual('P12Y15M');
|
|
11
|
+
expect(formatDuration({ years: 14, months: 50 })).toEqual('P14Y50M');
|
|
12
|
+
expect(formatDuration({ years: 14, months: null })).toEqual('P14Y0M');
|
|
13
|
+
expect(formatDuration({ years: null, months: null })).toEqual(null);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=formatDuration.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDuration.spec.js","sourceRoot":"","sources":["../../../src/components/Duration/formatDuration.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,QAAQ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
|
|
4
|
+
*
|
|
5
|
+
* ## Example
|
|
6
|
+
* - "P12Y5M" => {year: 12, month: 5}
|
|
7
|
+
*/
|
|
8
|
+
export declare const getDurationFromValue: (value: string | null, format: Formats) => DurationValue;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a string into a duration
|
|
3
|
+
*
|
|
4
|
+
* ## Example
|
|
5
|
+
* - "P12Y5M" => {year: 12, month: 5}
|
|
6
|
+
*/
|
|
7
|
+
export const getDurationFromValue = (value, format) => {
|
|
8
|
+
// Handle nulls value
|
|
9
|
+
if (value === null && format === 'PTnHnM') {
|
|
10
|
+
return { hours: null, minutes: null };
|
|
11
|
+
}
|
|
12
|
+
else if (value === null) {
|
|
13
|
+
return { years: null, months: null };
|
|
14
|
+
}
|
|
15
|
+
const match = matchFromFormat(value, format);
|
|
16
|
+
if (format === 'PTnHnM') {
|
|
17
|
+
return { hours: match[0], minutes: match[1] };
|
|
18
|
+
}
|
|
19
|
+
return { years: match[0], months: match[1] };
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Generate a regexp from the format to extract the numbers from the string
|
|
23
|
+
*
|
|
24
|
+
* ## Example :
|
|
25
|
+
* - "P12Y3M" => [12, 3]
|
|
26
|
+
*/
|
|
27
|
+
const matchFromFormat = (value, format) => {
|
|
28
|
+
const regex = new RegExp(format.replaceAll('n', '(\\d+)'));
|
|
29
|
+
const match = value.match(regex);
|
|
30
|
+
if (!match) {
|
|
31
|
+
throw new Error(`Invalid duration value "${value}" does not match the format "${format}"`);
|
|
32
|
+
}
|
|
33
|
+
const [, ...matches] = match;
|
|
34
|
+
return matches.map((v) => parseInt(v, 10));
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=getDurationFromValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDurationFromValue.js","sourceRoot":"","sources":["../../../src/components/Duration/getDurationFromValue.ts"],"names":[],"mappings":"AAEA;;;;;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,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const FilterDescription = ({ id, label }) => (_jsx("div", { id: `filter-description-${id}`, "aria-label": `filter-description`, className: "filter-description-lunatic", children: label }));
|
|
3
|
+
//# sourceMappingURL=FilterDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDescription.js","sourceRoot":"","sources":["../../../src/components/FilterDescription/FilterDescription.tsx"],"names":[],"mappings":";AAOA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAS,EAAE,EAAE,CAAC,CAC1D,cACC,EAAE,EAAE,sBAAsB,EAAE,EAAE,gBAClB,oBAAoB,EAChC,SAAS,EAAC,4BAA4B,YAErC,KAAK,GACD,CACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { FilterDescription } from './FilterDescription';
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
5
|
+
describe('FilterDescription component', () => {
|
|
6
|
+
it('renders with correct label and aria-label', () => {
|
|
7
|
+
const id = '1';
|
|
8
|
+
const label = 'Filter description';
|
|
9
|
+
const { getByLabelText } = render(_jsx(FilterDescription, { id: id, label: label }));
|
|
10
|
+
const filterDescriptionElement = getByLabelText('filter-description');
|
|
11
|
+
expect(filterDescriptionElement).toHaveTextContent(label);
|
|
12
|
+
expect(filterDescriptionElement).toHaveClass('filter-description-lunatic');
|
|
13
|
+
expect(filterDescriptionElement).toHaveAttribute('id', `filter-description-${id}`);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=FilterDescription.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDescription.spec.js","sourceRoot":"","sources":["../../../src/components/FilterDescription/FilterDescription.spec.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACpD,MAAM,EAAE,GAAG,GAAG,CAAC;QACf,MAAM,KAAK,GAAG,oBAAoB,CAAC;QACnC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAChC,KAAC,iBAAiB,IAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAC3C,CAAC;QACF,MAAM,wBAAwB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;QACtE,MAAM,CAAC,wBAAwB,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,CAAC,wBAAwB,CAAC,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;QAC3E,MAAM,CAAC,wBAAwB,CAAC,CAAC,eAAe,CAC/C,IAAI,EACJ,sBAAsB,EAAE,EAAE,CAC1B,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LunaticComponentProps } from '../type';
|
|
2
|
+
import type { LunaticError } from '../../use-lunatic/type';
|
|
3
|
+
export declare function Input({ handleChanges, response, errors, ...props }: LunaticComponentProps<'Input'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
type CustomProps = Omit<LunaticComponentProps<'Input'>, 'response' | 'handleChanges' | 'errors'> & {
|
|
5
|
+
onChange: (v: string) => void;
|
|
6
|
+
errors?: LunaticError[];
|
|
7
|
+
};
|
|
8
|
+
export declare const CustomInput: import("react").ComponentType<CustomProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { Label } from '../shared/Label/Label';
|
|
4
|
+
import { slottableComponent } from '../shared/HOC/slottableComponent';
|
|
5
|
+
import { ComponentErrors, getComponentErrors, } from '../shared/ComponentErrors/ComponentErrors';
|
|
6
|
+
import { Declarations } from '../shared/Declarations/Declarations';
|
|
7
|
+
export function Input({ handleChanges, response, errors, ...props }) {
|
|
8
|
+
return (_jsx(CustomInput, { ...props, onChange: (value) => handleChanges([{ name: response.name, value }]), errors: getComponentErrors(errors, props.id) }));
|
|
9
|
+
}
|
|
10
|
+
export const CustomInput = slottableComponent('Input', (props) => {
|
|
11
|
+
const { value, onChange, disabled, required, maxLength, label, description, id, errors, readOnly, declarations, } = props;
|
|
12
|
+
const labelId = `label-${id}`;
|
|
13
|
+
return (_jsxs("div", { className: classnames('lunatic-input'), children: [_jsx(Label, { htmlFor: id, id: labelId, description: description, children: label }), _jsx(Declarations, { type: "AFTER_QUESTION_TEXT", declarations: declarations, id: id }), _jsx("input", { id: id, "aria-labelledby": labelId, autoComplete: "off", type: "text", disabled: disabled, readOnly: readOnly, value: (value !== null && value !== void 0 ? value : '').toString(), onChange: (e) => onChange(e.target.value), "aria-required": required, required: required, maxLength: maxLength, "aria-invalid": !!errors }), _jsx(ComponentErrors, { errors: errors })] }));
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,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Q,EAClB,KAAK,EAAE,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,mBAC1B,QAAQ,EACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,kBACN,CAAC,CAAC,MAAM,GACrB,EACF,KAAC,eAAe,IAAC,MAAM,EAAE,MAAM,GAAI,IAC9B,CACN,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { Input } from './Input';
|
|
5
|
+
describe('Input', () => {
|
|
6
|
+
const mockOnChange = vi.fn();
|
|
7
|
+
const baseProps = {
|
|
8
|
+
value: 'input',
|
|
9
|
+
id: 'input',
|
|
10
|
+
response: { name: 'demo' },
|
|
11
|
+
handleChanges: mockOnChange,
|
|
12
|
+
};
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
mockOnChange.mockClear();
|
|
15
|
+
});
|
|
16
|
+
it('renders without crashing', () => {
|
|
17
|
+
const { container } = render(_jsx(Input, { ...baseProps, errors: undefined, description: "description" }));
|
|
18
|
+
expect(container).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
it('renders label and input', () => {
|
|
21
|
+
const labelText = 'Enter a number';
|
|
22
|
+
const { container } = render(_jsx(Input, { ...baseProps, label: labelText, errors: undefined }));
|
|
23
|
+
const label = screen.getByText(labelText);
|
|
24
|
+
const input = container.querySelector('input[type="text"]');
|
|
25
|
+
expect(label).toBeInTheDocument();
|
|
26
|
+
expect(input).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
it('calls onChange with parsed value', () => {
|
|
29
|
+
const { container } = render(_jsx(Input, { ...baseProps, errors: undefined }));
|
|
30
|
+
const input = container.querySelector('input[type="text"]');
|
|
31
|
+
fireEvent.change(input, { target: { value: 'Dupont' } });
|
|
32
|
+
expect(mockOnChange).toHaveBeenCalledTimes(1);
|
|
33
|
+
expect(mockOnChange).toHaveBeenCalledWith([
|
|
34
|
+
{ ...baseProps.response, value: 'Dupont' },
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
it('disables input when disabled prop is true', () => {
|
|
38
|
+
const { container } = render(_jsx(Input, { ...baseProps, disabled: true, errors: undefined }));
|
|
39
|
+
const input = container.querySelector('input[type="text"]');
|
|
40
|
+
expect(input).toBeDisabled();
|
|
41
|
+
});
|
|
42
|
+
it('should handle readOnly', () => {
|
|
43
|
+
const { container } = render(_jsx(Input, { ...baseProps, id: "number", value: "toto", readOnly: true, errors: undefined }));
|
|
44
|
+
expect(container).toMatchSnapshot();
|
|
45
|
+
const input = container.querySelector('input[type="text"]');
|
|
46
|
+
expect(input).toHaveAttribute('readonly');
|
|
47
|
+
input.focus();
|
|
48
|
+
expect(input).toHaveFocus();
|
|
49
|
+
expect(input).toHaveValue('toto');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=Input.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.spec.js","sourceRoot":"","sources":["../../../src/components/Input/Input.spec.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACtB,MAAM,YA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AAK,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LunaticComponentProps } from '../type';
|
|
2
|
+
import type { LunaticError } from '../../use-lunatic/type';
|
|
3
|
+
export declare function InputNumber({ handleChanges, response, errors, decimals, ...props }: LunaticComponentProps<'InputNumber'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
type CustomProps = Omit<LunaticComponentProps<'InputNumber'>, 'response' | 'handleChanges' | 'errors'> & {
|
|
5
|
+
onChange: (v: number | null) => void;
|
|
6
|
+
errors?: LunaticError[];
|
|
7
|
+
};
|
|
8
|
+
export declare const CustomInputNumber: import("react").ComponentType<CustomProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InputNumberThousand } from './InputNumberThousand';
|
|
3
|
+
import { Label } from '../shared/Label/Label';
|
|
4
|
+
import { ComponentErrors, getComponentErrors, } from '../shared/ComponentErrors/ComponentErrors';
|
|
5
|
+
import { slottableComponent } from '../shared/HOC/slottableComponent';
|
|
6
|
+
import { Declarations } from '../shared/Declarations/Declarations';
|
|
7
|
+
export function InputNumber({ handleChanges, response, errors, decimals, ...props }) {
|
|
8
|
+
return (_jsx(CustomInputNumber, { ...props, decimals: decimals !== null && decimals !== void 0 ? decimals : 0, onChange: (value) => handleChanges([{ name: response.name, value }]), errors: getComponentErrors(errors, props.id) }));
|
|
9
|
+
}
|
|
10
|
+
export const CustomInputNumber = slottableComponent('InputNumber', (props) => {
|
|
11
|
+
const { id, value, onChange, disabled, readOnly, max, decimals, unit, label, errors, required, description, declarations, } = props;
|
|
12
|
+
const labelId = `label-${id}`;
|
|
13
|
+
return (_jsxs("div", { className: "lunatic-input-number", children: [_jsx(Label, { htmlFor: id, id: labelId, description: description, children: label }), _jsx(Declarations, { type: "AFTER_QUESTION_TEXT", declarations: declarations, id: id }), _jsx(InputNumberThousand, { id: id, value: value, onChange: onChange, disabled: !!disabled, readOnly: !!readOnly, required: !!required, labelId: labelId, max: max, decimals: decimals, invalid: !!errors }), unit && _jsx("span", { children: unit }), _jsx(ComponentErrors, { errors: errors })] }));
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=InputNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNumber.js","sourceRoot":"","sources":["../../../src/components/InputNumber/InputNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EACN,eAAe,EACf,kBAAkB,GAClB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGnE,MAAM,UAAU,WAAW,CAAC,EAC3B,aAAa,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,GAAG,KAAK,EAC8B;IACtC,OAAO,CACN,KAAC,iBAAiB,OACb,KAAK,EACT,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EACpE,MAAM,EAAE,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAC3C,CACF,CAAC;AACH,CAAC;AAUD,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAClD,aAAa,EACb,CAAC,KAAK,EAAE,EAAE;IACT,MAAM,EACL,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,GACZ,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,SAAS,EAAE,EAAE,CAAC;IAC9B,OAAO,CACN,eAAK,SAAS,EAAC,sBAAsB,aACpC,KAAC,KAAK,IAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,YACvD,KAAK,GACC,EACR,KAAC,YAAY,IACZ,IAAI,EAAC,qBAAqB,EAC1B,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,EAAE,GACL,EACF,KAAC,mBAAmB,IACnB,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,CAAC,MAAM,GAChB,EACD,IAAI,IAAI,yBAAO,IAAI,GAAQ,EAC5B,KAAC,eAAe,IAAC,MAAM,EAAE,MAAM,GAAI,IAC9B,CACN,CAAC;AACH,CAAC,CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { InputNumber } from './InputNumber';
|
|
5
|
+
describe('InputNumber', () => {
|
|
6
|
+
const mockOnChange = vi.fn();
|
|
7
|
+
const baseProps = {
|
|
8
|
+
handleChanges: mockOnChange,
|
|
9
|
+
response: { name: 'demo' },
|
|
10
|
+
value: 10,
|
|
11
|
+
id: 'number',
|
|
12
|
+
'aria-labelledby': 'input',
|
|
13
|
+
};
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
mockOnChange.mockClear();
|
|
16
|
+
});
|
|
17
|
+
it('renders without crashing', () => {
|
|
18
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps }));
|
|
19
|
+
expect(container).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
it('renders label and input', () => {
|
|
22
|
+
const labelText = 'Enter a number';
|
|
23
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps, label: labelText, handleChanges: mockOnChange }));
|
|
24
|
+
const label = screen.getByText(labelText);
|
|
25
|
+
const input = container.querySelector('input[type="text"]');
|
|
26
|
+
expect(label).toBeInTheDocument();
|
|
27
|
+
expect(input).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
it('renders with value', () => {
|
|
30
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps }));
|
|
31
|
+
const input = container.querySelector('input[type="text"]');
|
|
32
|
+
expect(input).toHaveValue('10');
|
|
33
|
+
});
|
|
34
|
+
it('renders with big value', () => {
|
|
35
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps, value: 10000.45, decimals: 2 }));
|
|
36
|
+
const input = container.querySelector('input[type="text"]');
|
|
37
|
+
expect(input).toHaveValue('10,000.45');
|
|
38
|
+
});
|
|
39
|
+
it('calls onChange with parsed value', () => {
|
|
40
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps, id: "number" }));
|
|
41
|
+
const input = container.querySelector('input[type="text"]');
|
|
42
|
+
fireEvent.change(input, { target: { value: '12' } });
|
|
43
|
+
expect(mockOnChange).toHaveBeenCalledTimes(1);
|
|
44
|
+
expect(mockOnChange).toHaveBeenCalledWith([
|
|
45
|
+
{
|
|
46
|
+
...baseProps.response,
|
|
47
|
+
value: 12,
|
|
48
|
+
},
|
|
49
|
+
]);
|
|
50
|
+
});
|
|
51
|
+
it('renders unit element if provided', () => {
|
|
52
|
+
const { getByText } = render(_jsx(InputNumber, { ...baseProps, id: "input-number-test", value: 5, label: "Input Number", unit: "kg" }));
|
|
53
|
+
const unit = getByText('kg');
|
|
54
|
+
expect(unit).toBeInTheDocument();
|
|
55
|
+
});
|
|
56
|
+
it('disables input when disabled prop is true', () => {
|
|
57
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps, disabled: true }));
|
|
58
|
+
const input = container.querySelector('input[type="text"]');
|
|
59
|
+
expect(input).toBeDisabled();
|
|
60
|
+
});
|
|
61
|
+
it('should handle readOnly', () => {
|
|
62
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps, value: 123, readOnly: true }));
|
|
63
|
+
expect(container).toMatchSnapshot();
|
|
64
|
+
const input = container.querySelector('input[type="text"]');
|
|
65
|
+
expect(input).toHaveAttribute('readonly');
|
|
66
|
+
input.focus();
|
|
67
|
+
expect(input).toHaveFocus();
|
|
68
|
+
expect(input).toHaveValue('123');
|
|
69
|
+
});
|
|
70
|
+
it('renders with unit', () => {
|
|
71
|
+
const { container } = render(_jsx(InputNumber, { ...baseProps, unit: "kg" }));
|
|
72
|
+
const unit = container.querySelector('span');
|
|
73
|
+
expect(unit).toHaveTextContent('kg');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=InputNumber.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNumber.spec.js","sourceRoot":"","sources":["../../../src/components/InputNumber/InputNumber.spec.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,MAAM,YA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C,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
onChange: (n: number | null) => void;
|
|
4
|
+
value?: number | null;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
labelId?: string;
|
|
9
|
+
max?: number;
|
|
10
|
+
decimals?: number;
|
|
11
|
+
invalid?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const InputNumberThousand: ({ id, onChange, value, disabled, readOnly, required, labelId, max, decimals, invalid, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { NumericFormat, } from 'react-number-format';
|
|
5
|
+
import { inputNumberPropsI18N } from '../../i18n';
|
|
6
|
+
export const InputNumberThousand = ({ id, onChange, value, disabled, readOnly, required, labelId, max, decimals, invalid, }) => {
|
|
7
|
+
const handleChange = useCallback(function (e) {
|
|
8
|
+
var _a;
|
|
9
|
+
const val = (_a = e.floatValue) !== null && _a !== void 0 ? _a : null;
|
|
10
|
+
onChange(Number.isNaN(val) ? null : val);
|
|
11
|
+
}, [onChange]);
|
|
12
|
+
const isAllowed = useCallback((values) => {
|
|
13
|
+
const { floatValue } = values;
|
|
14
|
+
if (Number.isInteger(max) && floatValue && max)
|
|
15
|
+
return floatValue <= max || false;
|
|
16
|
+
return true;
|
|
17
|
+
}, [max]);
|
|
18
|
+
return (_jsx(NumericFormat, { id: id, className: classNames({ disabled }), onValueChange: handleChange, value: value !== null && value !== void 0 ? value : '', "aria-labelledby": labelId, disabled: disabled, readOnly: readOnly, required: required, lang: "en", isAllowed: isAllowed, allowedDecimalSeparators: inputNumberPropsI18N.allDecimalSeparators, decimalSeparator: inputNumberPropsI18N.decimalSeparator, decimalScale: decimals, allowLeadingZeros: true, thousandSeparator: inputNumberPropsI18N.thousandSeparator, inputMode: decimals ? 'decimal' : 'numeric', "aria-invalid": invalid }));
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=InputNumberThousand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNumberThousand.js","sourceRoot":"","sources":["../../../src/components/InputNumber/InputNumberThousand.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EACN,aAAa,GAGb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAelD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EACnC,EAAE,EACF,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,GAAG,EACH,QAAQ,EACR,OAAO,GACA,EAAE,EAAE;IACX,MAAM,YAAY,GAAG,WAAW,CAC/B,UAAU,CAAC;;QACV,MAAM,GAAG,GAAG,MAAA,CAAC,CAAC,UAAU,mCAAI,IAAI,CAAC;QACjC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC,EACD,CAAC,QAAQ,CAAC,CACV,CAAC;IAEF,MAAM,SAAS,GAAG,WAAW,CAC5B,CAAC,MAA0B,EAAE,EAAE;QAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,IAAI,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,UAAU,IAAI,GAAG;YAC7C,OAAO,UAAU,IAAI,GAAG,IAAI,KAAK,CAAC;QACnC,OAAO,IAAI,CAAC;IACb,CAAC,EACD,CAAC,GAAG,CAAC,CACL,CAAC;IACF,OAAO,CACN,KAAC,aAAa,IACb,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC,EACnC,aAAa,EAAE,YAAY,EAC3B,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,qBACD,OAAO,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,IAAI,EACT,SAAS,EAAE,SAAS,EACpB,wBAAwB,EAAE,oBAAoB,CAAC,oBAAoB,EACnE,gBAAgB,EAAE,oBAAoB,CAAC,gBAAgB,EACvD,YAAY,EAAE,QAAQ,EACtB,iBAAiB,QACjB,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB,EACzD,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,kBAC7B,OAAO,GACpB,CACF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { LunaticComponentProps } from '../type';
|
|
3
|
+
import type { LunaticError } from '../../use-lunatic/type';
|
|
4
|
+
/**
|
|
5
|
+
* Loop without specific markup (stack of subcomponents)
|
|
6
|
+
*/
|
|
7
|
+
export declare function Loop({ lines, iterations, value, handleChanges, getComponents, errors, ...props }: LunaticComponentProps<'Loop'>): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
type CustomProps = Omit<LunaticComponentProps<'RosterForLoop' | 'Loop'>, 'response' | 'handleChanges' | 'errors' | 'lines' | 'iterations' | 'value' | 'getComponents'> & PropsWithChildren<{
|
|
9
|
+
errors?: LunaticError[];
|
|
10
|
+
addRow?: () => void;
|
|
11
|
+
removeRow?: () => void;
|
|
12
|
+
canControlRows?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const CustomLoop: import("react").ComponentType<CustomProps>;
|
|
15
|
+
export {};
|