@itcase/ui 1.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 (233) hide show
  1. package/README.md +2 -0
  2. package/dist/SelectContainer-e2544642.js +7717 -0
  3. package/dist/components/Accordion.js +249 -0
  4. package/dist/components/Avatar.js +94 -0
  5. package/dist/components/Background.js +90 -0
  6. package/dist/components/Breadcrumbs.js +239 -0
  7. package/dist/components/Button.js +215 -0
  8. package/dist/components/Caption.js +65 -0
  9. package/dist/components/Card.js +112 -0
  10. package/dist/components/Cell.js +180 -0
  11. package/dist/components/Checkbox.js +68 -0
  12. package/dist/components/Chips.js +135 -0
  13. package/dist/components/ContextMenu.js +149 -0
  14. package/dist/components/CookiesWarning.js +133 -0
  15. package/dist/components/Counter.js +99 -0
  16. package/dist/components/Divider.js +73 -0
  17. package/dist/components/Dropdown.js +139 -0
  18. package/dist/components/Emoji.js +124 -0
  19. package/dist/components/Fader.js +66 -0
  20. package/dist/components/Flex.js +264 -0
  21. package/dist/components/FormField.js +289 -0
  22. package/dist/components/Grid.js +329 -0
  23. package/dist/components/Group.js +132 -0
  24. package/dist/components/Icon.js +184 -0
  25. package/dist/components/Image.js +143 -0
  26. package/dist/components/Input.js +94 -0
  27. package/dist/components/Label.js +125 -0
  28. package/dist/components/LanguageSelector.js +86 -0
  29. package/dist/components/Link.js +172 -0
  30. package/dist/components/List.js +143 -0
  31. package/dist/components/Loader.js +66 -0
  32. package/dist/components/Logo.js +55 -0
  33. package/dist/components/Menu.js +86 -0
  34. package/dist/components/MenuItem.js +209 -0
  35. package/dist/components/Modal.js +69 -0
  36. package/dist/components/Notification.js +131 -0
  37. package/dist/components/Pagination.js +93 -0
  38. package/dist/components/Popup.js +254 -0
  39. package/dist/components/Profile.js +99 -0
  40. package/dist/components/RadioButton.js +71 -0
  41. package/dist/components/RangeSlider.js +2086 -0
  42. package/dist/components/Scrollbar.js +3872 -0
  43. package/dist/components/Search.js +260 -0
  44. package/dist/components/Segmented.js +77 -0
  45. package/dist/components/Select.js +49 -0
  46. package/dist/components/SiteMenu.js +137 -0
  47. package/dist/components/Swiper.js +927 -0
  48. package/dist/components/Switch.js +29 -0
  49. package/dist/components/Text.js +121 -0
  50. package/dist/components/Textarea.js +90 -0
  51. package/dist/components/Tile.js +252 -0
  52. package/dist/components/Title.js +146 -0
  53. package/dist/components/Tooltip.js +115 -0
  54. package/dist/components/Video.js +74 -0
  55. package/dist/components/Wrapper.js +119 -0
  56. package/dist/constants/componentProps/align.js +5 -0
  57. package/dist/constants/componentProps/alignDirection.js +5 -0
  58. package/dist/constants/componentProps/borderColor.js +5 -0
  59. package/dist/constants/componentProps/borderType.js +5 -0
  60. package/dist/constants/componentProps/captionPosition.js +5 -0
  61. package/dist/constants/componentProps/direction.js +5 -0
  62. package/dist/constants/componentProps/emojiSize.js +5 -0
  63. package/dist/constants/componentProps/fill.js +5 -0
  64. package/dist/constants/componentProps/fillGradient.js +5 -0
  65. package/dist/constants/componentProps/fillType.js +5 -0
  66. package/dist/constants/componentProps/flexAlign.js +5 -0
  67. package/dist/constants/componentProps/flexJustifyContent.js +5 -0
  68. package/dist/constants/componentProps/flexWrap.js +5 -0
  69. package/dist/constants/componentProps/gridAlign.js +5 -0
  70. package/dist/constants/componentProps/gridAlignSelf.js +5 -0
  71. package/dist/constants/componentProps/gridJustifyItems.js +5 -0
  72. package/dist/constants/componentProps/gridJustifySelf.js +5 -0
  73. package/dist/constants/componentProps/horizontalContentAlign.js +5 -0
  74. package/dist/constants/componentProps/horizontalResizeMode.js +5 -0
  75. package/dist/constants/componentProps/iconSize.js +5 -0
  76. package/dist/constants/componentProps/position.js +5 -0
  77. package/dist/constants/componentProps/resizeMode.js +5 -0
  78. package/dist/constants/componentProps/shape.js +5 -0
  79. package/dist/constants/componentProps/size.js +5 -0
  80. package/dist/constants/componentProps/stacking.js +5 -0
  81. package/dist/constants/componentProps/strokeColor.js +5 -0
  82. package/dist/constants/componentProps/textAlign.js +5 -0
  83. package/dist/constants/componentProps/textColor.js +5 -0
  84. package/dist/constants/componentProps/textColorActive.js +5 -0
  85. package/dist/constants/componentProps/textColorHover.js +5 -0
  86. package/dist/constants/componentProps/textGradient.js +5 -0
  87. package/dist/constants/componentProps/textStyle.js +5 -0
  88. package/dist/constants/componentProps/textTag.js +5 -0
  89. package/dist/constants/componentProps/textWeight.js +5 -0
  90. package/dist/constants/componentProps/titleSize.js +5 -0
  91. package/dist/constants/componentProps/type.js +5 -0
  92. package/dist/constants/componentProps/underline.js +5 -0
  93. package/dist/constants/componentProps/verticalContentAlign.js +5 -0
  94. package/dist/constants/componentProps/verticalResizeMode.js +5 -0
  95. package/dist/constants/componentProps/width.js +5 -0
  96. package/dist/constants/componentProps/wrap.js +5 -0
  97. package/dist/constants.js +87 -0
  98. package/dist/context/Notifications.js +121 -0
  99. package/dist/context/UIContext.js +59 -0
  100. package/dist/css/components/Accordion/Accordion.css +65 -0
  101. package/dist/css/components/Avatar/Avatar.css +28 -0
  102. package/dist/css/components/Background/Background.css +11 -0
  103. package/dist/css/components/Button/Button.css +362 -0
  104. package/dist/css/components/Caption/Caption.css +22 -0
  105. package/dist/css/components/Card/Card.css +19 -0
  106. package/dist/css/components/Cell/Cell.css +89 -0
  107. package/dist/css/components/Cell/css/__wrapper/cell__wrapper.css +7 -0
  108. package/dist/css/components/Cell/css/__wrapper/cell__wrapper_shape.css +15 -0
  109. package/dist/css/components/Checkbox/Checkbox.css +97 -0
  110. package/dist/css/components/Chips/Chips.css +47 -0
  111. package/dist/css/components/ContextMenu/ContextMenu.css +43 -0
  112. package/dist/css/components/ContextMenu/css/__item/context-menu__item.css +10 -0
  113. package/dist/css/components/CookiesWarning/CookiesWarning.css +37 -0
  114. package/dist/css/components/Counter/Counter.css +55 -0
  115. package/dist/css/components/Divider/Divider.css +78 -0
  116. package/dist/css/components/Dropdown/Dropdown.css +58 -0
  117. package/dist/css/components/Emoji/Emoji.css +104 -0
  118. package/dist/css/components/Emoji/css/__icon/emoji__icon-shape.css +12 -0
  119. package/dist/css/components/Emoji/css/__icon/emoji__icon.css +5 -0
  120. package/dist/css/components/Fader/Fader.css +55 -0
  121. package/dist/css/components/Flex/Flex.css +179 -0
  122. package/dist/css/components/Flex/css/__item/flex__item.css +5 -0
  123. package/dist/css/components/Flex/css/__item/flex__item_align.css +15 -0
  124. package/dist/css/components/Flex/css/__item/flex__item_direction.css +17 -0
  125. package/dist/css/components/Flex/css/__item/flex__item_grow.css +9 -0
  126. package/dist/css/components/Flex/css/__item/flex__item_justify-content.css +9 -0
  127. package/dist/css/components/Flex/css/__item/flex__item_shape.css +12 -0
  128. package/dist/css/components/Flex/css/__item/flex__item_wrap.css +9 -0
  129. package/dist/css/components/Grid/Grid.css +208 -0
  130. package/dist/css/components/Grid/css/__item/grid__item.css +4 -0
  131. package/dist/css/components/Grid/css/__item/grid__item_align-self.css +9 -0
  132. package/dist/css/components/Grid/css/__item/grid__item_column.css +17 -0
  133. package/dist/css/components/Grid/css/__item/grid__item_justify-self.css +9 -0
  134. package/dist/css/components/Grid/css/__item/grid__item_row.css +17 -0
  135. package/dist/css/components/Group/Group.css +106 -0
  136. package/dist/css/components/Icon/Icon.css +149 -0
  137. package/dist/css/components/Image/Image.css +106 -0
  138. package/dist/css/components/Input/Input.css +41 -0
  139. package/dist/css/components/Label/Label.css +33 -0
  140. package/dist/css/components/Link/Link.css +10 -0
  141. package/dist/css/components/List/List.css +112 -0
  142. package/dist/css/components/Loader/Loader.css +42 -0
  143. package/dist/css/components/Logo/Logo.css +17 -0
  144. package/dist/css/components/Menu/Menu.css +56 -0
  145. package/dist/css/components/MenuItem/MenuItem.css +56 -0
  146. package/dist/css/components/Notification/Notification.css +18 -0
  147. package/dist/css/components/Pagination/Pagination.css +80 -0
  148. package/dist/css/components/Pagination/css/__item/pagination__item.css +31 -0
  149. package/dist/css/components/Pagination/css/__item/pagination__item_state_active.css +16 -0
  150. package/dist/css/components/Pagination/css/__item/pagination__item_state_disabled.css +19 -0
  151. package/dist/css/components/Popup/Popup.css +49 -0
  152. package/dist/css/components/Profile/Profile.css +19 -0
  153. package/dist/css/components/RadioButton/RadioButton.css +98 -0
  154. package/dist/css/components/RangeSlider/RangeSlider.css +396 -0
  155. package/dist/css/components/Scrollbar/Scrollbar.css +2 -0
  156. package/dist/css/components/Search/Search.css +113 -0
  157. package/dist/css/components/Search/css/search-input/search-input.css +81 -0
  158. package/dist/css/components/Search/css/search-input/search-input_shape.css +8 -0
  159. package/dist/css/components/Search/css/search-result/search-result.css +6 -0
  160. package/dist/css/components/Search/css/search-result/search-result_shape.css +8 -0
  161. package/dist/css/components/Select/Select.css +236 -0
  162. package/dist/css/components/Select/css/__control/select__control.css +11 -0
  163. package/dist/css/components/Select/css/__control/select__control_fill.css +15 -0
  164. package/dist/css/components/Select/css/__control/select__control_shape.css +12 -0
  165. package/dist/css/components/Select/css/__indicators/select__indicators.css +18 -0
  166. package/dist/css/components/Select/css/__input-container/select__input-container.css +24 -0
  167. package/dist/css/components/Select/css/__menu/select__menu-notice.css +7 -0
  168. package/dist/css/components/Select/css/__menu/select__menu.css +36 -0
  169. package/dist/css/components/Select/css/__option/select__option.css +56 -0
  170. package/dist/css/components/Select/css/__single-value/select__single-value.css +5 -0
  171. package/dist/css/components/Select/css/__value-container/select__value-container.css +12 -0
  172. package/dist/css/components/SiteMenu/SiteMenu.css +37 -0
  173. package/dist/css/components/Swiper/Swiper.css +839 -0
  174. package/dist/css/components/Switch/Switch.css +53 -0
  175. package/dist/css/components/Text/Text.css +33 -0
  176. package/dist/css/components/Textarea/Textarea.css +40 -0
  177. package/dist/css/components/Tile/Tile.css +23 -0
  178. package/dist/css/components/Title/Title.css +71 -0
  179. package/dist/css/components/Tooltip/Tooltip.css +4 -0
  180. package/dist/css/components/Video/Video.css +37 -0
  181. package/dist/css/components/Wrapper/Wrapper.css +36 -0
  182. package/dist/css/styles/align/align_horizontal-reverse.css +50 -0
  183. package/dist/css/styles/align/align_horizontal.css +67 -0
  184. package/dist/css/styles/align/align_vertical-reverse.css +49 -0
  185. package/dist/css/styles/align/align_vertical.css +64 -0
  186. package/dist/css/styles/border/border.css +13 -0
  187. package/dist/css/styles/border-color/border-color.css +28 -0
  188. package/dist/css/styles/caret-color/caret-color.css +13 -0
  189. package/dist/css/styles/constraints/constraints.css +59 -0
  190. package/dist/css/styles/cursor/cursor.css +9 -0
  191. package/dist/css/styles/direction/direction.css +10 -0
  192. package/dist/css/styles/elevation/elevation.css +7 -0
  193. package/dist/css/styles/elevation/elevation_hover.css +11 -0
  194. package/dist/css/styles/fill/fill.css +28 -0
  195. package/dist/css/styles/fill/fill_active.css +22 -0
  196. package/dist/css/styles/fill/fill_active_hover.css +24 -0
  197. package/dist/css/styles/fill/fill_disabled.css +22 -0
  198. package/dist/css/styles/fill/fill_hover.css +34 -0
  199. package/dist/css/styles/fill-gradient/fill-gradient.css +15 -0
  200. package/dist/css/styles/height/height.css +9 -0
  201. package/dist/css/styles/hover/hover-fill-color.css +13 -0
  202. package/dist/css/styles/hover/hover-item-color.css +15 -0
  203. package/dist/css/styles/hover/hover-text-color.css +15 -0
  204. package/dist/css/styles/mediaqueries.css +66 -0
  205. package/dist/css/styles/mixin_elevation.css +33 -0
  206. package/dist/css/styles/mixin_fill-gradient.css +23 -0
  207. package/dist/css/styles/mixin_global.css +54 -0
  208. package/dist/css/styles/opacity/opacity.css +7 -0
  209. package/dist/css/styles/placeholder-text-color/placeholder-text-color.css +15 -0
  210. package/dist/css/styles/position/position.css +14 -0
  211. package/dist/css/styles/resize-horizontal/resize-horizontal.css +12 -0
  212. package/dist/css/styles/resize-vertical/resize-vertical.css +10 -0
  213. package/dist/css/styles/shape/shape.css +8 -0
  214. package/dist/css/styles/text-align/text-align.css +7 -0
  215. package/dist/css/styles/text-color/text-color.css +13 -0
  216. package/dist/css/styles/text-color/text-color_active.css +15 -0
  217. package/dist/css/styles/text-color/text-color_hover.css +17 -0
  218. package/dist/css/styles/text-color-hover/text-color-hover.css +15 -0
  219. package/dist/css/styles/text-decoration/text-decoration.css +9 -0
  220. package/dist/css/styles/text-gradient/text-gradient.css +24 -0
  221. package/dist/css/styles/text-style/text-style.css +9 -0
  222. package/dist/css/styles/text-truncate/text-truncate.css +7 -0
  223. package/dist/css/styles/text-weight/text-weight.css +40 -0
  224. package/dist/css/styles/width/width.css +9 -0
  225. package/dist/css/styles/word-wrap/word-wrap.css +8 -0
  226. package/dist/hooks/styleAttributes.js +33 -0
  227. package/dist/hooks/useDeviceTargetClass.js +60 -0
  228. package/dist/hooks/useMediaQueries.js +134 -0
  229. package/dist/hooks/useStyles.js +16 -0
  230. package/dist/index-f1505c84.js +86 -0
  231. package/dist/objectWithoutProperties-ea190611.js +188 -0
  232. package/dist/useStyles-77c3b520.js +153 -0
  233. package/package.json +123 -0
