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,339 +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 _lodash = _interopRequireWildcard(require("lodash"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _FormChipCellView = _interopRequireDefault(require("./FormChipCellView"));
|
|
12
|
-
var _types = require("../../types");
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var _common = require("../../utils/common.util");
|
|
15
|
-
var _validation = require("../../utils/validation.util");
|
|
16
|
-
var _generateChipsList = require("../../utils/generateChipsList.util");
|
|
17
|
-
var _formChipCell = require("./formChipCell.util");
|
|
18
|
-
var _hooks = require("../../hooks");
|
|
19
|
-
require("./formChipCell.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 FormChipCell = _ref => {
|
|
42
|
-
let {
|
|
43
|
-
chipOptions = {
|
|
44
|
-
background: 'purple',
|
|
45
|
-
boldValue: false,
|
|
46
|
-
borderRadius: 'primary',
|
|
47
|
-
borderColor: 'transparent',
|
|
48
|
-
density: 'dense',
|
|
49
|
-
font: 'purple'
|
|
50
|
-
},
|
|
51
|
-
className = '',
|
|
52
|
-
delimiter = null,
|
|
53
|
-
formState,
|
|
54
|
-
initialValues,
|
|
55
|
-
isEditable = false,
|
|
56
|
-
label = null,
|
|
57
|
-
name,
|
|
58
|
-
onClick = () => {},
|
|
59
|
-
shortChips = false,
|
|
60
|
-
validationRules = {},
|
|
61
|
-
validator = null,
|
|
62
|
-
onExitEditModeCallback,
|
|
63
|
-
visibleChipsMaxLength = null
|
|
64
|
-
} = _ref;
|
|
65
|
-
const chipsClassName = (0, _classnames.default)('chips', className);
|
|
66
|
-
const {
|
|
67
|
-
chipsCellRef,
|
|
68
|
-
chipsWrapperRef,
|
|
69
|
-
handleShowElements,
|
|
70
|
-
hiddenChipsCounterRef,
|
|
71
|
-
hiddenChipsPopUpRef,
|
|
72
|
-
setChipsSizes,
|
|
73
|
-
setShowHiddenChips,
|
|
74
|
-
showChips,
|
|
75
|
-
showHiddenChips,
|
|
76
|
-
visibleChipsCount
|
|
77
|
-
} = (0, _hooks.useChipCell)(isEditable, visibleChipsMaxLength);
|
|
78
|
-
const [editConfig, setEditConfig] = (0, _react.useState)({
|
|
79
|
-
chipIndex: null,
|
|
80
|
-
isEdit: false,
|
|
81
|
-
isKeyFocused: false,
|
|
82
|
-
isValueFocused: false,
|
|
83
|
-
isNewChip: false
|
|
84
|
-
});
|
|
85
|
-
let chips = (0, _react.useMemo)(() => {
|
|
86
|
-
return isEditable || visibleChipsMaxLength === 'all' ? {
|
|
87
|
-
visibleChips: (0, _lodash.get)(formState.values, name),
|
|
88
|
-
hiddenChips: []
|
|
89
|
-
} : (0, _generateChipsList.generateChipsList)((0, _lodash.get)(formState.values, name), visibleChipsMaxLength ? visibleChipsMaxLength : visibleChipsCount);
|
|
90
|
-
}, [visibleChipsMaxLength, isEditable, visibleChipsCount, formState.values, name]);
|
|
91
|
-
const checkChipsList = (0, _react.useCallback)(currentChipsList => {
|
|
92
|
-
if ((0, _common.areArraysEqual)((0, _lodash.get)(initialValues, name), currentChipsList, ['id'])) {
|
|
93
|
-
(0, _lodash.set)(formState.initialValues, name, currentChipsList);
|
|
94
|
-
}
|
|
95
|
-
formState.form.mutators.setFieldState(name, {
|
|
96
|
-
modified: true
|
|
97
|
-
});
|
|
98
|
-
formState.form.mutators.setFieldState(name, {
|
|
99
|
-
touched: true
|
|
100
|
-
});
|
|
101
|
-
}, [initialValues, name, formState]);
|
|
102
|
-
const handleAddNewChip = (0, _react.useCallback)((event, fields) => {
|
|
103
|
-
const fieldsLength = fields.value?.length || 0;
|
|
104
|
-
if (!editConfig.isEdit && !editConfig.chipIndex) {
|
|
105
|
-
formState.form.mutators.push(name, {
|
|
106
|
-
id: fieldsLength + new Date(),
|
|
107
|
-
key: '',
|
|
108
|
-
value: '',
|
|
109
|
-
delimiter: delimiter
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
if (showHiddenChips) {
|
|
113
|
-
setShowHiddenChips(false);
|
|
114
|
-
}
|
|
115
|
-
setEditConfig({
|
|
116
|
-
chipIndex: fieldsLength,
|
|
117
|
-
isEdit: true,
|
|
118
|
-
isKeyFocused: true,
|
|
119
|
-
isValueFocused: false,
|
|
120
|
-
isNewChip: true
|
|
121
|
-
});
|
|
122
|
-
event && event.preventDefault();
|
|
123
|
-
}, [editConfig.isEdit, editConfig.chipIndex, showHiddenChips, formState.form.mutators, name, delimiter, setShowHiddenChips]);
|
|
124
|
-
const handleRemoveChip = (0, _react.useCallback)(function (event, fields, chipIndex) {
|
|
125
|
-
let isOutsideClick = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
126
|
-
checkChipsList(_lodash.default.chain(formState).get(['values', name]).filter((_, index) => index !== chipIndex).value());
|
|
127
|
-
fields.remove(chipIndex);
|
|
128
|
-
onExitEditModeCallback && onExitEditModeCallback();
|
|
129
|
-
event && !isOutsideClick && event.stopPropagation();
|
|
130
|
-
}, [checkChipsList, formState, name, onExitEditModeCallback]);
|
|
131
|
-
const handleEditChip = (0, _react.useCallback)((event, fields, nameEvent, isOutsideClick) => {
|
|
132
|
-
const {
|
|
133
|
-
key,
|
|
134
|
-
value
|
|
135
|
-
} = fields.value[editConfig.chipIndex];
|
|
136
|
-
const isChipNotEmpty = !!(key?.trim() && value?.trim());
|
|
137
|
-
if (nameEvent === _constants.CLICK) {
|
|
138
|
-
if (!isChipNotEmpty) {
|
|
139
|
-
handleRemoveChip(event, fields, editConfig.chipIndex, isOutsideClick);
|
|
140
|
-
}
|
|
141
|
-
setEditConfig({
|
|
142
|
-
chipIndex: null,
|
|
143
|
-
isEdit: false,
|
|
144
|
-
isKeyFocused: false,
|
|
145
|
-
isValueFocused: false,
|
|
146
|
-
isNewChip: false
|
|
147
|
-
});
|
|
148
|
-
isChipNotEmpty && onExitEditModeCallback && onExitEditModeCallback();
|
|
149
|
-
} else if (nameEvent === _constants.TAB) {
|
|
150
|
-
if (!isChipNotEmpty) {
|
|
151
|
-
handleRemoveChip(event, fields, editConfig.chipIndex);
|
|
152
|
-
}
|
|
153
|
-
setEditConfig(prevState => {
|
|
154
|
-
const lastChipSelected = prevState.chipIndex + 1 > fields.value.length - 1;
|
|
155
|
-
isChipNotEmpty && lastChipSelected && onExitEditModeCallback && onExitEditModeCallback();
|
|
156
|
-
return {
|
|
157
|
-
chipIndex: lastChipSelected ? null : prevState.chipIndex + 1,
|
|
158
|
-
isEdit: !lastChipSelected,
|
|
159
|
-
isKeyFocused: !lastChipSelected,
|
|
160
|
-
isValueFocused: false,
|
|
161
|
-
isNewChip: false
|
|
162
|
-
};
|
|
163
|
-
});
|
|
164
|
-
} else if (nameEvent === _constants.TAB_SHIFT) {
|
|
165
|
-
if (!isChipNotEmpty) {
|
|
166
|
-
handleRemoveChip(event, fields, editConfig.chipIndex);
|
|
167
|
-
}
|
|
168
|
-
setEditConfig(prevState => {
|
|
169
|
-
const firstChipIsSelected = prevState.chipIndex === 0;
|
|
170
|
-
isChipNotEmpty && firstChipIsSelected && onExitEditModeCallback && onExitEditModeCallback();
|
|
171
|
-
return {
|
|
172
|
-
chipIndex: firstChipIsSelected ? null : prevState.chipIndex - 1,
|
|
173
|
-
isEdit: !firstChipIsSelected,
|
|
174
|
-
isKeyFocused: false,
|
|
175
|
-
isValueFocused: !firstChipIsSelected,
|
|
176
|
-
isNewChip: false
|
|
177
|
-
};
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
checkChipsList((0, _lodash.get)(formState.values, name));
|
|
181
|
-
if (editConfig.chipIndex > 0 && editConfig.chipIndex < fields.value.length - 1 || fields.value.length > 1 && editConfig.chipIndex === 0 && nameEvent !== _constants.TAB_SHIFT || fields.value.length > 1 && editConfig.chipIndex === fields.value.length - 1 && nameEvent !== _constants.TAB) {
|
|
182
|
-
event && event.preventDefault();
|
|
183
|
-
}
|
|
184
|
-
}, [editConfig.chipIndex, checkChipsList, formState.values, name, onExitEditModeCallback, handleRemoveChip]);
|
|
185
|
-
const handleToEditMode = (0, _react.useCallback)((event, chipIndex, keyName) => {
|
|
186
|
-
if (isEditable) {
|
|
187
|
-
const {
|
|
188
|
-
clientX: pointerCoordinateX,
|
|
189
|
-
clientY: pointerCoordinateY
|
|
190
|
-
} = event;
|
|
191
|
-
let isKeyClicked = false;
|
|
192
|
-
const isClickedInsideInputElement = (pointerCoordinateX, pointerCoordinateY, inputElement) => {
|
|
193
|
-
if (inputElement) {
|
|
194
|
-
const {
|
|
195
|
-
top: topPosition,
|
|
196
|
-
left: leftPosition,
|
|
197
|
-
right: rightPosition,
|
|
198
|
-
bottom: bottomPosition
|
|
199
|
-
} = inputElement.getBoundingClientRect();
|
|
200
|
-
if (pointerCoordinateX > rightPosition || pointerCoordinateX < leftPosition) return false;
|
|
201
|
-
if (pointerCoordinateY > bottomPosition || pointerCoordinateY < topPosition) return false;
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
event.stopPropagation();
|
|
206
|
-
if (event.target.nodeName !== 'INPUT') {
|
|
207
|
-
if (event.target.firstElementChild) {
|
|
208
|
-
isKeyClicked = isClickedInsideInputElement(pointerCoordinateX, pointerCoordinateY, event.target.firstElementChild);
|
|
209
|
-
}
|
|
210
|
-
} else {
|
|
211
|
-
isKeyClicked = event.target.name === keyName;
|
|
212
|
-
}
|
|
213
|
-
setEditConfig(preState => ({
|
|
214
|
-
...preState,
|
|
215
|
-
chipIndex,
|
|
216
|
-
isEdit: true,
|
|
217
|
-
isKeyFocused: isKeyClicked,
|
|
218
|
-
isValueFocused: !isKeyClicked
|
|
219
|
-
}));
|
|
220
|
-
}
|
|
221
|
-
onClick && onClick();
|
|
222
|
-
}, [isEditable, onClick]);
|
|
223
|
-
const validateFields = fieldsArray => {
|
|
224
|
-
if (!fieldsArray) return null;
|
|
225
|
-
let errorData = [];
|
|
226
|
-
const uniquenessValidator = (newValue, idx) => {
|
|
227
|
-
return !fieldsArray.some((_ref2, index) => {
|
|
228
|
-
let {
|
|
229
|
-
key
|
|
230
|
-
} = _ref2;
|
|
231
|
-
return newValue === key && index !== idx;
|
|
232
|
-
});
|
|
233
|
-
};
|
|
234
|
-
if (!(0, _lodash.isEmpty)(validationRules)) {
|
|
235
|
-
errorData = fieldsArray.map(chip => {
|
|
236
|
-
const [keyValidation, valueValidation] = validateChip(chip);
|
|
237
|
-
if (keyValidation && valueValidation) return {
|
|
238
|
-
key: keyValidation,
|
|
239
|
-
value: valueValidation
|
|
240
|
-
};
|
|
241
|
-
if (keyValidation) return {
|
|
242
|
-
key: keyValidation
|
|
243
|
-
};
|
|
244
|
-
if (valueValidation) return {
|
|
245
|
-
value: valueValidation
|
|
246
|
-
};
|
|
247
|
-
return null;
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// uniqueness
|
|
252
|
-
fieldsArray.forEach((chip, index) => {
|
|
253
|
-
const isUnique = uniquenessValidator(chip.key, index);
|
|
254
|
-
if (!isUnique) {
|
|
255
|
-
if ((0, _lodash.get)(errorData, [index, 'key'], false)) {
|
|
256
|
-
errorData.at(index).key.push(_formChipCell.uniquenessError);
|
|
257
|
-
} else {
|
|
258
|
-
(0, _lodash.set)(errorData, [index, 'key'], [_formChipCell.uniquenessError]);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
if ((0, _lodash.isEmpty)(errorData) && validator) {
|
|
263
|
-
errorData = validator(fieldsArray);
|
|
264
|
-
}
|
|
265
|
-
if (errorData.every(label => (0, _lodash.isNil)(label))) {
|
|
266
|
-
return null;
|
|
267
|
-
}
|
|
268
|
-
return errorData;
|
|
269
|
-
};
|
|
270
|
-
const validateChip = _ref3 => {
|
|
271
|
-
let {
|
|
272
|
-
key,
|
|
273
|
-
value,
|
|
274
|
-
disabled
|
|
275
|
-
} = _ref3;
|
|
276
|
-
const validateField = (value, field) => {
|
|
277
|
-
const [newRules, isValidField] = (0, _validation.checkPatternsValidity)(validationRules[field].filter(rule => rule.pattern), value);
|
|
278
|
-
if (isValidField) return null;
|
|
279
|
-
const invalidRules = newRules.filter(rule => !rule.isValid);
|
|
280
|
-
return invalidRules.map(rule => ({
|
|
281
|
-
name: rule.name,
|
|
282
|
-
label: rule.label
|
|
283
|
-
}));
|
|
284
|
-
};
|
|
285
|
-
return disabled ? [null, null] : [validateField(key, 'key'), validateField(value, 'value')];
|
|
286
|
-
};
|
|
287
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
288
|
-
className: chipsClassName,
|
|
289
|
-
"data-testid": `${name}-chips`,
|
|
290
|
-
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
291
|
-
className: "chips__label",
|
|
292
|
-
children: label
|
|
293
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
294
|
-
className: label ? 'chips__wrapper' : '',
|
|
295
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormChipCellView.default, {
|
|
296
|
-
chipOptions: chipOptions,
|
|
297
|
-
chips: chips,
|
|
298
|
-
editConfig: editConfig,
|
|
299
|
-
formState: formState,
|
|
300
|
-
handleAddNewChip: handleAddNewChip,
|
|
301
|
-
handleEditChip: handleEditChip,
|
|
302
|
-
handleRemoveChip: handleRemoveChip,
|
|
303
|
-
handleShowElements: handleShowElements,
|
|
304
|
-
handleToEditMode: handleToEditMode,
|
|
305
|
-
isEditable: isEditable,
|
|
306
|
-
name: name,
|
|
307
|
-
ref: {
|
|
308
|
-
chipsCellRef,
|
|
309
|
-
chipsWrapperRef,
|
|
310
|
-
hiddenChipsCounterRef,
|
|
311
|
-
hiddenChipsPopUpRef
|
|
312
|
-
},
|
|
313
|
-
setChipsSizes: setChipsSizes,
|
|
314
|
-
setEditConfig: setEditConfig,
|
|
315
|
-
shortChips: shortChips,
|
|
316
|
-
showChips: showChips,
|
|
317
|
-
showHiddenChips: showHiddenChips,
|
|
318
|
-
validateFields: validateFields,
|
|
319
|
-
validationRules: validationRules
|
|
320
|
-
})
|
|
321
|
-
})]
|
|
322
|
-
});
|
|
323
|
-
};
|
|
324
|
-
FormChipCell.propTypes = {
|
|
325
|
-
chipOptions: _types.CHIP_OPTIONS,
|
|
326
|
-
className: _propTypes.default.string,
|
|
327
|
-
delimiter: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
328
|
-
formState: _propTypes.default.shape({}).isRequired,
|
|
329
|
-
initialValues: _propTypes.default.object.isRequired,
|
|
330
|
-
isEditable: _propTypes.default.bool,
|
|
331
|
-
label: _propTypes.default.string,
|
|
332
|
-
name: _propTypes.default.string.isRequired,
|
|
333
|
-
onClick: _propTypes.default.func,
|
|
334
|
-
shortChips: _propTypes.default.bool,
|
|
335
|
-
validationRules: _propTypes.default.object,
|
|
336
|
-
validator: _propTypes.default.func,
|
|
337
|
-
visibleChipsMaxLength: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
338
|
-
};
|
|
339
|
-
var _default = exports.default = /*#__PURE__*/_react.default.memo(FormChipCell);
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _reactFinalFormArrays = require("react-final-form-arrays");
|
|
11
|
-
var _lodash = require("lodash");
|
|
12
|
-
var _FormChip = _interopRequireDefault(require("./FormChip/FormChip"));
|
|
13
|
-
var _HiddenChipsBlock = _interopRequireDefault(require("./HiddenChipsBlock/HiddenChipsBlock"));
|
|
14
|
-
var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
|
|
15
|
-
var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
|
|
16
|
-
var _types = require("../../types");
|
|
17
|
-
var _common = require("../../utils/common.util");
|
|
18
|
-
var _formChipCell = require("./formChipCell.util");
|
|
19
|
-
var _add = require("../../images/add.svg");
|
|
20
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
-
/*
|
|
23
|
-
Copyright 2022 Iguazio Systems Ltd.
|
|
24
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
25
|
-
an addition restriction as set forth herein. You may not use this
|
|
26
|
-
file except in compliance with the License. You may obtain a copy of
|
|
27
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
28
|
-
Unless required by applicable law or agreed to in writing, software
|
|
29
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
31
|
-
implied. See the License for the specific language governing
|
|
32
|
-
permissions and limitations under the License.
|
|
33
|
-
In addition, you may not use the software for any purposes that are
|
|
34
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
35
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
36
|
-
such restriction.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
const FormChipCellView = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) => {
|
|
40
|
-
let {
|
|
41
|
-
chipOptions = {
|
|
42
|
-
background: 'purple',
|
|
43
|
-
boldValue: false,
|
|
44
|
-
borderRadius: 'primary',
|
|
45
|
-
borderColor: 'transparent',
|
|
46
|
-
density: 'dense',
|
|
47
|
-
font: 'purple'
|
|
48
|
-
},
|
|
49
|
-
chips,
|
|
50
|
-
editConfig,
|
|
51
|
-
formState,
|
|
52
|
-
handleAddNewChip,
|
|
53
|
-
handleEditChip,
|
|
54
|
-
handleRemoveChip,
|
|
55
|
-
handleShowElements,
|
|
56
|
-
handleToEditMode,
|
|
57
|
-
isEditable = false,
|
|
58
|
-
name,
|
|
59
|
-
setChipsSizes,
|
|
60
|
-
setEditConfig,
|
|
61
|
-
shortChips = false,
|
|
62
|
-
showChips,
|
|
63
|
-
showHiddenChips,
|
|
64
|
-
validateFields,
|
|
65
|
-
validationRules = {}
|
|
66
|
-
} = _ref;
|
|
67
|
-
let {
|
|
68
|
-
chipsCellRef,
|
|
69
|
-
chipsWrapperRef,
|
|
70
|
-
hiddenChipsCounterRef,
|
|
71
|
-
hiddenChipsPopUpRef
|
|
72
|
-
} = _ref2;
|
|
73
|
-
const buttonAddClassNames = (0, _classnames.default)('button-add', chipOptions.background && `button-add-background_${chipOptions.background}`, chipOptions.borderColor && `button-add-border_${chipOptions.borderColor}`, chipOptions.font && `button-add-font_${chipOptions.font}`, chipOptions.density && `button-add-density_${chipOptions.density}`);
|
|
74
|
-
const wrapperClassNames = (0, _classnames.default)('chips-wrapper', isEditable && 'fixed-max-width');
|
|
75
|
-
const chipClassNames = (0, _classnames.default)('chip', 'chip__content', isEditable && 'data-ellipsis', shortChips && 'chip_short', chips.hiddenChips && 'chip_hidden', chipOptions.density && `chip-density_${chipOptions.density}`, chipOptions.borderRadius && `chip-border_${chipOptions.borderRadius}`, chipOptions.background && `chip-background_${chipOptions.background}`, chipOptions.borderColor && `chip-border_${chipOptions.borderColor}`, chipOptions.font && `chip-font_${chipOptions.font}`, isEditable && 'editable', (showChips || isEditable) && 'chip_visible');
|
|
76
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
77
|
-
name: name,
|
|
78
|
-
validate: validateFields,
|
|
79
|
-
children: _ref3 => {
|
|
80
|
-
let {
|
|
81
|
-
fields,
|
|
82
|
-
meta
|
|
83
|
-
} = _ref3;
|
|
84
|
-
let newValidationRules = {
|
|
85
|
-
...validationRules
|
|
86
|
-
};
|
|
87
|
-
if (!(0, _lodash.isEmpty)(validationRules) && validationRules.key.every(rule => rule.name !== _formChipCell.uniquenessError.name)) {
|
|
88
|
-
newValidationRules = {
|
|
89
|
-
...validationRules,
|
|
90
|
-
key: [...validationRules.key, _formChipCell.uniquenessError]
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
return (isEditable || !(0, _common.isEveryObjectValueEmpty)(fields)) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
-
className: "chips-cell",
|
|
95
|
-
ref: chipsCellRef,
|
|
96
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
97
|
-
className: wrapperClassNames,
|
|
98
|
-
ref: chipsWrapperRef,
|
|
99
|
-
children: [fields.map((contentItem, index) => {
|
|
100
|
-
const chipData = fields.value[index];
|
|
101
|
-
return index < chips.visibleChips?.length && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
102
|
-
className: "chip-block",
|
|
103
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
104
|
-
hidden: editConfig.isEdit && !chipData.tooltip,
|
|
105
|
-
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
|
|
106
|
-
text: chipData.tooltip || /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
107
|
-
className: "chip__content",
|
|
108
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
109
|
-
className: "chip__content-item",
|
|
110
|
-
children: chipData.key
|
|
111
|
-
}), !chipData.isKeyOnly && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
112
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
113
|
-
className: "chip__delimiter",
|
|
114
|
-
children: chipData.delimiter ? chipData.delimiter : ':'
|
|
115
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
116
|
-
className: "chip__content-item",
|
|
117
|
-
children: chipData.value
|
|
118
|
-
})]
|
|
119
|
-
})]
|
|
120
|
-
})
|
|
121
|
-
}),
|
|
122
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormChip.default, {
|
|
123
|
-
chip: chipData,
|
|
124
|
-
chipIndex: index,
|
|
125
|
-
chipOptions: chipOptions,
|
|
126
|
-
editConfig: editConfig,
|
|
127
|
-
handleEditChip: (event, nameEvent, isOutsideClick) => handleEditChip(event, fields, nameEvent, isOutsideClick),
|
|
128
|
-
handleRemoveChip: (event, index) => handleRemoveChip(event, fields, index),
|
|
129
|
-
handleToEditMode: handleToEditMode,
|
|
130
|
-
isEditable: isEditable,
|
|
131
|
-
keyName: `${contentItem}.key`,
|
|
132
|
-
meta: meta,
|
|
133
|
-
ref: chipsCellRef,
|
|
134
|
-
setChipsSizes: setChipsSizes,
|
|
135
|
-
setEditConfig: setEditConfig,
|
|
136
|
-
validationRules: newValidationRules,
|
|
137
|
-
valueName: `${contentItem}.value`
|
|
138
|
-
})
|
|
139
|
-
}, chipData.id)
|
|
140
|
-
}, chipData.id);
|
|
141
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
142
|
-
className: "chip-block",
|
|
143
|
-
children: [chips.hiddenChips.length > 0 && showHiddenChips && /*#__PURE__*/(0, _jsxRuntime.jsx)(_HiddenChipsBlock.default, {
|
|
144
|
-
chipClassNames: chipClassNames,
|
|
145
|
-
chipOptions: chipOptions,
|
|
146
|
-
chips: chips.hiddenChips,
|
|
147
|
-
handleShowElements: handleShowElements,
|
|
148
|
-
ref: {
|
|
149
|
-
hiddenChipsCounterRef,
|
|
150
|
-
hiddenChipsPopUpRef
|
|
151
|
-
},
|
|
152
|
-
textOverflowEllipsis: true
|
|
153
|
-
}), chips.hiddenChipsNumber && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
154
|
-
ref: hiddenChipsCounterRef,
|
|
155
|
-
className: `${chipClassNames} chips_button`,
|
|
156
|
-
onClick: handleShowElements,
|
|
157
|
-
children: chips.hiddenChipsNumber
|
|
158
|
-
})]
|
|
159
|
-
}), isEditable && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
160
|
-
"data-testid": `${name}-add-chip`,
|
|
161
|
-
className: buttonAddClassNames,
|
|
162
|
-
onClick: e => handleAddNewChip(e, fields),
|
|
163
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_add.ReactComponent, {})
|
|
164
|
-
})]
|
|
165
|
-
})
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
FormChipCellView.propTypes = {
|
|
171
|
-
chipOptions: _types.CHIP_OPTIONS,
|
|
172
|
-
chips: _propTypes.default.object.isRequired,
|
|
173
|
-
editConfig: _propTypes.default.object.isRequired,
|
|
174
|
-
formState: _propTypes.default.object.isRequired,
|
|
175
|
-
handleAddNewChip: _propTypes.default.func.isRequired,
|
|
176
|
-
handleEditChip: _propTypes.default.func.isRequired,
|
|
177
|
-
handleRemoveChip: _propTypes.default.func.isRequired,
|
|
178
|
-
handleShowElements: _propTypes.default.func.isRequired,
|
|
179
|
-
handleToEditMode: _propTypes.default.func.isRequired,
|
|
180
|
-
isEditable: _propTypes.default.bool,
|
|
181
|
-
name: _propTypes.default.string.isRequired,
|
|
182
|
-
setChipsSizes: _propTypes.default.func.isRequired,
|
|
183
|
-
setEditConfig: _propTypes.default.func.isRequired,
|
|
184
|
-
shortChips: _propTypes.default.bool,
|
|
185
|
-
showChips: _propTypes.default.bool.isRequired,
|
|
186
|
-
showHiddenChips: _propTypes.default.bool.isRequired,
|
|
187
|
-
validateFields: _propTypes.default.func.isRequired,
|
|
188
|
-
validationRules: _propTypes.default.object
|
|
189
|
-
};
|
|
190
|
-
var _default = exports.default = FormChipCellView;
|
|
@@ -1,107 +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 _reactDom = require("react-dom");
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _Tooltip = _interopRequireDefault(require("../../Tooltip/Tooltip"));
|
|
12
|
-
var _TextTooltipTemplate = _interopRequireDefault(require("../../TooltipTemplate/TextTooltipTemplate"));
|
|
13
|
-
var _types = require("../../../types");
|
|
14
|
-
var _hooks = require("../../../hooks");
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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; }
|
|
19
|
-
/*
|
|
20
|
-
Copyright 2022 Iguazio Systems Ltd.
|
|
21
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
22
|
-
an addition restriction as set forth herein. You may not use this
|
|
23
|
-
file except in compliance with the License. You may obtain a copy of
|
|
24
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
25
|
-
Unless required by applicable law or agreed to in writing, software
|
|
26
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
28
|
-
implied. See the License for the specific language governing
|
|
29
|
-
permissions and limitations under the License.
|
|
30
|
-
In addition, you may not use the software for any purposes that are
|
|
31
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
32
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
33
|
-
such restriction.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
const HiddenChipsBlock = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) => {
|
|
37
|
-
let {
|
|
38
|
-
chipClassNames,
|
|
39
|
-
chipOptions,
|
|
40
|
-
chips,
|
|
41
|
-
handleShowElements,
|
|
42
|
-
textOverflowEllipsis = false
|
|
43
|
-
} = _ref;
|
|
44
|
-
let {
|
|
45
|
-
hiddenChipsCounterRef,
|
|
46
|
-
hiddenChipsPopUpRef
|
|
47
|
-
} = _ref2;
|
|
48
|
-
const {
|
|
49
|
-
hiddenChipsBlockClassNames
|
|
50
|
-
} = (0, _hooks.useHiddenChipsBlock)(hiddenChipsCounterRef, hiddenChipsPopUpRef);
|
|
51
|
-
const chipLabelClassNames = (0, _classnames.default)('chip__label', textOverflowEllipsis && 'data-ellipsis');
|
|
52
|
-
const chipValueClassNames = (0, _classnames.default)('chip__value', textOverflowEllipsis && 'data-ellipsis', chipOptions.boldValue && 'chip-value_bold');
|
|
53
|
-
const generateChipData = chip => {
|
|
54
|
-
return chip.isKeyOnly ? chip.key : `${chip.key}${chip.delimiter ? chip.delimiter : ':'} ${chip.value}`;
|
|
55
|
-
};
|
|
56
|
-
(0, _react.useEffect)(() => {
|
|
57
|
-
if (chips.length === 0) {
|
|
58
|
-
handleShowElements();
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
62
|
-
ref: hiddenChipsPopUpRef,
|
|
63
|
-
className: hiddenChipsBlockClassNames,
|
|
64
|
-
onClick: event => event.stopPropagation(),
|
|
65
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
-
className: "chip-block-hidden__scrollable-container",
|
|
67
|
-
children: chips?.map(element => {
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
69
|
-
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
|
|
70
|
-
text: element.delimiter ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
71
|
-
className: "chip__content",
|
|
72
|
-
children: [element.key, !element.isKeyOnly && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
73
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
74
|
-
className: "chip__delimiter",
|
|
75
|
-
children: element.delimiter
|
|
76
|
-
}), element.value]
|
|
77
|
-
})]
|
|
78
|
-
}) : generateChipData(element)
|
|
79
|
-
}),
|
|
80
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
81
|
-
className: chipClassNames,
|
|
82
|
-
children: [element.key && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
|
-
className: chipLabelClassNames,
|
|
84
|
-
children: element.key
|
|
85
|
-
}), element.value && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
86
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
|
-
className: "chip__delimiter",
|
|
88
|
-
children: element.delimiter ?? ':'
|
|
89
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
-
className: chipValueClassNames,
|
|
91
|
-
children: element.value
|
|
92
|
-
})]
|
|
93
|
-
})]
|
|
94
|
-
})
|
|
95
|
-
}, element.id);
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
}), document.getElementById('overlay_container'));
|
|
99
|
-
});
|
|
100
|
-
HiddenChipsBlock.propTypes = {
|
|
101
|
-
chipClassNames: _propTypes.default.string.isRequired,
|
|
102
|
-
chipOptions: _types.CHIP_OPTIONS.isRequired,
|
|
103
|
-
chips: _propTypes.default.array.isRequired,
|
|
104
|
-
handleShowElements: _propTypes.default.func.isRequired,
|
|
105
|
-
textOverflowEllipsis: _propTypes.default.bool
|
|
106
|
-
};
|
|
107
|
-
var _default = exports.default = HiddenChipsBlock;
|