@prom-ui/core 1.3.1 → 1.4.0

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/Avatar/cjs/index.development.js +99 -67
  2. package/Avatar/cjs/index.development.v2.js +99 -67
  3. package/Avatar/cjs/index.production.js +1 -1
  4. package/Avatar/cjs/index.production.v2.js +1 -1
  5. package/Avatar/index.d.ts +14 -14
  6. package/Avatar/package.json +1 -1
  7. package/Avatar/utils.d.ts +2 -2
  8. package/Backdrop/cjs/index.development.js +131 -77
  9. package/Backdrop/cjs/index.development.v2.js +131 -77
  10. package/Backdrop/cjs/index.production.js +1 -1
  11. package/Backdrop/cjs/index.production.v2.js +1 -1
  12. package/Backdrop/index.d.ts +25 -25
  13. package/Backdrop/package.json +1 -1
  14. package/Body/cjs/index.development.js +2 -0
  15. package/Body/cjs/index.development.v2.js +2 -0
  16. package/Body/index.d.ts +36 -36
  17. package/Body/package.json +1 -1
  18. package/BodyContext/cjs/index.development.js +6 -7
  19. package/BodyContext/cjs/index.development.v2.js +6 -7
  20. package/BodyContext/cjs/index.production.js +1 -1
  21. package/BodyContext/cjs/index.production.v2.js +1 -1
  22. package/BodyContext/index.d.ts +12 -12
  23. package/BodyContext/package.json +1 -1
  24. package/BodyProvider/cjs/index.development.js +7 -6
  25. package/BodyProvider/cjs/index.development.v2.js +7 -6
  26. package/BodyProvider/index.d.ts +10 -10
  27. package/BodyProvider/package.json +1 -1
  28. package/Box/cjs/index.development.js +4 -4
  29. package/Box/cjs/index.development.v2.js +4 -4
  30. package/Box/index.d.ts +106 -106
  31. package/Box/package.json +1 -1
  32. package/Button/cjs/index.development.js +67 -62
  33. package/Button/cjs/index.development.v2.js +67 -62
  34. package/Button/cjs/index.production.js +1 -1
  35. package/Button/cjs/index.production.v2.js +1 -1
  36. package/Button/index.d.ts +45 -45
  37. package/Button/package.json +1 -1
  38. package/ButtonPageUp/cjs/index.development.js +195 -85
  39. package/ButtonPageUp/cjs/index.development.v2.js +195 -85
  40. package/ButtonPageUp/cjs/index.production.js +1 -1
  41. package/ButtonPageUp/cjs/index.production.v2.js +1 -1
  42. package/ButtonPageUp/index.d.ts +18 -18
  43. package/ButtonPageUp/package.json +1 -1
  44. package/Checkbox/cjs/index.development.js +99 -67
  45. package/Checkbox/cjs/index.development.v2.js +99 -67
  46. package/Checkbox/cjs/index.production.js +1 -1
  47. package/Checkbox/cjs/index.production.v2.js +1 -1
  48. package/Checkbox/index.d.ts +8 -8
  49. package/Checkbox/package.json +1 -1
  50. package/Flex/index.d.ts +34 -34
  51. package/Flex/package.json +1 -1
  52. package/Grid/index.d.ts +46 -46
  53. package/Grid/package.json +1 -1
  54. package/Icon/index.d.ts +9 -9
  55. package/Icon/package.json +1 -1
  56. package/Image/index.d.ts +42 -42
  57. package/Image/package.json +1 -1
  58. package/ImageEmoji/cjs/index.development.js +70 -63
  59. package/ImageEmoji/cjs/index.development.v2.js +70 -63
  60. package/ImageEmoji/cjs/index.production.js +1 -1
  61. package/ImageEmoji/cjs/index.production.v2.js +1 -1
  62. package/ImageEmoji/index.d.ts +9 -9
  63. package/ImageEmoji/package.json +1 -1
  64. package/Input/index.d.ts +18 -18
  65. package/Input/package.json +1 -1
  66. package/InputField/addons/AfterClearValue.d.ts +3 -3
  67. package/InputField/addons/AfterCorrectValue.d.ts +2 -2
  68. package/InputField/addons/AfterLoading.d.ts +2 -2
  69. package/InputField/addons/AfterTogglePassword.d.ts +6 -6
  70. package/InputField/addons/ErrorText.d.ts +6 -6
  71. package/InputField/cjs/index.development.js +237 -173
  72. package/InputField/cjs/index.development.v2.js +237 -173
  73. package/InputField/cjs/index.production.js +1 -1
  74. package/InputField/cjs/index.production.v2.js +1 -1
  75. package/InputField/index.d.ts +18 -18
  76. package/InputField/package.json +1 -1
  77. package/InputField/utils.d.ts +10 -10
  78. package/KeyPress/cjs/index.development.js +13 -13
  79. package/KeyPress/cjs/index.development.v2.js +13 -13
  80. package/KeyPress/index.d.ts +14 -14
  81. package/KeyPress/package.json +1 -1
  82. package/Line/index.d.ts +13 -13
  83. package/Line/package.json +1 -1
  84. package/Link/cjs/index.development.js +5 -5
  85. package/Link/cjs/index.development.v2.js +5 -5
  86. package/Link/index.d.ts +28 -28
  87. package/Link/package.json +1 -1
  88. package/List/index.d.ts +23 -23
  89. package/List/package.json +1 -1
  90. package/Media/MediaProvider.d.ts +8 -8
  91. package/Media/cjs/index.development.js +70 -19
  92. package/Media/cjs/index.development.v2.js +70 -19
  93. package/Media/cjs/index.production.js +1 -1
  94. package/Media/cjs/index.production.v2.js +1 -1
  95. package/Media/index.d.ts +20 -20
  96. package/Media/package.json +1 -1
  97. package/OutsideClick/cjs/index.development.js +117 -61
  98. package/OutsideClick/cjs/index.development.v2.js +117 -61
  99. package/OutsideClick/cjs/index.production.js +1 -1
  100. package/OutsideClick/cjs/index.production.v2.js +1 -1
  101. package/OutsideClick/index.d.ts +12 -12
  102. package/OutsideClick/package.json +1 -1
  103. package/Overlay/cjs/index.development.js +197 -183
  104. package/Overlay/cjs/index.development.v2.js +197 -183
  105. package/Overlay/cjs/index.production.js +1 -1
  106. package/Overlay/cjs/index.production.v2.js +1 -1
  107. package/Overlay/components/OverlayHeader.d.ts +11 -11
  108. package/Overlay/components/SwipeClose.d.ts +11 -11
  109. package/Overlay/components/TouchScrollable.d.ts +8 -8
  110. package/Overlay/index.d.ts +76 -76
  111. package/Overlay/package.json +1 -1
  112. package/Overlay/utils.d.ts +10 -10
  113. package/Picture/index.d.ts +70 -70
  114. package/Picture/package.json +1 -1
  115. package/Portal/cjs/index.development.js +11 -11
  116. package/Portal/cjs/index.development.v2.js +11 -11
  117. package/Portal/index.d.ts +10 -10
  118. package/Portal/package.json +1 -1
  119. package/QRCode/cjs/index.development.js +11 -11
  120. package/QRCode/cjs/index.development.v2.js +11 -11
  121. package/QRCode/index.d.ts +17 -17
  122. package/QRCode/package.json +1 -1
  123. package/Rating/cjs/index.development.js +75 -69
  124. package/Rating/cjs/index.development.v2.js +75 -69
  125. package/Rating/cjs/index.production.js +1 -1
  126. package/Rating/cjs/index.production.v2.js +1 -1
  127. package/Rating/index.d.ts +17 -17
  128. package/Rating/package.json +1 -1
  129. package/RatingSelect/cjs/index.development.js +148 -68
  130. package/RatingSelect/cjs/index.development.v2.js +148 -68
  131. package/RatingSelect/cjs/index.production.js +1 -1
  132. package/RatingSelect/cjs/index.production.v2.js +1 -1
  133. package/RatingSelect/index.d.ts +22 -18
  134. package/RatingSelect/package.json +1 -1
  135. package/SafeQuery/cjs/index.development.js +158 -110
  136. package/SafeQuery/cjs/index.development.v2.js +158 -110
  137. package/SafeQuery/cjs/index.production.js +1 -1
  138. package/SafeQuery/cjs/index.production.v2.js +1 -1
  139. package/SafeQuery/components/Error.d.ts +7 -7
  140. package/SafeQuery/index.d.ts +10 -10
  141. package/SafeQuery/package.json +1 -1
  142. package/Scroll/index.d.ts +25 -25
  143. package/Scroll/package.json +1 -1
  144. package/ScrollControls/ScrollControlsButton.d.ts +11 -11
  145. package/ScrollControls/cjs/index.development.js +201 -113
  146. package/ScrollControls/cjs/index.development.v2.js +201 -113
  147. package/ScrollControls/cjs/index.production.js +1 -1
  148. package/ScrollControls/cjs/index.production.v2.js +1 -1
  149. package/ScrollControls/index.d.ts +16 -16
  150. package/ScrollControls/package.json +1 -1
  151. package/SimpleSlider/cjs/index.development.js +270 -158
  152. package/SimpleSlider/cjs/index.development.v2.js +270 -158
  153. package/SimpleSlider/cjs/index.production.js +1 -1
  154. package/SimpleSlider/cjs/index.production.v2.js +1 -1
  155. package/SimpleSlider/index.d.ts +41 -41
  156. package/SimpleSlider/package.json +1 -1
  157. package/SimpleSlider/useAutoPlay.d.ts +3 -3
  158. package/SimpleSlider/utils.d.ts +19 -19
  159. package/Skeleton/cjs/index.development.js +118 -64
  160. package/Skeleton/cjs/index.development.v2.js +118 -64
  161. package/Skeleton/cjs/index.production.js +1 -1
  162. package/Skeleton/cjs/index.production.v2.js +1 -1
  163. package/Skeleton/index.d.ts +37 -37
  164. package/Skeleton/package.json +1 -1
  165. package/Spinner/cjs/index.development.js +66 -61
  166. package/Spinner/cjs/index.development.v2.js +66 -61
  167. package/Spinner/cjs/index.production.js +1 -1
  168. package/Spinner/cjs/index.production.v2.js +1 -1
  169. package/Spinner/index.d.ts +29 -29
  170. package/Spinner/package.json +1 -1
  171. package/Text/index.d.ts +25 -25
  172. package/Text/package.json +1 -1
  173. package/TextEmoji/cjs/index.development.js +65 -60
  174. package/TextEmoji/cjs/index.development.v2.js +65 -60
  175. package/TextEmoji/cjs/index.production.js +1 -1
  176. package/TextEmoji/cjs/index.production.v2.js +1 -1
  177. package/TextEmoji/index.d.ts +9 -9
  178. package/TextEmoji/package.json +1 -1
  179. package/Tooltip/cjs/index.development.js +80 -91
  180. package/Tooltip/cjs/index.development.v2.js +80 -91
  181. package/Tooltip/cjs/index.production.js +1 -1
  182. package/Tooltip/cjs/index.production.v2.js +1 -1
  183. package/Tooltip/index.d.ts +87 -87
  184. package/Tooltip/package.json +1 -1
  185. package/Tumbler/cjs/index.development.js +98 -66
  186. package/Tumbler/cjs/index.development.v2.js +98 -66
  187. package/Tumbler/cjs/index.production.js +1 -1
  188. package/Tumbler/cjs/index.production.v2.js +1 -1
  189. package/Tumbler/index.d.ts +8 -8
  190. package/Tumbler/package.json +1 -1
  191. package/package.json +7 -5
  192. package/useBodyTTag/cjs/index.development.js +1 -1
  193. package/useBodyTTag/cjs/index.development.v2.js +1 -1
  194. package/useBodyTTag/index.d.ts +2 -2
  195. package/useBodyTTag/package.json +1 -1
  196. package/useDebounce/cjs/index.development.js +58 -6
  197. package/useDebounce/cjs/index.development.v2.js +58 -6
  198. package/useDebounce/cjs/index.production.js +1 -1
  199. package/useDebounce/cjs/index.production.v2.js +1 -1
  200. package/useDebounce/index.d.ts +4 -4
  201. package/useDebounce/package.json +1 -1
  202. package/useId/cjs/index.development.js +6 -7
  203. package/useId/cjs/index.development.v2.js +6 -7
  204. package/useId/cjs/index.production.js +1 -1
  205. package/useId/cjs/index.production.v2.js +1 -1
  206. package/useId/index.d.ts +4 -4
  207. package/useId/package.json +1 -1
  208. package/useIsMounted/cjs/index.development.js +3 -3
  209. package/useIsMounted/cjs/index.development.v2.js +3 -3
  210. package/useIsMounted/index.d.ts +4 -4
  211. package/useIsMounted/package.json +1 -1
  212. package/useKeyPress/cjs/index.development.js +76 -22
  213. package/useKeyPress/cjs/index.development.v2.js +76 -22
  214. package/useKeyPress/cjs/index.production.js +1 -1
  215. package/useKeyPress/cjs/index.production.v2.js +1 -1
  216. package/useKeyPress/index.d.ts +6 -6
  217. package/useKeyPress/package.json +1 -1
  218. package/useMedia/cjs/index.development.js +5 -5
  219. package/useMedia/cjs/index.development.v2.js +5 -5
  220. package/useMedia/index.d.ts +21 -21
  221. package/useMedia/package.json +1 -1
  222. package/useOutsideClick/cjs/index.development.js +2 -2
  223. package/useOutsideClick/cjs/index.development.v2.js +2 -2
  224. package/useOutsideClick/index.d.ts +5 -5
  225. package/useOutsideClick/package.json +1 -1
  226. package/usePortal/cjs/index.development.js +32 -27
  227. package/usePortal/cjs/index.development.v2.js +32 -27
  228. package/usePortal/index.d.ts +12 -12
  229. package/usePortal/package.json +1 -1
  230. package/useScrollPosition/cjs/index.development.js +2 -2
  231. package/useScrollPosition/cjs/index.development.v2.js +2 -2
  232. package/useScrollPosition/index.d.ts +5 -5
  233. package/useScrollPosition/package.json +1 -1
