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.
Files changed (368) hide show
  1. package/dist/components/Backdrop/Backdrop.d.ts +14 -0
  2. package/dist/components/Backdrop/Backdrop.d.ts.map +1 -0
  3. package/dist/components/Backdrop/Backdrop.mjs +29 -0
  4. package/dist/components/Backdrop/Backdrop.mjs.map +1 -0
  5. package/dist/components/Button/Button.d.ts +28 -0
  6. package/dist/components/Button/Button.d.ts.map +1 -0
  7. package/dist/components/Button/Button.mjs +43 -0
  8. package/dist/components/Button/Button.mjs.map +1 -0
  9. package/dist/components/Button/Button.stories.d.ts +14 -0
  10. package/dist/components/Button/Button.stories.d.ts.map +1 -0
  11. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +33 -0
  12. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
  13. package/dist/components/ConfirmDialog/ConfirmDialog.mjs +83 -0
  14. package/dist/components/ConfirmDialog/ConfirmDialog.mjs.map +1 -0
  15. package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
  16. package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts.map +1 -0
  17. package/dist/components/FormCheckBox/FormCheckBox.d.ts +21 -0
  18. package/dist/components/FormCheckBox/FormCheckBox.d.ts.map +1 -0
  19. package/dist/components/FormCheckBox/FormCheckBox.mjs +54 -0
  20. package/dist/components/FormCheckBox/FormCheckBox.mjs.map +1 -0
  21. package/dist/components/FormCheckBox/FormCheckbox.stories.d.ts +7 -0
  22. package/dist/components/FormCheckBox/FormCheckbox.stories.d.ts.map +1 -0
  23. package/dist/components/FormChipCell/FormChip/FormChip.d.ts +45 -0
  24. package/dist/components/FormChipCell/FormChip/FormChip.d.ts.map +1 -0
  25. package/dist/components/FormChipCell/FormChip/FormChip.mjs +78 -0
  26. package/dist/components/FormChipCell/FormChip/FormChip.mjs.map +1 -0
  27. package/dist/components/FormChipCell/FormChipCell.d.ts +44 -0
  28. package/dist/components/FormChipCell/FormChipCell.d.ts.map +1 -0
  29. package/dist/components/FormChipCell/FormChipCell.mjs +239 -0
  30. package/dist/components/FormChipCell/FormChipCell.mjs.map +1 -0
  31. package/dist/components/FormChipCell/FormChipCellView.d.ts +56 -0
  32. package/dist/components/FormChipCell/FormChipCellView.d.ts.map +1 -0
  33. package/dist/components/FormChipCell/FormChipCellView.mjs +169 -0
  34. package/dist/components/FormChipCell/FormChipCellView.mjs.map +1 -0
  35. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.d.ts +22 -0
  36. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.d.ts.map +1 -0
  37. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.mjs +72 -0
  38. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.mjs.map +1 -0
  39. package/dist/components/FormChipCell/NewChipForm/NewChipForm.d.ts +35 -0
  40. package/dist/components/FormChipCell/NewChipForm/NewChipForm.d.ts.map +1 -0
  41. package/dist/components/FormChipCell/NewChipForm/NewChipForm.mjs +270 -0
  42. package/dist/components/FormChipCell/NewChipForm/NewChipForm.mjs.map +1 -0
  43. package/dist/components/FormChipCell/NewChipInput/NewChipInput.d.ts +16 -0
  44. package/dist/components/FormChipCell/NewChipInput/NewChipInput.d.ts.map +1 -0
  45. package/dist/components/FormChipCell/NewChipInput/NewChipInput.mjs +36 -0
  46. package/dist/components/FormChipCell/NewChipInput/NewChipInput.mjs.map +1 -0
  47. package/dist/components/FormChipCell/formChipCell.util.d.ts +6 -0
  48. package/dist/components/FormChipCell/formChipCell.util.d.ts.map +1 -0
  49. package/dist/components/FormChipCell/formChipCell.util.mjs +24 -0
  50. package/dist/components/FormChipCell/formChipCell.util.mjs.map +1 -0
  51. package/dist/components/FormCombobox/FormCombobox.d.ts +56 -0
  52. package/dist/components/FormCombobox/FormCombobox.d.ts.map +1 -0
  53. package/dist/components/FormCombobox/FormCombobox.mjs +278 -0
  54. package/dist/components/FormCombobox/FormCombobox.mjs.map +1 -0
  55. package/dist/components/FormCombobox/FormCombobox.stories.d.ts +12 -0
  56. package/dist/components/FormCombobox/FormCombobox.stories.d.ts.map +1 -0
  57. package/dist/components/FormInput/FormInput.d.ts +3 -0
  58. package/dist/components/FormInput/FormInput.d.ts.map +1 -0
  59. package/dist/components/FormInput/FormInput.mjs +272 -0
  60. package/dist/components/FormInput/FormInput.mjs.map +1 -0
  61. package/dist/components/FormInput/FormInput.stories.d.ts +14 -0
  62. package/dist/components/FormInput/FormInput.stories.d.ts.map +1 -0
  63. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.d.ts +20 -0
  64. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.d.ts.map +1 -0
  65. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.mjs +61 -0
  66. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.mjs.map +1 -0
  67. package/dist/components/FormKeyValueTable/FormKeyValueTable.d.ts +49 -0
  68. package/dist/components/FormKeyValueTable/FormKeyValueTable.d.ts.map +1 -0
  69. package/dist/components/FormKeyValueTable/FormKeyValueTable.mjs +202 -0
  70. package/dist/components/FormKeyValueTable/FormKeyValueTable.mjs.map +1 -0
  71. package/dist/components/FormOnChange/FormOnChange.d.ts +12 -0
  72. package/dist/components/FormOnChange/FormOnChange.d.ts.map +1 -0
  73. package/dist/components/FormOnChange/FormOnChange.mjs +33 -0
  74. package/dist/components/FormOnChange/FormOnChange.mjs.map +1 -0
  75. package/dist/components/FormRadio/FormRadio.d.ts +19 -0
  76. package/dist/components/FormRadio/FormRadio.d.ts.map +1 -0
  77. package/dist/components/FormRadio/FormRadio.mjs +57 -0
  78. package/dist/components/FormRadio/FormRadio.mjs.map +1 -0
  79. package/dist/components/FormRadio/FormRadio.stories.d.ts +7 -0
  80. package/dist/components/FormRadio/FormRadio.stories.d.ts.map +1 -0
  81. package/dist/components/FormSelect/FormSelect.d.ts +43 -0
  82. package/dist/components/FormSelect/FormSelect.d.ts.map +1 -0
  83. package/dist/components/FormSelect/FormSelect.mjs +257 -0
  84. package/dist/components/FormSelect/FormSelect.mjs.map +1 -0
  85. package/dist/components/FormSelect/FormSelect.stories.d.ts +10 -0
  86. package/dist/components/FormSelect/FormSelect.stories.d.ts.map +1 -0
  87. package/dist/components/FormTextarea/FormTextarea.d.ts +40 -0
  88. package/dist/components/FormTextarea/FormTextarea.d.ts.map +1 -0
  89. package/dist/components/FormTextarea/FormTextarea.mjs +122 -0
  90. package/dist/components/FormTextarea/FormTextarea.mjs.map +1 -0
  91. package/dist/components/FormTextarea/FormTextarea.stories.d.ts +9 -0
  92. package/dist/components/FormTextarea/FormTextarea.stories.d.ts.map +1 -0
  93. package/dist/components/FormToggle/FormToggle.d.ts +18 -0
  94. package/dist/components/FormToggle/FormToggle.d.ts.map +1 -0
  95. package/dist/components/FormToggle/FormToggle.mjs +48 -0
  96. package/dist/components/FormToggle/FormToggle.mjs.map +1 -0
  97. package/dist/components/Modal/Modal.d.ts +29 -0
  98. package/dist/components/Modal/Modal.d.ts.map +1 -0
  99. package/dist/components/Modal/Modal.mjs +71 -0
  100. package/dist/components/Modal/Modal.mjs.map +1 -0
  101. package/dist/components/PopUpDialog/PopUpDialog.d.ts +28 -0
  102. package/dist/components/PopUpDialog/PopUpDialog.d.ts.map +1 -0
  103. package/dist/components/PopUpDialog/PopUpDialog.mjs +90 -0
  104. package/dist/components/PopUpDialog/PopUpDialog.mjs.map +1 -0
  105. package/dist/components/RoundedIcon/RoundedIcon.d.ts +23 -0
  106. package/dist/components/RoundedIcon/RoundedIcon.d.ts.map +1 -0
  107. package/dist/components/RoundedIcon/RoundedIcon.mjs +40 -0
  108. package/dist/components/RoundedIcon/RoundedIcon.mjs.map +1 -0
  109. package/dist/components/RoundedIcon/RoundedIcon.stories.d.ts +9 -0
  110. package/dist/components/RoundedIcon/RoundedIcon.stories.d.ts.map +1 -0
  111. package/dist/components/Tip/Tip.d.ts +14 -0
  112. package/dist/components/Tip/Tip.d.ts.map +1 -0
  113. package/dist/components/Tip/Tip.mjs +67 -0
  114. package/dist/components/Tip/Tip.mjs.map +1 -0
  115. package/dist/components/Tip/Tip.stories.d.ts +7 -0
  116. package/dist/components/Tip/Tip.stories.d.ts.map +1 -0
  117. package/dist/components/Tooltip/Tooltip.d.ts +22 -0
  118. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
  119. package/dist/components/Tooltip/Tooltip.mjs +136 -0
  120. package/dist/components/Tooltip/Tooltip.mjs.map +1 -0
  121. package/dist/components/Tooltip/Tooltip.stories.d.ts +8 -0
  122. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -0
  123. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.d.ts +12 -0
  124. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.d.ts.map +1 -0
  125. package/dist/components/TooltipTemplate/TextTooltipTemplate.d.ts +12 -0
  126. package/dist/components/TooltipTemplate/TextTooltipTemplate.d.ts.map +1 -0
  127. package/dist/components/TooltipTemplate/TextTooltipTemplate.mjs +21 -0
  128. package/dist/components/TooltipTemplate/TextTooltipTemplate.mjs.map +1 -0
  129. package/dist/components/Wizard/Wizard.d.ts +33 -0
  130. package/dist/components/Wizard/Wizard.d.ts.map +1 -0
  131. package/dist/components/Wizard/Wizard.mjs +129 -0
  132. package/dist/components/Wizard/Wizard.mjs.map +1 -0
  133. package/dist/components/Wizard/WizardSteps/WizardSteps.d.ts +16 -0
  134. package/dist/components/Wizard/WizardSteps/WizardSteps.d.ts.map +1 -0
  135. package/dist/components/Wizard/WizardSteps/WizardSteps.mjs +41 -0
  136. package/dist/components/Wizard/WizardSteps/WizardSteps.mjs.map +1 -0
  137. package/dist/components/index.d.ts +21 -0
  138. package/dist/components/index.d.ts.map +1 -0
  139. package/dist/components/index.mjs +41 -0
  140. package/dist/components/index.mjs.map +1 -0
  141. package/dist/constants.d.ts +114 -0
  142. package/dist/constants.d.ts.map +1 -0
  143. package/dist/constants.mjs +44 -0
  144. package/dist/constants.mjs.map +1 -0
  145. package/dist/elements/FormActionButton/FormActionButton.d.ts +23 -0
  146. package/dist/elements/FormActionButton/FormActionButton.d.ts.map +1 -0
  147. package/dist/elements/FormActionButton/FormActionButton.mjs +43 -0
  148. package/dist/elements/FormActionButton/FormActionButton.mjs.map +1 -0
  149. package/dist/elements/FormRowActions/FormRowActions.d.ts +27 -0
  150. package/dist/elements/FormRowActions/FormRowActions.d.ts.map +1 -0
  151. package/dist/elements/FormRowActions/FormRowActions.mjs +87 -0
  152. package/dist/elements/FormRowActions/FormRowActions.mjs.map +1 -0
  153. package/dist/elements/OptionsMenu/OptionsMenu.d.ts +18 -0
  154. package/dist/elements/OptionsMenu/OptionsMenu.d.ts.map +1 -0
  155. package/dist/elements/OptionsMenu/OptionsMenu.mjs +47 -0
  156. package/dist/elements/OptionsMenu/OptionsMenu.mjs.map +1 -0
  157. package/dist/elements/SelectOption/SelectOption.d.ts +20 -0
  158. package/dist/elements/SelectOption/SelectOption.d.ts.map +1 -0
  159. package/dist/elements/SelectOption/SelectOption.mjs +84 -0
  160. package/dist/elements/SelectOption/SelectOption.mjs.map +1 -0
  161. package/dist/elements/ValidationTemplate/ValidationTemplate.d.ts +12 -0
  162. package/dist/elements/ValidationTemplate/ValidationTemplate.d.ts.map +1 -0
  163. package/dist/elements/ValidationTemplate/ValidationTemplate.mjs +22 -0
  164. package/dist/elements/ValidationTemplate/ValidationTemplate.mjs.map +1 -0
  165. package/dist/elements/index.d.ts +7 -0
  166. package/dist/elements/index.d.ts.map +1 -0
  167. package/dist/elements/index.mjs +13 -0
  168. package/dist/elements/index.mjs.map +1 -0
  169. package/dist/hooks/index.d.ts +6 -0
  170. package/dist/hooks/index.d.ts.map +1 -0
  171. package/dist/hooks/index.mjs +13 -0
  172. package/dist/hooks/index.mjs.map +1 -0
  173. package/dist/hooks/useChipCell.hook.d.ts +13 -0
  174. package/dist/hooks/useChipCell.hook.d.ts.map +1 -0
  175. package/dist/hooks/useChipCell.hook.mjs +58 -0
  176. package/dist/hooks/useChipCell.hook.mjs.map +1 -0
  177. package/dist/hooks/useDebounce.hook.d.ts +2 -0
  178. package/dist/hooks/useDebounce.hook.d.ts.map +1 -0
  179. package/dist/hooks/useDebounce.hook.mjs +19 -0
  180. package/dist/hooks/useDebounce.hook.mjs.map +1 -0
  181. package/dist/hooks/useDetectOutsideClick.hook.d.ts +2 -0
  182. package/dist/hooks/useDetectOutsideClick.hook.d.ts.map +1 -0
  183. package/dist/hooks/useDetectOutsideClick.hook.mjs +15 -0
  184. package/dist/hooks/useDetectOutsideClick.hook.mjs.map +1 -0
  185. package/dist/hooks/useFormTable.hook.d.ts +16 -0
  186. package/dist/hooks/useFormTable.hook.d.ts.map +1 -0
  187. package/dist/hooks/useFormTable.hook.mjs +128 -0
  188. package/dist/hooks/useFormTable.hook.mjs.map +1 -0
  189. package/dist/hooks/useHiddenChipsBlock.hook.d.ts +4 -0
  190. package/dist/hooks/useHiddenChipsBlock.hook.d.ts.map +1 -0
  191. package/dist/hooks/useHiddenChipsBlock.hook.mjs +51 -0
  192. package/dist/hooks/useHiddenChipsBlock.hook.mjs.map +1 -0
  193. package/dist/images/add.svg.mjs +6 -0
  194. package/dist/images/add.svg.mjs.map +1 -0
  195. package/dist/images/alerts-icon.svg +3 -0
  196. package/dist/images/arrow.svg.mjs +6 -0
  197. package/dist/images/arrow.svg.mjs.map +1 -0
  198. package/dist/images/back-arrow.svg.mjs +6 -0
  199. package/dist/images/back-arrow.svg.mjs.map +1 -0
  200. package/dist/images/checkmark.svg.mjs +6 -0
  201. package/dist/images/checkmark.svg.mjs.map +1 -0
  202. package/dist/images/checkmark2.svg.mjs +6 -0
  203. package/dist/images/checkmark2.svg.mjs.map +1 -0
  204. package/dist/images/close.svg.mjs +6 -0
  205. package/dist/images/close.svg.mjs.map +1 -0
  206. package/dist/images/delete.svg.mjs +6 -0
  207. package/dist/images/delete.svg.mjs.map +1 -0
  208. package/dist/images/documents-icon.svg +3 -0
  209. package/dist/images/dropdown.svg.mjs +6 -0
  210. package/dist/images/dropdown.svg.mjs.map +1 -0
  211. package/dist/images/edit.svg.mjs +6 -0
  212. package/dist/images/edit.svg.mjs.map +1 -0
  213. package/dist/images/exclamation-mark.svg.mjs +6 -0
  214. package/dist/images/exclamation-mark.svg.mjs.map +1 -0
  215. package/dist/images/llm-prompt-icon.svg +3 -0
  216. package/dist/images/mlrun-api-gateways.svg +8 -0
  217. package/dist/images/mlrun-artifacts.svg +11 -0
  218. package/dist/images/mlrun-datasets.svg +5 -0
  219. package/dist/images/mlrun-feature-store.svg +10 -0
  220. package/dist/images/mlrun-jobs-and-workflows.svg +5 -0
  221. package/dist/images/mlrun-ml-functions.svg +8 -0
  222. package/dist/images/mlrun-models.svg +5 -0
  223. package/dist/images/mlrun-project-home.svg +5 -0
  224. package/dist/images/mlrun-project-monitoring.svg +9 -0
  225. package/dist/images/mlrun-project-settings.svg +5 -0
  226. package/dist/images/mlrun-realtime-functions.svg +8 -0
  227. package/dist/images/model-monitoring.svg +3 -0
  228. package/dist/images/plus.svg.mjs +6 -0
  229. package/dist/images/plus.svg.mjs.map +1 -0
  230. package/dist/images/popout.svg.mjs +6 -0
  231. package/dist/images/popout.svg.mjs.map +1 -0
  232. package/dist/images/question-mark.svg.mjs +6 -0
  233. package/dist/images/question-mark.svg.mjs.map +1 -0
  234. package/dist/images/range-arrow-small.svg.mjs +6 -0
  235. package/dist/images/range-arrow-small.svg.mjs.map +1 -0
  236. package/dist/images/search.svg.mjs +6 -0
  237. package/dist/images/search.svg.mjs.map +1 -0
  238. package/dist/images/success_done.svg.mjs +6 -0
  239. package/dist/images/success_done.svg.mjs.map +1 -0
  240. package/dist/images/warning.svg.mjs +6 -0
  241. package/dist/images/warning.svg.mjs.map +1 -0
  242. package/dist/index.css +1 -0
  243. package/dist/index.d.ts +8 -0
  244. package/dist/index.d.ts.map +1 -0
  245. package/dist/index.mjs +15 -0
  246. package/dist/index.mjs.map +1 -0
  247. package/dist/robots.txt +3 -0
  248. package/dist/scss/borders.scss +22 -22
  249. package/dist/scss/colors.scss +0 -11
  250. package/dist/scss/common.scss +48 -33
  251. package/dist/scss/fonts.scss +6 -0
  252. package/dist/scss/mixins.scss +117 -106
  253. package/dist/scss/shadows.scss +12 -12
  254. package/dist/scss/variables.scss +3 -3
  255. package/dist/types.d.ts +25 -0
  256. package/dist/types.d.ts.map +1 -0
  257. package/dist/types.mjs +143 -0
  258. package/dist/types.mjs.map +1 -0
  259. package/dist/utils/common.util.d.ts +10 -0
  260. package/dist/utils/common.util.d.ts.map +1 -0
  261. package/dist/utils/common.util.mjs +60 -0
  262. package/dist/utils/common.util.mjs.map +1 -0
  263. package/dist/utils/form.util.d.ts +11 -0
  264. package/dist/utils/form.util.d.ts.map +1 -0
  265. package/dist/utils/form.util.mjs +26 -0
  266. package/dist/utils/form.util.mjs.map +1 -0
  267. package/dist/utils/generateChipsList.util.d.ts +10 -0
  268. package/dist/utils/generateChipsList.util.d.ts.map +1 -0
  269. package/dist/utils/generateChipsList.util.mjs +19 -0
  270. package/dist/utils/generateChipsList.util.mjs.map +1 -0
  271. package/dist/utils/getFirstScrollableParent.util.d.ts +2 -0
  272. package/dist/utils/getFirstScrollableParent.util.d.ts.map +1 -0
  273. package/dist/utils/getFirstScrollableParent.util.mjs +5 -0
  274. package/dist/utils/getFirstScrollableParent.util.mjs.map +1 -0
  275. package/dist/utils/index.d.ts +7 -0
  276. package/dist/utils/index.d.ts.map +1 -0
  277. package/dist/utils/index.mjs +15 -0
  278. package/dist/utils/index.mjs.map +1 -0
  279. package/dist/utils/math.util.d.ts +2 -0
  280. package/dist/utils/math.util.d.ts.map +1 -0
  281. package/dist/utils/math.util.mjs +18 -0
  282. package/dist/utils/math.util.mjs.map +1 -0
  283. package/dist/utils/validation.util.d.ts +6 -0
  284. package/dist/utils/validation.util.d.ts.map +1 -0
  285. package/dist/utils/validation.util.mjs +306 -0
  286. package/dist/utils/validation.util.mjs.map +1 -0
  287. package/package.json +48 -38
  288. package/dist/components/Backdrop/Backdrop.js +0 -56
  289. package/dist/components/Backdrop/Backdrop.scss +0 -32
  290. package/dist/components/Button/Button.js +0 -73
  291. package/dist/components/Button/Button.scss +0 -171
  292. package/dist/components/ConfirmDialog/ConfirmDialog.js +0 -101
  293. package/dist/components/ConfirmDialog/confirmDialog.scss +0 -23
  294. package/dist/components/FormCheckBox/FormCheckBox.js +0 -82
  295. package/dist/components/FormCheckBox/formCheckBox.scss +0 -91
  296. package/dist/components/FormChipCell/FormChip/FormChip.js +0 -103
  297. package/dist/components/FormChipCell/FormChip/formChip.scss +0 -68
  298. package/dist/components/FormChipCell/FormChipCell.js +0 -339
  299. package/dist/components/FormChipCell/FormChipCellView.js +0 -190
  300. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +0 -107
  301. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +0 -353
  302. package/dist/components/FormChipCell/NewChipForm/newChipForm.scss +0 -81
  303. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +0 -71
  304. package/dist/components/FormChipCell/formChipCell.scss +0 -64
  305. package/dist/components/FormChipCell/formChipCell.util.js +0 -52
  306. package/dist/components/FormCombobox/FormCombobox.js +0 -432
  307. package/dist/components/FormCombobox/formCombobox.scss +0 -134
  308. package/dist/components/FormInput/FormInput.js +0 -408
  309. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +0 -91
  310. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.scss +0 -123
  311. package/dist/components/FormInput/formInput.scss +0 -76
  312. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +0 -221
  313. package/dist/components/FormOnChange/FormOnChange.js +0 -69
  314. package/dist/components/FormRadio/FormRadio.js +0 -85
  315. package/dist/components/FormRadio/FormRadio.scss +0 -41
  316. package/dist/components/FormSelect/FormSelect.js +0 -353
  317. package/dist/components/FormSelect/FormSelect.test.js +0 -138
  318. package/dist/components/FormSelect/formSelect.scss +0 -97
  319. package/dist/components/FormTextarea/FormTextarea.js +0 -184
  320. package/dist/components/FormTextarea/formTextarea.scss +0 -32
  321. package/dist/components/FormToggle/FormToggle.js +0 -82
  322. package/dist/components/FormToggle/formToggle.scss +0 -58
  323. package/dist/components/Modal/Modal.js +0 -116
  324. package/dist/components/Modal/Modal.scss +0 -149
  325. package/dist/components/PopUpDialog/PopUpDialog.js +0 -171
  326. package/dist/components/PopUpDialog/popUpDialog.scss +0 -83
  327. package/dist/components/RoundedIcon/RoundedIcon.js +0 -72
  328. package/dist/components/RoundedIcon/roundedIcon.scss +0 -57
  329. package/dist/components/Tip/Tip.js +0 -116
  330. package/dist/components/Tip/Tip.test.js +0 -64
  331. package/dist/components/Tip/tip.scss +0 -94
  332. package/dist/components/Tooltip/Tooltip.js +0 -180
  333. package/dist/components/Tooltip/Tooltip.test.js +0 -155
  334. package/dist/components/Tooltip/tooltip.scss +0 -29
  335. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +0 -53
  336. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +0 -53
  337. package/dist/components/TooltipTemplate/producerTooltipTemplate.scss +0 -23
  338. package/dist/components/TooltipTemplate/textTooltipTemplate.scss +0 -21
  339. package/dist/components/Wizard/Wizard.js +0 -192
  340. package/dist/components/Wizard/Wizard.scss +0 -53
  341. package/dist/components/Wizard/WizardSteps/WizardSteps.js +0 -74
  342. package/dist/components/Wizard/WizardSteps/WizardSteps.scss +0 -108
  343. package/dist/components/index.js +0 -139
  344. package/dist/constants.js +0 -120
  345. package/dist/elements/FormActionButton/FormActionButton.js +0 -64
  346. package/dist/elements/FormRowActions/FormRowActions.js +0 -99
  347. package/dist/elements/OptionsMenu/OptionsMenu.js +0 -75
  348. package/dist/elements/OptionsMenu/optionsMenu.scss +0 -45
  349. package/dist/elements/SelectOption/SelectOption.js +0 -107
  350. package/dist/elements/SelectOption/SelectOption.test.js +0 -98
  351. package/dist/elements/SelectOption/selectOption.scss +0 -98
  352. package/dist/elements/ValidationTemplate/ValidationTemplate.js +0 -56
  353. package/dist/elements/ValidationTemplate/ValidationTemplate.scss +0 -36
  354. package/dist/elements/index.js +0 -41
  355. package/dist/hooks/index.js +0 -40
  356. package/dist/hooks/useChipCell.hook.js +0 -129
  357. package/dist/hooks/useDebounce.hook.js +0 -52
  358. package/dist/hooks/useDetectOutsideClick.hook.js +0 -47
  359. package/dist/hooks/useFormTable.hook.js +0 -224
  360. package/dist/hooks/useHiddenChipsBlock.hook.js +0 -102
  361. package/dist/index.js +0 -18
  362. package/dist/types.js +0 -127
  363. package/dist/utils/common.util.js +0 -130
  364. package/dist/utils/form.util.js +0 -70
  365. package/dist/utils/generateChipsList.util.js +0 -39
  366. package/dist/utils/getFirstScrollableParent.util.js +0 -49
  367. package/dist/utils/math.util.js +0 -44
  368. package/dist/utils/validation.util.js +0 -401
