@consta/uikit 3.12.3 → 3.12.4

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 (323) hide show
  1. package/Attach/package.json +1 -1
  2. package/Attachment/package.json +1 -1
  3. package/Avatar/package.json +1 -1
  4. package/Badge/package.json +1 -1
  5. package/BasicSelectDeprecated/package.json +1 -1
  6. package/Breadcrumbs/package.json +1 -1
  7. package/Button/package.json +1 -1
  8. package/CHANGELOG.md +17 -15
  9. package/Calendar/package.json +1 -1
  10. package/Card/package.json +1 -1
  11. package/Checkbox/package.json +1 -1
  12. package/CheckboxGroup/package.json +1 -1
  13. package/ChoiceGroup/package.json +1 -1
  14. package/Collapse/package.json +1 -1
  15. package/CollapseGroup/package.json +1 -1
  16. package/Combobox/package.json +1 -1
  17. package/ComboboxDeprecated/package.json +1 -1
  18. package/ContextMenu/package.json +1 -1
  19. package/DatePickerCanary/package.json +1 -1
  20. package/DateTimeCanary/package.json +1 -1
  21. package/DragNDropField/package.json +1 -1
  22. package/EventInterceptor/package.json +1 -1
  23. package/FieldCaption/package.json +1 -1
  24. package/FieldLabel/package.json +1 -1
  25. package/File/package.json +1 -1
  26. package/FileField/package.json +1 -1
  27. package/FileIcon/package.json +1 -1
  28. package/FileIconAvi/package.json +1 -1
  29. package/FileIconBmp/package.json +1 -1
  30. package/FileIconCsv/package.json +1 -1
  31. package/FileIconDoc/package.json +1 -1
  32. package/FileIconExe/package.json +1 -1
  33. package/FileIconGif/package.json +1 -1
  34. package/FileIconJpg/package.json +1 -1
  35. package/FileIconJson/package.json +1 -1
  36. package/FileIconLoading/package.json +1 -1
  37. package/FileIconMov/package.json +1 -1
  38. package/FileIconMp3/package.json +1 -1
  39. package/FileIconMp4/package.json +1 -1
  40. package/FileIconPdf/package.json +1 -1
  41. package/FileIconPng/package.json +1 -1
  42. package/FileIconPtt/package.json +1 -1
  43. package/FileIconRar/package.json +1 -1
  44. package/FileIconRtf/package.json +1 -1
  45. package/FileIconTiff/package.json +1 -1
  46. package/FileIconTxt/package.json +1 -1
  47. package/FileIconUndefined/package.json +1 -1
  48. package/FileIconWav/package.json +1 -1
  49. package/FileIconXls/package.json +1 -1
  50. package/FileIconZip/package.json +1 -1
  51. package/Grid/package.json +1 -1
  52. package/Header/package.json +1 -1
  53. package/Icon/package.json +1 -1
  54. package/IconAdd/package.json +1 -1
  55. package/IconAddToComparison/package.json +1 -1
  56. package/IconAlert/package.json +1 -1
  57. package/IconAlignBlocksLeft/package.json +1 -1
  58. package/IconAlignBlocksRight/package.json +1 -1
  59. package/IconAlignCenter/package.json +1 -1
  60. package/IconAlignJustify/package.json +1 -1
  61. package/IconAlignLeft/package.json +1 -1
  62. package/IconAlignRight/package.json +1 -1
  63. package/IconAllDone/package.json +1 -1
  64. package/IconArrowDown/package.json +1 -1
  65. package/IconArrowLeft/package.json +1 -1
  66. package/IconArrowRight/package.json +1 -1
  67. package/IconArrowUp/package.json +1 -1
  68. package/IconArtBrush/package.json +1 -1
  69. package/IconAttach/package.json +1 -1
  70. package/IconBackward/package.json +1 -1
  71. package/IconBag/package.json +1 -1
  72. package/IconBarrier/package.json +1 -1
  73. package/IconBento/package.json +1 -1
  74. package/IconBold/package.json +1 -1
  75. package/IconBook/package.json +1 -1
  76. package/IconBookmarkFilled/package.json +1 -1
  77. package/IconBookmarkStroked/package.json +1 -1
  78. package/IconCalculator/package.json +1 -1
  79. package/IconCalendar/package.json +1 -1
  80. package/IconCamera/package.json +1 -1
  81. package/IconCancel/package.json +1 -1
  82. package/IconCards/package.json +1 -1
  83. package/IconChat/package.json +1 -1
  84. package/IconCheck/package.json +1 -1
  85. package/IconClose/package.json +1 -1
  86. package/IconCollapse/package.json +1 -1
  87. package/IconColorFill/package.json +1 -1
  88. package/IconColorText/package.json +1 -1
  89. package/IconColumns/package.json +1 -1
  90. package/IconComment/package.json +1 -1
  91. package/IconConnection/package.json +1 -1
  92. package/IconCopy/package.json +1 -1
  93. package/IconCrown/package.json +1 -1
  94. package/IconCursorMouse/package.json +1 -1
  95. package/IconDataNull/package.json +1 -1
  96. package/IconDiamond/package.json +1 -1
  97. package/IconDinosaur/package.json +1 -1
  98. package/IconDisconnection/package.json +1 -1
  99. package/IconDocAdd/package.json +1 -1
  100. package/IconDocBlank/package.json +1 -1
  101. package/IconDocDelete/package.json +1 -1
  102. package/IconDocExport/package.json +1 -1
  103. package/IconDocFilled/package.json +1 -1
  104. package/IconDown/package.json +1 -1
  105. package/IconDownload/package.json +1 -1
  106. package/IconDrag/package.json +1 -1
  107. package/IconDraggable/package.json +1 -1
  108. package/IconDrillingRig/package.json +1 -1
  109. package/IconDrop/package.json +1 -1
  110. package/IconEdit/package.json +1 -1
  111. package/IconExit/package.json +1 -1
  112. package/IconExpand/package.json +1 -1
  113. package/IconEye/package.json +1 -1
  114. package/IconEyeClose/package.json +1 -1
  115. package/IconFavorite/package.json +1 -1
  116. package/IconFilter/package.json +1 -1
  117. package/IconFitToDefault/package.json +1 -1
  118. package/IconFlagFilled/package.json +1 -1
  119. package/IconFlagStroked/package.json +1 -1
  120. package/IconFolders/package.json +1 -1
  121. package/IconForward/package.json +1 -1
  122. package/IconFunnel/package.json +1 -1
  123. package/IconGas/package.json +1 -1
  124. package/IconGeo/package.json +1 -1
  125. package/IconGrouping/package.json +1 -1
  126. package/IconHamburger/package.json +1 -1
  127. package/IconHand/package.json +1 -1
  128. package/IconHealth/package.json +1 -1
  129. package/IconInComparison/package.json +1 -1
  130. package/IconInfo/package.json +1 -1
  131. package/IconIntroduction/package.json +1 -1
  132. package/IconIpad/package.json +1 -1
  133. package/IconItalic/package.json +1 -1
  134. package/IconKebab/package.json +1 -1
  135. package/IconLaptop/package.json +1 -1
  136. package/IconLayers/package.json +1 -1
  137. package/IconLeaf/package.json +1 -1
  138. package/IconLightningBolt/package.json +1 -1
  139. package/IconLineAndBarChart/package.json +1 -1
  140. package/IconLink/package.json +1 -1
  141. package/IconList/package.json +1 -1
  142. package/IconListNumbered/package.json +1 -1
  143. package/IconLock/package.json +1 -1
  144. package/IconLogicalElement/package.json +1 -1
  145. package/IconMBU/package.json +1 -1
  146. package/IconMGRP/package.json +1 -1
  147. package/IconMLSP/package.json +1 -1
  148. package/IconMMP/package.json +1 -1
  149. package/IconMail/package.json +1 -1
  150. package/IconMap/package.json +1 -1
  151. package/IconMaxHeight/package.json +1 -1
  152. package/IconMaxWidth/package.json +1 -1
  153. package/IconMeatball/package.json +1 -1
  154. package/IconMic/package.json +1 -1
  155. package/IconMolecules/package.json +1 -1
  156. package/IconMoon/package.json +1 -1
  157. package/IconNodeEnd/package.json +1 -1
  158. package/IconNodeStart/package.json +1 -1
  159. package/IconNodeStep/package.json +1 -1
  160. package/IconNodes/package.json +1 -1
  161. package/IconOpenInNew/package.json +1 -1
  162. package/IconPanelBottom/package.json +1 -1
  163. package/IconPanelLeft/package.json +1 -1
  164. package/IconPanelRight/package.json +1 -1
  165. package/IconPanelTop/package.json +1 -1
  166. package/IconPaste/package.json +1 -1
  167. package/IconPause/package.json +1 -1
  168. package/IconPhone/package.json +1 -1
  169. package/IconPhoto/package.json +1 -1
  170. package/IconPlay/package.json +1 -1
  171. package/IconPressure/package.json +1 -1
  172. package/IconProcessing/package.json +1 -1
  173. package/IconQuestion/package.json +1 -1
  174. package/IconQuote/package.json +1 -1
  175. package/IconRUO/package.json +1 -1
  176. package/IconRUS/package.json +1 -1
  177. package/IconRecord/package.json +1 -1
  178. package/IconRemove/package.json +1 -1
  179. package/IconRemoveFromComparison/package.json +1 -1
  180. package/IconReply/package.json +1 -1
  181. package/IconResize/package.json +1 -1
  182. package/IconRestart/package.json +1 -1
  183. package/IconRevert/package.json +1 -1
  184. package/IconRing/package.json +1 -1
  185. package/IconRouble/package.json +1 -1
  186. package/IconRuler/package.json +1 -1
  187. package/IconScreen/package.json +1 -1
  188. package/IconSearch/package.json +1 -1
  189. package/IconSelect/package.json +1 -1
  190. package/IconSelectOpen/package.json +1 -1
  191. package/IconSettings/package.json +1 -1
  192. package/IconShape/package.json +1 -1
  193. package/IconShuffle/package.json +1 -1
  194. package/IconSmile/package.json +1 -1
  195. package/IconSortDown/package.json +1 -1
  196. package/IconSortDownCenter/package.json +1 -1
  197. package/IconSortUp/package.json +1 -1
  198. package/IconSortUpCenter/package.json +1 -1
  199. package/IconStop/package.json +1 -1
  200. package/IconStorage/package.json +1 -1
  201. package/IconStrikethrough/package.json +1 -1
  202. package/IconSun/package.json +1 -1
  203. package/IconTable/package.json +1 -1
  204. package/IconTarget/package.json +1 -1
  205. package/IconTeam/package.json +1 -1
  206. package/IconTest/package.json +1 -1
  207. package/IconThumbUp/package.json +1 -1
  208. package/IconTie/package.json +1 -1
  209. package/IconTop/package.json +1 -1
  210. package/IconTrash/package.json +1 -1
  211. package/IconType/package.json +1 -1
  212. package/IconUnderline/package.json +1 -1
  213. package/IconUnlock/package.json +1 -1
  214. package/IconUnsort/package.json +1 -1
  215. package/IconUnsortCenter/package.json +1 -1
  216. package/IconUpload/package.json +1 -1
  217. package/IconUser/package.json +1 -1
  218. package/IconVZD/package.json +1 -1
  219. package/IconVideo/package.json +1 -1
  220. package/IconWarning/package.json +1 -1
  221. package/IconWatch/package.json +1 -1
  222. package/IconWideScreen/package.json +1 -1
  223. package/IconWorld/package.json +1 -1
  224. package/Informer/package.json +1 -1
  225. package/LayoutCanary/package.json +1 -1
  226. package/Loader/package.json +1 -1
  227. package/MixCard/package.json +1 -1
  228. package/MixFocus/package.json +1 -1
  229. package/MixSpace/package.json +1 -1
  230. package/MixVisuallyHidden/package.json +1 -1
  231. package/Modal/package.json +1 -1
  232. package/MultiComboboxDeprecated/package.json +1 -1
  233. package/Pagination/package.json +1 -1
  234. package/Popover/package.json +1 -1
  235. package/PortalWithTheme/package.json +1 -1
  236. package/ProgressSpin/package.json +1 -1
  237. package/ProgressStepBarCanary/package.json +1 -1
  238. package/Radio/package.json +1 -1
  239. package/RadioGroup/package.json +1 -1
  240. package/Responses/package.json +1 -1
  241. package/Responses403/package.json +1 -1
  242. package/Responses404/package.json +1 -1
  243. package/Responses500/package.json +1 -1
  244. package/Responses503/package.json +1 -1
  245. package/ResponsesConnectionError/package.json +1 -1
  246. package/ResponsesDeleted/package.json +1 -1
  247. package/ResponsesEmptyBox/package.json +1 -1
  248. package/ResponsesEmptyPockets/package.json +1 -1
  249. package/ResponsesImage/package.json +1 -1
  250. package/ResponsesImage403/package.json +1 -1
  251. package/ResponsesImage404/package.json +1 -1
  252. package/ResponsesImage500/package.json +1 -1
  253. package/ResponsesImage503/package.json +1 -1
  254. package/ResponsesImageConnectionError/package.json +1 -1
  255. package/ResponsesImageDeleted/package.json +1 -1
  256. package/ResponsesImageEmptyBox/package.json +1 -1
  257. package/ResponsesImageEmptyPockets/package.json +1 -1
  258. package/ResponsesImageNothingFound/package.json +1 -1
  259. package/ResponsesImageSuccess/package.json +1 -1
  260. package/ResponsesNothingFound/package.json +1 -1
  261. package/ResponsesSuccess/package.json +1 -1
  262. package/Select/package.json +1 -1
  263. package/Sidebar/package.json +1 -1
  264. package/Skeleton/package.json +1 -1
  265. package/SliderCanary/package.json +1 -1
  266. package/SnackBar/package.json +1 -1
  267. package/Steps/package.json +1 -1
  268. package/Switch/package.json +1 -1
  269. package/SwitchGroup/package.json +1 -1
  270. package/Table/package.json +1 -1
  271. package/Tabs/package.json +1 -1
  272. package/Tag/package.json +1 -1
  273. package/TagBase/package.json +1 -1
  274. package/Text/package.json +1 -1
  275. package/TextField/package.json +1 -1
  276. package/Theme/package.json +1 -1
  277. package/ThemeToggler/package.json +1 -1
  278. package/Timer/package.json +1 -1
  279. package/Tooltip/package.json +1 -1
  280. package/User/package.json +1 -1
  281. package/UserSelect/package.json +1 -1
  282. package/UserSelectDeprecated/package.json +1 -1
  283. package/__internal__/cjs-src/components/SliderCanary/Slider.css +4 -0
  284. package/__internal__/cjs-src/components/SliderCanary/SliderCanary.js +9 -11
  285. package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.css +1 -0
  286. package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.js +3 -5
  287. package/__internal__/cjs-src/components/SliderCanary/helper.d.ts +4 -2
  288. package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.d.ts +4 -4
  289. package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.js +8 -7
  290. package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.js +53 -66
  291. package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.js +10 -13
  292. package/__internal__/src/components/SliderCanary/Slider.css +4 -0
  293. package/__internal__/src/components/SliderCanary/SliderCanary.js +5 -7
  294. package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.css +1 -0
  295. package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.js +3 -5
  296. package/__internal__/src/components/SliderCanary/helper.d.ts +4 -2
  297. package/__internal__/src/components/SliderCanary/useSlider/helper.d.ts +4 -4
  298. package/__internal__/src/components/SliderCanary/useSlider/helper.js +8 -7
  299. package/__internal__/src/components/SliderCanary/useSlider/useSlider.js +53 -66
  300. package/__internal__/src/components/SliderCanary/useSliderStationing.js +11 -14
  301. package/createIcon/package.json +1 -1
  302. package/createResponsesImage/package.json +1 -1
  303. package/package.json +1 -1
  304. package/useBreakpoints/package.json +1 -1
  305. package/useChoiceGroup/package.json +1 -1
  306. package/useChoiceGroupIndexed/package.json +1 -1
  307. package/useClickOutside/package.json +1 -1
  308. package/useComponentSize/package.json +1 -1
  309. package/useDebounce/package.json +1 -1
  310. package/useFlag/package.json +1 -1
  311. package/useForkRef/package.json +1 -1
  312. package/useGlobalKeys/package.json +1 -1
  313. package/useKeys/package.json +1 -1
  314. package/useMutableRef/package.json +1 -1
  315. package/useOverflow/package.json +1 -1
  316. package/usePrevious/package.json +1 -1
  317. package/useResizeObserved/package.json +1 -1
  318. package/useScrollElements/package.json +1 -1
  319. package/useScrollPosition/package.json +1 -1
  320. package/useSelect/package.json +1 -1
  321. package/useThemeVars/package.json +1 -1
  322. package/useTimer/package.json +1 -1
  323. package/withTooltip/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/SwitchGroup",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Table",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