@@ -14,111 +14,218 @@ var Right = require('@prom-ui/icons/Right');
14
14
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
15
15
 
16
16
  function _interopNamespaceCompat(e) {
17
- if (e && typeof e === 'object' && 'default' in e) return e;
18
- var n = Object.create(null);
19
- if (e) {
20
- Object.keys(e).forEach(function (k) {
21
- if (k !== 'default') {
22
- var d = Object.getOwnPropertyDescriptor(e, k);
23
- Object.defineProperty(n, k, d.get ? d : {
24
- enumerable: true,
25
- get: function () { return e[k]; }
26
- });
27
- }
17
+ if (e && typeof e === 'object' && 'default' in e) return e;
18
+ var n = Object.create(null);
19
+ if (e) {
20
+ Object.keys(e).forEach(function (k) {
21
+ if (k !== 'default') {
22
+ var d = Object.getOwnPropertyDescriptor(e, k);
23
+ Object.defineProperty(n, k, d.get ? d : {
24
+ enumerable: true,
25
+ get: function () { return e[k]; }
28
26
  });
29
- }
30
- n.default = e;
31
- return Object.freeze(n);
27
+ }
28
+ });
29
+ }
30
+ n.default = e;
31
+ return Object.freeze(n);
32
32
  }
33
33
 
34
34
  var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
35
35
  var Swipe__default = /*#__PURE__*/_interopDefaultCompat(Swipe);
36
36
  var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
37
37
 
38
- /******************************************************************************
39
- Copyright (c) Microsoft Corporation.
40
-
41
- Permission to use, copy, modify, and/or distribute this software for any
42
- purpose with or without fee is hereby granted.
43
-
44
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
45
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
46
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
47
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
48
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
49
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
50
- PERFORMANCE OF THIS SOFTWARE.
51
- ***************************************************************************** */
52
-
53
- var __assign = function() {
54
- __assign = Object.assign || function __assign(t) {
55
- for (var s, i = 1, n = arguments.length; i < n; i++) {
56
- s = arguments[i];
57
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
58
- }
59
- return t;
60
- };
61
- return __assign.apply(this, arguments);
62
- };
63
-
64
- function __rest(s, e) {
65
- var t = {};
66
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
67
- t[p] = s[p];
68
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
69
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
70
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
71
- t[p[i]] = s[p[i]];
72
- }
73
- return t;
74
- }
75
-
76
- function __makeTemplateObject(cooked, raw) {
77
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
78
- return cooked;
38
+ function _iterableToArrayLimit(arr, i) {
39
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
40
+ if (null != _i) {
41
+ var _s,
42
+ _e,
43
+ _x,
44
+ _r,
45
+ _arr = [],
46
+ _n = !0,
47
+ _d = !1;
48
+ try {
49
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
50
+ if (Object(_i) !== _i) return;
51
+ _n = !1;
52
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
53
+ } catch (err) {
54
+ _d = !0, _e = err;
55
+ } finally {
56
+ try {
57
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
58
+ } finally {
59
+ if (_d) throw _e;
60
+ }
61
+ }
62
+ return _arr;
63
+ }
64
+ }
65
+ function ownKeys(object, enumerableOnly) {
66
+ var keys = Object.keys(object);
67
+ if (Object.getOwnPropertySymbols) {
68
+ var symbols = Object.getOwnPropertySymbols(object);
69
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
70
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
71
+ })), keys.push.apply(keys, symbols);
72
+ }
73
+ return keys;
74
+ }
75
+ function _objectSpread2(target) {
76
+ for (var i = 1; i < arguments.length; i++) {
77
+ var source = null != arguments[i] ? arguments[i] : {};
78
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
79
+ _defineProperty(target, key, source[key]);
80
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
81
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
82
+ });
83
+ }
84
+ return target;
85
+ }
86
+ function _defineProperty(obj, key, value) {
87
+ key = _toPropertyKey(key);
88
+ if (key in obj) {
89
+ Object.defineProperty(obj, key, {
90
+ value: value,
91
+ enumerable: true,
92
+ configurable: true,
93
+ writable: true
94
+ });
95
+ } else {
96
+ obj[key] = value;
97
+ }
98
+ return obj;
99
+ }
100
+ function _extends() {
101
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
102
+ for (var i = 1; i < arguments.length; i++) {
103
+ var source = arguments[i];
104
+ for (var key in source) {
105
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
106
+ target[key] = source[key];
107
+ }
108
+ }
109
+ }
110
+ return target;
111
+ };
112
+ return _extends.apply(this, arguments);
113
+ }
114
+ function _objectWithoutPropertiesLoose(source, excluded) {
115
+ if (source == null) return {};
116
+ var target = {};
117
+ var sourceKeys = Object.keys(source);
118
+ var key, i;
119
+ for (i = 0; i < sourceKeys.length; i++) {
120
+ key = sourceKeys[i];
121
+ if (excluded.indexOf(key) >= 0) continue;
122
+ target[key] = source[key];
123
+ }
124
+ return target;
125
+ }
126
+ function _objectWithoutProperties(source, excluded) {
127
+ if (source == null) return {};
128
+ var target = _objectWithoutPropertiesLoose(source, excluded);
129
+ var key, i;
130
+ if (Object.getOwnPropertySymbols) {
131
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
132
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
133
+ key = sourceSymbolKeys[i];
134
+ if (excluded.indexOf(key) >= 0) continue;
135
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
136
+ target[key] = source[key];
137
+ }
138
+ }
139
+ return target;
140
+ }
141
+ function _taggedTemplateLiteral(strings, raw) {
142
+ if (!raw) {
143
+ raw = strings.slice(0);
144
+ }
145
+ return Object.freeze(Object.defineProperties(strings, {
146
+ raw: {
147
+ value: Object.freeze(raw)
148
+ }
149
+ }));
150
+ }
151
+ function _slicedToArray(arr, i) {
152
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
153
+ }
154
+ function _arrayWithHoles(arr) {
155
+ if (Array.isArray(arr)) return arr;
156
+ }
157
+ function _unsupportedIterableToArray(o, minLen) {
158
+ if (!o) return;
159
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
160
+ var n = Object.prototype.toString.call(o).slice(8, -1);
161
+ if (n === "Object" && o.constructor) n = o.constructor.name;
162
+ if (n === "Map" || n === "Set") return Array.from(o);
163
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
164
+ }
165
+ function _arrayLikeToArray(arr, len) {
166
+ if (len == null || len > arr.length) len = arr.length;
167
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
168
+ return arr2;
169
+ }
170
+ function _nonIterableRest() {
171
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
172
+ }
173
+ function _toPrimitive(input, hint) {
174
+ if (typeof input !== "object" || input === null) return input;
175
+ var prim = input[Symbol.toPrimitive];
176
+ if (prim !== undefined) {
177
+ var res = prim.call(input, hint || "default");
178
+ if (typeof res !== "object") return res;
179
+ throw new TypeError("@@toPrimitive must return a primitive value.");
180
+ }
181
+ return (hint === "string" ? String : Number)(input);
182
+ }
183
+ function _toPropertyKey(arg) {
184
+ var key = _toPrimitive(arg, "string");
185
+ return typeof key === "symbol" ? key : String(key);
79
186
  }