@@ -1,408 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var _lodash = require("lodash");
11
- var _reactFinalForm = require("react-final-form");
12
- var _InputNumberButtons = _interopRequireDefault(require("./InputNumberButtons/InputNumberButtons"));
13
- var _OptionsMenu = _interopRequireDefault(require("../../elements/OptionsMenu/OptionsMenu"));
14
- var _ValidationTemplate = _interopRequireDefault(require("../../elements/ValidationTemplate/ValidationTemplate"));
15
- var _components = require("../../components");
16
- var _types = require("../../types");
17
- var _validation = require("../../utils/validation.util");
18
- var _hooks = require("../../hooks");
19
- var _constants = require("../../constants");
20
- var _exclamationMark = require("../../images/exclamation-mark.svg");
21
- var _popout = require("../../images/popout.svg");
22
- var _warning = require("../../images/warning.svg");
23
- require("./formInput.scss");
24
- var _jsxRuntime = require("react/jsx-runtime");
25
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
26
- 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); }
27
- 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; }
28
- /*
29
- Copyright 2022 Iguazio Systems Ltd.
30
- Licensed under the Apache License, Version 2.0 (the "License") with
31
- an addition restriction as set forth herein. You may not use this
32
- file except in compliance with the License. You may obtain a copy of
33
- the License at http://www.apache.org/licenses/LICENSE-2.0.
34
- Unless required by applicable law or agreed to in writing, software
35
- distributed under the License is distributed on an "AS IS" BASIS,
36
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
37
- implied. See the License for the specific language governing
38
- permissions and limitations under the License.
39
- In addition, you may not use the software for any purposes that are
40
- illegal under applicable law, and the grant of the foregoing license
41
- under the Apache 2.0 license is conditioned upon your compliance with
42
- such restriction.
43
- */
44
-
45
- const defaultProps = {
46
- iconClick: () => {},
47
- link: {
48
- show: '',
49
- value: ''
50
- },
51
- onBlur: () => {},
52
- onChange: () => {},
53
- onKeyDown: () => {},
54
- onValidationError: () => {},
55
- validator: () => {},
56
- rules: []
57
- };
58
- const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
59
- let {
60
- async = false,
61
- className = '',
62
- customRequiredLabel = '',
63
- density = 'normal',
64
- disabled = false,
65
- focused = false,
66
- iconClass = '',
67
- iconClick = defaultProps.iconClick,
68
- inputIcon = null,
69
- invalidText = 'This field is invalid',
70
- label = '',
71
- link = defaultProps.link,
72
- name,
73
- onBlur = defaultProps.onBlur,
74
- onChange = defaultProps.onChange,
75
- onFocus,
76
- onKeyDown = defaultProps.onKeyDown,
77
- pattern = null,
78
- required = false,
79
- onValidationError = defaultProps.onValidationError,
80
- suggestionList = [],
81
- step = '1',
82
- tip = '',
83
- type = 'text',
84
- validationRules: rules = defaultProps.rules,
85
- validator = defaultProps.validator,
86
- withoutBorder = false,
87
- ...inputProps
88
- } = _ref;
89
- const {
90
- input,
91
- meta
92
- } = (0, _reactFinalForm.useField)(name);
93
- const [isInvalid, setIsInvalid] = (0, _react.useState)(false);
94
- const [isFocused, setIsFocused] = (0, _react.useState)(false);
95
- const [typedValue, setTypedValue] = (0, _react.useState)('');
96
- const [validationPattern] = (0, _react.useState)(RegExp(pattern));
97
- const [validationRules, setValidationRules] = (0, _react.useState)(rules);
98
- const [showValidationRules, setShowValidationRules] = (0, _react.useState)(false);
99
- const wrapperRef = (0, _react.useRef)();
100
- ref ??= wrapperRef;
101
- const inputRef = (0, _react.useRef)();
102
- const errorsRef = (0, _react.useRef)();
103
- const isRequiredRulePresentRef = (0, _react.useRef)(false);
104
- (0, _hooks.useDetectOutsideClick)(ref, () => setShowValidationRules(false));
105
- const debounceAsync = (0, _hooks.useDebounce)();
106
- const formFieldClassNames = (0, _classnames.default)('form-field-input', className);
107
- const inputWrapperClassNames = (0, _classnames.default)('form-field__wrapper', `form-field__wrapper-${density}`, disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
108
- const labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
109
- (0, _react.useEffect)(() => {
110
- setTypedValue(String(input.value)); // convert from number to string
111
- }, [input.value]);
112
- (0, _react.useEffect)(() => {
113
- const isInputInvalid = errorsRef.current && meta.invalid && (meta.validating || meta.modified || meta.submitFailed && meta.touched);
114
- setIsInvalid(isInputInvalid);
115
- onValidationError(isInputInvalid);
116
- }, [meta.invalid, meta.modified, meta.submitFailed, meta.touched, meta.validating, onValidationError]);
117
- (0, _react.useEffect)(() => {
118
- if (!errorsRef.current) {
119
- if (meta.valid && showValidationRules) {
120
- setShowValidationRules(false);
121
- }
122
- }
123
- }, [errorsRef.current, meta.valid, showValidationRules]);
124
- (0, _react.useEffect)(() => {
125
- if (showValidationRules) {
126
- window.addEventListener('scroll', handleScroll, true);
127
- }
128
- return () => {
129
- window.removeEventListener('scroll', handleScroll, true);
130
- };
131
- }, [showValidationRules]);
132
- (0, _react.useEffect)(() => {
133
- if (focused) {
134
- inputRef.current.focus();
135
- }
136
- }, [focused]);
137
- (0, _react.useEffect)(() => {
138
- setValidationRules(() => {
139
- isRequiredRulePresentRef.current = false;
140
- return rules.map(rule => {
141
- if (rule.name === _constants.validation.REQUIRED.NAME) {
142
- isRequiredRulePresentRef.current = true;
143
- }
144
- return {
145
- ...rule,
146
- isValid: !errorsRef.current || !Array.isArray(errorsRef.current) ? true : !errorsRef.current.some(err => err.name === rule.name)
147
- };
148
- });
149
- });
150
- }, [rules]);
151
- const getValidationRules = () => {
152
- return validationRules.map(_ref2 => {
153
- let {
154
- isValid = false,
155
- label,
156
- name
157
- } = _ref2;
158
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ValidationTemplate.default, {
159
- valid: isValid,
160
- validationMessage: label
161
- }, name);
162
- });
163
- };
164
- const isValueEmptyAndValid = value => {
165
- return !value && !required || disabled;
166
- };
167
- const handleInputBlur = event => {
168
- input.onBlur && input.onBlur(event);
169
- if (!event.relatedTarget || !event.relatedTarget?.closest('.form-field__suggestion-list')) {
170
- setIsFocused(false);
171
- onBlur && onBlur(event);
172
- }
173
- };
174
- const handleInputFocus = event => {
175
- input.onFocus && input.onFocus(event);
176
- onFocus && onFocus(event);
177
- setIsFocused(true);
178
- };
179
- const handleInputKeyDown = event => {
180
- input.onKeyDown && input.onKeyDown(event);
181
- onKeyDown && onKeyDown(event);
182
- };
183
- const handleScroll = event => {
184
- if (inputRef.current && inputRef.current.contains(event.target)) return;
185
- if (!event.target.closest('.options-menu') && !event.target.classList.contains('form-field-input')) {
186
- setShowValidationRules(false);
187
- }
188
- };
189
- const handleSuggestionClick = item => {
190
- input.onChange && input.onChange(item);
191
- setIsFocused(false);
192
- onBlur();
193
- };
194
- const toggleValidationRulesMenu = () => {
195
- inputRef.current.focus();
196
- setShowValidationRules(state => !state);
197
- };
198
- const validateField = (value, allValues) => {
199
- let valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
200
- if (isValueEmptyAndValid(valueToValidate)) return;
201
- let validationError = null;
202
- if (required && valueToValidate.trim().length === 0 && !isRequiredRulePresentRef.current) {
203
- validationError = {
204
- name: 'required',
205
- label: customRequiredLabel || 'This field is required'
206
- };
207
- } else if (!(0, _lodash.isEmpty)(rules) && !async) {
208
- const [newRules, isValidField] = (0, _validation.checkPatternsValidity)(rules, valueToValidate);
209
- const invalidRules = newRules.filter(rule => !rule.isValid);
210
- if (!isValidField) {
211
- validationError = invalidRules.map(rule => ({
212
- name: rule.name,
213
- label: rule.label
214
- }));
215
- }
216
- }
217
- if ((0, _lodash.isEmpty)(validationError)) {
218
- if (type === 'number') {
219
- if (inputProps.max && +valueToValidate > +inputProps.max) {
220
- validationError = {
221
- name: 'maxValue',
222
- label: `The maximum value must be ${inputProps.max}`
223
- };
224
- }
225
- if (inputProps.min && +valueToValidate < +inputProps.min) {
226
- validationError = {
227
- name: 'minValue',
228
- label: `The minimum value must be ${inputProps.min}`
229
- };
230
- }
231
- }
232
- if (pattern && !validationPattern.test(valueToValidate)) {
233
- validationError = {
234
- name: 'pattern',
235
- label: invalidText
236
- };
237
- } else if (valueToValidate.startsWith(' ')) {
238
- validationError = {
239
- name: 'empty',
240
- label: invalidText
241
- };
242
- }
243
- }
244
- if (!validationError && validator) {
245
- validationError = validator(value, allValues);
246
- }
247
- errorsRef.current = validationError;
248
- return validationError;
249
- };
250
- const validateFieldAsync = debounceAsync(async (value, allValues) => {
251
- let valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
252
- if (isValueEmptyAndValid(valueToValidate)) return;
253
- let validationError = validateField(valueToValidate, allValues);
254
- if (!(0, _lodash.isEmpty)(rules)) {
255
- const [newRules, isValidField] = await (0, _validation.checkPatternsValidityAsync)(rules, valueToValidate);
256
- const invalidRules = newRules.filter(rule => !rule.isValid);
257
- if (!isValidField) {
258
- validationError = invalidRules.map(rule => ({
259
- name: rule.name,
260
- label: rule.label
261
- }));
262
- }
263
- }
264
- errorsRef.current = validationError;
265
- return validationError;
266
- }, 400);
267
- const parseField = val => {
268
- return type === 'number' && val ? parseFloat(val) || val : val;
269
- };
270
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
271
- validate: async ? validateFieldAsync : validateField,
272
- name: name,
273
- parse: parseField,
274
- children: _ref3 => {
275
- let {
276
- input
277
- } = _ref3;
278
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
279
- ref: ref,
280
- className: formFieldClassNames,
281
- "data-testid": name ? `${name}-form-field-input` : 'form-field-input',
282
- children: [label && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
283
- className: labelClassNames,
284
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
285
- "data-testid": name ? `${name}-form-label` : 'form-label',
286
- htmlFor: input.name,
287
- children: [label, (required || validationRules.find(rule => rule.name === 'required')) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
288
- className: "form-field__label-mandatory",
289
- children: " *"
290
- })]
291
- }), link && link.show && typedValue.trim() && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
292
- className: "form-field__label-icon",
293
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
294
- template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextTooltipTemplate, {
295
- text: link.url || typedValue
296
- }),
297
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
298
- href: link.url || typedValue,
299
- onClick: event => event.stopPropagation(),
300
- target: "_blank",
301
- rel: "noreferrer",
302
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_popout.ReactComponent, {})
303
- })
304
- })
305
- })]
306
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
307
- className: inputWrapperClassNames,
308
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
309
- className: "form-field__control",
310
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
311
- "data-testid": name ? `${name}-form-input` : 'form-input',
312
- id: input.name,
313
- ref: inputRef,
314
- required: isInvalid || required,
315
- disabled,
316
- pattern,
317
- type,
318
- ...inputProps,
319
- ...input,
320
- autoComplete: inputProps.autocomplete ?? 'off',
321
- onBlur: handleInputBlur,
322
- onKeyDown: handleInputKeyDown,
323
- onFocus: handleInputFocus
324
- })
325
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
326
- className: "form-field__icons",
327
- children: [isInvalid && !Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
328
- className: "form-field__warning",
329
- template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextTooltipTemplate, {
330
- text: errorsRef.current?.label ?? invalidText,
331
- warning: true
332
- }),
333
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {})
334
- }), isInvalid && Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
335
- className: "form-field__warning",
336
- onClick: toggleValidationRulesMenu,
337
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_warning.ReactComponent, {})
338
- }), tip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tip, {
339
- text: tip,
340
- className: "form-field__tip"
341
- }), inputIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
342
- "data-testid": "input-icon",
343
- className: iconClass,
344
- onClick: iconClick,
345
- children: inputIcon
346
- })]
347
- }), type === 'number' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputNumberButtons.default, {
348
- ...inputProps,
349
- step: +step,
350
- ...input,
351
- disabled
352
- })]
353
- }), suggestionList?.length > 0 && isFocused && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
354
- className: "form-field__suggestion-list",
355
- children: suggestionList.map((item, index) => {
356
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
357
- className: "suggestion-item",
358
- onClick: () => {
359
- handleSuggestionClick(item);
360
- },
361
- tabIndex: index,
362
- dangerouslySetInnerHTML: {
363
- __html: item.replace(new RegExp(typedValue, 'gi'), match => match ? `<b>${match}</b>` : match)
364
- }
365
- }, `${item}${index}`);
366
- })
367
- }), !(0, _lodash.isEmpty)(validationRules) && isInvalid && Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_OptionsMenu.default, {
368
- show: showValidationRules,
369
- ref: ref,
370
- children: getValidationRules()
371
- })]
372
- });
373
- }
374
- });
375
- });
376
- FormInput.propTypes = {
377
- async: _propTypes.default.bool,
378
- className: _propTypes.default.string,
379
- customRequiredLabel: _propTypes.default.string,
380
- density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
381
- disabled: _propTypes.default.bool,
382
- focused: _propTypes.default.bool,
383
- iconClass: _propTypes.default.string,
384
- iconClick: _propTypes.default.func,
385
- inputIcon: _propTypes.default.element,
386
- invalidText: _propTypes.default.string,
387
- label: _propTypes.default.string,
388
- link: _types.INPUT_LINK,
389
- min: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
390
- max: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
391
- name: _propTypes.default.string.isRequired,
392
- onBlur: _propTypes.default.func,
393
- onChange: _propTypes.default.func,
394
- onFocus: _propTypes.default.func,
395
- onKeyDown: _propTypes.default.func,
396
- pattern: _propTypes.default.string,
397
- placeholder: _propTypes.default.string,
398
- required: _propTypes.default.bool,
399
- step: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
400
- suggestionList: _propTypes.default.arrayOf(_propTypes.default.string),
401
- tip: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
402
- type: _propTypes.default.string,
403
- validationRules: _types.INPUT_VALIDATION_RULES,
404
- validator: _propTypes.default.func,
405
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
406
- withoutBorder: _propTypes.default.bool
407
- };
408
- var _default = exports.default = /*#__PURE__*/_react.default.memo(FormInput);
@@ -1,91 +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 _lodash = require("lodash");
10
- var _math = require("../../../utils/math.util");
11
- var _rangeArrowSmall = require("../../../images/range-arrow-small.svg");
12
- require("./InputNumberButtons.scss");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- /*
16
- Copyright 2022 Iguazio Systems Ltd.
17
- Licensed under the Apache License, Version 2.0 (the "License") with
18
- an addition restriction as set forth herein. You may not use this
19
- file except in compliance with the License. You may obtain a copy of
20
- the License at http://www.apache.org/licenses/LICENSE-2.0.
21
- Unless required by applicable law or agreed to in writing, software
22
- distributed under the License is distributed on an "AS IS" BASIS,
23
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
24
- implied. See the License for the specific language governing
25
- permissions and limitations under the License.
26
- In addition, you may not use the software for any purposes that are
27
- illegal under applicable law, and the grant of the foregoing license
28
- under the Apache 2.0 license is conditioned upon your compliance with
29
- such restriction.
30
- */
31
-
32
- const InputNumberButtons = _ref => {
33
- let {
34
- disabled = false,
35
- min = null,
36
- max = null,
37
- onChange,
38
- step = 1,
39
- value
40
- } = _ref;
41
- const handleIncrease = event => {
42
- event.preventDefault();
43
- if (max && value >= max) return;
44
- let newValue = isCurrentValueEmpty() ? step : (0, _math.performFloatOperation)(value, step, '+');
45
- newValue = max && newValue > max ? max : newValue;
46
- onChange(newValue);
47
- };
48
- const handleDecrease = event => {
49
- event.preventDefault();
50
- if (min && value <= min) return;
51
- let newValue = isCurrentValueEmpty() ? -step : (0, _math.performFloatOperation)(value, step, '-');
52
- newValue = min && newValue < min ? min : newValue;
53
- onChange(newValue);
54
- };
55
- const isCurrentValueEmpty = () => {
56
- return (0, _lodash.isNil)(value) || value === '';
57
- };
58
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
59
- "data-testid": "range-input-container",
60
- className: "form-field-range",
61
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
62
- className: "range__buttons",
63
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
64
- "data-testid": "btn-increase",
65
- className: "range__button range__button-increase",
66
- disabled: disabled,
67
- onClick: handleIncrease,
68
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rangeArrowSmall.ReactComponent, {
69
- className: "increase"
70
- })
71
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
72
- "data-testid": "btn-decrease",
73
- className: "range__button range__button-decrease",
74
- disabled: disabled,
75
- onClick: handleDecrease,
76
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rangeArrowSmall.ReactComponent, {
77
- className: "decrease"
78
- })
79
- })]
80
- })
81
- });
82
- };
83
- InputNumberButtons.propTypes = {
84
- disabled: _propTypes.default.bool,
85
- min: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
86
- max: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
87
- onChange: _propTypes.default.func.isRequired,
88
- step: _propTypes.default.number,
89
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
90
- };
91
- var _default = exports.default = /*#__PURE__*/_react.default.memo(InputNumberButtons);
@@ -1,123 +0,0 @@
1
- @import '../../../scss/colors';
2
- @import '../../../scss/borders';
3
-
4
- .form-field-range {
5
- align-self: stretch;
6
-
7
- .range {
8
- &__buttons {
9
- display: flex;
10
- flex-direction: column;
11
- justify-content: center;
12
- width: 28px;
13
- height: 100%;
14
- }
15
-
16
- &__button {
17
- display: flex;
18
- width: 100%;
19
- height: calc(50% + 1px);
20
- align-items: center;
21
- justify-content: center;
22
- padding: 0;
23
- background-color: $wildSand;
24
- cursor: pointer;
25
-
26
- svg {
27
- path {
28
- fill: $topaz;
29
- }
30
- }
31
-
32
- &:hover {
33
- background-color: $mercury;
34
-
35
- svg {
36
- path {
37
- fill: $primary;
38
- }
39
- }
40
- }
41
-
42
- &:focus {
43
- border: $focusBorder;
44
- }
45
-
46
- &:active {
47
- background-color: rgba($black, 0.2);
48
- border: $focusBorder;
49
-
50
- svg {
51
- path {
52
- fill: $primary;
53
- }
54
- }
55
- }
56
-
57
- &:disabled {
58
- cursor: not-allowed;
59
-
60
- svg {
61
- path {
62
- fill: $spunPearl;
63
- }
64
- }
65
-
66
- &:focus {
67
- border: none;
68
- }
69
-
70
- &:hover {
71
- background-color: $wildSand;
72
- }
73
- }
74
-
75
- &-increase {
76
- border-bottom: $transparentBorder;
77
- border-left: $transparentBorder;
78
- border-top-right-radius: 4px;
79
- }
80
-
81
- &-decrease {
82
- border-top: $transparentBorder;
83
- border-left: $transparentBorder;
84
- border-bottom-right-radius: 4px;
85
- }
86
-
87
- .decrease {
88
- transform: rotate(180deg);
89
- }
90
- }
91
-
92
- &-warning {
93
- border: $errorBorder;
94
-
95
- &_asterisk {
96
- position: absolute;
97
- top: 50%;
98
- right: 35px;
99
- color: $amaranth;
100
- transform: translateY(-50%);
101
- }
102
-
103
- .range__button {
104
- &-increase {
105
- border-top: $errorBorder;
106
- border-right: $errorBorder;
107
- }
108
-
109
- &-decrease {
110
- border-right: $errorBorder;
111
- border-bottom: $errorBorder;
112
- }
113
- }
114
- }
115
-
116
- &__warning-icon {
117
- position: absolute;
118
- top: 50%;
119
- right: 30px;
120
- transform: translateY(-50%);
121
- }
122
- }
123
- }
@@ -1,76 +0,0 @@
1
- @import '../../scss/colors';
2
- @import '../../scss/borders';
3
- @import '../../scss/shadows';
4
- @import '../../scss/mixins';
5
-
6
- .form-field-input {
7
- width: 100%;
8
-
9
- input {
10
- height: inherit;
11
- width: 100%;
12
- padding: 12px 16px;
13
- }
14
-
15
- .form-field {
16
- @include inputSelectField;
17
-
18
- &__label {
19
- &-icon {
20
- display: inline-flex;
21
- margin-left: 3px;
22
-
23
- & > *,
24
- a {
25
- display: inline-flex;
26
- }
27
-
28
- a {
29
- transform: translateY(-1px);
30
- }
31
-
32
- svg {
33
- width: 12px;
34
- height: 12px;
35
-
36
- path {
37
- fill: $cornflowerBlue;
38
- }
39
- }
40
- }
41
- }
42
-
43
- &__suggestion-list {
44
- position: absolute;
45
- top: 100%;
46
- left: 0;
47
- z-index: 5;
48
- margin: 0;
49
- padding: 7px 0;
50
- background-color: $white;
51
- border-radius: 4px;
52
- box-shadow: $previewBoxShadow;
53
-
54
- .suggestion-item {
55
- padding: 7px 15px;
56
- color: $mulledWine;
57
- list-style-type: none;
58
-
59
- &:hover {
60
- background-color: $alabaster;
61
- cursor: pointer;
62
- }
63
- }
64
- }
65
- }
66
-
67
- input[type='number'] {
68
- border: none;
69
- -moz-appearance: textfield;
70
-
71
- &::-webkit-outer-spin-button,
72
- &::-webkit-inner-spin-button {
73
- -webkit-appearance: none;
74
- }
75
- }
76
- }