package/Tabs/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Tabs",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
package/Tag/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Tag",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/TagBase",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
package/Text/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Text",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/TextField",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Theme",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/ThemeToggler",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Timer",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/Tooltip",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
package/User/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/User",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/UserSelect",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/UserSelectDeprecated",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -61,6 +61,10 @@
61
61
  align-items: center;
62
62
  width: 100%;
63
63
  height: var(--space-m);
64
+ -webkit-user-select: none;
65
+ -moz-user-select: none;
66
+ -ms-user-select: none;
67
+ user-select: none;
64
68
  }
65
69
 
66
70
  .Slider-Side_position_left {
@@ -12,9 +12,8 @@ var FieldLabel_1 = require("../FieldLabel/FieldLabel");
12
12
  var SliderInput_1 = require("./SliderInput/SliderInput");
13
13
  var SliderLine_1 = require("./SliderLine/SliderLine");
14
14
  var SliderPoint_1 = require("./SliderPoint/SliderPoint");
15
- var helper_1 = require("./useSlider/helper");
16
15
  var useSlider_1 = require("./useSlider/useSlider");
17
- var helper_2 = require("./helper");
16
+ var helper_1 = require("./helper");
18
17
  var useSliderStationing_1 = require("./useSliderStationing");
19
18
  var cnSlider = bem_1.cn('Slider');
20
19
  var sizeMap = {
@@ -24,13 +23,13 @@ var sizeMap = {
24
23
  l: 'm'
25
24
  };
26
25
  function SliderRender(props, ref) {
27
- var _a = props.min, min = _a === void 0 ? 0 : _a, _b = props.max, max = _b === void 0 ? 100 : _b, onChange = props.onChange, onAfterChange = props.onAfterChange, value = props.value, _c = props.step, step = _c === void 0 ? 1 : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.size, size = _e === void 0 ? helper_2.defaultPropSize : _e, _f = props.view, view = _f === void 0 ? 'default' : _f, leftSide = props.leftSide, rightSide = props.rightSide, withTooltip = props.withTooltip, _g = props.range, range = _g === void 0 ? false : _g, label = props.label, status = props.status, caption = props.caption, _h = props.tooltipFormatter, tooltipFormatter = _h === void 0 ? helper_2.defaultTooltipFormatter : _h, className = props.className, otherProps = tslib_1.__rest(props, ["min", "max", "onChange", "onAfterChange", "value", "step", "disabled", "size", "view", "leftSide", "rightSide", "withTooltip", "range", "label", "status", "caption", "tooltipFormatter", "className"]);
26
+ var _a = props.min, min = _a === void 0 ? 0 : _a, _b = props.max, max = _b === void 0 ? 100 : _b, onChange = props.onChange, onAfterChange = props.onAfterChange, value = props.value, _c = props.step, step = _c === void 0 ? 1 : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.size, size = _e === void 0 ? helper_1.defaultPropSize : _e, _f = props.view, view = _f === void 0 ? 'default' : _f, leftSide = props.leftSide, rightSide = props.rightSide, withTooltip = props.withTooltip, _g = props.range, range = _g === void 0 ? false : _g, label = props.label, status = props.status, caption = props.caption, _h = props.tooltipFormatter, tooltipFormatter = _h === void 0 ? helper_1.defaultTooltipFormatter : _h, className = props.className, otherProps = tslib_1.__rest(props, ["min", "max", "onChange", "onAfterChange", "value", "step", "disabled", "size", "view", "leftSide", "rightSide", "withTooltip", "range", "label", "status", "caption", "tooltipFormatter", "className"]);
28
27
  var _j = tslib_1.__read(useFlag_1.useFlag(false), 2), isHovered = _j[0], _k = _j[1], on = _k.on, off = _k.off;
29
28
  var leftButtonRef = react_1.useRef(null);
30
29
  var rightButtonRef = react_1.useRef(null);
31
30
  var sliderRef = react_1.useRef(null);
32
31
  var IconRight = rightSide;
33
- var IconLeft = helper_2.isNotRangeParams && props.leftSide && props.leftSide !== 'input' ? props.leftSide : undefined;
32
+ var IconLeft = helper_1.isNotRangeParams && props.leftSide && props.leftSide !== 'input' ? props.leftSide : undefined;
34
33
  var iconSize = getByMap_1.getByMap(sizeMap, size);
35
34
  var _l = useSlider_1.useSlider({
36
35
  disabled: disabled,
@@ -43,8 +42,8 @@ function SliderRender(props, ref) {
43
42
  onAfterChange: onAfterChange,
44
43
  sliderRef: sliderRef,
45
44
  buttonRefs: [leftButtonRef, rightButtonRef]
46
- }), onKeyPress = _l.onKeyPress, onFocus = _l.onFocus, dragPoint = _l.dragPoint, popoverPosition = _l.popoverPosition, activeButton = _l.activeButton, currentValue = _l.currentValue;
47
- var _m = useSliderStationing_1.useSliderStationing(currentValue, min, max, view, range, step, [leftButtonRef, rightButtonRef], sliderRef), lineSizes = _m.lineSizes, buttonPositions = _m.buttonPositions;
45
+ }), onKeyPress = _l.onKeyPress, onFocus = _l.onFocus, handlePress = _l.handlePress, popoverPosition = _l.popoverPosition, activeButton = _l.activeButton, currentValue = _l.currentValue;
46
+ var _m = useSliderStationing_1.useSliderStationing(currentValue.length === 1 ? currentValue[0] : currentValue, min, max, view, range, step, [leftButtonRef, rightButtonRef], sliderRef), lineSizes = _m.lineSizes, buttonPositions = _m.buttonPositions;
48
47
  var changeHovered = function (status) {
49
48
  if (status)
50
49
  on();
@@ -54,14 +53,13 @@ function SliderRender(props, ref) {
54
53
  return (react_1["default"].createElement("div", tslib_1.__assign({ ref: ref, className: cnSlider({ size: size }, [className]) }, otherProps),
55
54
  label && (react_1["default"].createElement(FieldLabel_1.FieldLabel, { className: cnSlider('Label'), size: size }, label)),
56
55
  react_1["default"].createElement("div", { className: cnSlider('Container') },
57
- leftSide === 'input' && helper_2.isNotRangeParams(props) && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'left' }) },
58
- react_1["default"].createElement(SliderInput_1.SliderInput, { value: props.value, onChange: function (params) { var _a; return helper_2.isNotRangeParams(props) && ((_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, params)); }, size: size, min: min, max: max, status: status, step: step, disabled: disabled }))),
56
+ leftSide === 'input' && helper_1.isNotRangeParams(props) && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'left' }) },
57
+ react_1["default"].createElement(SliderInput_1.SliderInput, { value: props.value, onChange: function (params) { var _a; return helper_1.isNotRangeParams(props) && ((_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, params)); }, size: size, min: min, max: max, status: status, step: step, disabled: disabled }))),
59
58
  IconLeft && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'left' }) },