@@ -0,0 +1,2086 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var PropTypes = require('prop-types');
5
+ var clsx = require('clsx');
6
+ var fill = require('../constants/componentProps/fill.js');
7
+ var shape = require('../constants/componentProps/shape.js');
8
+ var width = require('../constants/componentProps/width.js');
9
+ var useStyles = require('../useStyles-77c3b520.js');
10
+ var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
11
+ var objectWithoutProperties = require('../objectWithoutProperties-ea190611.js');
12
+ require('lodash/camelCase');
13
+ require('lodash/maxBy');
14
+ require('lodash/upperFirst');
15
+ require('../hooks/styleAttributes.js');
16
+ require('../context/UIContext.js');
17
+ require('../hooks/useMediaQueries.js');
18
+ require('react-responsive');
19
+ require('lodash/castArray');
20
+
21
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
22
+
23
+ function _interopNamespace(e) {
24
+ if (e && e.__esModule) return e;
25
+ var n = Object.create(null);
26
+ if (e) {
27
+ Object.keys(e).forEach(function (k) {
28
+ if (k !== 'default') {
29
+ var d = Object.getOwnPropertyDescriptor(e, k);
30
+ Object.defineProperty(n, k, d.get ? d : {
31
+ enumerable: true,
32
+ get: function () { return e[k]; }
33
+ });
34
+ }
35
+ });
36
+ }
37
+ n.default = e;
38
+ return Object.freeze(n);
39
+ }
40
+
41
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
42
+ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
43
+ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
44
+
45
+ function getDefaultExportFromCjs (x) {
46
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
47
+ }
48
+
49
+ var classnames = {exports: {}};
50
+
51
+ /*!
52
+ Copyright (c) 2018 Jed Watson.
53
+ Licensed under the MIT License (MIT), see
54
+ http://jedwatson.github.io/classnames
55
+ */
56
+
57
+ (function (module) {
58
+ /* global define */
59
+
60
+ (function () {
61
+
62
+ var hasOwn = {}.hasOwnProperty;
63
+
64
+ function classNames() {
65
+ var classes = [];
66
+
67
+ for (var i = 0; i < arguments.length; i++) {
68
+ var arg = arguments[i];
69
+ if (!arg) continue;
70
+
71
+ var argType = typeof arg;
72
+
73
+ if (argType === 'string' || argType === 'number') {
74
+ classes.push(arg);
75
+ } else if (Array.isArray(arg)) {
76
+ if (arg.length) {
77
+ var inner = classNames.apply(null, arg);
78
+ if (inner) {
79
+ classes.push(inner);
80
+ }
81
+ }
82
+ } else if (argType === 'object') {
83
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
84
+ classes.push(arg.toString());
85
+ continue;
86
+ }
87
+
88
+ for (var key in arg) {
89
+ if (hasOwn.call(arg, key) && arg[key]) {
90
+ classes.push(key);
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ return classes.join(' ');
97
+ }
98
+
99
+ if (module.exports) {
100
+ classNames.default = classNames;
101
+ module.exports = classNames;
102
+ } else {
103
+ window.classNames = classNames;
104
+ }
105
+ }());
106
+ } (classnames));
107
+
108
+ var classnamesExports = classnames.exports;
109
+ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
110
+
111
+ /* eslint-disable no-console */
112
+ var warned = {};
113
+ var preWarningFns = [];
114
+
115
+ /**
116
+ * Pre warning enable you to parse content before console.error.
117
+ * Modify to null will prevent warning.
118
+ */
119
+ var preMessage = function preMessage(fn) {
120
+ preWarningFns.push(fn);
121
+ };
122
+ function warning(valid, message) {
123
+ // Support uglify
124
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
125
+ var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
126
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
127
+ }, message);
128
+ if (finalMessage) {
129
+ console.error("Warning: ".concat(finalMessage));
130
+ }
131
+ }
132
+ }
133
+ function note(valid, message) {
134
+ // Support uglify
135
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
136
+ var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
137
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
138
+ }, message);
139
+ if (finalMessage) {
140
+ console.warn("Note: ".concat(finalMessage));
141
+ }
142
+ }
143
+ }
144
+ function resetWarned() {
145
+ warned = {};
146
+ }
147
+ function call(method, valid, message) {
148
+ if (!valid && !warned[message]) {
149
+ method(false, message);
150
+ warned[message] = true;
151
+ }
152
+ }
153
+ function warningOnce(valid, message) {
154
+ call(warning, valid, message);
155
+ }
156
+ function noteOnce(valid, message) {
157
+ call(note, valid, message);
158
+ }
159
+ warningOnce.preMessage = preMessage;
160
+ warningOnce.resetWarned = resetWarned;
161
+ warningOnce.noteOnce = noteOnce;
162
+ /* eslint-enable */
163
+
164
+ /**
165
+ * Deeply compares two object literals.
166
+ * @param obj1 object 1
167
+ * @param obj2 object 2
168
+ * @param shallow shallow compare
169
+ * @returns
170
+ */
171
+ function isEqual(obj1, obj2) {
172
+ var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
173
+ // https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
174
+ var refSet = new Set();
175
+ function deepEqual(a, b) {
176
+ var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
177
+ var circular = refSet.has(a);
178
+ warningOnce(!circular, 'Warning: There may be circular references');
179
+ if (circular) {
180
+ return false;
181
+ }
182
+ if (a === b) {
183
+ return true;
184
+ }
185
+ if (shallow && level > 1) {
186
+ return false;
187
+ }
188
+ refSet.add(a);
189
+ var newLevel = level + 1;
190
+ if (Array.isArray(a)) {
191
+ if (!Array.isArray(b) || a.length !== b.length) {
192
+ return false;
193
+ }
194
+ for (var i = 0; i < a.length; i++) {
195
+ if (!deepEqual(a[i], b[i], newLevel)) {
196
+ return false;
197
+ }
198
+ }
199
+ return true;
200
+ }
201
+ if (a && b && objectWithoutProperties._typeof(a) === 'object' && objectWithoutProperties._typeof(b) === 'object') {
202
+ var keys = Object.keys(a);
203
+ if (keys.length !== Object.keys(b).length) {
204
+ return false;
205
+ }
206
+ return keys.every(function (key) {
207
+ return deepEqual(a[key], b[key], newLevel);
208
+ });
209
+ }
210
+ // other
211
+ return false;
212
+ }
213
+ return deepEqual(obj1, obj2);
214
+ }
215
+
216
+ function useEvent(callback) {
217
+ var fnRef = React__namespace.useRef();
218
+ fnRef.current = callback;
219
+ var memoFn = React__namespace.useCallback(function () {
220
+ var _fnRef$current;
221
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
222
+ args[_key] = arguments[_key];
223
+ }
224
+ return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
225
+ }, []);
226
+ return memoFn;
227
+ }
228
+
229
+ function canUseDom() {
230
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
231
+ }
232
+
233
+ /**
234
+ * Wrap `React.useLayoutEffect` which will not throw warning message in test env
235
+ */
236
+ var useLayoutEffect = process.env.NODE_ENV !== 'test' && canUseDom() ? React__namespace.useLayoutEffect : React__namespace.useEffect;
237
+ var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
238
+ var firstMountRef = React__namespace.useRef(true);
239
+ useLayoutEffect(function () {
240
+ if (!firstMountRef.current) {
241
+ return callback();
242
+ }
243
+ }, deps);
244
+
245
+ // We tell react that first mount has passed
246
+ useLayoutEffect(function () {
247
+ firstMountRef.current = false;
248
+ return function () {
249
+ firstMountRef.current = true;
250
+ };
251
+ }, []);
252
+ };
253
+
254
+ /**
255
+ * Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
256
+ * We do not make this auto is to avoid real memory leak.
257
+ * Developer should confirm it's safe to ignore themselves.
258
+ */
259
+ function useSafeState(defaultValue) {
260
+ var destroyRef = React__namespace.useRef(false);
261
+ var _React$useState = React__namespace.useState(defaultValue),
262
+ _React$useState2 = objectWithoutProperties._slicedToArray(_React$useState, 2),
263
+ value = _React$useState2[0],
264
+ setValue = _React$useState2[1];
265
+ React__namespace.useEffect(function () {
266
+ destroyRef.current = false;
267
+ return function () {
268
+ destroyRef.current = true;
269
+ };
270
+ }, []);
271
+ function safeSetState(updater, ignoreDestroy) {
272
+ if (ignoreDestroy && destroyRef.current) {
273
+ return;
274
+ }
275
+ setValue(updater);
276
+ }
277
+ return [value, safeSetState];
278
+ }
279
+
280
+ /** We only think `undefined` is empty */
281
+ function hasValue(value) {
282
+ return value !== undefined;
283
+ }
284
+
285
+ /**
286
+ * Similar to `useState` but will use props value if provided.
287
+ * Note that internal use rc-util `useState` hook.
288
+ */
289
+ function useMergedState(defaultStateValue, option) {
290
+ var _ref = option || {},
291
+ defaultValue = _ref.defaultValue,
292
+ value = _ref.value,
293
+ onChange = _ref.onChange,
294
+ postState = _ref.postState;
295
+
296
+ // ======================= Init =======================
297
+ var _useState = useSafeState(function () {
298
+ if (hasValue(value)) {
299
+ return value;
300
+ } else if (hasValue(defaultValue)) {
301
+ return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
302
+ } else {
303
+ return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
304
+ }
305
+ }),
306
+ _useState2 = objectWithoutProperties._slicedToArray(_useState, 2),
307
+ innerValue = _useState2[0],
308
+ setInnerValue = _useState2[1];
309
+ var mergedValue = value !== undefined ? value : innerValue;
310
+ var postMergedValue = postState ? postState(mergedValue) : mergedValue;
311
+
312
+ // ====================== Change ======================
313
+ var onChangeFn = useEvent(onChange);
314
+ var _useState3 = useSafeState([mergedValue]),
315
+ _useState4 = objectWithoutProperties._slicedToArray(_useState3, 2),
316
+ prevValue = _useState4[0],
317
+ setPrevValue = _useState4[1];
318
+ useLayoutUpdateEffect(function () {
319
+ var prev = prevValue[0];
320
+ if (innerValue !== prev) {
321
+ onChangeFn(innerValue, prev);
322
+ }
323
+ }, [prevValue]);
324
+
325
+ // Sync value back to `undefined` when it from control to un-control
326
+ useLayoutUpdateEffect(function () {
327
+ if (!hasValue(value)) {
328
+ setInnerValue(value);
329
+ }
330
+ }, [value]);
331
+
332
+ // ====================== Update ======================
333
+ var triggerChange = useEvent(function (updater, ignoreDestroy) {
334
+ setInnerValue(updater, ignoreDestroy);
335
+ setPrevValue([mergedValue], ignoreDestroy);
336
+ });
337
+ return [postMergedValue, triggerChange];
338
+ }
339
+
340
+ /**
341
+ * @ignore
342
+ * some key-codes definition and utils from closure-library
343
+ * @author yiminghe@gmail.com
344
+ */
345
+
346
+ var KeyCode = {
347
+ /**
348
+ * MAC_ENTER
349
+ */
350
+ MAC_ENTER: 3,
351
+ /**
352
+ * BACKSPACE
353
+ */
354
+ BACKSPACE: 8,
355
+ /**
356
+ * TAB
357
+ */
358
+ TAB: 9,
359
+ /**
360
+ * NUMLOCK on FF/Safari Mac
361
+ */
362
+ NUM_CENTER: 12,
363
+ // NUMLOCK on FF/Safari Mac
364
+ /**
365
+ * ENTER
366
+ */
367
+ ENTER: 13,
368
+ /**
369
+ * SHIFT
370
+ */
371
+ SHIFT: 16,
372
+ /**
373
+ * CTRL
374
+ */
375
+ CTRL: 17,
376
+ /**
377
+ * ALT
378
+ */
379
+ ALT: 18,
380
+ /**
381
+ * PAUSE
382
+ */
383
+ PAUSE: 19,
384
+ /**
385
+ * CAPS_LOCK
386
+ */
387
+ CAPS_LOCK: 20,
388
+ /**
389
+ * ESC
390
+ */
391
+ ESC: 27,
392
+ /**
393
+ * SPACE
394
+ */
395
+ SPACE: 32,
396
+ /**
397
+ * PAGE_UP
398
+ */
399
+ PAGE_UP: 33,
400
+ // also NUM_NORTH_EAST
401
+ /**
402
+ * PAGE_DOWN
403
+ */
404
+ PAGE_DOWN: 34,
405
+ // also NUM_SOUTH_EAST
406
+ /**
407
+ * END
408
+ */
409
+ END: 35,
410
+ // also NUM_SOUTH_WEST
411
+ /**
412
+ * HOME
413
+ */
414
+ HOME: 36,
415
+ // also NUM_NORTH_WEST
416
+ /**
417
+ * LEFT
418
+ */
419
+ LEFT: 37,
420
+ // also NUM_WEST
421
+ /**
422
+ * UP
423
+ */
424
+ UP: 38,
425
+ // also NUM_NORTH
426
+ /**
427
+ * RIGHT
428
+ */
429
+ RIGHT: 39,
430
+ // also NUM_EAST
431
+ /**
432
+ * DOWN
433
+ */
434
+ DOWN: 40,
435
+ // also NUM_SOUTH
436
+ /**
437
+ * PRINT_SCREEN
438
+ */
439
+ PRINT_SCREEN: 44,
440
+ /**
441
+ * INSERT
442
+ */
443
+ INSERT: 45,
444
+ // also NUM_INSERT
445
+ /**
446
+ * DELETE
447
+ */
448
+ DELETE: 46,
449
+ // also NUM_DELETE
450
+ /**
451
+ * ZERO
452
+ */
453
+ ZERO: 48,
454
+ /**
455
+ * ONE
456
+ */
457
+ ONE: 49,
458
+ /**
459
+ * TWO
460
+ */
461
+ TWO: 50,
462
+ /**
463
+ * THREE
464
+ */
465
+ THREE: 51,
466
+ /**
467
+ * FOUR
468
+ */
469
+ FOUR: 52,
470
+ /**
471
+ * FIVE
472
+ */
473
+ FIVE: 53,
474
+ /**
475
+ * SIX
476
+ */
477
+ SIX: 54,
478
+ /**
479
+ * SEVEN
480
+ */
481
+ SEVEN: 55,
482
+ /**
483
+ * EIGHT
484
+ */
485
+ EIGHT: 56,
486
+ /**
487
+ * NINE
488
+ */
489
+ NINE: 57,
490
+ /**
491
+ * QUESTION_MARK
492
+ */
493
+ QUESTION_MARK: 63,
494
+ // needs localization
495
+ /**
496
+ * A
497
+ */
498
+ A: 65,
499
+ /**
500
+ * B
501
+ */
502
+ B: 66,
503
+ /**
504
+ * C
505
+ */
506
+ C: 67,
507
+ /**
508
+ * D
509
+ */
510
+ D: 68,
511
+ /**
512
+ * E
513
+ */
514
+ E: 69,
515
+ /**
516
+ * F
517
+ */
518
+ F: 70,
519
+ /**
520
+ * G
521
+ */
522
+ G: 71,
523
+ /**
524
+ * H
525
+ */
526
+ H: 72,
527
+ /**
528
+ * I
529
+ */
530
+ I: 73,
531
+ /**
532
+ * J
533
+ */
534
+ J: 74,
535
+ /**
536
+ * K
537
+ */
538
+ K: 75,
539
+ /**
540
+ * L
541
+ */
542
+ L: 76,
543
+ /**
544
+ * M
545
+ */
546
+ M: 77,
547
+ /**
548
+ * N
549
+ */
550
+ N: 78,
551
+ /**
552
+ * O
553
+ */
554
+ O: 79,
555
+ /**
556
+ * P
557
+ */
558
+ P: 80,
559
+ /**
560
+ * Q
561
+ */
562
+ Q: 81,
563
+ /**
564
+ * R
565
+ */
566
+ R: 82,
567
+ /**
568
+ * S
569
+ */
570
+ S: 83,
571
+ /**
572
+ * T
573
+ */
574
+ T: 84,
575
+ /**
576
+ * U
577
+ */
578
+ U: 85,
579
+ /**
580
+ * V
581
+ */
582
+ V: 86,
583
+ /**
584
+ * W
585
+ */
586
+ W: 87,
587
+ /**
588
+ * X
589
+ */
590
+ X: 88,
591
+ /**
592
+ * Y
593
+ */
594
+ Y: 89,
595
+ /**
596
+ * Z
597
+ */
598
+ Z: 90,
599
+ /**
600
+ * META
601
+ */
602
+ META: 91,
603
+ // WIN_KEY_LEFT
604
+ /**
605
+ * WIN_KEY_RIGHT
606
+ */
607
+ WIN_KEY_RIGHT: 92,
608
+ /**
609
+ * CONTEXT_MENU
610
+ */
611
+ CONTEXT_MENU: 93,
612
+ /**
613
+ * NUM_ZERO
614
+ */
615
+ NUM_ZERO: 96,
616
+ /**
617
+ * NUM_ONE
618
+ */
619
+ NUM_ONE: 97,
620
+ /**
621
+ * NUM_TWO
622
+ */
623
+ NUM_TWO: 98,
624
+ /**
625
+ * NUM_THREE
626
+ */
627
+ NUM_THREE: 99,
628
+ /**
629
+ * NUM_FOUR
630
+ */
631
+ NUM_FOUR: 100,
632
+ /**
633
+ * NUM_FIVE
634
+ */
635
+ NUM_FIVE: 101,
636
+ /**
637
+ * NUM_SIX
638
+ */
639
+ NUM_SIX: 102,
640
+ /**
641
+ * NUM_SEVEN
642
+ */
643
+ NUM_SEVEN: 103,
644
+ /**
645
+ * NUM_EIGHT
646
+ */
647
+ NUM_EIGHT: 104,
648
+ /**
649
+ * NUM_NINE
650
+ */
651
+ NUM_NINE: 105,
652
+ /**
653
+ * NUM_MULTIPLY
654
+ */
655
+ NUM_MULTIPLY: 106,
656
+ /**
657
+ * NUM_PLUS
658
+ */
659
+ NUM_PLUS: 107,
660
+ /**
661
+ * NUM_MINUS
662
+ */
663
+ NUM_MINUS: 109,
664
+ /**
665
+ * NUM_PERIOD
666
+ */
667
+ NUM_PERIOD: 110,
668
+ /**
669
+ * NUM_DIVISION
670
+ */
671
+ NUM_DIVISION: 111,
672
+ /**
673
+ * F1
674
+ */
675
+ F1: 112,
676
+ /**
677
+ * F2
678
+ */
679
+ F2: 113,
680
+ /**
681
+ * F3
682
+ */
683
+ F3: 114,
684
+ /**
685
+ * F4
686
+ */
687
+ F4: 115,
688
+ /**
689
+ * F5
690
+ */
691
+ F5: 116,
692
+ /**
693
+ * F6
694
+ */
695
+ F6: 117,
696
+ /**
697
+ * F7
698
+ */
699
+ F7: 118,
700
+ /**
701
+ * F8
702
+ */
703
+ F8: 119,
704
+ /**
705
+ * F9
706
+ */
707
+ F9: 120,
708
+ /**
709
+ * F10
710
+ */
711
+ F10: 121,
712
+ /**
713
+ * F11
714
+ */
715
+ F11: 122,
716
+ /**
717
+ * F12
718
+ */
719
+ F12: 123,
720
+ /**
721
+ * NUMLOCK
722
+ */
723
+ NUMLOCK: 144,
724
+ /**
725
+ * SEMICOLON
726
+ */
727
+ SEMICOLON: 186,
728
+ // needs localization
729
+ /**
730
+ * DASH
731
+ */
732
+ DASH: 189,
733
+ // needs localization
734
+ /**
735
+ * EQUALS
736
+ */
737
+ EQUALS: 187,
738
+ // needs localization
739
+ /**
740
+ * COMMA
741
+ */
742
+ COMMA: 188,
743
+ // needs localization
744
+ /**
745
+ * PERIOD
746
+ */
747
+ PERIOD: 190,
748
+ // needs localization
749
+ /**
750
+ * SLASH
751
+ */
752
+ SLASH: 191,
753
+ // needs localization
754
+ /**
755
+ * APOSTROPHE
756
+ */
757
+ APOSTROPHE: 192,
758
+ // needs localization
759
+ /**
760
+ * SINGLE_QUOTE
761
+ */
762
+ SINGLE_QUOTE: 222,
763
+ // needs localization
764
+ /**
765
+ * OPEN_SQUARE_BRACKET
766
+ */
767
+ OPEN_SQUARE_BRACKET: 219,
768
+ // needs localization
769
+ /**
770
+ * BACKSLASH
771
+ */
772
+ BACKSLASH: 220,
773
+ // needs localization
774
+ /**
775
+ * CLOSE_SQUARE_BRACKET
776
+ */
777
+ CLOSE_SQUARE_BRACKET: 221,
778
+ // needs localization
779
+ /**
780
+ * WIN_KEY
781
+ */
782
+ WIN_KEY: 224,
783
+ /**
784
+ * MAC_FF_META
785
+ */
786
+ MAC_FF_META: 224,
787
+ // Firefox (Gecko) fires this for the meta key instead of 91
788
+ /**
789
+ * WIN_IME
790
+ */
791
+ WIN_IME: 229,
792
+ // ======================== Function ========================
793
+ /**
794
+ * whether text and modified key is entered at the same time.
795
+ */
796
+ isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
797
+ var keyCode = e.keyCode;
798
+ if (e.altKey && !e.ctrlKey || e.metaKey ||
799
+ // Function keys don't generate text
800
+ keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
801
+ return false;
802
+ }
803
+
804
+ // The following keys are quite harmless, even in combination with
805
+ // CTRL, ALT or SHIFT.
806
+ switch (keyCode) {
807
+ case KeyCode.ALT:
808
+ case KeyCode.CAPS_LOCK:
809
+ case KeyCode.CONTEXT_MENU:
810
+ case KeyCode.CTRL:
811
+ case KeyCode.DOWN:
812
+ case KeyCode.END:
813
+ case KeyCode.ESC:
814
+ case KeyCode.HOME:
815
+ case KeyCode.INSERT:
816
+ case KeyCode.LEFT:
817
+ case KeyCode.MAC_FF_META:
818
+ case KeyCode.META:
819
+ case KeyCode.NUMLOCK:
820
+ case KeyCode.NUM_CENTER:
821
+ case KeyCode.PAGE_DOWN:
822
+ case KeyCode.PAGE_UP:
823
+ case KeyCode.PAUSE:
824
+ case KeyCode.PRINT_SCREEN:
825
+ case KeyCode.RIGHT:
826
+ case KeyCode.SHIFT:
827
+ case KeyCode.UP:
828
+ case KeyCode.WIN_KEY:
829
+ case KeyCode.WIN_KEY_RIGHT:
830
+ return false;
831
+ default:
832
+ return true;
833
+ }
834
+ },
835
+ /**
836
+ * whether character is entered.
837
+ */
838
+ isCharacterKey: function isCharacterKey(keyCode) {
839
+ if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
840
+ return true;
841
+ }
842
+ if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
843
+ return true;
844
+ }
845
+ if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
846
+ return true;
847
+ }
848
+
849
+ // Safari sends zero key code for non-latin characters.
850
+ if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
851
+ return true;
852
+ }
853
+ switch (keyCode) {
854
+ case KeyCode.SPACE:
855
+ case KeyCode.QUESTION_MARK:
856
+ case KeyCode.NUM_PLUS:
857
+ case KeyCode.NUM_MINUS:
858
+ case KeyCode.NUM_PERIOD:
859
+ case KeyCode.NUM_DIVISION:
860
+ case KeyCode.SEMICOLON:
861
+ case KeyCode.DASH:
862
+ case KeyCode.EQUALS:
863
+ case KeyCode.COMMA:
864
+ case KeyCode.PERIOD:
865
+ case KeyCode.SLASH:
866
+ case KeyCode.APOSTROPHE:
867
+ case KeyCode.SINGLE_QUOTE:
868
+ case KeyCode.OPEN_SQUARE_BRACKET:
869
+ case KeyCode.BACKSLASH:
870
+ case KeyCode.CLOSE_SQUARE_BRACKET:
871
+ return true;
872
+ default:
873
+ return false;
874
+ }
875
+ }
876
+ };
877
+
878
+ var SliderContext = /*#__PURE__*/React__namespace.createContext({
879
+ min: 0,
880
+ max: 0,
881
+ direction: 'ltr',
882
+ step: 1,
883
+ includedStart: 0,
884
+ includedEnd: 0,
885
+ tabIndex: 0,
886
+ keyboard: true
887
+ });
888
+
889
+ function getOffset(value, min, max) {
890
+ return (value - min) / (max - min);
891
+ }
892
+ function getDirectionStyle(direction, value, min, max) {
893
+ var offset = getOffset(value, min, max);
894
+ var positionStyle = {};
895
+ switch (direction) {
896
+ case 'rtl':
897
+ positionStyle.right = "".concat(offset * 100, "%");
898
+ positionStyle.transform = 'translateX(50%)';
899
+ break;
900
+ case 'btt':
901
+ positionStyle.bottom = "".concat(offset * 100, "%");
902
+ positionStyle.transform = 'translateY(50%)';
903
+ break;
904
+ case 'ttb':
905
+ positionStyle.top = "".concat(offset * 100, "%");
906
+ positionStyle.transform = 'translateY(-50%)';
907
+ break;
908
+ default:
909
+ positionStyle.left = "".concat(offset * 100, "%");
910
+ positionStyle.transform = 'translateX(-50%)';
911
+ break;
912
+ }
913
+ return positionStyle;
914
+ }
915
+ /** Return index value if is list or return value directly */
916
+ function getIndex(value, index) {
917
+ return Array.isArray(value) ? value[index] : value;
918
+ }
919
+
920
+ var _excluded$1 = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange"];
921
+ var Handle = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
922
+ var _classNames, _getIndex;
923
+ var prefixCls = props.prefixCls,
924
+ value = props.value,
925
+ valueIndex = props.valueIndex,
926
+ onStartMove = props.onStartMove,
927
+ style = props.style,
928
+ render = props.render,
929
+ dragging = props.dragging,
930
+ onOffsetChange = props.onOffsetChange,
931
+ restProps = objectWithoutProperties._objectWithoutProperties(props, _excluded$1);
932
+ var _React$useContext = React__namespace.useContext(SliderContext),
933
+ min = _React$useContext.min,
934
+ max = _React$useContext.max,
935
+ direction = _React$useContext.direction,
936
+ disabled = _React$useContext.disabled,
937
+ keyboard = _React$useContext.keyboard,
938
+ range = _React$useContext.range,
939
+ tabIndex = _React$useContext.tabIndex,
940
+ ariaLabelForHandle = _React$useContext.ariaLabelForHandle,
941
+ ariaLabelledByForHandle = _React$useContext.ariaLabelledByForHandle,
942
+ ariaValueTextFormatterForHandle = _React$useContext.ariaValueTextFormatterForHandle;
943
+ var handlePrefixCls = "".concat(prefixCls, "-handle");
944
+ // ============================ Events ============================
945
+ var onInternalStartMove = function onInternalStartMove(e) {
946
+ if (!disabled) {
947
+ onStartMove(e, valueIndex);
948
+ }
949
+ };
950
+ // =========================== Keyboard ===========================
951
+ var onKeyDown = function onKeyDown(e) {
952
+ if (!disabled && keyboard) {
953
+ var offset = null;
954
+ // Change the value
955
+ switch (e.which || e.keyCode) {
956
+ case KeyCode.LEFT:
957
+ offset = direction === 'ltr' || direction === 'btt' ? -1 : 1;
958
+ break;
959
+ case KeyCode.RIGHT:
960
+ offset = direction === 'ltr' || direction === 'btt' ? 1 : -1;
961
+ break;
962
+ // Up is plus
963
+ case KeyCode.UP:
964
+ offset = direction !== 'ttb' ? 1 : -1;
965
+ break;
966
+ // Down is minus
967
+ case KeyCode.DOWN:
968
+ offset = direction !== 'ttb' ? -1 : 1;
969
+ break;
970
+ case KeyCode.HOME:
971
+ offset = 'min';
972
+ break;
973
+ case KeyCode.END:
974
+ offset = 'max';
975
+ break;
976
+ case KeyCode.PAGE_UP:
977
+ offset = 2;
978
+ break;
979
+ case KeyCode.PAGE_DOWN:
980
+ offset = -2;
981
+ break;
982
+ }
983
+ if (offset !== null) {
984
+ e.preventDefault();
985
+ onOffsetChange(offset, valueIndex);
986
+ }
987
+ }
988
+ };
989
+ // ============================ Offset ============================
990
+ var positionStyle = getDirectionStyle(direction, value, min, max);
991
+ // ============================ Render ============================
992
+ var handleNode = /*#__PURE__*/React__namespace.createElement("div", objectWithoutProperties._extends({
993
+ ref: ref,
994
+ className: classNames(handlePrefixCls, (_classNames = {}, objectWithoutProperties._defineProperty(_classNames, "".concat(handlePrefixCls, "-").concat(valueIndex + 1), range), objectWithoutProperties._defineProperty(_classNames, "".concat(handlePrefixCls, "-dragging"), dragging), _classNames)),
995
+ style: objectWithoutProperties._objectSpread2(objectWithoutProperties._objectSpread2({}, positionStyle), style),
996
+ onMouseDown: onInternalStartMove,
997
+ onTouchStart: onInternalStartMove,
998
+ onKeyDown: onKeyDown,
999
+ tabIndex: disabled ? null : getIndex(tabIndex, valueIndex),
1000
+ role: "slider",
1001
+ "aria-valuemin": min,
1002
+ "aria-valuemax": max,
1003
+ "aria-valuenow": value,
1004
+ "aria-disabled": disabled,
1005
+ "aria-label": getIndex(ariaLabelForHandle, valueIndex),
1006
+ "aria-labelledby": getIndex(ariaLabelledByForHandle, valueIndex),
1007
+ "aria-valuetext": (_getIndex = getIndex(ariaValueTextFormatterForHandle, valueIndex)) === null || _getIndex === void 0 ? void 0 : _getIndex(value)
1008
+ }, restProps));
1009
+ // Customize
1010
+ if (render) {
1011
+ handleNode = render(handleNode, {
1012
+ index: valueIndex,
1013
+ prefixCls: prefixCls,
1014
+ value: value,
1015
+ dragging: dragging
1016
+ });
1017
+ }
1018
+ return handleNode;
1019
+ });
1020
+ if (process.env.NODE_ENV !== 'production') {
1021
+ Handle.displayName = 'Handle';
1022
+ }
1023
+
1024
+ var _excluded = ["prefixCls", "style", "onStartMove", "onOffsetChange", "values", "handleRender", "draggingIndex"];
1025
+ var Handles = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
1026
+ var prefixCls = props.prefixCls,
1027
+ style = props.style,
1028
+ onStartMove = props.onStartMove,
1029
+ onOffsetChange = props.onOffsetChange,
1030
+ values = props.values,
1031
+ handleRender = props.handleRender,
1032
+ draggingIndex = props.draggingIndex,
1033
+ restProps = objectWithoutProperties._objectWithoutProperties(props, _excluded);
1034
+ var handlesRef = React__namespace.useRef({});
1035
+ React__namespace.useImperativeHandle(ref, function () {
1036
+ return {
1037
+ focus: function focus(index) {
1038
+ var _handlesRef$current$i;
1039
+ (_handlesRef$current$i = handlesRef.current[index]) === null || _handlesRef$current$i === void 0 ? void 0 : _handlesRef$current$i.focus();
1040
+ }
1041
+ };
1042
+ });
1043
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, values.map(function (value, index) {
1044
+ return /*#__PURE__*/React__namespace.createElement(Handle, objectWithoutProperties._extends({
1045
+ ref: function ref(node) {
1046
+ if (!node) {
1047
+ delete handlesRef.current[index];
1048
+ } else {
1049
+ handlesRef.current[index] = node;
1050
+ }
1051
+ },
1052
+ dragging: draggingIndex === index,
1053
+ prefixCls: prefixCls,
1054
+ style: getIndex(style, index),
1055
+ key: index,
1056
+ value: value,
1057
+ valueIndex: index,
1058
+ onStartMove: onStartMove,
1059
+ onOffsetChange: onOffsetChange,
1060
+ render: handleRender
1061
+ }, restProps));
1062
+ }));
1063
+ });
1064
+ if (process.env.NODE_ENV !== 'production') {
1065
+ Handles.displayName = 'Handles';
1066
+ }
1067
+
1068
+ function getPosition(e) {
1069
+ var obj = 'touches' in e ? e.touches[0] : e;
1070
+ return {
1071
+ pageX: obj.pageX,
1072
+ pageY: obj.pageY
1073
+ };
1074
+ }
1075
+ function useDrag(containerRef, direction, rawValues, min, max, formatValue, triggerChange, finishChange, offsetValues) {
1076
+ var _React$useState = React__namespace.useState(null),
1077
+ _React$useState2 = objectWithoutProperties._slicedToArray(_React$useState, 2),
1078
+ draggingValue = _React$useState2[0],
1079
+ setDraggingValue = _React$useState2[1];
1080
+ var _React$useState3 = React__namespace.useState(-1),
1081
+ _React$useState4 = objectWithoutProperties._slicedToArray(_React$useState3, 2),
1082
+ draggingIndex = _React$useState4[0],
1083
+ setDraggingIndex = _React$useState4[1];
1084
+ var _React$useState5 = React__namespace.useState(rawValues),
1085
+ _React$useState6 = objectWithoutProperties._slicedToArray(_React$useState5, 2),
1086
+ cacheValues = _React$useState6[0],
1087
+ setCacheValues = _React$useState6[1];
1088
+ var _React$useState7 = React__namespace.useState(rawValues),
1089
+ _React$useState8 = objectWithoutProperties._slicedToArray(_React$useState7, 2),
1090
+ originValues = _React$useState8[0],
1091
+ setOriginValues = _React$useState8[1];
1092
+ var mouseMoveEventRef = React__namespace.useRef(null);
1093
+ var mouseUpEventRef = React__namespace.useRef(null);
1094
+ React__namespace.useEffect(function () {
1095
+ if (draggingIndex === -1) {
1096
+ setCacheValues(rawValues);
1097
+ }
1098
+ }, [rawValues, draggingIndex]);
1099
+ // Clean up event
1100
+ React__namespace.useEffect(function () {
1101
+ return function () {
1102
+ document.removeEventListener('mousemove', mouseMoveEventRef.current);
1103
+ document.removeEventListener('mouseup', mouseUpEventRef.current);
1104
+ document.removeEventListener('touchmove', mouseMoveEventRef.current);
1105
+ document.removeEventListener('touchend', mouseUpEventRef.current);
1106
+ };
1107
+ }, []);
1108
+ var flushValues = function flushValues(nextValues, nextValue) {
1109
+ // Perf: Only update state when value changed
1110
+ if (cacheValues.some(function (val, i) {
1111
+ return val !== nextValues[i];
1112
+ })) {
1113
+ if (nextValue !== undefined) {
1114
+ setDraggingValue(nextValue);
1115
+ }
1116
+ setCacheValues(nextValues);
1117
+ triggerChange(nextValues);
1118
+ }
1119
+ };
1120
+ var updateCacheValue = function updateCacheValue(valueIndex, offsetPercent) {
1121
+ // Basic point offset
1122
+ if (valueIndex === -1) {
1123
+ // >>>> Dragging on the track
1124
+ var startValue = originValues[0];
1125
+ var endValue = originValues[originValues.length - 1];
1126
+ var maxStartOffset = min - startValue;
1127
+ var maxEndOffset = max - endValue;
1128
+ // Get valid offset
1129
+ var offset = offsetPercent * (max - min);
1130
+ offset = Math.max(offset, maxStartOffset);
1131
+ offset = Math.min(offset, maxEndOffset);
1132
+ // Use first value to revert back of valid offset (like steps marks)
1133
+ var formatStartValue = formatValue(startValue + offset);
1134
+ offset = formatStartValue - startValue;
1135
+ var cloneCacheValues = originValues.map(function (val) {
1136
+ return val + offset;
1137
+ });
1138
+ flushValues(cloneCacheValues);
1139
+ } else {
1140
+ // >>>> Dragging on the handle
1141
+ var offsetDist = (max - min) * offsetPercent;
1142
+ // Always start with the valueIndex origin value
1143
+ var cloneValues = objectWithoutProperties._toConsumableArray(cacheValues);
1144
+ cloneValues[valueIndex] = originValues[valueIndex];
1145
+ var next = offsetValues(cloneValues, offsetDist, valueIndex, 'dist');
1146
+ flushValues(next.values, next.value);
1147
+ }
1148
+ };
1149
+ // Resolve closure
1150
+ var updateCacheValueRef = React__namespace.useRef(updateCacheValue);
1151
+ updateCacheValueRef.current = updateCacheValue;
1152
+ var onStartMove = function onStartMove(e, valueIndex) {
1153
+ e.stopPropagation();
1154
+ var originValue = rawValues[valueIndex];
1155
+ setDraggingIndex(valueIndex);
1156
+ setDraggingValue(originValue);
1157
+ setOriginValues(rawValues);
1158
+ var _getPosition = getPosition(e),
1159
+ startX = _getPosition.pageX,
1160
+ startY = _getPosition.pageY;
1161
+ // Moving
1162
+ var onMouseMove = function onMouseMove(event) {
1163
+ event.preventDefault();
1164
+ var _getPosition2 = getPosition(event),
1165
+ moveX = _getPosition2.pageX,
1166
+ moveY = _getPosition2.pageY;
1167
+ var offsetX = moveX - startX;
1168
+ var offsetY = moveY - startY;
1169
+ var _containerRef$current = containerRef.current.getBoundingClientRect(),
1170
+ width = _containerRef$current.width,
1171
+ height = _containerRef$current.height;
1172
+ var offSetPercent;
1173
+ switch (direction) {
1174
+ case 'btt':
1175
+ offSetPercent = -offsetY / height;
1176
+ break;
1177
+ case 'ttb':
1178
+ offSetPercent = offsetY / height;
1179
+ break;
1180
+ case 'rtl':
1181
+ offSetPercent = -offsetX / width;
1182
+ break;
1183
+ default:
1184
+ offSetPercent = offsetX / width;
1185
+ }
1186
+ updateCacheValueRef.current(valueIndex, offSetPercent);
1187
+ };
1188
+ // End
1189
+ var onMouseUp = function onMouseUp(event) {
1190
+ event.preventDefault();
1191
+ document.removeEventListener('mouseup', onMouseUp);
1192
+ document.removeEventListener('mousemove', onMouseMove);
1193
+ document.removeEventListener('touchend', onMouseUp);
1194
+ document.removeEventListener('touchmove', onMouseMove);
1195
+ mouseMoveEventRef.current = null;
1196
+ mouseUpEventRef.current = null;
1197
+ setDraggingIndex(-1);
1198
+ finishChange();
1199
+ };
1200
+ document.addEventListener('mouseup', onMouseUp);
1201
+ document.addEventListener('mousemove', onMouseMove);
1202
+ document.addEventListener('touchend', onMouseUp);
1203
+ document.addEventListener('touchmove', onMouseMove);
1204
+ mouseMoveEventRef.current = onMouseMove;
1205
+ mouseUpEventRef.current = onMouseUp;
1206
+ };
1207
+ // Only return cache value when it mapping with rawValues
1208
+ var returnValues = React__namespace.useMemo(function () {
1209
+ var sourceValues = objectWithoutProperties._toConsumableArray(rawValues).sort(function (a, b) {
1210
+ return a - b;
1211
+ });
1212
+ var targetValues = objectWithoutProperties._toConsumableArray(cacheValues).sort(function (a, b) {
1213
+ return a - b;
1214
+ });
1215
+ return sourceValues.every(function (val, index) {
1216
+ return val === targetValues[index];
1217
+ }) ? cacheValues : rawValues;
1218
+ }, [rawValues, cacheValues]);
1219
+ return [draggingIndex, draggingValue, returnValues, onStartMove];
1220
+ }
1221
+
1222
+ function Track(props) {
1223
+ var prefixCls = props.prefixCls,
1224
+ style = props.style,
1225
+ start = props.start,
1226
+ end = props.end,
1227
+ index = props.index,
1228
+ onStartMove = props.onStartMove;
1229
+ var _React$useContext = React__namespace.useContext(SliderContext),
1230
+ direction = _React$useContext.direction,
1231
+ min = _React$useContext.min,
1232
+ max = _React$useContext.max,
1233
+ disabled = _React$useContext.disabled,
1234
+ range = _React$useContext.range;
1235
+ var trackPrefixCls = "".concat(prefixCls, "-track");
1236
+ var offsetStart = getOffset(start, min, max);
1237
+ var offsetEnd = getOffset(end, min, max);
1238
+ // ============================ Events ============================
1239
+ var onInternalStartMove = function onInternalStartMove(e) {
1240
+ if (!disabled && onStartMove) {
1241
+ onStartMove(e, -1);
1242
+ }
1243
+ };
1244
+ // ============================ Render ============================
1245
+ var positionStyle = {};
1246
+ switch (direction) {
1247
+ case 'rtl':
1248
+ positionStyle.right = "".concat(offsetStart * 100, "%");
1249
+ positionStyle.width = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
1250
+ break;
1251
+ case 'btt':
1252
+ positionStyle.bottom = "".concat(offsetStart * 100, "%");
1253
+ positionStyle.height = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
1254
+ break;
1255
+ case 'ttb':
1256
+ positionStyle.top = "".concat(offsetStart * 100, "%");
1257
+ positionStyle.height = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
1258
+ break;
1259
+ default:
1260
+ positionStyle.left = "".concat(offsetStart * 100, "%");
1261
+ positionStyle.width = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
1262
+ }
1263
+ return /*#__PURE__*/React__namespace.createElement("div", {
1264
+ className: classNames(trackPrefixCls, range && "".concat(trackPrefixCls, "-").concat(index + 1)),
1265
+ style: objectWithoutProperties._objectSpread2(objectWithoutProperties._objectSpread2({}, positionStyle), style),
1266
+ onMouseDown: onInternalStartMove,
1267
+ onTouchStart: onInternalStartMove
1268
+ });
1269
+ }
1270
+
1271
+ function Tracks(props) {
1272
+ var prefixCls = props.prefixCls,
1273
+ style = props.style,
1274
+ values = props.values,
1275
+ startPoint = props.startPoint,
1276
+ onStartMove = props.onStartMove;
1277
+ var _React$useContext = React__namespace.useContext(SliderContext),
1278
+ included = _React$useContext.included,
1279
+ range = _React$useContext.range,
1280
+ min = _React$useContext.min;
1281
+ var trackList = React__namespace.useMemo(function () {
1282
+ if (!range) {
1283
+ // null value do not have track
1284
+ if (values.length === 0) {
1285
+ return [];
1286
+ }
1287
+ var startValue = startPoint !== null && startPoint !== void 0 ? startPoint : min;
1288
+ var endValue = values[0];
1289
+ return [{
1290
+ start: Math.min(startValue, endValue),
1291
+ end: Math.max(startValue, endValue)
1292
+ }];
1293
+ }
1294
+ // Multiple
1295
+ var list = [];
1296
+ for (var i = 0; i < values.length - 1; i += 1) {
1297
+ list.push({
1298
+ start: values[i],
1299
+ end: values[i + 1]
1300
+ });
1301
+ }
1302
+ return list;
1303
+ }, [values, range, startPoint, min]);
1304
+ return included ? trackList.map(function (_ref, index) {
1305
+ var start = _ref.start,
1306
+ end = _ref.end;
1307
+ return /*#__PURE__*/React__namespace.createElement(Track, {
1308
+ index: index,
1309
+ prefixCls: prefixCls,
1310
+ style: getIndex(style, index),
1311
+ start: start,
1312
+ end: end,
1313
+ key: index,
1314
+ onStartMove: onStartMove
1315
+ });
1316
+ }) : null;
1317
+ }
1318
+
1319
+ function Mark(props) {
1320
+ var prefixCls = props.prefixCls,
1321
+ style = props.style,
1322
+ children = props.children,
1323
+ value = props.value,
1324
+ _onClick = props.onClick;
1325
+ var _React$useContext = React__namespace.useContext(SliderContext),
1326
+ min = _React$useContext.min,
1327
+ max = _React$useContext.max,
1328
+ direction = _React$useContext.direction,
1329
+ includedStart = _React$useContext.includedStart,
1330
+ includedEnd = _React$useContext.includedEnd,
1331
+ included = _React$useContext.included;
1332
+ var textCls = "".concat(prefixCls, "-text");
1333
+ // ============================ Offset ============================
1334
+ var positionStyle = getDirectionStyle(direction, value, min, max);
1335
+ return /*#__PURE__*/React__namespace.createElement("span", {
1336
+ className: classNames(textCls, objectWithoutProperties._defineProperty({}, "".concat(textCls, "-active"), included && includedStart <= value && value <= includedEnd)),
1337
+ style: objectWithoutProperties._objectSpread2(objectWithoutProperties._objectSpread2({}, positionStyle), style),
1338
+ onMouseDown: function onMouseDown(e) {
1339
+ e.stopPropagation();
1340
+ },
1341
+ onClick: function onClick() {
1342
+ _onClick(value);
1343
+ }
1344
+ }, children);
1345
+ }
1346
+
1347
+ function Marks(props) {
1348
+ var prefixCls = props.prefixCls,
1349
+ marks = props.marks,
1350
+ onClick = props.onClick;
1351
+ var markPrefixCls = "".concat(prefixCls, "-mark");
1352
+ // Not render mark if empty
1353
+ if (!marks.length) {
1354
+ return null;
1355
+ }
1356
+ return /*#__PURE__*/React__namespace.createElement("div", {
1357
+ className: markPrefixCls
1358
+ }, marks.map(function (_ref) {
1359
+ var value = _ref.value,
1360
+ style = _ref.style,
1361
+ label = _ref.label;
1362
+ return /*#__PURE__*/React__namespace.createElement(Mark, {
1363
+ key: value,
1364
+ prefixCls: markPrefixCls,
1365
+ style: style,
1366
+ value: value,
1367
+ onClick: onClick
1368
+ }, label);
1369
+ }));
1370
+ }
1371
+
1372
+ function Dot(props) {
1373
+ var prefixCls = props.prefixCls,
1374
+ value = props.value,
1375
+ style = props.style,
1376
+ activeStyle = props.activeStyle;
1377
+ var _React$useContext = React__namespace.useContext(SliderContext),
1378
+ min = _React$useContext.min,
1379
+ max = _React$useContext.max,
1380
+ direction = _React$useContext.direction,
1381
+ included = _React$useContext.included,
1382
+ includedStart = _React$useContext.includedStart,
1383
+ includedEnd = _React$useContext.includedEnd;
1384
+ var dotClassName = "".concat(prefixCls, "-dot");
1385
+ var active = included && includedStart <= value && value <= includedEnd;
1386
+ // ============================ Offset ============================
1387
+ var mergedStyle = objectWithoutProperties._objectSpread2(objectWithoutProperties._objectSpread2({}, getDirectionStyle(direction, value, min, max)), typeof style === 'function' ? style(value) : style);
1388
+ if (active) {
1389
+ mergedStyle = objectWithoutProperties._objectSpread2(objectWithoutProperties._objectSpread2({}, mergedStyle), typeof activeStyle === 'function' ? activeStyle(value) : activeStyle);
1390
+ }
1391
+ return /*#__PURE__*/React__namespace.createElement("span", {
1392
+ className: classNames(dotClassName, objectWithoutProperties._defineProperty({}, "".concat(dotClassName, "-active"), active)),
1393
+ style: mergedStyle
1394
+ });
1395
+ }
1396
+
1397
+ function Steps(props) {
1398
+ var prefixCls = props.prefixCls,
1399
+ marks = props.marks,
1400
+ dots = props.dots,
1401
+ style = props.style,
1402
+ activeStyle = props.activeStyle;
1403
+ var _React$useContext = React__namespace.useContext(SliderContext),
1404
+ min = _React$useContext.min,
1405
+ max = _React$useContext.max,
1406
+ step = _React$useContext.step;
1407
+ var stepDots = React__namespace.useMemo(function () {
1408
+ var dotSet = new Set();
1409
+ // Add marks
1410
+ marks.forEach(function (mark) {
1411
+ dotSet.add(mark.value);
1412
+ });
1413
+ // Fill dots
1414
+ if (dots && step !== null) {
1415
+ var current = min;
1416
+ while (current <= max) {
1417
+ dotSet.add(current);
1418
+ current += step;
1419
+ }
1420
+ }
1421
+ return Array.from(dotSet);
1422
+ }, [min, max, step, dots, marks]);
1423
+ return /*#__PURE__*/React__namespace.createElement("div", {
1424
+ className: "".concat(prefixCls, "-step")
1425
+ }, stepDots.map(function (dotValue) {
1426
+ return /*#__PURE__*/React__namespace.createElement(Dot, {
1427
+ prefixCls: prefixCls,
1428
+ key: dotValue,
1429
+ value: dotValue,
1430
+ style: style,
1431
+ activeStyle: activeStyle
1432
+ });
1433
+ }));
1434
+ }
1435
+
1436
+ function useOffset(min, max, step, markList, allowCross, pushable) {
1437
+ var formatRangeValue = React__namespace.useCallback(function (val) {
1438
+ var formatNextValue = isFinite(val) ? val : min;
1439
+ formatNextValue = Math.min(max, val);
1440
+ formatNextValue = Math.max(min, formatNextValue);
1441
+ return formatNextValue;
1442
+ }, [min, max]);
1443
+ var formatStepValue = React__namespace.useCallback(function (val) {
1444
+ if (step !== null) {
1445
+ var stepValue = min + Math.round((formatRangeValue(val) - min) / step) * step;
1446
+ // Cut number in case to be like 0.30000000000000004
1447
+ var getDecimal = function getDecimal(num) {
1448
+ return (String(num).split('.')[1] || '').length;
1449
+ };
1450
+ var maxDecimal = Math.max(getDecimal(step), getDecimal(max), getDecimal(min));
1451
+ var fixedValue = Number(stepValue.toFixed(maxDecimal));
1452
+ return min <= fixedValue && fixedValue <= max ? fixedValue : null;
1453
+ }
1454
+ return null;
1455
+ }, [step, min, max, formatRangeValue]);
1456
+ var formatValue = React__namespace.useCallback(function (val) {
1457
+ var formatNextValue = formatRangeValue(val);
1458
+ // List align values
1459
+ var alignValues = markList.map(function (mark) {
1460
+ return mark.value;
1461
+ });
1462
+ if (step !== null) {
1463
+ alignValues.push(formatStepValue(val));
1464
+ }
1465
+ // min & max
1466
+ alignValues.push(min, max);
1467
+ // Align with marks
1468
+ var closeValue = alignValues[0];
1469
+ var closeDist = max - min;
1470
+ alignValues.forEach(function (alignValue) {
1471
+ var dist = Math.abs(formatNextValue - alignValue);
1472
+ if (dist <= closeDist) {
1473
+ closeValue = alignValue;
1474
+ closeDist = dist;
1475
+ }
1476
+ });
1477
+ return closeValue;
1478
+ }, [min, max, markList, step, formatRangeValue, formatStepValue]);
1479
+ // ========================== Offset ==========================
1480
+ // Single Value
1481
+ var offsetValue = function offsetValue(values, offset, valueIndex) {
1482
+ var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
1483
+ if (typeof offset === 'number') {
1484
+ var nextValue;
1485
+ var originValue = values[valueIndex];
1486
+ // Only used for `dist` mode
1487
+ var targetDistValue = originValue + offset;
1488
+ // Compare next step value & mark value which is best match
1489
+ var potentialValues = [];
1490
+ markList.forEach(function (mark) {
1491
+ potentialValues.push(mark.value);
1492
+ });
1493
+ // Min & Max
1494
+ potentialValues.push(min, max);
1495
+ // In case origin value is align with mark but not with step
1496
+ potentialValues.push(formatStepValue(originValue));
1497
+ // Put offset step value also
1498
+ var sign = offset > 0 ? 1 : -1;
1499
+ if (mode === 'unit') {
1500
+ potentialValues.push(formatStepValue(originValue + sign * step));
1501
+ } else {
1502
+ potentialValues.push(formatStepValue(targetDistValue));
1503
+ }
1504
+ // Find close one
1505
+ potentialValues = potentialValues.filter(function (val) {
1506
+ return val !== null;
1507
+ })
1508
+ // Remove reverse value
1509
+ .filter(function (val) {
1510
+ return offset < 0 ? val <= originValue : val >= originValue;
1511
+ });
1512
+ if (mode === 'unit') {
1513
+ // `unit` mode can not contain itself
1514
+ potentialValues = potentialValues.filter(function (val) {
1515
+ return val !== originValue;
1516
+ });
1517
+ }
1518
+ var compareValue = mode === 'unit' ? originValue : targetDistValue;
1519
+ nextValue = potentialValues[0];
1520
+ var valueDist = Math.abs(nextValue - compareValue);
1521
+ potentialValues.forEach(function (potentialValue) {
1522
+ var dist = Math.abs(potentialValue - compareValue);
1523
+ if (dist < valueDist) {
1524
+ nextValue = potentialValue;
1525
+ valueDist = dist;
1526
+ }
1527
+ });
1528
+ // Out of range will back to range
1529
+ if (nextValue === undefined) {
1530
+ return offset < 0 ? min : max;
1531
+ }
1532
+ // `dist` mode
1533
+ if (mode === 'dist') {
1534
+ return nextValue;
1535
+ }
1536
+ // `unit` mode may need another round
1537
+ if (Math.abs(offset) > 1) {
1538
+ var cloneValues = objectWithoutProperties._toConsumableArray(values);
1539
+ cloneValues[valueIndex] = nextValue;
1540
+ return offsetValue(cloneValues, offset - sign, valueIndex, mode);
1541
+ }
1542
+ return nextValue;
1543
+ } else if (offset === 'min') {
1544
+ return min;
1545
+ } else if (offset === 'max') {
1546
+ return max;
1547
+ }
1548
+ };
1549
+ /** Same as `offsetValue` but return `changed` mark to tell value changed */
1550
+ var offsetChangedValue = function offsetChangedValue(values, offset, valueIndex) {
1551
+ var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
1552
+ var originValue = values[valueIndex];
1553
+ var nextValue = offsetValue(values, offset, valueIndex, mode);
1554
+ return {
1555
+ value: nextValue,
1556
+ changed: nextValue !== originValue
1557
+ };
1558
+ };
1559
+ var needPush = function needPush(dist) {
1560
+ return pushable === null && dist === 0 || typeof pushable === 'number' && dist < pushable;
1561
+ };
1562
+ // Values
1563
+ var offsetValues = function offsetValues(values, offset, valueIndex) {
1564
+ var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
1565
+ var nextValues = values.map(formatValue);
1566
+ var originValue = nextValues[valueIndex];
1567
+ var nextValue = offsetValue(nextValues, offset, valueIndex, mode);
1568
+ nextValues[valueIndex] = nextValue;
1569
+ if (allowCross === false) {
1570
+ // >>>>> Allow Cross
1571
+ var pushNum = pushable || 0;
1572
+ // ============ AllowCross ===============
1573
+ if (valueIndex > 0 && nextValues[valueIndex - 1] !== originValue) {
1574
+ nextValues[valueIndex] = Math.max(nextValues[valueIndex], nextValues[valueIndex - 1] + pushNum);
1575
+ }
1576
+ if (valueIndex < nextValues.length - 1 && nextValues[valueIndex + 1] !== originValue) {
1577
+ nextValues[valueIndex] = Math.min(nextValues[valueIndex], nextValues[valueIndex + 1] - pushNum);
1578
+ }
1579
+ } else if (typeof pushable === 'number' || pushable === null) {
1580
+ // >>>>> Pushable
1581
+ // =============== Push ==================
1582
+ // >>>>>> Basic push
1583
+ // End values
1584
+ for (var i = valueIndex + 1; i < nextValues.length; i += 1) {
1585
+ var changed = true;
1586
+ while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {
1587
+ var _offsetChangedValue = offsetChangedValue(nextValues, 1, i);
1588
+ nextValues[i] = _offsetChangedValue.value;
1589
+ changed = _offsetChangedValue.changed;
1590
+ }
1591
+ }
1592
+ // Start values
1593
+ for (var _i = valueIndex; _i > 0; _i -= 1) {
1594
+ var _changed = true;
1595
+ while (needPush(nextValues[_i] - nextValues[_i - 1]) && _changed) {
1596
+ var _offsetChangedValue2 = offsetChangedValue(nextValues, -1, _i - 1);
1597
+ nextValues[_i - 1] = _offsetChangedValue2.value;
1598
+ _changed = _offsetChangedValue2.changed;
1599
+ }
1600
+ }
1601
+ // >>>>> Revert back to safe push range
1602
+ // End to Start
1603
+ for (var _i2 = nextValues.length - 1; _i2 > 0; _i2 -= 1) {
1604
+ var _changed2 = true;
1605
+ while (needPush(nextValues[_i2] - nextValues[_i2 - 1]) && _changed2) {
1606
+ var _offsetChangedValue3 = offsetChangedValue(nextValues, -1, _i2 - 1);
1607
+ nextValues[_i2 - 1] = _offsetChangedValue3.value;
1608
+ _changed2 = _offsetChangedValue3.changed;
1609
+ }
1610
+ }
1611
+ // Start to End
1612
+ for (var _i3 = 0; _i3 < nextValues.length - 1; _i3 += 1) {
1613
+ var _changed3 = true;
1614
+ while (needPush(nextValues[_i3 + 1] - nextValues[_i3]) && _changed3) {
1615
+ var _offsetChangedValue4 = offsetChangedValue(nextValues, 1, _i3 + 1);
1616
+ nextValues[_i3 + 1] = _offsetChangedValue4.value;
1617
+ _changed3 = _offsetChangedValue4.changed;
1618
+ }
1619
+ }
1620
+ }
1621
+ return {
1622
+ value: nextValues[valueIndex],
1623
+ values: nextValues
1624
+ };
1625
+ };
1626
+ return [formatValue, offsetValues];
1627
+ }
1628
+
1629
+ var Slider = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
1630
+ var _classNames;
1631
+ var _props$prefixCls = props.prefixCls,
1632
+ prefixCls = _props$prefixCls === void 0 ? 'rc-slider' : _props$prefixCls,
1633
+ className = props.className,
1634
+ style = props.style,
1635
+ _props$disabled = props.disabled,
1636
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
1637
+ _props$keyboard = props.keyboard,
1638
+ keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
1639
+ autoFocus = props.autoFocus,
1640
+ onFocus = props.onFocus,
1641
+ onBlur = props.onBlur,
1642
+ _props$min = props.min,
1643
+ min = _props$min === void 0 ? 0 : _props$min,
1644
+ _props$max = props.max,
1645
+ max = _props$max === void 0 ? 100 : _props$max,
1646
+ _props$step = props.step,
1647
+ step = _props$step === void 0 ? 1 : _props$step,
1648
+ value = props.value,
1649
+ defaultValue = props.defaultValue,
1650
+ range = props.range,
1651
+ count = props.count,
1652
+ onChange = props.onChange,
1653
+ onBeforeChange = props.onBeforeChange,
1654
+ onAfterChange = props.onAfterChange,
1655
+ _props$allowCross = props.allowCross,
1656
+ allowCross = _props$allowCross === void 0 ? true : _props$allowCross,
1657
+ _props$pushable = props.pushable,
1658
+ pushable = _props$pushable === void 0 ? false : _props$pushable,
1659
+ draggableTrack = props.draggableTrack,
1660
+ reverse = props.reverse,
1661
+ vertical = props.vertical,
1662
+ _props$included = props.included,
1663
+ included = _props$included === void 0 ? true : _props$included,
1664
+ startPoint = props.startPoint,
1665
+ trackStyle = props.trackStyle,
1666
+ handleStyle = props.handleStyle,
1667
+ railStyle = props.railStyle,
1668
+ dotStyle = props.dotStyle,
1669
+ activeDotStyle = props.activeDotStyle,
1670
+ marks = props.marks,
1671
+ dots = props.dots,
1672
+ handleRender = props.handleRender,
1673
+ _props$tabIndex = props.tabIndex,
1674
+ tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
1675
+ ariaLabelForHandle = props.ariaLabelForHandle,
1676
+ ariaLabelledByForHandle = props.ariaLabelledByForHandle,
1677
+ ariaValueTextFormatterForHandle = props.ariaValueTextFormatterForHandle;
1678
+ var handlesRef = React__namespace.useRef();
1679
+ var containerRef = React__namespace.useRef();
1680
+ var direction = React__namespace.useMemo(function () {
1681
+ if (vertical) {
1682
+ return reverse ? 'ttb' : 'btt';
1683
+ }
1684
+ return reverse ? 'rtl' : 'ltr';
1685
+ }, [reverse, vertical]);
1686
+ // ============================ Range =============================
1687
+ var mergedMin = React__namespace.useMemo(function () {
1688
+ return isFinite(min) ? min : 0;
1689
+ }, [min]);
1690
+ var mergedMax = React__namespace.useMemo(function () {
1691
+ return isFinite(max) ? max : 100;
1692
+ }, [max]);
1693
+ // ============================= Step =============================
1694
+ var mergedStep = React__namespace.useMemo(function () {
1695
+ return step !== null && step <= 0 ? 1 : step;
1696
+ }, [step]);
1697
+ // ============================= Push =============================
1698
+ var mergedPush = React__namespace.useMemo(function () {
1699
+ if (pushable === true) {
1700
+ return mergedStep;
1701
+ }
1702
+ return pushable >= 0 ? pushable : false;
1703
+ }, [pushable, mergedStep]);
1704
+ // ============================ Marks =============================
1705
+ var markList = React__namespace.useMemo(function () {
1706
+ var keys = Object.keys(marks || {});
1707
+ return keys.map(function (key) {
1708
+ var mark = marks[key];
1709
+ var markObj = {
1710
+ value: Number(key)
1711
+ };
1712
+ if (mark && objectWithoutProperties._typeof(mark) === 'object' && ! /*#__PURE__*/React__namespace.isValidElement(mark) && ('label' in mark || 'style' in mark)) {
1713
+ markObj.style = mark.style;
1714
+ markObj.label = mark.label;
1715
+ } else {
1716
+ markObj.label = mark;
1717
+ }
1718
+ return markObj;
1719
+ }).filter(function (_ref) {
1720
+ var label = _ref.label;
1721
+ return label || typeof label === 'number';
1722
+ }).sort(function (a, b) {
1723
+ return a.value - b.value;
1724
+ });
1725
+ }, [marks]);
1726
+ // ============================ Format ============================
1727
+ var _useOffset = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush),
1728
+ _useOffset2 = objectWithoutProperties._slicedToArray(_useOffset, 2),
1729
+ formatValue = _useOffset2[0],
1730
+ offsetValues = _useOffset2[1];
1731
+ // ============================ Values ============================
1732
+ var _useMergedState = useMergedState(defaultValue, {
1733
+ value: value
1734
+ }),
1735
+ _useMergedState2 = objectWithoutProperties._slicedToArray(_useMergedState, 2),
1736
+ mergedValue = _useMergedState2[0],
1737
+ setValue = _useMergedState2[1];
1738
+ var rawValues = React__namespace.useMemo(function () {
1739
+ var valueList = mergedValue === null || mergedValue === undefined ? [] : Array.isArray(mergedValue) ? mergedValue : [mergedValue];
1740
+ var _valueList = objectWithoutProperties._slicedToArray(valueList, 1),
1741
+ _valueList$ = _valueList[0],
1742
+ val0 = _valueList$ === void 0 ? mergedMin : _valueList$;
1743
+ var returnValues = mergedValue === null ? [] : [val0];
1744
+ // Format as range
1745
+ if (range) {
1746
+ returnValues = objectWithoutProperties._toConsumableArray(valueList);
1747
+ // When count provided or value is `undefined`, we fill values
1748
+ if (count || mergedValue === undefined) {
1749
+ var pointCount = count >= 0 ? count + 1 : 2;
1750
+ returnValues = returnValues.slice(0, pointCount);
1751
+ // Fill with count
1752
+ while (returnValues.length < pointCount) {
1753
+ var _returnValues;
1754
+ returnValues.push((_returnValues = returnValues[returnValues.length - 1]) !== null && _returnValues !== void 0 ? _returnValues : mergedMin);
1755
+ }
1756
+ }
1757
+ returnValues.sort(function (a, b) {
1758
+ return a - b;
1759
+ });
1760
+ }
1761
+ // Align in range
1762
+ returnValues.forEach(function (val, index) {
1763
+ returnValues[index] = formatValue(val);
1764
+ });
1765
+ return returnValues;
1766
+ }, [mergedValue, range, mergedMin, count, formatValue]);
1767
+ // =========================== onChange ===========================
1768
+ var rawValuesRef = React__namespace.useRef(rawValues);
1769
+ rawValuesRef.current = rawValues;
1770
+ var getTriggerValue = function getTriggerValue(triggerValues) {
1771
+ return range ? triggerValues : triggerValues[0];
1772
+ };
1773
+ var triggerChange = function triggerChange(nextValues) {
1774
+ // Order first
1775
+ var cloneNextValues = objectWithoutProperties._toConsumableArray(nextValues).sort(function (a, b) {
1776
+ return a - b;
1777
+ });
1778
+ // Trigger event if needed
1779
+ if (onChange && !isEqual(cloneNextValues, rawValuesRef.current, true)) {
1780
+ onChange(getTriggerValue(cloneNextValues));
1781
+ }
1782
+ // We set this later since it will re-render component immediately
1783
+ setValue(cloneNextValues);
1784
+ };
1785
+ var changeToCloseValue = function changeToCloseValue(newValue) {
1786
+ if (!disabled) {
1787
+ var valueIndex = 0;
1788
+ var valueDist = mergedMax - mergedMin;
1789
+ rawValues.forEach(function (val, index) {
1790
+ var dist = Math.abs(newValue - val);
1791
+ if (dist <= valueDist) {
1792
+ valueDist = dist;
1793
+ valueIndex = index;
1794
+ }
1795
+ });
1796
+ // Create new values
1797
+ var cloneNextValues = objectWithoutProperties._toConsumableArray(rawValues);
1798
+ cloneNextValues[valueIndex] = newValue;
1799
+ // Fill value to match default 2
1800
+ if (range && !rawValues.length && count === undefined) {
1801
+ cloneNextValues.push(newValue);
1802
+ }
1803
+ onBeforeChange === null || onBeforeChange === void 0 ? void 0 : onBeforeChange(getTriggerValue(cloneNextValues));
1804
+ triggerChange(cloneNextValues);
1805
+ onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(getTriggerValue(cloneNextValues));
1806
+ }
1807
+ };
1808
+ // ============================ Click =============================
1809
+ var onSliderMouseDown = function onSliderMouseDown(e) {
1810
+ e.preventDefault();
1811
+ var _containerRef$current = containerRef.current.getBoundingClientRect(),
1812
+ width = _containerRef$current.width,
1813
+ height = _containerRef$current.height,
1814
+ left = _containerRef$current.left,
1815
+ top = _containerRef$current.top,
1816
+ bottom = _containerRef$current.bottom,
1817
+ right = _containerRef$current.right;
1818
+ var clientX = e.clientX,
1819
+ clientY = e.clientY;
1820
+ var percent;
1821
+ switch (direction) {
1822
+ case 'btt':
1823
+ percent = (bottom - clientY) / height;
1824
+ break;
1825
+ case 'ttb':
1826
+ percent = (clientY - top) / height;
1827
+ break;
1828
+ case 'rtl':
1829
+ percent = (right - clientX) / width;
1830
+ break;
1831
+ default:
1832
+ percent = (clientX - left) / width;
1833
+ }
1834
+ var nextValue = mergedMin + percent * (mergedMax - mergedMin);
1835
+ changeToCloseValue(formatValue(nextValue));
1836
+ };
1837
+ // =========================== Keyboard ===========================
1838
+ var _React$useState = React__namespace.useState(null),
1839
+ _React$useState2 = objectWithoutProperties._slicedToArray(_React$useState, 2),
1840
+ keyboardValue = _React$useState2[0],
1841
+ setKeyboardValue = _React$useState2[1];
1842
+ var onHandleOffsetChange = function onHandleOffsetChange(offset, valueIndex) {
1843
+ if (!disabled) {
1844
+ var next = offsetValues(rawValues, offset, valueIndex);
1845
+ onBeforeChange === null || onBeforeChange === void 0 ? void 0 : onBeforeChange(getTriggerValue(rawValues));
1846
+ triggerChange(next.values);
1847
+ onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(getTriggerValue(next.values));
1848
+ setKeyboardValue(next.value);
1849
+ }
1850
+ };
1851
+ React__namespace.useEffect(function () {
1852
+ if (keyboardValue !== null) {
1853
+ var valueIndex = rawValues.indexOf(keyboardValue);
1854
+ if (valueIndex >= 0) {
1855
+ handlesRef.current.focus(valueIndex);
1856
+ }
1857
+ }
1858
+ setKeyboardValue(null);
1859
+ }, [keyboardValue]);
1860
+ // ============================= Drag =============================
1861
+ var mergedDraggableTrack = React__namespace.useMemo(function () {
1862
+ if (draggableTrack && mergedStep === null) {
1863
+ if (process.env.NODE_ENV !== 'production') {
1864
+ warningOnce(false, '`draggableTrack` is not supported when `step` is `null`.');
1865
+ }
1866
+ return false;
1867
+ }
1868
+ return draggableTrack;
1869
+ }, [draggableTrack, mergedStep]);
1870
+ var finishChange = function finishChange() {
1871
+ onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(getTriggerValue(rawValuesRef.current));
1872
+ };
1873
+ var _useDrag = useDrag(containerRef, direction, rawValues, mergedMin, mergedMax, formatValue, triggerChange, finishChange, offsetValues),
1874
+ _useDrag2 = objectWithoutProperties._slicedToArray(_useDrag, 4),
1875
+ draggingIndex = _useDrag2[0],
1876
+ draggingValue = _useDrag2[1],
1877
+ cacheValues = _useDrag2[2],
1878
+ onStartDrag = _useDrag2[3];
1879
+ var onStartMove = function onStartMove(e, valueIndex) {
1880
+ onStartDrag(e, valueIndex);
1881
+ onBeforeChange === null || onBeforeChange === void 0 ? void 0 : onBeforeChange(getTriggerValue(rawValuesRef.current));
1882
+ };
1883
+ // Auto focus for updated handle
1884
+ var dragging = draggingIndex !== -1;
1885
+ React__namespace.useEffect(function () {
1886
+ if (!dragging) {
1887
+ var valueIndex = rawValues.lastIndexOf(draggingValue);
1888
+ handlesRef.current.focus(valueIndex);
1889
+ }
1890
+ }, [dragging]);
1891
+ // =========================== Included ===========================
1892
+ var sortedCacheValues = React__namespace.useMemo(function () {
1893
+ return objectWithoutProperties._toConsumableArray(cacheValues).sort(function (a, b) {
1894
+ return a - b;
1895
+ });
1896
+ }, [cacheValues]);
1897
+ // Provide a range values with included [min, max]
1898
+ // Used for Track, Mark & Dot
1899
+ var _React$useMemo = React__namespace.useMemo(function () {
1900
+ if (!range) {
1901
+ return [mergedMin, sortedCacheValues[0]];
1902
+ }
1903
+ return [sortedCacheValues[0], sortedCacheValues[sortedCacheValues.length - 1]];
1904
+ }, [sortedCacheValues, range, mergedMin]),
1905
+ _React$useMemo2 = objectWithoutProperties._slicedToArray(_React$useMemo, 2),
1906
+ includedStart = _React$useMemo2[0],
1907
+ includedEnd = _React$useMemo2[1];
1908
+ // ============================= Refs =============================
1909
+ React__namespace.useImperativeHandle(ref, function () {
1910
+ return {
1911
+ focus: function focus() {
1912
+ handlesRef.current.focus(0);
1913
+ },
1914
+ blur: function blur() {
1915
+ var _document = document,
1916
+ activeElement = _document.activeElement;
1917
+ if (containerRef.current.contains(activeElement)) {
1918
+ activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur();
1919
+ }
1920
+ }
1921
+ };
1922
+ });
1923
+ // ========================== Auto Focus ==========================
1924
+ React__namespace.useEffect(function () {
1925
+ if (autoFocus) {
1926
+ handlesRef.current.focus(0);
1927
+ }
1928
+ }, []);
1929
+ // =========================== Context ============================
1930
+ var context = React__namespace.useMemo(function () {
1931
+ return {
1932
+ min: mergedMin,
1933
+ max: mergedMax,
1934
+ direction: direction,
1935
+ disabled: disabled,
1936
+ keyboard: keyboard,
1937
+ step: mergedStep,
1938
+ included: included,
1939
+ includedStart: includedStart,
1940
+ includedEnd: includedEnd,
1941
+ range: range,
1942
+ tabIndex: tabIndex,
1943
+ ariaLabelForHandle: ariaLabelForHandle,
1944
+ ariaLabelledByForHandle: ariaLabelledByForHandle,
1945
+ ariaValueTextFormatterForHandle: ariaValueTextFormatterForHandle
1946
+ };
1947
+ }, [mergedMin, mergedMax, direction, disabled, keyboard, mergedStep, included, includedStart, includedEnd, range, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaValueTextFormatterForHandle]);
1948
+ // ============================ Render ============================
1949
+ return /*#__PURE__*/React__namespace.createElement(SliderContext.Provider, {
1950
+ value: context
1951
+ }, /*#__PURE__*/React__namespace.createElement("div", {
1952
+ ref: containerRef,
1953
+ className: classNames(prefixCls, className, (_classNames = {}, objectWithoutProperties._defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), objectWithoutProperties._defineProperty(_classNames, "".concat(prefixCls, "-vertical"), vertical), objectWithoutProperties._defineProperty(_classNames, "".concat(prefixCls, "-horizontal"), !vertical), objectWithoutProperties._defineProperty(_classNames, "".concat(prefixCls, "-with-marks"), markList.length), _classNames)),
1954
+ style: style,
1955
+ onMouseDown: onSliderMouseDown
1956
+ }, /*#__PURE__*/React__namespace.createElement("div", {
1957
+ className: "".concat(prefixCls, "-rail"),
1958
+ style: railStyle
1959
+ }), /*#__PURE__*/React__namespace.createElement(Tracks, {
1960
+ prefixCls: prefixCls,
1961
+ style: trackStyle,
1962
+ values: sortedCacheValues,
1963
+ startPoint: startPoint,
1964
+ onStartMove: mergedDraggableTrack ? onStartMove : null
1965
+ }), /*#__PURE__*/React__namespace.createElement(Steps, {
1966
+ prefixCls: prefixCls,
1967
+ marks: markList,
1968
+ dots: dots,
1969
+ style: dotStyle,
1970
+ activeStyle: activeDotStyle
1971
+ }), /*#__PURE__*/React__namespace.createElement(Handles, {
1972
+ ref: handlesRef,
1973
+ prefixCls: prefixCls,
1974
+ style: handleStyle,
1975
+ values: cacheValues,
1976
+ draggingIndex: draggingIndex,
1977
+ onStartMove: onStartMove,
1978
+ onOffsetChange: onHandleOffsetChange,
1979
+ onFocus: onFocus,
1980
+ onBlur: onBlur,
1981
+ handleRender: handleRender
1982
+ }), /*#__PURE__*/React__namespace.createElement(Marks, {
1983
+ prefixCls: prefixCls,
1984
+ marks: markList,
1985
+ onClick: changeToCloseValue
1986
+ })));
1987
+ });
1988
+ if (process.env.NODE_ENV !== 'production') {
1989
+ Slider.displayName = 'Slider';
1990
+ }
1991
+
1992
+ function RangeSlider(props) {
1993
+ var after = props.after,
1994
+ before = props.before,
1995
+ children = props.children,
1996
+ className = props.className,
1997
+ set = props.set,
1998
+ disabled = props.disabled,
1999
+ min = props.min,
2000
+ max = props.max,
2001
+ pushable = props.pushable,
2002
+ range = props.range,
2003
+ vertical = props.vertical,
2004
+ value = props.value,
2005
+ onChangeSlider = props.onChangeSlider;
2006
+ var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2007
+ prefix: 'fill_',
2008
+ propsKey: 'fill'
2009
+ });
2010
+ var trackFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2011
+ prefix: 'range-slider-track-fill_',
2012
+ propsKey: 'fillTrack'
2013
+ });
2014
+ var railFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2015
+ prefix: 'range-slider-rail-fill_',
2016
+ propsKey: 'fillRail'
2017
+ });
2018
+ var handleFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2019
+ prefix: 'range-slider-handle-fill_',
2020
+ propsKey: 'fillHandle'
2021
+ });
2022
+ var handleFillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2023
+ prefix: 'range-slider-handle-fill-hover_',
2024
+ propsKey: 'fillHandleHover'
2025
+ });
2026
+ var handleDraggingFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2027
+ prefix: 'range-slider-handle-dragging-fill_',
2028
+ propsKey: 'fillHandleDragging'
2029
+ });
2030
+ var handleDraggingFillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2031
+ prefix: 'range-slider-handle-dragging-fill-hover_',
2032
+ propsKey: 'fillHandleDraggingHover'
2033
+ });
2034
+ var shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2035
+ prefix: 'filter_shape_',
2036
+ propsKey: 'shape'
2037
+ });
2038
+ var widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
2039
+ prefix: 'width_',
2040
+ propsKey: 'width'
2041
+ });
2042
+ var _useStyles = useStyles.useStyles(props),
2043
+ rangeSliderStyles = _useStyles.styles;
2044
+ return /*#__PURE__*/React__namespace.default.createElement("div", {
2045
+ className: clsx__default.default(className, 'range-slider', set && "range-slider_set_" + set, fillClass, trackFillClass, railFillClass, handleFillClass, handleFillHoverClass, handleDraggingFillClass, handleDraggingFillHoverClass, shapeClass, widthClass),
2046
+ style: rangeSliderStyles
2047
+ }, before && /*#__PURE__*/React__namespace.default.createElement("div", {
2048
+ className: "range-slider__before"
2049
+ }, before), /*#__PURE__*/React__namespace.default.createElement(Slider, {
2050
+ className: "range-slider__wrapper",
2051
+ disabled: disabled,
2052
+ min: min,
2053
+ max: max,
2054
+ pushable: pushable,
2055
+ range: range,
2056
+ vertical: vertical,
2057
+ value: value,
2058
+ onChange: onChangeSlider
2059
+ }), children, after && /*#__PURE__*/React__namespace.default.createElement("div", {
2060
+ className: "range-slider__after"
2061
+ }, after));
2062
+ }
2063
+ RangeSlider.propTypes = {
2064
+ after: PropTypes__default.default.any,
2065
+ before: PropTypes__default.default.any,
2066
+ children: PropTypes__default.default.any,
2067
+ className: PropTypes__default.default.string,
2068
+ desc: PropTypes__default.default.string,
2069
+ descSize: PropTypes__default.default.string,
2070
+ descTextColor: PropTypes__default.default.string,
2071
+ fill: PropTypes__default.default.oneOf(fill.default),
2072
+ fillDesktop: PropTypes__default.default.oneOf(fill.default),
2073
+ fillMobile: PropTypes__default.default.oneOf(fill.default),
2074
+ fillTablet: PropTypes__default.default.oneOf(fill.default),
2075
+ set: PropTypes__default.default.string,
2076
+ shape: PropTypes__default.default.oneOf(shape.default),
2077
+ shapeDesktop: PropTypes__default.default.oneOf(shape.default),
2078
+ shapeMobile: PropTypes__default.default.oneOf(shape.default),
2079
+ shapeTablet: PropTypes__default.default.oneOf(shape.default),
2080
+ width: PropTypes__default.default.oneOf(width.default),
2081
+ widthDesktop: PropTypes__default.default.oneOf(width.default),
2082
+ widthMobile: PropTypes__default.default.oneOf(width.default),
2083
+ widthTablet: PropTypes__default.default.oneOf(width.default)
2084
+ };
2085
+
2086
+ exports.RangeSlider = RangeSlider;