iguazio.dashboard-react-controls 2.2.25 → 3.0.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/dist/components/Backdrop/Backdrop.d.ts +14 -0
- package/dist/components/Backdrop/Backdrop.d.ts.map +1 -0
- package/dist/components/Backdrop/Backdrop.mjs +29 -0
- package/dist/components/Backdrop/Backdrop.mjs.map +1 -0
- package/dist/components/Button/Button.d.ts +28 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.mjs +43 -0
- package/dist/components/Button/Button.mjs.map +1 -0
- package/dist/components/Button/Button.stories.d.ts +14 -0
- package/dist/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +33 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.mjs +83 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.mjs.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts.map +1 -0
- package/dist/components/FormCheckBox/FormCheckBox.d.ts +21 -0
- package/dist/components/FormCheckBox/FormCheckBox.d.ts.map +1 -0
- package/dist/components/FormCheckBox/FormCheckBox.mjs +54 -0
- package/dist/components/FormCheckBox/FormCheckBox.mjs.map +1 -0
- package/dist/components/FormCheckBox/FormCheckbox.stories.d.ts +7 -0
- package/dist/components/FormCheckBox/FormCheckbox.stories.d.ts.map +1 -0
- package/dist/components/FormChipCell/FormChip/FormChip.d.ts +45 -0
- package/dist/components/FormChipCell/FormChip/FormChip.d.ts.map +1 -0
- package/dist/components/FormChipCell/FormChip/FormChip.mjs +78 -0
- package/dist/components/FormChipCell/FormChip/FormChip.mjs.map +1 -0
- package/dist/components/FormChipCell/FormChipCell.d.ts +44 -0
- package/dist/components/FormChipCell/FormChipCell.d.ts.map +1 -0
- package/dist/components/FormChipCell/FormChipCell.mjs +239 -0
- package/dist/components/FormChipCell/FormChipCell.mjs.map +1 -0
- package/dist/components/FormChipCell/FormChipCellView.d.ts +56 -0
- package/dist/components/FormChipCell/FormChipCellView.d.ts.map +1 -0
- package/dist/components/FormChipCell/FormChipCellView.mjs +169 -0
- package/dist/components/FormChipCell/FormChipCellView.mjs.map +1 -0
- package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.d.ts +22 -0
- package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.d.ts.map +1 -0
- package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.mjs +72 -0
- package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.mjs.map +1 -0
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.d.ts +35 -0
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.d.ts.map +1 -0
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.mjs +270 -0
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.mjs.map +1 -0
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.d.ts +16 -0
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.d.ts.map +1 -0
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.mjs +36 -0
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.mjs.map +1 -0
- package/dist/components/FormChipCell/formChipCell.util.d.ts +6 -0
- package/dist/components/FormChipCell/formChipCell.util.d.ts.map +1 -0
- package/dist/components/FormChipCell/formChipCell.util.mjs +24 -0
- package/dist/components/FormChipCell/formChipCell.util.mjs.map +1 -0
- package/dist/components/FormCombobox/FormCombobox.d.ts +56 -0
- package/dist/components/FormCombobox/FormCombobox.d.ts.map +1 -0
- package/dist/components/FormCombobox/FormCombobox.mjs +278 -0
- package/dist/components/FormCombobox/FormCombobox.mjs.map +1 -0
- package/dist/components/FormCombobox/FormCombobox.stories.d.ts +12 -0
- package/dist/components/FormCombobox/FormCombobox.stories.d.ts.map +1 -0
- package/dist/components/FormInput/FormInput.d.ts +3 -0
- package/dist/components/FormInput/FormInput.d.ts.map +1 -0
- package/dist/components/FormInput/FormInput.mjs +272 -0
- package/dist/components/FormInput/FormInput.mjs.map +1 -0
- package/dist/components/FormInput/FormInput.stories.d.ts +14 -0
- package/dist/components/FormInput/FormInput.stories.d.ts.map +1 -0
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.d.ts +20 -0
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.d.ts.map +1 -0
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.mjs +61 -0
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.mjs.map +1 -0
- package/dist/components/FormKeyValueTable/FormKeyValueTable.d.ts +49 -0
- package/dist/components/FormKeyValueTable/FormKeyValueTable.d.ts.map +1 -0
- package/dist/components/FormKeyValueTable/FormKeyValueTable.mjs +202 -0
- package/dist/components/FormKeyValueTable/FormKeyValueTable.mjs.map +1 -0
- package/dist/components/FormOnChange/FormOnChange.d.ts +12 -0
- package/dist/components/FormOnChange/FormOnChange.d.ts.map +1 -0
- package/dist/components/FormOnChange/FormOnChange.mjs +33 -0
- package/dist/components/FormOnChange/FormOnChange.mjs.map +1 -0
- package/dist/components/FormRadio/FormRadio.d.ts +19 -0
- package/dist/components/FormRadio/FormRadio.d.ts.map +1 -0
- package/dist/components/FormRadio/FormRadio.mjs +57 -0
- package/dist/components/FormRadio/FormRadio.mjs.map +1 -0
- package/dist/components/FormRadio/FormRadio.stories.d.ts +7 -0
- package/dist/components/FormRadio/FormRadio.stories.d.ts.map +1 -0
- package/dist/components/FormSelect/FormSelect.d.ts +43 -0
- package/dist/components/FormSelect/FormSelect.d.ts.map +1 -0
- package/dist/components/FormSelect/FormSelect.mjs +257 -0
- package/dist/components/FormSelect/FormSelect.mjs.map +1 -0
- package/dist/components/FormSelect/FormSelect.stories.d.ts +10 -0
- package/dist/components/FormSelect/FormSelect.stories.d.ts.map +1 -0
- package/dist/components/FormTextarea/FormTextarea.d.ts +40 -0
- package/dist/components/FormTextarea/FormTextarea.d.ts.map +1 -0
- package/dist/components/FormTextarea/FormTextarea.mjs +122 -0
- package/dist/components/FormTextarea/FormTextarea.mjs.map +1 -0
- package/dist/components/FormTextarea/FormTextarea.stories.d.ts +9 -0
- package/dist/components/FormTextarea/FormTextarea.stories.d.ts.map +1 -0
- package/dist/components/FormToggle/FormToggle.d.ts +18 -0
- package/dist/components/FormToggle/FormToggle.d.ts.map +1 -0
- package/dist/components/FormToggle/FormToggle.mjs +48 -0
- package/dist/components/FormToggle/FormToggle.mjs.map +1 -0
- package/dist/components/Modal/Modal.d.ts +29 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.mjs +71 -0
- package/dist/components/Modal/Modal.mjs.map +1 -0
- package/dist/components/PopUpDialog/PopUpDialog.d.ts +28 -0
- package/dist/components/PopUpDialog/PopUpDialog.d.ts.map +1 -0
- package/dist/components/PopUpDialog/PopUpDialog.mjs +90 -0
- package/dist/components/PopUpDialog/PopUpDialog.mjs.map +1 -0
- package/dist/components/RoundedIcon/RoundedIcon.d.ts +23 -0
- package/dist/components/RoundedIcon/RoundedIcon.d.ts.map +1 -0
- package/dist/components/RoundedIcon/RoundedIcon.mjs +40 -0
- package/dist/components/RoundedIcon/RoundedIcon.mjs.map +1 -0
- package/dist/components/RoundedIcon/RoundedIcon.stories.d.ts +9 -0
- package/dist/components/RoundedIcon/RoundedIcon.stories.d.ts.map +1 -0
- package/dist/components/Tip/Tip.d.ts +14 -0
- package/dist/components/Tip/Tip.d.ts.map +1 -0
- package/dist/components/Tip/Tip.mjs +67 -0
- package/dist/components/Tip/Tip.mjs.map +1 -0
- package/dist/components/Tip/Tip.stories.d.ts +7 -0
- package/dist/components/Tip/Tip.stories.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +22 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.mjs +136 -0
- package/dist/components/Tooltip/Tooltip.mjs.map +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -0
- package/dist/components/TooltipTemplate/ProducerTooltipTemplate.d.ts +12 -0
- package/dist/components/TooltipTemplate/ProducerTooltipTemplate.d.ts.map +1 -0
- package/dist/components/TooltipTemplate/TextTooltipTemplate.d.ts +12 -0
- package/dist/components/TooltipTemplate/TextTooltipTemplate.d.ts.map +1 -0
- package/dist/components/TooltipTemplate/TextTooltipTemplate.mjs +21 -0
- package/dist/components/TooltipTemplate/TextTooltipTemplate.mjs.map +1 -0
- package/dist/components/Wizard/Wizard.d.ts +33 -0
- package/dist/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/components/Wizard/Wizard.mjs +129 -0
- package/dist/components/Wizard/Wizard.mjs.map +1 -0
- package/dist/components/Wizard/WizardSteps/WizardSteps.d.ts +16 -0
- package/dist/components/Wizard/WizardSteps/WizardSteps.d.ts.map +1 -0
- package/dist/components/Wizard/WizardSteps/WizardSteps.mjs +41 -0
- package/dist/components/Wizard/WizardSteps/WizardSteps.mjs.map +1 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.mjs +41 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/constants.d.ts +114 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.mjs +44 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/elements/FormActionButton/FormActionButton.d.ts +23 -0
- package/dist/elements/FormActionButton/FormActionButton.d.ts.map +1 -0
- package/dist/elements/FormActionButton/FormActionButton.mjs +43 -0
- package/dist/elements/FormActionButton/FormActionButton.mjs.map +1 -0
- package/dist/elements/FormRowActions/FormRowActions.d.ts +27 -0
- package/dist/elements/FormRowActions/FormRowActions.d.ts.map +1 -0
- package/dist/elements/FormRowActions/FormRowActions.mjs +87 -0
- package/dist/elements/FormRowActions/FormRowActions.mjs.map +1 -0
- package/dist/elements/OptionsMenu/OptionsMenu.d.ts +18 -0
- package/dist/elements/OptionsMenu/OptionsMenu.d.ts.map +1 -0
- package/dist/elements/OptionsMenu/OptionsMenu.mjs +47 -0
- package/dist/elements/OptionsMenu/OptionsMenu.mjs.map +1 -0
- package/dist/elements/SelectOption/SelectOption.d.ts +20 -0
- package/dist/elements/SelectOption/SelectOption.d.ts.map +1 -0
- package/dist/elements/SelectOption/SelectOption.mjs +84 -0
- package/dist/elements/SelectOption/SelectOption.mjs.map +1 -0
- package/dist/elements/ValidationTemplate/ValidationTemplate.d.ts +12 -0
- package/dist/elements/ValidationTemplate/ValidationTemplate.d.ts.map +1 -0
- package/dist/elements/ValidationTemplate/ValidationTemplate.mjs +22 -0
- package/dist/elements/ValidationTemplate/ValidationTemplate.mjs.map +1 -0
- package/dist/elements/index.d.ts +7 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/index.mjs +13 -0
- package/dist/elements/index.mjs.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.mjs +13 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/useChipCell.hook.d.ts +13 -0
- package/dist/hooks/useChipCell.hook.d.ts.map +1 -0
- package/dist/hooks/useChipCell.hook.mjs +58 -0
- package/dist/hooks/useChipCell.hook.mjs.map +1 -0
- package/dist/hooks/useDebounce.hook.d.ts +2 -0
- package/dist/hooks/useDebounce.hook.d.ts.map +1 -0
- package/dist/hooks/useDebounce.hook.mjs +19 -0
- package/dist/hooks/useDebounce.hook.mjs.map +1 -0
- package/dist/hooks/useDetectOutsideClick.hook.d.ts +2 -0
- package/dist/hooks/useDetectOutsideClick.hook.d.ts.map +1 -0
- package/dist/hooks/useDetectOutsideClick.hook.mjs +15 -0
- package/dist/hooks/useDetectOutsideClick.hook.mjs.map +1 -0
- package/dist/hooks/useFormTable.hook.d.ts +16 -0
- package/dist/hooks/useFormTable.hook.d.ts.map +1 -0
- package/dist/hooks/useFormTable.hook.mjs +128 -0
- package/dist/hooks/useFormTable.hook.mjs.map +1 -0
- package/dist/hooks/useHiddenChipsBlock.hook.d.ts +4 -0
- package/dist/hooks/useHiddenChipsBlock.hook.d.ts.map +1 -0
- package/dist/hooks/useHiddenChipsBlock.hook.mjs +51 -0
- package/dist/hooks/useHiddenChipsBlock.hook.mjs.map +1 -0
- package/dist/images/add.svg.mjs +6 -0
- package/dist/images/add.svg.mjs.map +1 -0
- package/dist/images/alerts-icon.svg +3 -0
- package/dist/images/arrow.svg.mjs +6 -0
- package/dist/images/arrow.svg.mjs.map +1 -0
- package/dist/images/back-arrow.svg.mjs +6 -0
- package/dist/images/back-arrow.svg.mjs.map +1 -0
- package/dist/images/checkmark.svg.mjs +6 -0
- package/dist/images/checkmark.svg.mjs.map +1 -0
- package/dist/images/checkmark2.svg.mjs +6 -0
- package/dist/images/checkmark2.svg.mjs.map +1 -0
- package/dist/images/close.svg.mjs +6 -0
- package/dist/images/close.svg.mjs.map +1 -0
- package/dist/images/delete.svg.mjs +6 -0
- package/dist/images/delete.svg.mjs.map +1 -0
- package/dist/images/documents-icon.svg +3 -0
- package/dist/images/dropdown.svg.mjs +6 -0
- package/dist/images/dropdown.svg.mjs.map +1 -0
- package/dist/images/edit.svg.mjs +6 -0
- package/dist/images/edit.svg.mjs.map +1 -0
- package/dist/images/exclamation-mark.svg.mjs +6 -0
- package/dist/images/exclamation-mark.svg.mjs.map +1 -0
- package/dist/images/llm-prompt-icon.svg +3 -0
- package/dist/images/mlrun-api-gateways.svg +8 -0
- package/dist/images/mlrun-artifacts.svg +11 -0
- package/dist/images/mlrun-datasets.svg +5 -0
- package/dist/images/mlrun-feature-store.svg +10 -0
- package/dist/images/mlrun-jobs-and-workflows.svg +5 -0
- package/dist/images/mlrun-ml-functions.svg +8 -0
- package/dist/images/mlrun-models.svg +5 -0
- package/dist/images/mlrun-project-home.svg +5 -0
- package/dist/images/mlrun-project-monitoring.svg +9 -0
- package/dist/images/mlrun-project-settings.svg +5 -0
- package/dist/images/mlrun-realtime-functions.svg +8 -0
- package/dist/images/model-monitoring.svg +3 -0
- package/dist/images/plus.svg.mjs +6 -0
- package/dist/images/plus.svg.mjs.map +1 -0
- package/dist/images/popout.svg.mjs +6 -0
- package/dist/images/popout.svg.mjs.map +1 -0
- package/dist/images/question-mark.svg.mjs +6 -0
- package/dist/images/question-mark.svg.mjs.map +1 -0
- package/dist/images/range-arrow-small.svg.mjs +6 -0
- package/dist/images/range-arrow-small.svg.mjs.map +1 -0
- package/dist/images/search.svg.mjs +6 -0
- package/dist/images/search.svg.mjs.map +1 -0
- package/dist/images/success_done.svg.mjs +6 -0
- package/dist/images/success_done.svg.mjs.map +1 -0
- package/dist/images/warning.svg.mjs +6 -0
- package/dist/images/warning.svg.mjs.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +15 -0
- package/dist/index.mjs.map +1 -0
- package/dist/robots.txt +3 -0
- package/dist/scss/borders.scss +22 -22
- package/dist/scss/colors.scss +0 -11
- package/dist/scss/common.scss +48 -33
- package/dist/scss/fonts.scss +6 -0
- package/dist/scss/mixins.scss +117 -106
- package/dist/scss/shadows.scss +12 -12
- package/dist/scss/variables.scss +3 -3
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.mjs +143 -0
- package/dist/types.mjs.map +1 -0
- package/dist/utils/common.util.d.ts +10 -0
- package/dist/utils/common.util.d.ts.map +1 -0
- package/dist/utils/common.util.mjs +60 -0
- package/dist/utils/common.util.mjs.map +1 -0
- package/dist/utils/form.util.d.ts +11 -0
- package/dist/utils/form.util.d.ts.map +1 -0
- package/dist/utils/form.util.mjs +26 -0
- package/dist/utils/form.util.mjs.map +1 -0
- package/dist/utils/generateChipsList.util.d.ts +10 -0
- package/dist/utils/generateChipsList.util.d.ts.map +1 -0
- package/dist/utils/generateChipsList.util.mjs +19 -0
- package/dist/utils/generateChipsList.util.mjs.map +1 -0
- package/dist/utils/getFirstScrollableParent.util.d.ts +2 -0
- package/dist/utils/getFirstScrollableParent.util.d.ts.map +1 -0
- package/dist/utils/getFirstScrollableParent.util.mjs +5 -0
- package/dist/utils/getFirstScrollableParent.util.mjs.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.mjs +15 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/math.util.d.ts +2 -0
- package/dist/utils/math.util.d.ts.map +1 -0
- package/dist/utils/math.util.mjs +18 -0
- package/dist/utils/math.util.mjs.map +1 -0
- package/dist/utils/validation.util.d.ts +6 -0
- package/dist/utils/validation.util.d.ts.map +1 -0
- package/dist/utils/validation.util.mjs +306 -0
- package/dist/utils/validation.util.mjs.map +1 -0
- package/package.json +48 -38
- package/dist/components/Backdrop/Backdrop.js +0 -56
- package/dist/components/Backdrop/Backdrop.scss +0 -32
- package/dist/components/Button/Button.js +0 -73
- package/dist/components/Button/Button.scss +0 -171
- package/dist/components/ConfirmDialog/ConfirmDialog.js +0 -101
- package/dist/components/ConfirmDialog/confirmDialog.scss +0 -23
- package/dist/components/FormCheckBox/FormCheckBox.js +0 -82
- package/dist/components/FormCheckBox/formCheckBox.scss +0 -91
- package/dist/components/FormChipCell/FormChip/FormChip.js +0 -103
- package/dist/components/FormChipCell/FormChip/formChip.scss +0 -68
- package/dist/components/FormChipCell/FormChipCell.js +0 -339
- package/dist/components/FormChipCell/FormChipCellView.js +0 -190
- package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +0 -107
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +0 -353
- package/dist/components/FormChipCell/NewChipForm/newChipForm.scss +0 -81
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +0 -71
- package/dist/components/FormChipCell/formChipCell.scss +0 -64
- package/dist/components/FormChipCell/formChipCell.util.js +0 -52
- package/dist/components/FormCombobox/FormCombobox.js +0 -432
- package/dist/components/FormCombobox/formCombobox.scss +0 -134
- package/dist/components/FormInput/FormInput.js +0 -408
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +0 -91
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.scss +0 -123
- package/dist/components/FormInput/formInput.scss +0 -76
- package/dist/components/FormKeyValueTable/FormKeyValueTable.js +0 -221
- package/dist/components/FormOnChange/FormOnChange.js +0 -69
- package/dist/components/FormRadio/FormRadio.js +0 -85
- package/dist/components/FormRadio/FormRadio.scss +0 -41
- package/dist/components/FormSelect/FormSelect.js +0 -353
- package/dist/components/FormSelect/FormSelect.test.js +0 -138
- package/dist/components/FormSelect/formSelect.scss +0 -97
- package/dist/components/FormTextarea/FormTextarea.js +0 -184
- package/dist/components/FormTextarea/formTextarea.scss +0 -32
- package/dist/components/FormToggle/FormToggle.js +0 -82
- package/dist/components/FormToggle/formToggle.scss +0 -58
- package/dist/components/Modal/Modal.js +0 -116
- package/dist/components/Modal/Modal.scss +0 -149
- package/dist/components/PopUpDialog/PopUpDialog.js +0 -171
- package/dist/components/PopUpDialog/popUpDialog.scss +0 -83
- package/dist/components/RoundedIcon/RoundedIcon.js +0 -72
- package/dist/components/RoundedIcon/roundedIcon.scss +0 -57
- package/dist/components/Tip/Tip.js +0 -116
- package/dist/components/Tip/Tip.test.js +0 -64
- package/dist/components/Tip/tip.scss +0 -94
- package/dist/components/Tooltip/Tooltip.js +0 -180
- package/dist/components/Tooltip/Tooltip.test.js +0 -155
- package/dist/components/Tooltip/tooltip.scss +0 -29
- package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +0 -53
- package/dist/components/TooltipTemplate/TextTooltipTemplate.js +0 -53
- package/dist/components/TooltipTemplate/producerTooltipTemplate.scss +0 -23
- package/dist/components/TooltipTemplate/textTooltipTemplate.scss +0 -21
- package/dist/components/Wizard/Wizard.js +0 -192
- package/dist/components/Wizard/Wizard.scss +0 -53
- package/dist/components/Wizard/WizardSteps/WizardSteps.js +0 -74
- package/dist/components/Wizard/WizardSteps/WizardSteps.scss +0 -108
- package/dist/components/index.js +0 -139
- package/dist/constants.js +0 -120
- package/dist/elements/FormActionButton/FormActionButton.js +0 -64
- package/dist/elements/FormRowActions/FormRowActions.js +0 -99
- package/dist/elements/OptionsMenu/OptionsMenu.js +0 -75
- package/dist/elements/OptionsMenu/optionsMenu.scss +0 -45
- package/dist/elements/SelectOption/SelectOption.js +0 -107
- package/dist/elements/SelectOption/SelectOption.test.js +0 -98
- package/dist/elements/SelectOption/selectOption.scss +0 -98
- package/dist/elements/ValidationTemplate/ValidationTemplate.js +0 -56
- package/dist/elements/ValidationTemplate/ValidationTemplate.scss +0 -36
- package/dist/elements/index.js +0 -41
- package/dist/hooks/index.js +0 -40
- package/dist/hooks/useChipCell.hook.js +0 -129
- package/dist/hooks/useDebounce.hook.js +0 -52
- package/dist/hooks/useDetectOutsideClick.hook.js +0 -47
- package/dist/hooks/useFormTable.hook.js +0 -224
- package/dist/hooks/useHiddenChipsBlock.hook.js +0 -102
- package/dist/index.js +0 -18
- package/dist/types.js +0 -127
- package/dist/utils/common.util.js +0 -130
- package/dist/utils/form.util.js +0 -70
- package/dist/utils/generateChipsList.util.js +0 -39
- package/dist/utils/getFirstScrollableParent.util.js +0 -49
- package/dist/utils/math.util.js +0 -44
- package/dist/utils/validation.util.js +0 -401
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _reactFinalForm = require("react-final-form");
|
|
11
|
-
var _ConfirmDialog = _interopRequireDefault(require("../ConfirmDialog/ConfirmDialog"));
|
|
12
|
-
var _PopUpDialog = _interopRequireDefault(require("../PopUpDialog/PopUpDialog"));
|
|
13
|
-
var _SelectOption = _interopRequireDefault(require("../../elements/SelectOption/SelectOption"));
|
|
14
|
-
var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
|
|
15
|
-
var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
|
|
16
|
-
var _types = require("../../types");
|
|
17
|
-
var _constants = require("../../constants");
|
|
18
|
-
var _dropdown = require("../../images/dropdown.svg");
|
|
19
|
-
require("./formSelect.scss");
|
|
20
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
|
-
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 && {}.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; }
|
|
24
|
-
/*
|
|
25
|
-
Copyright 2022 Iguazio Systems Ltd.
|
|
26
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
27
|
-
an addition restriction as set forth herein. You may not use this
|
|
28
|
-
file except in compliance with the License. You may obtain a copy of
|
|
29
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
30
|
-
Unless required by applicable law or agreed to in writing, software
|
|
31
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
32
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
33
|
-
implied. See the License for the specific language governing
|
|
34
|
-
permissions and limitations under the License.
|
|
35
|
-
In addition, you may not use the software for any purposes that are
|
|
36
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
37
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
38
|
-
such restriction.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
const FormSelect = _ref => {
|
|
42
|
-
let {
|
|
43
|
-
className = '',
|
|
44
|
-
density = 'normal',
|
|
45
|
-
disabled = false,
|
|
46
|
-
hideSelectedOption = false,
|
|
47
|
-
label = '',
|
|
48
|
-
multiple = false,
|
|
49
|
-
name,
|
|
50
|
-
onChange,
|
|
51
|
-
options,
|
|
52
|
-
preventWidthOverflow = false,
|
|
53
|
-
required,
|
|
54
|
-
scrollToView = true,
|
|
55
|
-
search = false,
|
|
56
|
-
selectedItemAction,
|
|
57
|
-
tooltip = '',
|
|
58
|
-
withoutBorder = false,
|
|
59
|
-
withSelectedIcon = true
|
|
60
|
-
} = _ref;
|
|
61
|
-
const {
|
|
62
|
-
input,
|
|
63
|
-
meta
|
|
64
|
-
} = (0, _reactFinalForm.useField)(name);
|
|
65
|
-
const [isInvalid, setIsInvalid] = (0, _react.useState)(false);
|
|
66
|
-
const [isConfirmDialogOpen, setConfirmDialogOpen] = (0, _react.useState)(false);
|
|
67
|
-
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
68
|
-
const [searchValue, setSearchValue] = (0, _react.useState)('');
|
|
69
|
-
const optionsListRef = (0, _react.useRef)();
|
|
70
|
-
const popUpRef = (0, _react.useRef)();
|
|
71
|
-
const selectRef = (0, _react.useRef)();
|
|
72
|
-
const searchRef = (0, _react.useRef)();
|
|
73
|
-
const {
|
|
74
|
-
width: selectWidth
|
|
75
|
-
} = selectRef?.current?.getBoundingClientRect() || {};
|
|
76
|
-
const selectWrapperClassNames = (0, _classnames.default)('form-field__wrapper', `form-field__wrapper-${density}`, disabled && 'form-field__wrapper-disabled', isOpen && 'form-field__wrapper-active', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
|
|
77
|
-
const selectLabelClassName = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
|
|
78
|
-
const selectValueClassName = (0, _classnames.default)('form-field__select-value', !input.value && 'form-field__select-placeholder');
|
|
79
|
-
const selectedOption = options.find(option => option.id === input.value);
|
|
80
|
-
const getFilteredOptions = (0, _react.useCallback)(options => {
|
|
81
|
-
return options.filter(option => {
|
|
82
|
-
return !search || option.label.toLowerCase().includes(searchValue.toLowerCase());
|
|
83
|
-
});
|
|
84
|
-
}, [search, searchValue]);
|
|
85
|
-
const sortedOptionsList = (0, _react.useMemo)(() => {
|
|
86
|
-
if (scrollToView) {
|
|
87
|
-
return getFilteredOptions(options);
|
|
88
|
-
}
|
|
89
|
-
const optionsList = [...options];
|
|
90
|
-
const selectedOption = optionsList.filter((option, idx, arr) => {
|
|
91
|
-
if (option.id === input.value) {
|
|
92
|
-
arr.splice(idx, 1);
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
});
|
|
97
|
-
return getFilteredOptions([...selectedOption, ...optionsList]);
|
|
98
|
-
}, [input.value, getFilteredOptions, options, scrollToView]);
|
|
99
|
-
const getSelectValue = () => {
|
|
100
|
-
if (!input.value || !input.value.length) {
|
|
101
|
-
return `Select Option${multiple ? 's' : ''}`;
|
|
102
|
-
}
|
|
103
|
-
const multipleValue = multiple && input.value.includes('all') && input.value.length > 1 ? options.filter(option => option.id !== 'all').filter(option => input.value.includes(option.id)).map(option => option.label).join(', ') : options.filter(option => input.value.includes(option.id)).map(option => option.label).join(', ');
|
|
104
|
-
return !multiple ? selectedOption?.label : input.value.length <= 2 ? multipleValue : `${input.value.length} items selected`;
|
|
105
|
-
};
|
|
106
|
-
(0, _react.useEffect)(() => {
|
|
107
|
-
setIsInvalid(meta.invalid && (meta.validating || meta.modified || meta.submitFailed && meta.touched));
|
|
108
|
-
}, [meta.invalid, meta.modified, meta.submitFailed, meta.touched, meta.validating]);
|
|
109
|
-
const openMenu = (0, _react.useCallback)(() => {
|
|
110
|
-
if (!isOpen) {
|
|
111
|
-
setIsOpen(true);
|
|
112
|
-
input.onFocus(new Event('focus'));
|
|
113
|
-
}
|
|
114
|
-
}, [input, isOpen]);
|
|
115
|
-
const closeMenu = (0, _react.useCallback)(() => {
|
|
116
|
-
if (isOpen) {
|
|
117
|
-
setIsOpen(false);
|
|
118
|
-
input.onBlur(new Event('blur'));
|
|
119
|
-
}
|
|
120
|
-
}, [input, isOpen]);
|
|
121
|
-
const clickHandler = (0, _react.useCallback)(event => {
|
|
122
|
-
if (selectRef.current !== event.target.closest('.form-field-select')) {
|
|
123
|
-
closeMenu();
|
|
124
|
-
}
|
|
125
|
-
}, [closeMenu]);
|
|
126
|
-
const handleScroll = (0, _react.useCallback)(event => {
|
|
127
|
-
if (!event.target.closest('.options-list__body')) {
|
|
128
|
-
closeMenu();
|
|
129
|
-
}
|
|
130
|
-
}, [closeMenu]);
|
|
131
|
-
(0, _react.useEffect)(() => {
|
|
132
|
-
if (isOpen) {
|
|
133
|
-
window.addEventListener('scroll', handleScroll, true);
|
|
134
|
-
}
|
|
135
|
-
window.addEventListener('click', clickHandler);
|
|
136
|
-
return () => {
|
|
137
|
-
window.removeEventListener('click', clickHandler);
|
|
138
|
-
window.removeEventListener('scroll', handleScroll, true);
|
|
139
|
-
};
|
|
140
|
-
}, [clickHandler, handleScroll, isOpen]);
|
|
141
|
-
const scrollOptionToView = (0, _react.useCallback)(() => {
|
|
142
|
-
const selectedOptionEl = optionsListRef.current.querySelector(`[data-custom-id="${input.value}"]`);
|
|
143
|
-
if (!selectedOptionEl) return;
|
|
144
|
-
searchValue ? optionsListRef.current.scrollTo({
|
|
145
|
-
top: 0,
|
|
146
|
-
left: 0,
|
|
147
|
-
behavior: 'smooth'
|
|
148
|
-
}) : setTimeout(() => {
|
|
149
|
-
selectedOptionEl.scrollIntoView({
|
|
150
|
-
behavior: 'smooth',
|
|
151
|
-
block: 'center'
|
|
152
|
-
});
|
|
153
|
-
}, 0);
|
|
154
|
-
}, [input.value, searchValue]);
|
|
155
|
-
(0, _react.useEffect)(() => {
|
|
156
|
-
if (isOpen && optionsListRef.current && scrollToView) {
|
|
157
|
-
scrollOptionToView();
|
|
158
|
-
}
|
|
159
|
-
}, [isOpen, scrollOptionToView, scrollToView]);
|
|
160
|
-
(0, _react.useEffect)(() => {
|
|
161
|
-
if (isOpen && search && searchRef.current) {
|
|
162
|
-
searchRef.current.focus();
|
|
163
|
-
}
|
|
164
|
-
}, [isOpen, search]);
|
|
165
|
-
const toggleOpen = () => {
|
|
166
|
-
if (isOpen) {
|
|
167
|
-
closeMenu();
|
|
168
|
-
} else {
|
|
169
|
-
!disabled && openMenu();
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
const handleCloseSelectBody = (0, _react.useCallback)(event => {
|
|
173
|
-
event.stopPropagation();
|
|
174
|
-
if (multiple) return;
|
|
175
|
-
if (!event.target.classList.contains('disabled') && !event.target.closest('.options-list__search')) {
|
|
176
|
-
closeMenu();
|
|
177
|
-
setSearchValue('');
|
|
178
|
-
}
|
|
179
|
-
}, [closeMenu, multiple]);
|
|
180
|
-
const handleSelectOptionClick = (selectedOption, option) => {
|
|
181
|
-
if (selectedOption !== input.value) {
|
|
182
|
-
option.handler && option.handler();
|
|
183
|
-
onChange && onChange(selectedOption);
|
|
184
|
-
setTimeout(() => {
|
|
185
|
-
input.onChange(selectedOption);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
const validateField = value => {
|
|
190
|
-
if (required) {
|
|
191
|
-
return value ? undefined : 'Required';
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
195
|
-
name: name,
|
|
196
|
-
validate: validateField,
|
|
197
|
-
children: _ref2 => {
|
|
198
|
-
let {
|
|
199
|
-
input,
|
|
200
|
-
meta
|
|
201
|
-
} = _ref2;
|
|
202
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
203
|
-
className: "select-tooltip",
|
|
204
|
-
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
|
|
205
|
-
text: tooltip
|
|
206
|
-
}),
|
|
207
|
-
hidden: !tooltip,
|
|
208
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
209
|
-
"data-testid": name ? `${name}-form-field-select` : 'form-field-select',
|
|
210
|
-
ref: selectRef,
|
|
211
|
-
className: `form-field-select ${className}`,
|
|
212
|
-
onClick: toggleOpen,
|
|
213
|
-
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
214
|
-
className: selectLabelClassName,
|
|
215
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
216
|
-
"data-testid": name ? `${name}-form-select-label` : 'form-select-label',
|
|
217
|
-
children: [label, meta.error && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
218
|
-
className: "form-field__label-mandatory",
|
|
219
|
-
children: " *"
|
|
220
|
-
})]
|
|
221
|
-
})
|
|
222
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
223
|
-
"data-testid": "select-header",
|
|
224
|
-
className: selectWrapperClassNames,
|
|
225
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
226
|
-
className: "form-field__control",
|
|
227
|
-
children: !hideSelectedOption && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
228
|
-
"data-testid": "selected-option",
|
|
229
|
-
className: "form-field__select",
|
|
230
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
231
|
-
className: selectValueClassName,
|
|
232
|
-
children: getSelectValue()
|
|
233
|
-
})
|
|
234
|
-
})
|
|
235
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
236
|
-
className: "form-field__icons",
|
|
237
|
-
children: [input.value && selectedItemAction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
238
|
-
children: selectedItemAction.handler ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
239
|
-
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
|
|
240
|
-
text: selectedItemAction.tooltip
|
|
241
|
-
}),
|
|
242
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
243
|
-
onClick: event => {
|
|
244
|
-
if (selectedItemAction.confirm) {
|
|
245
|
-
setConfirmDialogOpen(true);
|
|
246
|
-
} else {
|
|
247
|
-
selectedItemAction.handler(input.value);
|
|
248
|
-
}
|
|
249
|
-
event.stopPropagation();
|
|
250
|
-
},
|
|
251
|
-
children: selectedItemAction.icon
|
|
252
|
-
})
|
|
253
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
254
|
-
children: selectedItemAction.icon
|
|
255
|
-
})
|
|
256
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
257
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dropdown.ReactComponent, {
|
|
258
|
-
className: "form-field__caret"
|
|
259
|
-
})
|
|
260
|
-
})]
|
|
261
|
-
})]
|
|
262
|
-
}), isConfirmDialogOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConfirmDialog.default, {
|
|
263
|
-
cancelButton: {
|
|
264
|
-
handler: () => {
|
|
265
|
-
setConfirmDialogOpen(false);
|
|
266
|
-
},
|
|
267
|
-
label: 'Cancel',
|
|
268
|
-
variant: _constants.TERTIARY_BUTTON
|
|
269
|
-
},
|
|
270
|
-
closePopUp: () => {
|
|
271
|
-
setConfirmDialogOpen(false);
|
|
272
|
-
},
|
|
273
|
-
confirmButton: {
|
|
274
|
-
handler: () => {
|
|
275
|
-
selectedItemAction.handler(input.value);
|
|
276
|
-
setConfirmDialogOpen(false);
|
|
277
|
-
},
|
|
278
|
-
label: selectedItemAction.confirm.btnConfirmLabel,
|
|
279
|
-
variant: selectedItemAction.confirm.btnConfirmType
|
|
280
|
-
},
|
|
281
|
-
header: selectedItemAction.confirm.title,
|
|
282
|
-
isOpen: isConfirmDialogOpen,
|
|
283
|
-
message: selectedItemAction.confirm.message
|
|
284
|
-
}), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopUpDialog.default, {
|
|
285
|
-
className: "form-field form-field-select__options-list",
|
|
286
|
-
headerIsHidden: true,
|
|
287
|
-
ref: popUpRef,
|
|
288
|
-
customPosition: {
|
|
289
|
-
element: selectRef,
|
|
290
|
-
position: 'bottom-right',
|
|
291
|
-
autoHorizontalPosition: true
|
|
292
|
-
},
|
|
293
|
-
style: {
|
|
294
|
-
maxWidth: `${selectWidth < 500 && !preventWidthOverflow ? 500 : selectWidth}px`,
|
|
295
|
-
minWidth: `${selectWidth}px`
|
|
296
|
-
},
|
|
297
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
298
|
-
"data-testid": "select-body",
|
|
299
|
-
className: "options-list__body",
|
|
300
|
-
onClick: handleCloseSelectBody,
|
|
301
|
-
children: [search && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
302
|
-
className: "options-list__search",
|
|
303
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
304
|
-
type: "text",
|
|
305
|
-
placeholder: "Search...",
|
|
306
|
-
value: searchValue,
|
|
307
|
-
onChange: event => setSearchValue(event.target.value),
|
|
308
|
-
ref: searchRef,
|
|
309
|
-
autoFocus: true
|
|
310
|
-
})
|
|
311
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
312
|
-
className: "options-list",
|
|
313
|
-
ref: optionsListRef,
|
|
314
|
-
children: sortedOptionsList.map(option => {
|
|
315
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOption.default, {
|
|
316
|
-
item: option,
|
|
317
|
-
name: name,
|
|
318
|
-
onClick: selectedOption => {
|
|
319
|
-
handleSelectOptionClick(selectedOption, option);
|
|
320
|
-
},
|
|
321
|
-
multiple: multiple,
|
|
322
|
-
selectedId: !multiple ? input.value : '',
|
|
323
|
-
withSelectedIcon: withSelectedIcon
|
|
324
|
-
}, option.id);
|
|
325
|
-
})
|
|
326
|
-
})]
|
|
327
|
-
})
|
|
328
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
329
|
-
...input,
|
|
330
|
-
type: "hidden"
|
|
331
|
-
})]
|
|
332
|
-
})
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
FormSelect.propTypes = {
|
|
338
|
-
className: _propTypes.default.string,
|
|
339
|
-
density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
|
|
340
|
-
disabled: _propTypes.default.bool,
|
|
341
|
-
hideSelectedOption: _propTypes.default.bool,
|
|
342
|
-
label: _propTypes.default.string,
|
|
343
|
-
multiple: _propTypes.default.bool,
|
|
344
|
-
name: _propTypes.default.string.isRequired,
|
|
345
|
-
options: _types.SELECT_OPTIONS.isRequired,
|
|
346
|
-
preventWidthOverflow: _propTypes.default.bool,
|
|
347
|
-
scrollToView: _propTypes.default.bool,
|
|
348
|
-
search: _propTypes.default.bool,
|
|
349
|
-
tooltip: _propTypes.default.string,
|
|
350
|
-
withoutBorder: _propTypes.default.bool,
|
|
351
|
-
withSelectedIcon: _propTypes.default.bool
|
|
352
|
-
};
|
|
353
|
-
var _default = exports.default = /*#__PURE__*/_react.default.memo(FormSelect);
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
var _Select = _interopRequireDefault(require("./Select"));
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
6
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
/*
|
|
9
|
-
Copyright 2022 Iguazio Systems Ltd.
|
|
10
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
11
|
-
an addition restriction as set forth herein. You may not use this
|
|
12
|
-
file except in compliance with the License. You may obtain a copy of
|
|
13
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
14
|
-
Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
17
|
-
implied. See the License for the specific language governing
|
|
18
|
-
permissions and limitations under the License.
|
|
19
|
-
In addition, you may not use the software for any purposes that are
|
|
20
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
21
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
22
|
-
such restriction.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
jest.mock('../../images/dropdown.svg', () => ({
|
|
26
|
-
ReactComponent: 'caret-icon'
|
|
27
|
-
}));
|
|
28
|
-
const renderComponent = props => (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
29
|
-
...props
|
|
30
|
-
}));
|
|
31
|
-
describe('Select component', () => {
|
|
32
|
-
let wrapper;
|
|
33
|
-
const mockClick = jest.fn();
|
|
34
|
-
beforeEach(() => {
|
|
35
|
-
const props = {
|
|
36
|
-
label: 'Select',
|
|
37
|
-
floatingLabel: true,
|
|
38
|
-
selectedId: 'test1',
|
|
39
|
-
onClick: mockClick,
|
|
40
|
-
options: [{
|
|
41
|
-
label: 'Test1',
|
|
42
|
-
id: 'test1',
|
|
43
|
-
subLabel: 'test sub label'
|
|
44
|
-
}]
|
|
45
|
-
};
|
|
46
|
-
wrapper = renderComponent(props);
|
|
47
|
-
});
|
|
48
|
-
afterEach(_react2.cleanup);
|
|
49
|
-
it('renders without crashing', () => {
|
|
50
|
-
expect(wrapper.queryByTestId('select')).not.toBeNull();
|
|
51
|
-
});
|
|
52
|
-
it('should show select body after click by select header', () => {
|
|
53
|
-
const select = wrapper.getByTestId('select');
|
|
54
|
-
_react2.fireEvent.click(select);
|
|
55
|
-
expect(wrapper.queryByTestId('select-body')).not.toBeNull();
|
|
56
|
-
});
|
|
57
|
-
it('should hide the select body when scrolling', () => {
|
|
58
|
-
const select = wrapper.getByTestId('select');
|
|
59
|
-
_react2.fireEvent.click(select);
|
|
60
|
-
expect(wrapper.queryByTestId('select-body')).not.toBeNull();
|
|
61
|
-
_react2.fireEvent.scroll(window);
|
|
62
|
-
expect(wrapper.queryByTestId('select-body')).toBeNull();
|
|
63
|
-
});
|
|
64
|
-
it('should call "onClick" callback with "test1"', () => {
|
|
65
|
-
const select = wrapper.getByTestId('select');
|
|
66
|
-
_react2.fireEvent.click(select);
|
|
67
|
-
const selectOption = wrapper.getByTestId('select-option');
|
|
68
|
-
_react2.fireEvent.click(selectOption);
|
|
69
|
-
expect(mockClick).toHaveBeenCalledWith('test1');
|
|
70
|
-
});
|
|
71
|
-
it('should not close "selectBody" if click by disabled option', () => {
|
|
72
|
-
const props = {
|
|
73
|
-
options: [{
|
|
74
|
-
label: 'Test1',
|
|
75
|
-
id: 'test1'
|
|
76
|
-
}],
|
|
77
|
-
disabledOptions: ['test1']
|
|
78
|
-
};
|
|
79
|
-
wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
80
|
-
...props
|
|
81
|
-
}));
|
|
82
|
-
const select = wrapper.getByTestId('select');
|
|
83
|
-
_react2.fireEvent.click(select);
|
|
84
|
-
const selectOption = wrapper.getByTestId('select-option');
|
|
85
|
-
_react2.fireEvent.click(selectOption);
|
|
86
|
-
expect(wrapper.queryByTestId('select-body')).not.toBeNull();
|
|
87
|
-
});
|
|
88
|
-
it('should display selected option', () => {
|
|
89
|
-
const select = wrapper.getByTestId('select');
|
|
90
|
-
_react2.fireEvent.click(select);
|
|
91
|
-
const selectOption = wrapper.getByTestId('select-option');
|
|
92
|
-
_react2.fireEvent.click(selectOption);
|
|
93
|
-
expect(mockClick).toHaveBeenCalledWith('test1');
|
|
94
|
-
wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
95
|
-
options: [{
|
|
96
|
-
label: 'Test1',
|
|
97
|
-
id: 'test1'
|
|
98
|
-
}],
|
|
99
|
-
selectedId: "test1"
|
|
100
|
-
}));
|
|
101
|
-
const selectedOption = wrapper.getByTestId('selected-option');
|
|
102
|
-
expect(selectedOption.textContent).toEqual('Test1');
|
|
103
|
-
});
|
|
104
|
-
it('should add className "select__label_floating" to select label if props floatingLabel "true"', () => {
|
|
105
|
-
expect(wrapper.getByTestId('select-label').className).toMatch('select__label_floating');
|
|
106
|
-
});
|
|
107
|
-
it('should not open select body if props disabled set to "true"', () => {
|
|
108
|
-
wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
109
|
-
options: [{
|
|
110
|
-
label: 'Test1',
|
|
111
|
-
id: 'test1'
|
|
112
|
-
}],
|
|
113
|
-
disabled: true
|
|
114
|
-
}));
|
|
115
|
-
const select = wrapper.getByTestId('select');
|
|
116
|
-
_react2.fireEvent.click(select);
|
|
117
|
-
expect(wrapper.queryByTestId('select-body')).toBeNull();
|
|
118
|
-
});
|
|
119
|
-
it('should display a "subLabel" if it exists in the option', () => {
|
|
120
|
-
const subLabel = wrapper.queryByTestId('select-subLabel');
|
|
121
|
-
expect(subLabel).not.toBeNull();
|
|
122
|
-
});
|
|
123
|
-
it('should call handler callback if it exists in the option', () => {
|
|
124
|
-
const mockHandler = jest.fn();
|
|
125
|
-
wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
126
|
-
options: [{
|
|
127
|
-
label: 'Test1',
|
|
128
|
-
id: 'test1',
|
|
129
|
-
handler: mockHandler
|
|
130
|
-
}]
|
|
131
|
-
}));
|
|
132
|
-
const select = wrapper.getByTestId('select');
|
|
133
|
-
_react2.fireEvent.click(select);
|
|
134
|
-
const selectOption = wrapper.getByTestId('select-option');
|
|
135
|
-
_react2.fireEvent.click(selectOption);
|
|
136
|
-
expect(mockHandler).toHaveBeenCalled();
|
|
137
|
-
});
|
|
138
|
-
});
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
@import '../../scss/mixins';
|
|
2
|
-
@import '../../scss/colors';
|
|
3
|
-
@import '../../scss/shadows';
|
|
4
|
-
|
|
5
|
-
.select-tooltip {
|
|
6
|
-
width: 100%;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.form-field-select {
|
|
10
|
-
width: 100%;
|
|
11
|
-
|
|
12
|
-
.form-field {
|
|
13
|
-
@include inputSelectField;
|
|
14
|
-
|
|
15
|
-
&__wrapper {
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
|
|
18
|
-
&-active {
|
|
19
|
-
background: $alabaster;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&-disabled {
|
|
23
|
-
cursor: not-allowed;
|
|
24
|
-
|
|
25
|
-
.form-field__caret {
|
|
26
|
-
path {
|
|
27
|
-
fill: $spunPearl;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&__select {
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
width: 100%;
|
|
37
|
-
padding: 0 20px 0 16px;
|
|
38
|
-
|
|
39
|
-
&-value {
|
|
40
|
-
display: block;
|
|
41
|
-
font-size: 15px;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
white-space: nowrap;
|
|
44
|
-
text-overflow: ellipsis;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&-placeholder {
|
|
48
|
-
color: $spunPearl;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&-sub_label {
|
|
52
|
-
display: block;
|
|
53
|
-
margin-left: 10px;
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
color: $topaz;
|
|
56
|
-
white-space: nowrap;
|
|
57
|
-
text-overflow: ellipsis;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&__options-list {
|
|
63
|
-
.pop-up-dialog {
|
|
64
|
-
width: 100%;
|
|
65
|
-
padding: 0;
|
|
66
|
-
border-radius: 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.options-list {
|
|
70
|
-
margin: 0;
|
|
71
|
-
padding: 0;
|
|
72
|
-
list-style-type: none;
|
|
73
|
-
max-height: 250px;
|
|
74
|
-
overflow-y: auto;
|
|
75
|
-
|
|
76
|
-
&__body {
|
|
77
|
-
width: 100%;
|
|
78
|
-
color: $mulledWineTwo;
|
|
79
|
-
background-color: $white;
|
|
80
|
-
border: $primaryBorder;
|
|
81
|
-
border-radius: 4px;
|
|
82
|
-
box-shadow: $filterShadow;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&__search {
|
|
86
|
-
width: 100%;
|
|
87
|
-
|
|
88
|
-
input {
|
|
89
|
-
width: 100%;
|
|
90
|
-
padding: 10px;
|
|
91
|
-
border: none;
|
|
92
|
-
border-bottom: $primaryBorder;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|