60
59
  react_1["default"].createElement(IconLeft, { size: iconSize, view: "secondary" }))),
61
60
  react_1["default"].createElement("div", { className: cnSlider('Control'), ref: sliderRef },
62
- react_1["default"].createElement(SliderLine_1.SliderLine, { hovered: isHovered, onHover: changeHovered, lines: lineSizes, disabled: disabled, view: view }),
63
- react_1["default"].createElement(SliderPoint_1.SliderPoint, { hovered: isHovered, buttonRef: leftButtonRef, popoverPosition: popoverPosition[0], onKeyPress: onKeyPress, onFocus: onFocus, disabled: disabled, onMouseDown: dragPoint, position: buttonPositions[0], focused: activeButton === 'left', buttonLabel: "left", withTooltip: withTooltip, onHover: changeHovered, value: tooltipFormatter(helper_1.getActiveValue(currentValue, 'left')) }),
64
- helper_2.isRangeParams(props) && (react_1["default"].createElement(SliderPoint_1.SliderPoint, { hovered: isHovered, buttonRef: rightButtonRef, onFocus: onFocus, popoverPosition: popoverPosition[1], onKeyPress: onKeyPress, disabled: disabled, onMouseDown: dragPoint, focused: activeButton === 'right', withTooltip: withTooltip, position: buttonPositions[1], buttonLabel: "right", onHover: changeHovered, value: tooltipFormatter(helper_1.getActiveValue(currentValue, 'right')) }))),
61
+ react_1["default"].createElement(SliderLine_1.SliderLine, { hovered: isHovered || typeof activeButton === 'number', onHover: changeHovered, lines: lineSizes, disabled: disabled, view: view }),
62
+ currentValue.map(function (val, index) { return (react_1["default"].createElement(SliderPoint_1.SliderPoint, { hovered: isHovered || typeof activeButton === 'number', buttonRef: leftButtonRef, popoverPosition: popoverPosition[index], onKeyPress: onKeyPress, onFocus: onFocus, handlePress: handlePress, disabled: disabled, position: buttonPositions[index], focused: activeButton === index, buttonLabel: index, withTooltip: withTooltip, onHover: changeHovered, tooltipFormatter: tooltipFormatter, value: val, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": val })); })),
65
63
  IconRight && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'right' }) },
66
64
  react_1["default"].createElement(IconRight, { size: iconSize, view: "secondary" })))),
