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
package/dist/elements/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "FormActionButton", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _FormActionButton.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "FormRowActions", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _FormRowActions.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "OptionsMenu", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _OptionsMenu.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "SelectOption", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _SelectOption.default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "ValidationTemplate", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _ValidationTemplate.default;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var _FormActionButton = _interopRequireDefault(require("./FormActionButton/FormActionButton"));
|
|
37
|
-
var _FormRowActions = _interopRequireDefault(require("./FormRowActions/FormRowActions"));
|
|
38
|
-
var _OptionsMenu = _interopRequireDefault(require("./OptionsMenu/OptionsMenu"));
|
|
39
|
-
var _SelectOption = _interopRequireDefault(require("./SelectOption/SelectOption"));
|
|
40
|
-
var _ValidationTemplate = _interopRequireDefault(require("./ValidationTemplate/ValidationTemplate"));
|
|
41
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/dist/hooks/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "useChipCell", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _useChipCell.useChipCell;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "useDebounce", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _useDebounce.useDebounce;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "useDetectOutsideClick", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _useDetectOutsideClick.useDetectOutsideClick;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "useFormTable", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _useFormTable.useFormTable;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "useHiddenChipsBlock", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _useHiddenChipsBlock.useHiddenChipsBlock;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var _useChipCell = require("./useChipCell.hook");
|
|
37
|
-
var _useDebounce = require("./useDebounce.hook");
|
|
38
|
-
var _useDetectOutsideClick = require("./useDetectOutsideClick.hook");
|
|
39
|
-
var _useFormTable = require("./useFormTable.hook");
|
|
40
|
-
var _useHiddenChipsBlock = require("./useHiddenChipsBlock.hook");
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useChipCell = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _lodash = require("lodash");
|
|
9
|
-
var _common = require("../utils/common.util");
|
|
10
|
-
var _getFirstScrollableParent = require("../utils/getFirstScrollableParent.util");
|
|
11
|
-
/*
|
|
12
|
-
Copyright 2019 Iguazio Systems Ltd.
|
|
13
|
-
|
|
14
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
15
|
-
an addition restriction as set forth herein. You may not use this
|
|
16
|
-
file except in compliance with the License. You may obtain a copy of
|
|
17
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
18
|
-
|
|
19
|
-
Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
22
|
-
implied. See the License for the specific language governing
|
|
23
|
-
permissions and limitations under the License.
|
|
24
|
-
|
|
25
|
-
In addition, you may not use the software for any purposes that are
|
|
26
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
27
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
28
|
-
such restriction.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
const useChipCell = (isEditMode, visibleChipsMaxLength) => {
|
|
32
|
-
const [showHiddenChips, setShowHiddenChips] = (0, _react.useState)(false);
|
|
33
|
-
const [chipsSizes, setChipsSizes] = (0, _react.useState)({});
|
|
34
|
-
const [showChips, setShowChips] = (0, _react.useState)(false);
|
|
35
|
-
const [visibleChipsCount, setVisibleChipsCount] = (0, _react.useState)(8);
|
|
36
|
-
const transitionEndEventName = (0, _react.useMemo)(() => (0, _common.getTransitionEndEventName)(), []);
|
|
37
|
-
const chipsCellRef = (0, _react.useRef)();
|
|
38
|
-
const chipsWrapperRef = (0, _react.useRef)();
|
|
39
|
-
const hiddenChipsCounterRef = (0, _react.useRef)();
|
|
40
|
-
const hiddenChipsPopUpRef = (0, _react.useRef)();
|
|
41
|
-
const handleShowElements = (0, _react.useCallback)(event => {
|
|
42
|
-
if (!isEditMode || isEditMode && visibleChipsMaxLength) {
|
|
43
|
-
if (hiddenChipsCounterRef.current?.contains(event.target) && !showHiddenChips) {
|
|
44
|
-
setShowHiddenChips(true);
|
|
45
|
-
} else {
|
|
46
|
-
setShowHiddenChips(false);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
event && hiddenChipsCounterRef.current?.contains(event.target) && event.stopPropagation();
|
|
50
|
-
}, [isEditMode, showHiddenChips, visibleChipsMaxLength]);
|
|
51
|
-
(0, _react.useEffect)(() => {
|
|
52
|
-
if (showHiddenChips) {
|
|
53
|
-
window.addEventListener('click', handleShowElements, true);
|
|
54
|
-
}
|
|
55
|
-
return () => window.removeEventListener('click', handleShowElements, true);
|
|
56
|
-
}, [showHiddenChips, handleShowElements]);
|
|
57
|
-
const handleScroll = (0, _react.useCallback)(event => {
|
|
58
|
-
if (event.target.parentElement !== hiddenChipsPopUpRef?.current) {
|
|
59
|
-
setShowHiddenChips(false);
|
|
60
|
-
}
|
|
61
|
-
}, [hiddenChipsPopUpRef]);
|
|
62
|
-
(0, _react.useEffect)(() => {
|
|
63
|
-
if (showHiddenChips) {
|
|
64
|
-
window.addEventListener('scroll', handleScroll, true);
|
|
65
|
-
}
|
|
66
|
-
return () => window.removeEventListener('scroll', handleScroll, true);
|
|
67
|
-
}, [handleScroll, showHiddenChips]);
|
|
68
|
-
const resizeChipCell = (0, _react.useCallback)(() => {
|
|
69
|
-
if (hiddenChipsPopUpRef?.current) {
|
|
70
|
-
const scrollableParent = (0, _getFirstScrollableParent.getFirstScrollableParent)(hiddenChipsCounterRef.current.offsetParent);
|
|
71
|
-
const scrollableParentRect = scrollableParent.getBoundingClientRect();
|
|
72
|
-
const hiddenChipsCounterRect = hiddenChipsCounterRef.current?.getBoundingClientRect();
|
|
73
|
-
|
|
74
|
-
// Check if the hiddenChipsCounterRect is outside the boundaries of the scrollableParentRect or the window
|
|
75
|
-
if (hiddenChipsCounterRect.left < scrollableParentRect.left || hiddenChipsCounterRect.top < scrollableParentRect.top || hiddenChipsCounterRect.right > scrollableParentRect.right || hiddenChipsCounterRect.bottom > scrollableParentRect.bottom || hiddenChipsCounterRect.right > window.innerWidth || hiddenChipsCounterRect.bottom > window.innerHeight) {
|
|
76
|
-
setShowHiddenChips(false);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (!isEditMode && !(0, _common.isEveryObjectValueEmpty)(chipsSizes)) {
|
|
80
|
-
const parentSize = chipsCellRef.current?.getBoundingClientRect().width;
|
|
81
|
-
let maxLength = 0;
|
|
82
|
-
let chipIndex = 0;
|
|
83
|
-
const padding = 65;
|
|
84
|
-
Object.values(chipsSizes).every((chipSize, index) => {
|
|
85
|
-
// Check if adding chipSize to maxLength exceeds parentSize
|
|
86
|
-
// or if adding chipSize and padding exceeds parentSize when there are multiple chips
|
|
87
|
-
if (maxLength + chipSize > parentSize || Object.values(chipsSizes).length > 1 && maxLength + chipSize + padding > parentSize) {
|
|
88
|
-
chipIndex = index;
|
|
89
|
-
return false;
|
|
90
|
-
} else {
|
|
91
|
-
maxLength += chipSize;
|
|
92
|
-
if (index === Object.values(chipsSizes).length - 1) {
|
|
93
|
-
chipIndex = 8;
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
setVisibleChipsCount(chipIndex);
|
|
99
|
-
setShowChips(true);
|
|
100
|
-
}
|
|
101
|
-
}, [chipsSizes, isEditMode]);
|
|
102
|
-
(0, _react.useLayoutEffect)(() => {
|
|
103
|
-
resizeChipCell();
|
|
104
|
-
}, [resizeChipCell]);
|
|
105
|
-
(0, _react.useEffect)(() => {
|
|
106
|
-
const resizeChipCellDebounced = (0, _lodash.throttle)(resizeChipCell, 500);
|
|
107
|
-
if (!isEditMode) {
|
|
108
|
-
window.addEventListener('resize', resizeChipCellDebounced);
|
|
109
|
-
window.addEventListener(transitionEndEventName, resizeChipCellDebounced);
|
|
110
|
-
return () => {
|
|
111
|
-
window.removeEventListener('resize', resizeChipCellDebounced);
|
|
112
|
-
window.removeEventListener(transitionEndEventName, resizeChipCellDebounced);
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}, [resizeChipCell, isEditMode, transitionEndEventName]);
|
|
116
|
-
return {
|
|
117
|
-
chipsCellRef,
|
|
118
|
-
chipsWrapperRef,
|
|
119
|
-
handleShowElements,
|
|
120
|
-
hiddenChipsCounterRef,
|
|
121
|
-
hiddenChipsPopUpRef,
|
|
122
|
-
setChipsSizes,
|
|
123
|
-
setShowHiddenChips,
|
|
124
|
-
showChips,
|
|
125
|
-
showHiddenChips,
|
|
126
|
-
visibleChipsCount
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
exports.useChipCell = useChipCell;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDebounce = void 0;
|
|
7
|
-
var _react = require("react");
|
|
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
|
-
const useDebounce = () => {
|
|
26
|
-
const timeout = (0, _react.useRef)(null);
|
|
27
|
-
const lastValue = (0, _react.useRef)(null);
|
|
28
|
-
const lastResult = (0, _react.useRef)(null);
|
|
29
|
-
return (0, _react.useCallback)((validate, time) => {
|
|
30
|
-
return value => {
|
|
31
|
-
return new Promise(resolve => {
|
|
32
|
-
if (timeout.current) {
|
|
33
|
-
timeout.current();
|
|
34
|
-
}
|
|
35
|
-
if (value !== lastValue.current) {
|
|
36
|
-
const timerId = setTimeout(() => {
|
|
37
|
-
lastValue.current = value;
|
|
38
|
-
lastResult.current = validate(value);
|
|
39
|
-
resolve(lastResult.current);
|
|
40
|
-
}, time);
|
|
41
|
-
timeout.current = () => {
|
|
42
|
-
clearTimeout(timerId);
|
|
43
|
-
resolve(true);
|
|
44
|
-
};
|
|
45
|
-
} else {
|
|
46
|
-
resolve(lastResult.current);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
}, []);
|
|
51
|
-
};
|
|
52
|
-
exports.useDebounce = useDebounce;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDetectOutsideClick = void 0;
|
|
7
|
-
var _react = require("react");
|
|
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
|
-
/**
|
|
26
|
-
* Hook for handling closing when clicking outside an element
|
|
27
|
-
* @function useDetectOutsideClick
|
|
28
|
-
* @param {React.node} ref
|
|
29
|
-
* @param {function} handler A callback function to use on outside click
|
|
30
|
-
*/
|
|
31
|
-
const useDetectOutsideClick = (ref, handler) => {
|
|
32
|
-
(0, _react.useEffect)(() => {
|
|
33
|
-
const onClick = e => {
|
|
34
|
-
e.stopPropagation();
|
|
35
|
-
// If the active element exists and is clicked outside of
|
|
36
|
-
if (ref.current !== null && !ref.current.contains(e.target)) {
|
|
37
|
-
handler(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
// If the item is active (ie open) then listen for clicks outside
|
|
41
|
-
window.addEventListener('click', onClick);
|
|
42
|
-
return () => {
|
|
43
|
-
window.removeEventListener('click', onClick);
|
|
44
|
-
};
|
|
45
|
-
}, [ref, handler]);
|
|
46
|
-
};
|
|
47
|
-
exports.useDetectOutsideClick = useDetectOutsideClick;
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useFormTable = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _lodash = require("lodash");
|
|
9
|
-
var _finalForm = require("final-form");
|
|
10
|
-
/*
|
|
11
|
-
Copyright 2019 Iguazio Systems Ltd.
|
|
12
|
-
|
|
13
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
14
|
-
an addition restriction as set forth herein. You may not use this
|
|
15
|
-
file except in compliance with the License. You may obtain a copy of
|
|
16
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
17
|
-
|
|
18
|
-
Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
21
|
-
implied. See the License for the specific language governing
|
|
22
|
-
permissions and limitations under the License.
|
|
23
|
-
|
|
24
|
-
In addition, you may not use the software for any purposes that are
|
|
25
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
26
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
27
|
-
such restriction.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
const useFormTable = (formState, exitEditModeTriggerItem, onExitEditModeCallback) => {
|
|
31
|
-
// `editingItem` should contain the `data` object with all fields that are used in the `formState`.
|
|
32
|
-
// Properties that aren't used in the `formState` should be placed directly in the `editingItem` object
|
|
33
|
-
// `editingItem` also has an `ui` property which is used internally in this hook
|
|
34
|
-
//
|
|
35
|
-
// e.g.
|
|
36
|
-
// editingItem = {
|
|
37
|
-
// data: {
|
|
38
|
-
// <fieldName>: <fieldValue>,
|
|
39
|
-
// <fieldName2>: <fieldValue2>
|
|
40
|
-
// },
|
|
41
|
-
// <anotherProperty>: <anotherPropertyValue>
|
|
42
|
-
// ui: {
|
|
43
|
-
// isNew: <true|false>, // `true` if we are creating a new row, if we are editing it's `false`
|
|
44
|
-
// fieldsPath: <"the.path">, // the path where table data is placed in the `formState`
|
|
45
|
-
// index: <0|1|...> // index of the editing row
|
|
46
|
-
// }
|
|
47
|
-
// }
|
|
48
|
-
const [editingItem, setEditingItem] = (0, _react.useState)(null);
|
|
49
|
-
const editingItemRef = (0, _react.useRef)(null);
|
|
50
|
-
const editingItemErrorsRef = (0, _react.useRef)(null);
|
|
51
|
-
const formStateRef = (0, _react.useRef)(null);
|
|
52
|
-
const bottomScrollRef = (0, _react.useRef)(null);
|
|
53
|
-
const onExitEditModeCallbackRef = (0, _react.useRef)(onExitEditModeCallback);
|
|
54
|
-
(0, _react.useLayoutEffect)(() => {
|
|
55
|
-
const tableErrors = (0, _lodash.get)(formState?.errors, editingItem?.ui.fieldsPath, []);
|
|
56
|
-
editingItemErrorsRef.current = (0, _lodash.get)(tableErrors, editingItem?.ui.index, null);
|
|
57
|
-
}, [editingItem?.ui.fieldsPath, editingItem?.ui.index, formState?.errors]);
|
|
58
|
-
(0, _react.useLayoutEffect)(() => {
|
|
59
|
-
formStateRef.current = formState;
|
|
60
|
-
}, [formState]);
|
|
61
|
-
(0, _react.useLayoutEffect)(() => {
|
|
62
|
-
onExitEditModeCallbackRef.current = onExitEditModeCallback;
|
|
63
|
-
}, [onExitEditModeCallback]);
|
|
64
|
-
const exitEditMode = () => {
|
|
65
|
-
if (editingItemRef.current?.data) {
|
|
66
|
-
Object.entries(editingItemRef.current?.data).forEach(_ref => {
|
|
67
|
-
let [fieldName] = _ref;
|
|
68
|
-
formStateRef.current?.form.mutators.setFieldState(`${editingItemRef.current?.ui.fieldsPath}[${editingItemRef.current?.ui.index}].data.${fieldName}`, {
|
|
69
|
-
modified: false
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
editingItemRef.current = null;
|
|
74
|
-
setEditingItem(null);
|
|
75
|
-
onExitEditModeCallbackRef?.current && onExitEditModeCallbackRef.current();
|
|
76
|
-
};
|
|
77
|
-
(0, _react.useEffect)(() => {
|
|
78
|
-
const applyOrDiscardOrDeleteInEffect = () => {
|
|
79
|
-
if (editingItemRef?.current) {
|
|
80
|
-
if (!editingItemErrorsRef.current) {
|
|
81
|
-
exitEditMode();
|
|
82
|
-
} else {
|
|
83
|
-
if (editingItemRef.current?.ui?.isNew) {
|
|
84
|
-
const values = (0, _lodash.get)(formStateRef.current.values, editingItemRef.current?.ui.fieldsPath);
|
|
85
|
-
if (values?.length > 1) {
|
|
86
|
-
formStateRef.current.form.mutators.remove(editingItemRef.current?.ui.fieldsPath, editingItemRef.current?.ui.index);
|
|
87
|
-
} else {
|
|
88
|
-
formStateRef.current.form.change(editingItemRef.current?.ui.fieldsPath, []);
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
formStateRef.current.form.mutators.update(editingItemRef.current?.ui.fieldsPath, editingItemRef.current?.ui.index, (0, _lodash.omit)(editingItemRef.current, ['ui']));
|
|
92
|
-
}
|
|
93
|
-
exitEditMode();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return () => {
|
|
98
|
-
applyOrDiscardOrDeleteInEffect();
|
|
99
|
-
};
|
|
100
|
-
}, [exitEditModeTriggerItem]);
|
|
101
|
-
const addNewRow = (event, fields, fieldsPath, newItem) => {
|
|
102
|
-
applyOrDiscardOrDelete(event);
|
|
103
|
-
formStateRef.current.form.mutators.push(fieldsPath, newItem);
|
|
104
|
-
setEditingItem(() => {
|
|
105
|
-
const newEditingItem = {
|
|
106
|
-
...newItem,
|
|
107
|
-
ui: {
|
|
108
|
-
isNew: true,
|
|
109
|
-
fieldsPath,
|
|
110
|
-
index: fields.value?.length || 0
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
editingItemRef.current = newEditingItem;
|
|
114
|
-
return newEditingItem;
|
|
115
|
-
});
|
|
116
|
-
scrollIntoView();
|
|
117
|
-
};
|
|
118
|
-
const applyChanges = (event, index) => {
|
|
119
|
-
if (editingItemRef.current) {
|
|
120
|
-
if (!editingItemErrorsRef.current) {
|
|
121
|
-
if (editingItemRef.current?.ui.isNew) {
|
|
122
|
-
scrollIntoView();
|
|
123
|
-
}
|
|
124
|
-
exitEditMode();
|
|
125
|
-
} else {
|
|
126
|
-
// Mark all empty fields as `modified` in order to highlight the error if the field is invalid
|
|
127
|
-
Object.entries(editingItemErrorsRef.current?.data).forEach(_ref2 => {
|
|
128
|
-
let [fieldName] = _ref2;
|
|
129
|
-
formStateRef.current?.form.mutators.setFieldState(`${editingItemRef.current?.ui.fieldsPath}[${index}].data.${fieldName}`, {
|
|
130
|
-
modified: true
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
const deleteRow = (event, fieldsPath, index) => {
|
|
137
|
-
if (editingItemRef.current && index !== editingItemRef.current.ui.index) {
|
|
138
|
-
applyOrDiscardOrDelete(event);
|
|
139
|
-
}
|
|
140
|
-
const values = (0, _lodash.get)(formStateRef.current.values, fieldsPath);
|
|
141
|
-
if (values?.length > 1) {
|
|
142
|
-
formStateRef.current.form.mutators.remove(fieldsPath, index);
|
|
143
|
-
} else {
|
|
144
|
-
formStateRef.current.form.change(fieldsPath, []);
|
|
145
|
-
}
|
|
146
|
-
exitEditMode();
|
|
147
|
-
event && event.stopPropagation();
|
|
148
|
-
};
|
|
149
|
-
const discardChanges = (event, fieldsPath, index) => {
|
|
150
|
-
formStateRef.current.form.mutators.update(fieldsPath, index, (0, _lodash.omit)(editingItemRef.current, ['ui']));
|
|
151
|
-
exitEditMode();
|
|
152
|
-
event && event.stopPropagation();
|
|
153
|
-
};
|
|
154
|
-
const discardOrDelete = (event, fieldsPath, index) => {
|
|
155
|
-
if (!editingItemRef.current || editingItemRef.current?.ui?.isNew) {
|
|
156
|
-
deleteRow(event, fieldsPath, index);
|
|
157
|
-
} else {
|
|
158
|
-
discardChanges(event, fieldsPath, index);
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const applyOrDiscardOrDelete = function () {
|
|
162
|
-
let event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
163
|
-
if (editingItemRef?.current) {
|
|
164
|
-
if (!editingItemErrorsRef.current) {
|
|
165
|
-
applyChanges(event, editingItemRef.current?.ui.index);
|
|
166
|
-
} else {
|
|
167
|
-
discardOrDelete(event, editingItemRef.current?.ui.fieldsPath, editingItemRef.current?.ui.index);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
const enterEditMode = (event, fields, fieldsPath, index) => {
|
|
172
|
-
applyOrDiscardOrDelete(event);
|
|
173
|
-
setTimeout(() => {
|
|
174
|
-
const editItem = fields.value[index];
|
|
175
|
-
setEditingItem(() => {
|
|
176
|
-
const newEditingItem = {
|
|
177
|
-
...editItem,
|
|
178
|
-
ui: {
|
|
179
|
-
fieldsPath,
|
|
180
|
-
index
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
editingItemRef.current = newEditingItem;
|
|
184
|
-
return newEditingItem;
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
const scrollIntoView = () => {
|
|
189
|
-
if (bottomScrollRef.current) {
|
|
190
|
-
setTimeout(() => {
|
|
191
|
-
bottomScrollRef.current.scrollIntoView({
|
|
192
|
-
behavior: 'smooth',
|
|
193
|
-
block: 'nearest'
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
const isCurrentRowEditing = rowPath => {
|
|
199
|
-
return editingItemRef?.current && `${editingItemRef.current.ui.fieldsPath}[${editingItemRef.current.ui.index}]` === rowPath;
|
|
200
|
-
};
|
|
201
|
-
const getTableArrayErrors = fieldsPath => {
|
|
202
|
-
if (formState.submitFailed && formState.invalid) {
|
|
203
|
-
return (0, _lodash.get)(formState, `errors.${fieldsPath}.${_finalForm.ARRAY_ERROR}`, []);
|
|
204
|
-
} else {
|
|
205
|
-
return [];
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
return {
|
|
209
|
-
addNewRow,
|
|
210
|
-
applyChanges,
|
|
211
|
-
applyOrDiscardOrDelete,
|
|
212
|
-
bottomScrollRef,
|
|
213
|
-
deleteRow,
|
|
214
|
-
discardChanges,
|
|
215
|
-
discardOrDelete,
|
|
216
|
-
editingItem,
|
|
217
|
-
editingItemRef,
|
|
218
|
-
enterEditMode,
|
|
219
|
-
exitEditMode,
|
|
220
|
-
getTableArrayErrors,
|
|
221
|
-
isCurrentRowEditing
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
exports.useFormTable = useFormTable;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useHiddenChipsBlock = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
var _common = require("../utils/common.util");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
/*
|
|
12
|
-
Copyright 2019 Iguazio Systems Ltd.
|
|
13
|
-
|
|
14
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
15
|
-
an addition restriction as set forth herein. You may not use this
|
|
16
|
-
file except in compliance with the License. You may obtain a copy of
|
|
17
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
18
|
-
|
|
19
|
-
Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
22
|
-
implied. See the License for the specific language governing
|
|
23
|
-
permissions and limitations under the License.
|
|
24
|
-
|
|
25
|
-
In addition, you may not use the software for any purposes that are
|
|
26
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
27
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
28
|
-
such restriction.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
const useHiddenChipsBlock = (hiddenChipsCounterRef, hiddenChipsPopUpRef) => {
|
|
32
|
-
const [isTop, setIsTop] = (0, _react.useState)(false);
|
|
33
|
-
const [isLeft, setIsLeft] = (0, _react.useState)(false);
|
|
34
|
-
const [isVisible, setIsVisible] = (0, _react.useState)(false);
|
|
35
|
-
const transitionEndEventName = (0, _react.useMemo)(() => (0, _common.getTransitionEndEventName)(), []);
|
|
36
|
-
const hiddenChipsBlockClassNames = (0, _classnames.default)('chip-block-hidden', isTop ? 'chip-block-hidden_top' : 'chip-block-hidden_bottom', isLeft ? 'chip-block-hidden_left' : 'chip-block-hidden_right', isVisible && 'chip-block-hidden_visible');
|
|
37
|
-
const resizePopUp = (0, _react.useCallback)(() => {
|
|
38
|
-
if (hiddenChipsPopUpRef?.current && hiddenChipsCounterRef?.current) {
|
|
39
|
-
const offset = 10;
|
|
40
|
-
const offsetMargin = 20;
|
|
41
|
-
const elementRect = hiddenChipsCounterRef.current.getBoundingClientRect();
|
|
42
|
-
|
|
43
|
-
// Calculate the distance from the right edge of the window to the element's right edge
|
|
44
|
-
const elementRectRight = Math.floor(window.innerWidth - elementRect.left - elementRect.width);
|
|
45
|
-
|
|
46
|
-
// Calculate the distance from the bottom edge of the window to the element's bottom edge
|
|
47
|
-
const elementRectBottom = Math.floor(window.innerHeight - elementRect.top - elementRect.height);
|
|
48
|
-
let isLeftPosition = false;
|
|
49
|
-
let isTopPosition = false;
|
|
50
|
-
hiddenChipsPopUpRef.current.style.maxWidth = '100%';
|
|
51
|
-
hiddenChipsPopUpRef.current.style.maxHeight = '100%';
|
|
52
|
-
|
|
53
|
-
// Determine if the left position is preferred based on the element's position and available width
|
|
54
|
-
if (elementRect.left > hiddenChipsPopUpRef.current.clientWidth) {
|
|
55
|
-
isLeftPosition = true;
|
|
56
|
-
} else if (elementRectRight > hiddenChipsPopUpRef.current.clientWidth) {
|
|
57
|
-
isLeftPosition = false;
|
|
58
|
-
} else {
|
|
59
|
-
// Compare elementRect.left and elementRectRight to choose the larger value as the max width
|
|
60
|
-
isLeftPosition = elementRect.left > elementRectRight;
|
|
61
|
-
const popUpMaxWidth = Math.max(elementRect.left, elementRectRight);
|
|
62
|
-
hiddenChipsPopUpRef.current.style.maxWidth = `${popUpMaxWidth}px`;
|
|
63
|
-
}
|
|
64
|
-
hiddenChipsPopUpRef.current.style.right = isLeftPosition ? `${elementRectRight}px` : 'unset';
|
|
65
|
-
hiddenChipsPopUpRef.current.style.left = isLeftPosition ? 'unset' : `${elementRect.left}px`;
|
|
66
|
-
|
|
67
|
-
// Determine if the top position is preferred based on the element's position and available height
|
|
68
|
-
if (elementRect.top > hiddenChipsPopUpRef.current.clientHeight + offset + offsetMargin) {
|
|
69
|
-
isTopPosition = true;
|
|
70
|
-
} else if (elementRectBottom > hiddenChipsPopUpRef.current.clientHeight + offset + offsetMargin) {
|
|
71
|
-
isTopPosition = false;
|
|
72
|
-
} else {
|
|
73
|
-
// Compare elementRect.top and elementRectBottom to choose the larger value as the max height
|
|
74
|
-
isTopPosition = elementRect.top > elementRectBottom + offset;
|
|
75
|
-
const popUpMaxHeight = Math.max(elementRect.top, elementRectBottom) - offset - offsetMargin;
|
|
76
|
-
hiddenChipsPopUpRef.current.style.maxHeight = `${popUpMaxHeight}px`;
|
|
77
|
-
}
|
|
78
|
-
hiddenChipsPopUpRef.current.style.bottom = isTopPosition ? `${elementRectBottom + elementRect.height + offset}px` : 'unset';
|
|
79
|
-
hiddenChipsPopUpRef.current.style.top = isTopPosition ? 'unset' : `${elementRect.bottom + offset}px`;
|
|
80
|
-
setIsTop(isTopPosition);
|
|
81
|
-
setIsLeft(isLeftPosition);
|
|
82
|
-
setIsVisible(true);
|
|
83
|
-
}
|
|
84
|
-
}, [hiddenChipsCounterRef, hiddenChipsPopUpRef]);
|
|
85
|
-
(0, _react.useEffect)(() => {
|
|
86
|
-
if (hiddenChipsPopUpRef?.current && hiddenChipsCounterRef?.current) {
|
|
87
|
-
window.addEventListener('resize', resizePopUp);
|
|
88
|
-
window.addEventListener(transitionEndEventName, resizePopUp);
|
|
89
|
-
return () => {
|
|
90
|
-
window.removeEventListener('resize', resizePopUp);
|
|
91
|
-
window.removeEventListener(transitionEndEventName, resizePopUp);
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}, [hiddenChipsPopUpRef, hiddenChipsCounterRef, resizePopUp, transitionEndEventName]);
|
|
95
|
-
(0, _react.useEffect)(() => {
|
|
96
|
-
resizePopUp();
|
|
97
|
-
}, [resizePopUp]);
|
|
98
|
-
return {
|
|
99
|
-
hiddenChipsBlockClassNames
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
exports.useHiddenChipsBlock = useHiddenChipsBlock;
|
package/dist/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.types = exports.hooks = exports.elements = exports.constants = exports.components = void 0;
|
|
7
|
-
var components = _interopRequireWildcard(require("./components"));
|
|
8
|
-
exports.components = components;
|
|
9
|
-
var constants = _interopRequireWildcard(require("./constants"));
|
|
10
|
-
exports.constants = constants;
|
|
11
|
-
var elements = _interopRequireWildcard(require("./elements"));
|
|
12
|
-
exports.elements = elements;
|
|
13
|
-
var hooks = _interopRequireWildcard(require("./hooks"));
|
|
14
|
-
exports.hooks = hooks;
|
|
15
|
-
var types = _interopRequireWildcard(require("./types"));
|
|
16
|
-
exports.types = types;
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|