80
187
 
81
- var useAutoPlay = function (callback, delay) {
188
+ var useAutoPlay = function useAutoPlay(callback, delay) {
82
189
  var timeout = React.useRef(null);
83
- var stop = function () {
190
+ var stop = function stop() {
84
191
  clearTimeout(timeout.current);
85
192
  };
86
- var start = function () {
193
+ var start = function start() {
87
194
  stop();
88
195
  timeout.current = setTimeout(callback, delay);
89
196
  };
90
197
  return [start, stop];
91
198
  };
92
199
 
93
- var isValidRatio = function (ratio) {
200
+ var isValidRatio = function isValidRatio(ratio) {
94
201
  return !!ratio && /\d\/\d/.test(ratio);
95
202
  };
96
- var getInfiniteIndex = function (index, count) {
203
+ var getInfiniteIndex = function getInfiniteIndex(index, count) {
97
204
  return Math.abs((index % count + count) % count);
98
205
  };
99
- var getRatioHolderStyle = function (ratio) {
206
+ var getRatioHolderStyle = function getRatioHolderStyle(ratio) {
100
207
  return {
101
208
  paddingTop: "calc(".concat(ratio.split('/').reverse().join('/'), " * 100%)")
102
209
  };
103
210
  };
104
- var getRootStyle = function (_a) {
105
- var width = _a.width,
106
- height = _a.height,
107
- ratio = _a.ratio,
108
- style = _a.style;
211
+ var getRootStyle = function getRootStyle(_ref) {
212
+ var width = _ref.width,
213
+ height = _ref.height,
214
+ ratio = _ref.ratio,
215
+ style = _ref.style;
109
216
  var hasRatio = isValidRatio(ratio);
110
- return __assign({
217
+ return _objectSpread2({
111
218
  width: width,
112
219
  height: hasRatio ? 'auto' : height,
113
220
  maxWidth: hasRatio ? '100%' : 'none',
114
221
  aspectRatio: hasRatio ? ratio : undefined
115
222
  }, style);
116
223
  };
117
- var getTrackStyle = function (_a) {
118
- var index = _a.index,
119
- childrenCount = _a.childrenCount,
120
- duration = _a.duration,
121
- offset = _a.offset;
224
+ var getTrackStyle = function getTrackStyle(_ref2) {
225
+ var index = _ref2.index,
226
+ childrenCount = _ref2.childrenCount,
227
+ duration = _ref2.duration,
228
+ offset = _ref2.offset;
122
229
  var hasOffset = typeof offset === 'number';
123
230
  var currentOffset = hasOffset ? offset : 0;
124
231
  return {
@@ -131,48 +238,53 @@ var getTrackStyle = function (_a) {
131
238
 
132
239
  var css = {"root":"SimpleSlider__root___WuTIM","track":"SimpleSlider__track___G8BYu","trackItem":"SimpleSlider__trackItem___94Eq7","resetButton":"SimpleSlider__resetButton___LXJjI","buttonCommon":"SimpleSlider__buttonCommon___I5yQD SimpleSlider__resetButton___LXJjI","buttonPrev":"SimpleSlider__buttonPrev___UqTOk SimpleSlider__buttonCommon___I5yQD SimpleSlider__resetButton___LXJjI","buttonNext":"SimpleSlider__buttonNext___BbLNv SimpleSlider__buttonCommon___I5yQD SimpleSlider__resetButton___LXJjI","buttonIcon":"SimpleSlider__buttonIcon___89h6n","dots":"SimpleSlider__dots___E7g4J","dotsTransparent":"SimpleSlider__dotsTransparent___v-ZWk","dotsItem":"SimpleSlider__dotsItem___cbWCu","dotsButton":"SimpleSlider__dotsButton___7N4yb SimpleSlider__resetButton___LXJjI","showOnHoverButtons":"SimpleSlider__showOnHoverButtons___yssoj","showOnHoverDots":"SimpleSlider__showOnHoverDots___ig5DV"};
133
240
 
134
- var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
135
- var _b, _c;
136
- var _d = _a.showIndex,
137
- showIndex = _d === void 0 ? 0 : _d,
138
- _e = _a.autoPlay,
139
- autoPlay = _e === void 0 ? 0 : _e,
140
- children = _a.children,
141
- className = _a.className,
142
- _f = _a.duration,
143
- duration = _f === void 0 ? 500 : _f,
144
- height = _a.height,
145
- _g = _a.infinite,
146
- infinite = _g === void 0 ? false : _g,
147
- ratio = _a.ratio,
148
- style = _a.style,
149
- width = _a.width,
150
- onChangeIndex = _a.onChangeIndex,
151
- onClickDot = _a.onClickDot,
152
- onClickItem = _a.onClickItem,
153
- onClickButtonNext = _a.onClickButtonNext,
154
- onClickButtonPrev = _a.onClickButtonPrev,
155
- onSwipeNext = _a.onSwipeNext,
156
- onSwipePrev = _a.onSwipePrev,
157
- _h = _a.showOnHoverButtons,
158
- showOnHoverButtons = _h === void 0 ? false : _h,
159
- _j = _a.showOnHoverDots,
160
- showOnHoverDots = _j === void 0 ? false : _j,
161
- _k = _a.isDotsTransparent,
162
- isDotsTransparent = _k === void 0 ? false : _k,
163
- props = __rest(_a, ["showIndex", "autoPlay", "children", "className", "duration", "height", "infinite", "ratio", "style", "width", "onChangeIndex", "onClickDot", "onClickItem", "onClickButtonNext", "onClickButtonPrev", "onSwipeNext", "onSwipePrev", "showOnHoverButtons", "showOnHoverDots", "isDotsTransparent"]);
164
- var t = useBodyTTag.useBodyTTag().t;
241
+ var _templateObject, _templateObject2, _templateObject3;
242
+ var _excluded = ["showIndex", "autoPlay", "children", "className", "duration", "height", "infinite", "ratio", "style", "width", "onChangeIndex", "onClickDot", "onClickItem", "onClickButtonNext", "onClickButtonPrev", "onSwipeNext", "onSwipePrev", "showOnHoverButtons", "showOnHoverDots", "isDotsTransparent"];
243
+ var SimpleSlider = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
244
+ var _classNames;
245
+ var _ref$showIndex = _ref.showIndex,
246
+ showIndex = _ref$showIndex === void 0 ? 0 : _ref$showIndex,
247
+ _ref$autoPlay = _ref.autoPlay,
248
+ autoPlay = _ref$autoPlay === void 0 ? 0 : _ref$autoPlay,
249
+ children = _ref.children,
250
+ className = _ref.className,
251
+ _ref$duration = _ref.duration,
252
+ duration = _ref$duration === void 0 ? 500 : _ref$duration,
253
+ height = _ref.height,
254
+ _ref$infinite = _ref.infinite,
255
+ infinite = _ref$infinite === void 0 ? false : _ref$infinite,
256
+ ratio = _ref.ratio,
257
+ style = _ref.style,
258
+ width = _ref.width,
259
+ onChangeIndex = _ref.onChangeIndex,
260
+ onClickDot = _ref.onClickDot,
261
+ onClickItem = _ref.onClickItem,
262
+ onClickButtonNext = _ref.onClickButtonNext,
263
+ onClickButtonPrev = _ref.onClickButtonPrev,
264
+ onSwipeNext = _ref.onSwipeNext,
265
+ onSwipePrev = _ref.onSwipePrev,
266
+ _ref$showOnHoverButto = _ref.showOnHoverButtons,
267
+ showOnHoverButtons = _ref$showOnHoverButto === void 0 ? false : _ref$showOnHoverButto,
268
+ _ref$showOnHoverDots = _ref.showOnHoverDots,
269
+ showOnHoverDots = _ref$showOnHoverDots === void 0 ? false : _ref$showOnHoverDots,
270
+ _ref$isDotsTransparen = _ref.isDotsTransparent,
271
+ isDotsTransparent = _ref$isDotsTransparen === void 0 ? false : _ref$isDotsTransparen,
272
+ props = _objectWithoutProperties(_ref, _excluded);
273
+ var _useBodyTTag = useBodyTTag.useBodyTTag(),
274
+ t = _useBodyTTag.t;
165
275
  var refTrack = React__namespace.useRef(null);
166
276
  var transitionRunning = React__namespace.useRef(false);
167
- var _l = React__namespace.useState(false),
168
- disableAutoPlay = _l[0],
169
- setDisableAutoPlay = _l[1];
170
- var _m = React__namespace.useState({
277
+ var _React$useState = React__namespace.useState(false),
278
+ _React$useState2 = _slicedToArray(_React$useState, 2),
279
+ disableAutoPlay = _React$useState2[0],
280
+ setDisableAutoPlay = _React$useState2[1];
281
+ var _React$useState3 = React__namespace.useState({
171
282
  index: showIndex,
172
283
  offset: undefined
173
284
  }),
174
- position = _m[0],
175
- setPosition = _m[1];
285
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
286
+ position = _React$useState4[0],
287
+ setPosition = _React$useState4[1];
176
288
  var childrenArray = React__namespace.Children.toArray(children);
177
289
  var childrenCount = childrenArray.length;
178
290
  var isDisablePrev = !infinite && position.index === 0;
@@ -185,7 +297,7 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
185
297
  var infiniteIndex = getInfiniteIndex(position.index, childrenCount);
186
298
  var infinitePrevIndex = getInfiniteIndex(prevIndex, childrenCount);
187
299
  var infiniteNextIndex = getInfiniteIndex(nextIndex, childrenCount);
188
- var handleClickButtonNext = function () {
300
+ var handleClickButtonNext = function handleClickButtonNext() {
189
301
  if (transitionRunning.current || isDisableNext) return;
190
302
  if (typeof onClickButtonNext === 'function') {
191
303
  onClickButtonNext(infiniteNextIndex);
@@ -195,7 +307,7 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
195
307
  offset: undefined
196
308
  });
197
309
  };
198
- var handleClickButtonPrev = function () {
310
+ var handleClickButtonPrev = function handleClickButtonPrev() {
199
311
  if (transitionRunning.current || isDisablePrev) return;
200
312
  if (typeof onClickButtonPrev === 'function') {
201
313
  onClickButtonPrev(infinitePrevIndex);
@@ -205,7 +317,7 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
205
317
  offset: undefined
206
318
  });
207
319
  };
208
- var handleClickDot = function (i) {
320
+ var handleClickDot = function handleClickDot(i) {
209
321
  if (transitionRunning.current) return;
210
322
  if (typeof onClickDot === 'function') {
211
323
  onClickDot(i);
@@ -215,7 +327,7 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
215
327
  offset: undefined
216
328
  });
217
329
  };
218
- var handleSwipeNext = function () {
330
+ var handleSwipeNext = function handleSwipeNext() {
219
331
  if (transitionRunning.current || isDisableNext) return;
220
332
  if (typeof onSwipeNext === 'function') {
221
333
  onSwipeNext(infiniteNextIndex);
@@ -225,7 +337,7 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
225
337
  offset: undefined
226
338
  });
227
339
  };
228
- var handleSwipePrev = function () {
340
+ var handleSwipePrev = function handleSwipePrev() {
229
341
  if (transitionRunning.current || isDisablePrev) return;
230
342
  if (typeof onSwipePrev === 'function') {
231
343
  onSwipePrev(infinitePrevIndex);
@@ -235,8 +347,8 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
235
347
  offset: undefined
236
348
  });
237
349
  };
238
- var handleSwipeMove = function (_a, event) {
239
- var x = _a.x;
350
+ var handleSwipeMove = function handleSwipeMove(_ref2, event) {
351
+ var x = _ref2.x;
240
352
  if (transitionRunning.current || event.touches && event.touches.length > 1) return;
241
353
  var offset = x;
242
354
  if (isDisablePrev && x > 0 || isDisableNext && x < 0) {
@@ -247,20 +359,21 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
247
359
  offset: offset
248
360
  });
249
361
  };
250
- var _o = useAutoPlay(function () {
362
+ var _useAutoPlay = useAutoPlay(function () {
251
363
  if (transitionRunning.current || isDisableNext) return;
252
364
  setPosition({
253
365
  index: nextIndex,
254
366
  offset: undefined
255
367
  });
256
368
  }, autoPlay),
257
- startAutoPlay = _o[0],
258
- stopAutoPlay = _o[1];
259
- var handleTransitionStart = function () {
369
+ _useAutoPlay2 = _slicedToArray(_useAutoPlay, 2),
370
+ startAutoPlay = _useAutoPlay2[0],
371
+ stopAutoPlay = _useAutoPlay2[1];
372
+ var handleTransitionStart = function handleTransitionStart() {
260
373
  transitionRunning.current = true;
261
374
  stopAutoPlay();
262
375
  };
263
- var handleTransitionEnd = function () {
376
+ var handleTransitionEnd = function handleTransitionEnd() {
264
377
  transitionRunning.current = false;
265
378
  if (isAutoPlay) {
266
379
  startAutoPlay();
@@ -276,7 +389,7 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
276
389
  }
277
390
  };
278
391
  React__namespace.useEffect(function () {
279
- var _a, _b;
392
+ var _refTrack$current, _refTrack$current2;
280
393
  var autoPlayObserver = new IntersectionObserver(function (entries) {
281
394
  if (entries[0].isIntersecting) {
282
395
  startAutoPlay();
@@ -284,15 +397,15 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
284
397
  stopAutoPlay();
285
398
  }
286
399
  });
287
- (_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.addEventListener('transitionstart', handleTransitionStart);
288
- (_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.addEventListener('transitionend', handleTransitionEnd);
400
+ (_refTrack$current = refTrack.current) === null || _refTrack$current === void 0 ? void 0 : _refTrack$current.addEventListener('transitionstart', handleTransitionStart);
401
+ (_refTrack$current2 = refTrack.current) === null || _refTrack$current2 === void 0 ? void 0 : _refTrack$current2.addEventListener('transitionend', handleTransitionEnd);
289
402
  if (isAutoPlay && refTrack.current) {
290
403
  autoPlayObserver.observe(refTrack.current);
291
404
  }
292
405
  return function () {
293
- var _a, _b;
294
- (_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('transitionstart', handleTransitionStart);
295
- (_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('transitionend', handleTransitionEnd);
406
+ var _refTrack$current3, _refTrack$current4;
407
+ (_refTrack$current3 = refTrack.current) === null || _refTrack$current3 === void 0 ? void 0 : _refTrack$current3.removeEventListener('transitionstart', handleTransitionStart);
408
+ (_refTrack$current4 = refTrack.current) === null || _refTrack$current4 === void 0 ? void 0 : _refTrack$current4.removeEventListener('transitionend', handleTransitionEnd);
296
409
  stopAutoPlay();
297
410
  autoPlayObserver.disconnect();
298
411
  };
@@ -305,33 +418,33 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
305
418
  });
306
419
  }
307
420
  }, [showIndex]);
308
- return React__namespace.createElement(Swipe__default.default, __assign({
421
+ return /*#__PURE__*/React__namespace.createElement(Swipe__default.default, _extends({
309
422
  ref: ref,
310
423
  onSwipeLeft: handleSwipeNext,
311
424
  onSwipeRight: handleSwipePrev,
312
425
  onSwipeMove: handleSwipeMove,
313
- className: classNames__default.default(css.root, className, (_b = {}, _b[css.showOnHoverButtons] = showOnHoverButtons, _b[css.showOnHoverDots] = showOnHoverDots, _b)),
426
+ className: classNames__default.default(css.root, className, (_classNames = {}, _defineProperty(_classNames, css.showOnHoverButtons, showOnHoverButtons), _defineProperty(_classNames, css.showOnHoverDots, showOnHoverDots), _classNames)),
314
427
  style: getRootStyle({
315
428
  width: width,
316
429
  height: height,
317
430
  ratio: ratio,
318
431
  style: style
319
432
  }),
320
- onSwipeStart: function () {
433
+ onSwipeStart: function onSwipeStart() {
321
434
  return setDisableAutoPlay(true);
322
435
  },
323
- onSwipeEnd: function () {
436
+ onSwipeEnd: function onSwipeEnd() {
324
437
  return setDisableAutoPlay(false);
325
438
  },
326
- onMouseEnter: function () {
439
+ onMouseEnter: function onMouseEnter() {
327
440
  return setDisableAutoPlay(true);
328
441
  },
329
- onMouseLeave: function () {
442
+ onMouseLeave: function onMouseLeave() {
330
443
  return setDisableAutoPlay(false);
331
444
  }
332
- }, props), isValidRatio(ratio) && React__namespace.createElement("div", {
445
+ }, props), isValidRatio(ratio) && /*#__PURE__*/React__namespace.createElement("div", {
333
446
  style: getRatioHolderStyle(ratio)
334
- }), React__namespace.createElement("ul", {
447
+ }), /*#__PURE__*/React__namespace.createElement("ul", {
335
448
  ref: refTrack,
336
449
  className: css.track,
337
450
  style: getTrackStyle({
@@ -340,62 +453,61 @@ var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
340
453
  duration: duration,
341
454
  offset: position.offset
342
455
  }),
343
- "data-testid": 'simple_slider_track'
344
- }, infinite && React__namespace.createElement("li", {
456
+ "data-testid": "simple_slider_track"
457
+ }, infinite && /*#__PURE__*/React__namespace.createElement("li", {
345
458
  className: css.trackItem
346
459
  }, childrenArray[childrenArray.length - 1]), childrenArray.map(function (child, index) {
347
- return React__namespace.createElement("li", {
460
+ return /*#__PURE__*/React__namespace.createElement("li", {
348
461
  key: child.key,
349
462
  className: css.trackItem,
350
- onClick: function () {
463
+ onClick: function onClick() {
351
464
  if (typeof onClickItem === 'function') {
352
465
  onClickItem(index);
353
466
  }
354
467
  },
355
468
  "data-qaid": "image_slider_".concat(index)
356
469
  }, child);
357
- }), infinite && React__namespace.createElement("li", {
470
+ }), infinite && /*#__PURE__*/React__namespace.createElement("li", {
358
471
  className: css.trackItem
359
- }, childrenArray[0])), isShowNavi && React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("button", {
360
- type: 'button',
472
+ }, childrenArray[0])), isShowNavi && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("button", {
473
+ type: "button",
361
474
  className: css.buttonPrev,
362
475
  onClick: handleClickButtonPrev,
363
476
  disabled: isDisablePrev,
364
- "aria-label": t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
365
- "data-qaid": 'prev_image'
366
- }, React__namespace.createElement(Icon.Icon, {
477
+ "aria-label": t(_templateObject || (_templateObject = _taggedTemplateLiteral(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
478
+ "data-qaid": "prev_image"
479
+ }, /*#__PURE__*/React__namespace.createElement(Icon.Icon, {
367
480
  className: css.buttonIcon,
368
481
  "icon-as": Left.Left
369
- })), React__namespace.createElement("button", {
370
- type: 'button',
482
+ })), /*#__PURE__*/React__namespace.createElement("button", {
483
+ type: "button",
371
484
  className: css.buttonNext,
372
485
  onClick: handleClickButtonNext,
373
486
  disabled: isDisableNext,
374
- "aria-label": t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
375
- "data-qaid": 'next_image'
376
- }, React__namespace.createElement(Icon.Icon, {
487
+ "aria-label": t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
488
+ "data-qaid": "next_image"
489
+ }, /*#__PURE__*/React__namespace.createElement(Icon.Icon, {
377
490
  className: css.buttonIcon,
378
491
  "icon-as": Right.Right
379
- }))), isShowDots && React__namespace.createElement("ul", {
380
- className: classNames__default.default(css.dots, (_c = {}, _c[css.dotsTransparent] = isDotsTransparent, _c))
492
+ }))), isShowDots && /*#__PURE__*/React__namespace.createElement("ul", {
493
+ className: classNames__default.default(css.dots, _defineProperty({}, css.dotsTransparent, isDotsTransparent))
381
494
  }, childrenArray.map(function (child, index) {
382
495
  var viewIndex = index + 1;
383
- return React__namespace.createElement("li", {
496
+ return /*#__PURE__*/React__namespace.createElement("li", {
384
497
  className: css.dotsItem,
385
498
  key: child.key
386
- }, React__namespace.createElement("button", {
387
- type: 'button',
499
+ }, /*#__PURE__*/React__namespace.createElement("button", {
500
+ type: "button",
388
501
  className: css.dotsButton,
389
- onClick: function () {
502
+ onClick: function onClick() {
390
503
  return handleClickDot(index);
391
504
  },
392
505
  disabled: index === infiniteIndex,
393
- "aria-label": t(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""])), viewIndex),
506
+ "aria-label": t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""])), viewIndex),
394
507
  "data-qaid": "view_image_".concat(viewIndex)
395
508
  }, viewIndex));
396
509
  })));
397
510
  });
398
- var templateObject_1, templateObject_2, templateObject_3;
399
511
 
400
512
  exports.SimpleSlider = SimpleSlider;
401
513