67
65
  caption && (react_1["default"].createElement(FieldCaption_1.FieldCaption, { className: cnSlider('Caption'), status: status }, caption))));
@@ -14,6 +14,7 @@
14
14
  align-items: center;
15
15
  width: var(--space-m);
16
16
  height: var(--space-m);
17
+ padding: 0;
17
18
  background-color: var(--color-bg-default);
18
19
  border: var(--space-3xs) solid var(--color-control-bg-primary);
19
20
  border-radius: calc(var(--space-m) * 0.5);
@@ -23,7 +23,7 @@ var getTooltipPosition = function (popoverPosition, buttonRef) {
23
23
  };
24
24
  exports.SliderPoint = function (props) {
25
25
  var _a;
26
- var hovered = props.hovered, onHover = props.onHover, value = props.value, position = props.position, disabled = props.disabled, withTooltip = props.withTooltip, focused = props.focused, popoverPosition = props.popoverPosition, buttonRef = props.buttonRef, onKeyPress = props.onKeyPress, buttonLabel = props.buttonLabel, onFocus = props.onFocus, otherProps = tslib_1.__rest(props, ["hovered", "onHover", "value", "position", "disabled", "withTooltip", "focused", "popoverPosition", "buttonRef", "onKeyPress", "buttonLabel", "onFocus"]);
26
+ var hovered = props.hovered, onHover = props.onHover, value = props.value, position = props.position, disabled = props.disabled, withTooltip = props.withTooltip, focused = props.focused, popoverPosition = props.popoverPosition, buttonRef = props.buttonRef, handlePress = props.handlePress, onKeyPress = props.onKeyPress, tooltipFormatter = props.tooltipFormatter, buttonLabel = props.buttonLabel, onFocus = props.onFocus, otherProps = tslib_1.__rest(props, ["hovered", "onHover", "value", "position", "disabled", "withTooltip", "focused", "popoverPosition", "buttonRef", "handlePress", "onKeyPress", "tooltipFormatter", "buttonLabel", "onFocus"]);
27
27
  var _b = tslib_1.__read(useFlag_1.useFlag(false), 2), tooltipVisible = _b[0], _c = _b[1], on = _c.on, off = _c.off;
28
28
  var theme = Theme_1.useTheme().theme;
29
29
  var tooltipTheme = tslib_1.__assign(tslib_1.__assign({}, theme), { color: {
@@ -59,11 +59,9 @@ exports.SliderPoint = function (props) {
59
59
  };
60
60
  var pointRef = react_1.useRef(null);
61
61
  return (react_1["default"].createElement(react_1["default"].Fragment, null,
62
- react_1["default"].createElement("button", tslib_1.__assign({ type: "button", "aria-label": buttonLabel + "-button", className: cnSliderPoint({ hovered: hovered, disabled: disabled }, [!disabled ? MixFocus_1.cnMixFocus() : '']), onMouseOver: function () { return handleMouseAction(true); }, onMouseOut: function () { return handleMouseAction(false); }, onKeyDown: function (e) { return onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(e, buttonLabel); }, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus,
63
- // onMouseUp={handleBlur}
64
- ref: useForkRef_1.useForkRef([buttonRef, pointRef]), tabIndex: 0, style: (_a = {},
62
+ react_1["default"].createElement("button", tslib_1.__assign({ type: "button", "aria-label": buttonLabel + "-button", className: cnSliderPoint({ hovered: hovered, disabled: disabled }, [!disabled ? MixFocus_1.cnMixFocus() : '']), onMouseOver: function () { return handleMouseAction(true); }, onMouseOut: function () { return handleMouseAction(false); }, onMouseDown: function () { return handlePress === null || handlePress === void 0 ? void 0 : handlePress(buttonLabel); }, onTouchStart: function () { return handlePress === null || handlePress === void 0 ? void 0 : handlePress(buttonLabel); }, onKeyDown: function (e) { return onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(e, buttonLabel); }, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus, ref: useForkRef_1.useForkRef([buttonRef, pointRef]), tabIndex: 0, style: (_a = {},
65
63
  _a['--slider-button-left'] = position + "%",
66
64
  _a) }, otherProps)),
67
65
  tooltipVisible && withTooltip && popoverPosition && (react_1["default"].createElement(Theme_1.ThemeContext.Provider, { value: { theme: tooltipTheme, themeClassNames: tooltipThemeClassNames } },
68
- react_1["default"].createElement(Tooltip_1.Tooltip, { position: getTooltipPosition(popoverPosition, buttonRef || pointRef), className: cnSliderPoint('Tooltip'), direction: "downCenter", possibleDirections: ['downCenter', 'leftDown', 'rightDown'] }, value)))));
66
+ react_1["default"].createElement(Tooltip_1.Tooltip, { position: getTooltipPosition(popoverPosition, buttonRef || pointRef), className: cnSliderPoint('Tooltip'), direction: "downCenter", possibleDirections: ['downCenter', 'leftDown', 'rightDown'] }, tooltipFormatter ? tooltipFormatter(value) : value)))));
69
67
  };
@@ -48,16 +48,18 @@ export declare type SliderLineProps = {
48
48
  onHover?: (hovered: boolean) => void;
49
49
  };
50
50
  export declare type SliderPointProps = PropsWithHTMLAttributes<{
51
- value?: number | string;
51
+ value?: number;
52
52
  disabled?: boolean;
53
53
  focused?: boolean;
54
54
  hovered?: boolean;
55
55
  withTooltip?: boolean;
56
+ handlePress?: (typeButton: ActiveButton) => void;
56
57
  buttonLabel?: ActiveButton;
57
58
  buttonRef?: React.RefObject<HTMLButtonElement>;
58
59
  popoverPosition?: TrackPosition;
60
+ tooltipFormatter?: PropToolipFormatter;
59
61
  onFocus?: (e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent, button: ActiveButton) => void;
60
- onKeyPress?: (e: React.KeyboardEvent, typeButton: ActiveButton) => void;
62
+ onKeyPress?: (e: React.KeyboardEvent, typeButton?: ActiveButton) => void;
61
63
  onHover?: (hovered: boolean) => void;
62
64
  position: number;
63
65
  }, HTMLButtonElement>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PropOnChange, SliderValue, TrackPosition } from '../helper';
3
- export declare type ActiveButton = 'left' | 'right' | null | undefined;
3
+ export declare type ActiveButton = 0 | 1 | null | undefined;
4
4
  export declare type Stationing = {
5
5
  x: number;
6
6
  y: number;
@@ -22,14 +22,14 @@ export declare type UseSliderProps<RANGE extends boolean = false> = {
22
22
  export declare type UseSliderValues = {
23
23
  onKeyPress: (e: React.KeyboardEvent, typeButton: ActiveButton) => void;
24
24
  onFocus: (e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent, button: ActiveButton) => void;
25
+ handlePress: (typeButton: ActiveButton) => void;
25
26
  activeButton: ActiveButton;
26
- dragPoint: () => void;
27
- currentValue: number | [number, number];
27
+ currentValue: [number] | [number, number];
28
28
  popoverPosition: TrackPosition[];
29
29
  };
30
30
  export declare const isRangeParams: (params: UseSliderProps<boolean>) => params is UseSliderProps<true>;
31
31
  export declare const isNotRangeParams: (params: UseSliderProps<boolean>) => params is UseSliderProps<false>;
32
- export declare const trackPosition: (event: Event | React.TouchEvent | React.MouseEvent) => TrackPosition;
32
+ export declare const trackPosition: (event: TouchEvent | MouseEvent) => TrackPosition;
33
33
  export declare const getActiveValue: (value: number | [number, number], active: ActiveButton) => number;
34
34
  export declare const detectActiveButton: (posittion: TrackPosition, buttons: React.RefObject<HTMLButtonElement>[]) => ActiveButton;
35
35
  export declare const getValidValue: (value: number, min: number, max: number, step?: number | number[] | undefined) => number;
@@ -16,11 +16,14 @@ exports.trackPosition = function (event) {
16
16
  y: event.clientY
17
17
  };
18
18
  }
19
- return null;
19
+ return {
20
+ x: event.changedTouches[0].clientX,
21
+ y: event.changedTouches[0].clientY
22
+ };
20
23
  };
21
24
  exports.getActiveValue = function (value, active) {
22
25
  if (Array.isArray(value)) {
23
- return active === 'left' ? value[0] : value[1];
26
+ return value[typeof active === 'number' ? active : 0];
24
27
  }
25
28
  return value;
26
29
  };
@@ -34,7 +37,7 @@ exports.detectActiveButton = function (position, buttons) {
34
37
  x + width >= position.x &&
35
38
  y <= position.y &&
36
39
  y + height >= position.y) {
37
- activeButton = index === 0 ? 'left' : 'right';
40
+ activeButton = index;
38
41
  button.focus();
39
42
  }
40
43
  }
@@ -104,7 +107,7 @@ exports.getNewValue = function (changedValue, currentValue, step, min, max, acti
104
107
  var minRangeValue = min;
105
108
  if (Array.isArray(currentValue)) {
106
109
  var _a = tslib_1.__read(currentValue, 2), left = _a[0], right = _a[1];
107
- if (activeButton === 'right') {
110
+ if (activeButton === 1) {
108
111
  minRangeValue = left;
109
112
  }
110
113
  else {
@@ -113,9 +116,7 @@ exports.getNewValue = function (changedValue, currentValue, step, min, max, acti
113
116
  }
114
117
  var analyzedValue = exports.getValidValue(exports.analyzeDivisionValue(changedValue, step, min, max), minRangeValue, maxRangeValue, step);
115
118
  if (Array.isArray(currentValue)) {
116
- return activeButton === 'right'
117
- ? [currentValue[0], analyzedValue]
118
- : [analyzedValue, currentValue[1]];
119
+ return activeButton === 1 ? [currentValue[0], analyzedValue] : [analyzedValue, currentValue[1]];
119
120
  }
120
121
  return analyzedValue;
121
122
  };
@@ -4,7 +4,7 @@ exports.useSlider = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var react_1 = require("react");
6
6
  var useComponentSize_1 = require("../../../hooks/useComponentSize/useComponentSize");
7
- var useFlag_1 = require("../../../hooks/useFlag/useFlag");
7
+ var useMutableRef_1 = require("../../../hooks/useMutableRef/useMutableRef");
8
8
  var helper_1 = require("./helper");
9
9
  function useSlider(props) {
10
10
  var disabled = props.disabled, range = props.range, value = props.value, min = props.min, max = props.max, _a = props.step, step = _a === void 0 ? 1 : _a, onChange = props.onChange, onAfterChange = props.onAfterChange, sliderRef = props.sliderRef, buttonRefs = props.buttonRefs;
@@ -13,51 +13,34 @@ function useSlider(props) {
13
13
  var _b = tslib_1.__read(react_1.useState(value), 2), currentValue = _b[0], setCurrentValue = _b[1];
14
14
  var _c = tslib_1.__read(react_1.useState(null), 2), leftPopover = _c[0], setLeftPopover = _c[1];
15
15
  var _d = tslib_1.__read(react_1.useState(null), 2), rightPopover = _d[0], setRightPopover = _d[1];
16
- var _e = tslib_1.__read(useFlag_1.useFlag(false), 2), draggable = _e[0], _f = _e[1], on = _f.on, off = _f.off;
17
16
  var activeButton = react_1.useRef(null);
18
17
  var sizeSlider = useComponentSize_1.useComponentSize(sliderRef);
19
- var addListeners = function () {
20
- document.addEventListener('mouseup', handleTouchEnd);
21
- document.addEventListener('touchend', handleTouchEnd);
22
- document.addEventListener('mousemove', handleTouchMove);
23
- document.addEventListener('touchmove', handleTouchMove);
24
- };
25
- var removeListeners = function () {
26
- document.removeEventListener('mouseup', handleTouchEnd);
27
- document.removeEventListener('touchend', handleTouchEnd);
28
- document.removeEventListener('mousemove', handleTouchMove);
29
- document.removeEventListener('touchmove', handleTouchMove);
30
- };
18
+ var lastValue = useMutableRef_1.useMutableRef(currentValue);
31
19
  react_1.useEffect(function () {
32
- addListeners();
33
- return function () {
34
- removeListeners();
35
- };
36
- }, [
37
- activeButton.current,
38
- step,
39
- currentValue,
40
- value,
41
- min,
42
- max,
43
- sliderRef.current,
44
- buttonRefs,
45
- disabled,
46
- draggable,
47
- ]);
20
+ if (disabled) {
21
+ controlListeners('remove');
22
+ }
23
+ }, [disabled]);
24
+ var controlListeners = function (type) {
25
+ var method = type === 'add' ? 'addEventListener' : 'removeEventListener';
26
+ document[method]('mouseup', handleRelease);
27
+ document[method]('touchend', handleRelease);
28
+ document[method]('mousemove', handleTouchMove);
29
+ document[method]('touchmove', handleTouchMove);
30
+ };
48
31
  react_1.useEffect(function () {
49
32
  if (Array.isArray(currentValue)) {
50
- setTooltipPosition(currentValue[0], 'left');
51
- setTooltipPosition(currentValue[1], 'right');
33
+ setTooltipPosition(currentValue[0], 0);
34
+ setTooltipPosition(currentValue[1], 1);
52
35
  }
53
36
  else {
54
- setTooltipPosition(currentValue, 'left');
37
+ setTooltipPosition(currentValue, 0);
55
38
  }
56
39
  }, [currentValue]);
57
40
  react_1.useEffect(function () {
58
41
  if (JSON.stringify(value) !== JSON.stringify(currentValue)) {
59
42
  setCurrentValue(value);
60
- setTooltipPosition(helper_1.getActiveValue(value, activeButton.current), 'left');
43
+ setTooltipPosition(helper_1.getActiveValue(value, activeButton.current), 0);
61
44
  activeButton.current = null;
62
45
  }
63
46
  }, [value]);
@@ -65,10 +48,10 @@ function useSlider(props) {
65
48
  onChange === null || onChange === void 0 ? void 0 : onChange({
66
49
  value: Array.isArray(currentValue)
67
50
  ? [
68
- helper_1.getNewValue(currentValue[0], currentValue[0], step, min, max, 'left'),
69
- helper_1.getNewValue(currentValue[1], currentValue[1], step, min, max, 'right'),
51
+ helper_1.getNewValue(currentValue[0], currentValue[0], step, min, max, 0),
52
+ helper_1.getNewValue(currentValue[1], currentValue[1], step, min, max, 1),
70
53
  ]
71
- : helper_1.getNewValue(currentValue, currentValue, step, min, max, 'left')
54
+ : helper_1.getNewValue(currentValue, currentValue, step, min, max, 0)
72
55
  });
73
56
  }, [step]);
74
57
  react_1.useEffect(function () {
@@ -92,7 +75,7 @@ function useSlider(props) {
92
75
  }
93
76
  }, []);
94
77
  var onKeyPress = react_1.useCallback(function (event, typeButton) {
95
- if (!disabled && typeof typeButton === 'string' && typeof currentValue !== 'undefined') {
78
+ if (!disabled && typeof typeButton === 'number' && typeof currentValue !== 'undefined') {
96
79
  var stepIncrement_1 = !Array.isArray(step) ? step || 1 : 1;
97
80
  var validKeyCode = false;
98
81
  var changedValue_1 = helper_1.getActiveValue(currentValue, typeButton);
@@ -121,7 +104,7 @@ function useSlider(props) {
121
104
  stepsArr_1 = tslib_1.__spread(stepsArr_1, [maxValue]);
122
105
  }
123
106
  stepsArr_1.forEach(function (stepPoint, index) {
124
- if (typeof typeButton === 'string' && changedValue_1 === stepPoint) {
107
+ if (typeof typeButton === 'number' && changedValue_1 === stepPoint) {
125
108
  if (stepIncrement_1 >= 0) {
126
109
  if (index === 0) {
127
110
  stepIncrement_1 = stepsArr_1[1] - minValue;
@@ -155,14 +138,14 @@ function useSlider(props) {
155
138
  }
156
139
  }, [currentValue, step, min, max]);
157
140
  var setTooltipPosition = function (value, position) {
158
- if (sliderRef.current && position) {
159
- var button = buttonRefs[position === 'left' ? 0 : 1].current || sliderRef.current;
141
+ if (sliderRef.current && typeof position === 'number') {
142
+ var button = buttonRefs[position].current || sliderRef.current;
160
143
  var _a = sliderRef.current.getBoundingClientRect(), x = _a.x, width = _a.width;
161
144
  var newPosition = {
162
145
  y: button.offsetTop + button.offsetHeight + 50,
163
146
  x: x + Math.abs((value - minValue) / (maxValue - minValue)) * width
164
147
  };
165
- if (position === 'left') {
148
+ if (position === 0) {
166
149
  setLeftPopover(newPosition);
167
150
  }
168
151
  else {
@@ -172,7 +155,7 @@ function useSlider(props) {
172
155
  };
173
156
  var changePosition = function (event) {
174
157
  var nativeEvent = event;
175
- if (typeof activeButton.current !== 'string') {
158
+ if (typeof activeButton.current !== 'number') {
176
159
  return value;
177
160
  }
178
161
  var position = helper_1.trackPosition(nativeEvent);
@@ -182,50 +165,54 @@ function useSlider(props) {
182
165
  var onFocus = function (e, button) {
183
166
  activeButton.current = button;
184
167
  };
185
- var handleTouchMove = function (event) {
186
- if (typeof activeButton.current === 'string' && draggable) {
168
+ var handleTouchMove = function (event, typeButton) {
169
+ var button = typeButton || activeButton.current;
170
+ if (typeof button === 'number') {
187
171
  var position = changePosition(event);
188
- var oldValue = helper_1.getActiveValue(currentValue, activeButton.current);
189
- var newValue = helper_1.getActiveValue(position, activeButton.current);
172
+ var oldValue = helper_1.getActiveValue(currentValue, button);
173
+ var newValue = helper_1.getActiveValue(position, button);
190
174
  if (oldValue !== newValue) {
191
175
  setCurrentValue(position);
192
176
  onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange({ e: event, value: position });
193
177
  }
194
178
  }
195
179
  };
196
- var handleTouchEnd = function (event) {
197
- var position = changePosition(event);
198
- if (typeof position !== 'undefined') {
199
- setCurrentValue(position);
200
- onChange === null || onChange === void 0 ? void 0 : onChange({ e: event, value: position });
201
- }
202
- off();
203
- if (JSON.stringify(position) !== JSON.stringify(currentValue)) {
204
- buttonRefs.forEach(function (button) {
205
- var _a;
206
- (_a = button.current) === null || _a === void 0 ? void 0 : _a.blur();
207
- });
208
- activeButton.current = null;
209
- }
210
- };
211
180
  react_1.useEffect(function () {
212
181
  if (helper_1.isRangeParams(props)) {
213
182
  props.value.forEach(function (val, index) {
214
- setTooltipPosition(helper_1.getActiveValue(val, activeButton.current), index === 0 ? 'left' : 'right');
183
+ setTooltipPosition(helper_1.getActiveValue(val, activeButton.current), index === 0 ? 0 : 1);
215
184
  });
216
185
  }
217
186
  if (helper_1.isNotRangeParams(props)) {
218
- setTooltipPosition(helper_1.getActiveValue(value, activeButton.current), 'left');
187
+ setTooltipPosition(helper_1.getActiveValue(value, activeButton.current), 0);
219
188
  }
220
189
  activeButton.current = null;
221
190
  }, [sizeSlider, typeof value]);
191
+ var handleRelease = react_1.useCallback(function (e) {
192
+ var _a, _b;
193
+ controlListeners('remove');
194
+ if (helper_1.isRangeParams(props) && Array.isArray(lastValue.current)) {
195
+ var copyValues = tslib_1.__spread(lastValue.current).sort(function (a, b) { return Number(a) - Number(b); });
196
+ (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, { e: e, value: copyValues });
197
+ }
198
+ if (helper_1.isNotRangeParams(props) && typeof lastValue.current === 'number') {
199
+ (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, { e: e, value: lastValue.current });
200
+ }
201
+ activeButton.current = null;
202
+ }, [lastValue, value, onChange, handleTouchMove]);
203
+ var handlePress = react_1.useCallback(function (typeButton) {
204
+ if (!disabled) {
205
+ activeButton.current = typeButton;
206
+ controlListeners('add');
207
+ }
208
+ }, [currentValue, value, onChange, handleTouchMove, disabled]);
222
209
  return {
223
210
  onKeyPress: onKeyPress,
224
211
  onFocus: onFocus,
225
- dragPoint: on,
212
+ handlePress: handlePress,
226
213
  activeButton: activeButton.current,
227
214
  popoverPosition: [leftPopover, rightPopover],
228
- currentValue: currentValue
215
+ currentValue: Array.isArray(currentValue) ? currentValue : [currentValue]
229
216
  };
230
217
  }
231
218
  exports.useSlider = useSlider;
@@ -51,18 +51,15 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
51
51
  });
52
52
  }
53
53
  else if (Array.isArray(value) && value) {
54
- sizesArray.push({
55
- width: ((value[0] - min) / absoluteSize) * 100,
56
- active: false
57
- });
58
- sizesArray.push({
59
- width: ((value[1] - value[0]) / absoluteSize) * 100,
60
- active: true
61
- });
62
- sizesArray.push({
63
- width: ((max - value[1]) / absoluteSize) * 100,
64
- active: false
65
- });
54
+ var endPointArray = tslib_1.__spread(value);
55
+ endPointArray.unshift(min);
56
+ endPointArray.push(max);
57
+ for (var i = 0; i < endPointArray.length - 1; i++) {
58
+ sizesArray.push({
59
+ width: ((endPointArray[i + 1] - endPointArray[i]) / absoluteSize) * 100,
60
+ active: endPointArray[i] !== min && endPointArray[i + 1] !== max
61
+ });
62
+ }
66
63
  }
67
64
  else {
68
65
  sizesArray.push({
@@ -77,7 +74,7 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
77
74
  width: (Math.abs(stepSize.max - stepSize.min) * 100) / absoluteSize,
78
75
  active: (typeof value === 'number' || Array.isArray(value)) &&
79
76
  (range && Array.isArray(value)
80
- ? stepSize.max > value[0] && stepSize.min < value[1]
77
+ ? stepSize.max > value[0] && stepSize.min < value[value.length - 1]
81
78
  : stepSize.max <= value)
82
79
  });
83
80
  });
@@ -61,6 +61,10 @@
61
61
  align-items: center;
62
62
  width: 100%;
63
63
  height: var(--space-m);
64
+ -webkit-user-select: none;
65
+ -moz-user-select: none;
66
+ -ms-user-select: none;
67
+ user-select: none;
64
68
  }
65
69
 
66
70
  .Slider-Side_position_left {