@okam/stack-ui 1.39.3 → 1.40.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 (447) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/components/fields/ComboBox/components/ComboBoxButton.d.ts +3 -0
  3. package/components/fields/ComboBox/interface.d.ts +5 -1
  4. package/index.d.ts +1 -0
  5. package/index108.js +6 -1
  6. package/index108.mjs +29 -12
  7. package/index123.js +1 -1
  8. package/index123.mjs +1 -1
  9. package/index125.js +1 -1
  10. package/index125.mjs +2 -2
  11. package/index126.js +1 -1
  12. package/index126.mjs +1 -1
  13. package/index131.js +1 -1
  14. package/index131.mjs +1 -1
  15. package/index133.js +1 -1
  16. package/index133.mjs +4 -4
  17. package/index134.js +1 -1
  18. package/index134.mjs +3 -3
  19. package/index135.js +1 -1
  20. package/index135.mjs +1 -1
  21. package/index136.js +1 -1
  22. package/index136.mjs +1 -1
  23. package/index137.js +1 -1
  24. package/index137.mjs +3 -3
  25. package/index141.js +1 -1
  26. package/index141.mjs +13 -38
  27. package/index142.js +1 -2
  28. package/index142.mjs +38 -24
  29. package/index143.js +2 -1
  30. package/index143.mjs +23 -21
  31. package/index144.js +1 -1
  32. package/index144.mjs +21 -41
  33. package/index145.js +1 -1
  34. package/index145.mjs +42 -25
  35. package/index146.js +1 -1
  36. package/index146.mjs +25 -40
  37. package/index147.js +1 -2
  38. package/index147.mjs +39 -56
  39. package/index148.js +2 -1
  40. package/index148.mjs +57 -38
  41. package/index149.js +1 -1
  42. package/index149.mjs +34 -26
  43. package/index150.js +1 -2
  44. package/index150.mjs +30 -8
  45. package/index151.js +1 -1
  46. package/index151.mjs +7 -8
  47. package/index152.js +2 -1
  48. package/index152.mjs +10 -30
  49. package/index153.js +1 -1
  50. package/index153.mjs +30 -15
  51. package/index154.js +1 -1
  52. package/index154.mjs +13 -15
  53. package/index155.js +1 -2
  54. package/index155.mjs +16 -47
  55. package/index156.js +2 -1
  56. package/index156.mjs +46 -36
  57. package/index157.js +1 -1
  58. package/index157.mjs +36 -27
  59. package/index158.js +1 -1
  60. package/index158.mjs +27 -20
  61. package/index159.js +1 -1
  62. package/index159.mjs +18 -32
  63. package/index160.js +1 -1
  64. package/index160.mjs +35 -21
  65. package/index161.js +1 -1
  66. package/index161.mjs +21 -56
  67. package/index162.js +1 -1
  68. package/index162.mjs +57 -46
  69. package/index163.js +1 -2
  70. package/index163.mjs +11 -12
  71. package/index164.js +1 -2
  72. package/index164.mjs +46 -31
  73. package/index165.js +2 -1
  74. package/index165.mjs +12 -11
  75. package/index166.js +2 -1
  76. package/index166.mjs +31 -12
  77. package/index167.js +1 -1
  78. package/index167.mjs +11 -5
  79. package/index168.js +1 -2
  80. package/index168.mjs +5 -49
  81. package/index169.js +2 -1
  82. package/index169.mjs +46 -200
  83. package/index170.js +1 -1
  84. package/index170.mjs +122 -61
  85. package/index171.js +1 -1
  86. package/index171.mjs +26 -142
  87. package/index172.js +1 -1
  88. package/index172.mjs +69 -120
  89. package/index173.js +1 -1
  90. package/index173.mjs +370 -213
  91. package/index174.js +1 -1
  92. package/index174.mjs +44 -188
  93. package/index175.js +1 -1
  94. package/index175.mjs +4 -70
  95. package/index176.js +1 -1
  96. package/index176.mjs +21 -276
  97. package/index177.js +1 -1
  98. package/index177.mjs +45 -96
  99. package/index178.js +1 -1
  100. package/index178.mjs +4 -187
  101. package/index179.js +1 -1
  102. package/index179.mjs +24 -84
  103. package/index180.js +1 -1
  104. package/index180.mjs +12 -58
  105. package/index181.js +1 -1
  106. package/index181.mjs +4 -126
  107. package/index182.js +1 -1
  108. package/index182.mjs +14 -116
  109. package/index183.js +1 -1
  110. package/index183.mjs +38 -118
  111. package/index184.js +1 -1
  112. package/index184.mjs +55 -70
  113. package/index185.js +1 -1
  114. package/index185.mjs +39 -108
  115. package/index186.js +1 -1
  116. package/index186.mjs +26 -50
  117. package/index187.js +1 -1
  118. package/index187.mjs +30 -92
  119. package/index188.js +1 -1
  120. package/index188.mjs +13 -69
  121. package/index189.js +1 -1
  122. package/index189.mjs +10 -56
  123. package/index19.js +1 -1
  124. package/index19.mjs +3 -2
  125. package/index190.js +1 -1
  126. package/index190.mjs +27 -98
  127. package/index191.js +1 -5
  128. package/index191.mjs +8 -79
  129. package/index192.js +1 -1
  130. package/index192.mjs +6 -2025
  131. package/index193.js +1 -1
  132. package/index193.mjs +5 -59
  133. package/index194.js +1 -1
  134. package/index194.mjs +7 -188
  135. package/index195.js +1 -1
  136. package/index195.mjs +26 -122
  137. package/index196.js +1 -1
  138. package/index196.mjs +14 -23
  139. package/index197.js +1 -1
  140. package/index197.mjs +12 -72
  141. package/index198.js +1 -1
  142. package/index198.mjs +39 -377
  143. package/index199.js +1 -1
  144. package/index199.mjs +8 -46
  145. package/index20.js +1 -1
  146. package/index20.mjs +1 -1
  147. package/index200.js +1 -1
  148. package/index200.mjs +18 -4
  149. package/index201.js +1 -1
  150. package/index201.mjs +3 -25
  151. package/index202.js +1 -1
  152. package/index202.mjs +4 -47
  153. package/index203.js +1 -1
  154. package/index203.mjs +19 -5
  155. package/index204.js +1 -1
  156. package/index204.mjs +54 -24
  157. package/index205.js +1 -1
  158. package/index205.mjs +123 -11
  159. package/index206.js +1 -1
  160. package/index206.mjs +134 -4
  161. package/index207.js +1 -1
  162. package/index207.mjs +44 -14
  163. package/index208.js +1 -1
  164. package/index208.mjs +12 -40
  165. package/index209.js +1 -1
  166. package/index209.mjs +91 -53
  167. package/index210.js +1 -1
  168. package/index210.mjs +107 -42
  169. package/index211.js +1 -1
  170. package/index211.mjs +4 -28
  171. package/index212.js +1 -1
  172. package/index212.mjs +3 -31
  173. package/index213.js +1 -1
  174. package/index213.mjs +125 -14
  175. package/index214.js +1 -1
  176. package/index214.mjs +29 -10
  177. package/index215.js +1 -1
  178. package/index215.mjs +50 -27
  179. package/index216.js +1 -1
  180. package/index216.mjs +44 -9
  181. package/index217.js +1 -1
  182. package/index217.mjs +37 -6
  183. package/index218.js +1 -1
  184. package/index218.mjs +113 -5
  185. package/index219.js +1 -1
  186. package/index219.mjs +77 -7
  187. package/index220.js +1 -1
  188. package/index220.mjs +101 -29
  189. package/index221.js +1 -1
  190. package/index221.mjs +98 -19
  191. package/index222.js +1 -1
  192. package/index222.mjs +139 -12
  193. package/index223.js +1 -1
  194. package/index223.mjs +195 -41
  195. package/index224.js +1 -1
  196. package/index224.mjs +22 -8
  197. package/index225.js +1 -1
  198. package/index225.mjs +47 -15
  199. package/index226.js +1 -1
  200. package/index226.mjs +49 -3
  201. package/index227.js +1 -1
  202. package/index227.mjs +97 -4
  203. package/index228.js +1 -1
  204. package/index228.mjs +72 -20
  205. package/index229.js +1 -1
  206. package/index229.mjs +64 -50
  207. package/index230.js +1 -1
  208. package/index230.mjs +7 -124
  209. package/index231.js +1 -1
  210. package/index231.mjs +10 -133
  211. package/index232.js +1 -1
  212. package/index232.mjs +202 -43
  213. package/index233.js +1 -1
  214. package/index233.mjs +64 -14
  215. package/index234.js +1 -1
  216. package/index234.mjs +134 -86
  217. package/index235.js +1 -1
  218. package/index235.mjs +120 -102
  219. package/index236.js +1 -1
  220. package/index236.mjs +224 -4
  221. package/index237.js +1 -1
  222. package/index237.mjs +190 -3
  223. package/index238.js +1 -1
  224. package/index238.mjs +67 -123
  225. package/index239.js +1 -1
  226. package/index239.mjs +273 -23
  227. package/index24.js +1 -1
  228. package/index24.mjs +1 -1
  229. package/index240.js +1 -1
  230. package/index240.mjs +93 -46
  231. package/index241.js +1 -1
  232. package/index241.mjs +187 -43
  233. package/index242.js +1 -1
  234. package/index242.mjs +83 -36
  235. package/index243.js +1 -1
  236. package/index243.mjs +54 -109
  237. package/index244.js +1 -1
  238. package/index244.mjs +125 -76
  239. package/index245.js +1 -1
  240. package/index245.mjs +116 -101
  241. package/index246.js +1 -1
  242. package/index246.mjs +123 -98
  243. package/index247.js +1 -1
  244. package/index247.mjs +67 -135
  245. package/index248.js +1 -1
  246. package/index248.mjs +101 -188
  247. package/index249.js +1 -1
  248. package/index249.mjs +52 -22
  249. package/index25.js +1 -1
  250. package/index25.mjs +3 -3
  251. package/index250.js +1 -1
  252. package/index250.mjs +90 -46
  253. package/index251.js +1 -1
  254. package/index251.mjs +69 -47
  255. package/index252.js +1 -1
  256. package/index252.mjs +55 -96
  257. package/index253.js +1 -1
  258. package/index253.mjs +100 -72
  259. package/index254.js +5 -1
  260. package/index254.mjs +76 -64
  261. package/index255.js +1 -1
  262. package/index255.mjs +2025 -7
  263. package/index256.js +1 -1
  264. package/index256.mjs +59 -11
  265. package/index257.js +1 -1
  266. package/index257.mjs +188 -5
  267. package/index258.js +1 -1
  268. package/index258.mjs +5 -121
  269. package/index259.js +1 -1
  270. package/index259.mjs +121 -43
  271. package/index26.js +1 -1
  272. package/index26.mjs +1 -1
  273. package/index260.js +1 -1
  274. package/index260.mjs +43 -230
  275. package/index261.js +1 -1
  276. package/index261.mjs +226 -27
  277. package/index262.js +1 -1
  278. package/index262.mjs +30 -129
  279. package/index263.js +1 -1
  280. package/index263.mjs +3 -190
  281. package/index264.js +1 -1
  282. package/index264.mjs +4 -9
  283. package/index265.js +1 -1
  284. package/index265.mjs +5 -4
  285. package/index266.js +1 -1
  286. package/index266.mjs +5 -37
  287. package/index267.js +1 -1
  288. package/index267.mjs +5 -6
  289. package/index268.js +1 -1
  290. package/index268.mjs +5 -30
  291. package/index269.js +1 -1
  292. package/index269.mjs +5 -7
  293. package/index27.js +1 -1
  294. package/index27.mjs +1 -1
  295. package/index270.js +1 -1
  296. package/index270.mjs +5 -4
  297. package/index271.js +1 -1
  298. package/index271.mjs +5 -5
  299. package/index272.js +1 -1
  300. package/index272.mjs +4 -4
  301. package/index273.js +1 -1
  302. package/index273.mjs +4 -4
  303. package/index274.js +1 -1
  304. package/index274.mjs +1 -1
  305. package/index275.js +1 -1
  306. package/index275.mjs +1 -1
  307. package/index276.js +1 -1
  308. package/index276.mjs +4 -4
  309. package/index277.js +1 -1
  310. package/index277.mjs +4 -4
  311. package/index278.js +1 -1
  312. package/index278.mjs +1 -1
  313. package/index279.js +1 -1
  314. package/index279.mjs +1 -1
  315. package/index280.js +1 -1
  316. package/index280.mjs +4 -4
  317. package/index281.js +1 -1
  318. package/index281.mjs +4 -4
  319. package/index282.js +1 -1
  320. package/index282.mjs +4 -4
  321. package/index283.js +1 -1
  322. package/index283.mjs +4 -4
  323. package/index284.js +1 -1
  324. package/index284.mjs +1 -1
  325. package/index285.js +1 -1
  326. package/index285.mjs +4 -4
  327. package/index286.js +1 -1
  328. package/index286.mjs +4 -4
  329. package/index287.js +1 -1
  330. package/index287.mjs +4 -4
  331. package/index288.js +1 -1
  332. package/index288.mjs +1 -1
  333. package/index289.js +1 -1
  334. package/index289.mjs +4 -4
  335. package/index29.js +1 -1
  336. package/index29.mjs +3 -3
  337. package/index290.js +1 -1
  338. package/index290.mjs +4 -4
  339. package/index291.js +1 -1
  340. package/index291.mjs +1 -1
  341. package/index292.js +1 -1
  342. package/index292.mjs +4 -4
  343. package/index293.js +1 -1
  344. package/index293.mjs +4 -4
  345. package/index294.js +1 -1
  346. package/index294.mjs +4 -4
  347. package/index295.js +1 -1
  348. package/index295.mjs +4 -4
  349. package/index296.js +1 -1
  350. package/index296.mjs +4 -4
  351. package/index297.js +1 -1
  352. package/index297.mjs +4 -4
  353. package/index298.js +1 -1
  354. package/index298.mjs +1 -1
  355. package/index299.js +1 -1
  356. package/index299.mjs +130 -4
  357. package/index30.js +1 -1
  358. package/index30.mjs +3 -3
  359. package/index300.js +1 -1
  360. package/index300.mjs +191 -5
  361. package/index301.js +1 -1
  362. package/index301.mjs +10 -5
  363. package/index302.js +1 -1
  364. package/index302.mjs +4 -5
  365. package/index303.js +1 -1
  366. package/index303.mjs +37 -5
  367. package/index304.js +1 -1
  368. package/index304.mjs +6 -5
  369. package/index305.js +1 -1
  370. package/index305.mjs +30 -5
  371. package/index306.js +1 -1
  372. package/index306.mjs +6 -62
  373. package/index307.js +1 -1
  374. package/index307.mjs +63 -7
  375. package/index308.js +1 -1
  376. package/index308.mjs +25 -23
  377. package/index309.js +1 -1
  378. package/index309.mjs +7 -93
  379. package/index31.js +1 -1
  380. package/index31.mjs +3 -3
  381. package/index310.js +1 -1
  382. package/index310.mjs +24 -6
  383. package/index311.js +1 -1
  384. package/index311.mjs +90 -23
  385. package/index312.js +1 -1
  386. package/index312.mjs +8 -32
  387. package/index313.js +1 -1
  388. package/index313.mjs +25 -6
  389. package/index314.js +1 -1
  390. package/index314.mjs +33 -6
  391. package/index315.js +1 -1
  392. package/index315.mjs +6 -50
  393. package/index316.js +1 -1
  394. package/index316.mjs +6 -29
  395. package/index317.js +1 -1
  396. package/index317.mjs +50 -14
  397. package/index318.js +1 -1
  398. package/index318.mjs +14 -21
  399. package/index319.js +1 -1
  400. package/index319.mjs +20 -28
  401. package/index320.js +1 -1
  402. package/index320.mjs +27 -64
  403. package/index321.js +1 -1
  404. package/index321.mjs +66 -53
  405. package/index322.js +1 -1
  406. package/index322.mjs +53 -54
  407. package/index323.js +1 -1
  408. package/index323.mjs +54 -281
  409. package/index324.js +1 -1
  410. package/index324.mjs +281 -20
  411. package/index325.js +1 -1
  412. package/index325.mjs +20 -3
  413. package/index326.js +1 -1
  414. package/index326.mjs +3 -4
  415. package/index327.js +1 -1
  416. package/index327.mjs +4 -8
  417. package/index328.js +1 -1
  418. package/index328.mjs +7 -4
  419. package/index329.js +1 -1
  420. package/index329.mjs +164 -27
  421. package/index33.js +1 -1
  422. package/index33.mjs +1 -1
  423. package/index330.js +1 -1
  424. package/index330.mjs +27 -164
  425. package/index331.js +1 -0
  426. package/index331.mjs +8 -0
  427. package/index35.js +1 -1
  428. package/index35.mjs +2 -2
  429. package/index36.js +1 -1
  430. package/index36.mjs +1 -1
  431. package/index39.js +1 -1
  432. package/index39.mjs +1 -1
  433. package/index43.js +1 -1
  434. package/index43.mjs +1 -1
  435. package/index45.js +1 -1
  436. package/index45.mjs +3 -3
  437. package/index47.js +1 -1
  438. package/index47.mjs +2 -2
  439. package/index48.js +1 -1
  440. package/index48.mjs +1 -1
  441. package/index49.js +1 -1
  442. package/index49.mjs +81 -82
  443. package/index51.js +1 -1
  444. package/index51.mjs +1 -1
  445. package/index95.js +1 -1
  446. package/index95.mjs +1 -1
  447. package/package.json +1 -1
package/index169.mjs CHANGED
@@ -1,206 +1,52 @@
1
- import { g as q } from "./index262.mjs";
2
- import { s as J, e as K, c as I } from "./index263.mjs";
3
- function X(U) {
4
- let {
5
- swiper: e,
6
- extendParams: z,
7
- on: M,
8
- emit: T
9
- } = U;
10
- z({
11
- virtual: {
12
- enabled: !1,
13
- slides: [],
14
- cache: !0,
15
- renderSlide: null,
16
- renderExternal: null,
17
- renderExternalUpdate: !0,
18
- addSlidesBefore: 0,
19
- addSlidesAfter: 0
20
- }
21
- });
22
- let C;
23
- const B = q();
24
- e.virtual = {
25
- cache: {},
26
- from: void 0,
27
- to: void 0,
28
- slides: [],
29
- offset: 0,
30
- slidesGrid: []
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { isSameDay as p, getDayOfWeek as O } from "./index207.mjs";
4
+ import { useFocusRing as W } from "@react-aria/focus";
5
+ import { mergeProps as v } from "./index134.mjs";
6
+ import { useRef as B } from "react";
7
+ import { useCalendarCell as I, useLocale as L } from "react-aria";
8
+ import $, { BoxWithForwardRef as V } from "./index28.mjs";
9
+ function z(c) {
10
+ const { themeName: a = "calendar", tokens: b, state: s, date: t } = c, l = B(null), {
11
+ isUnavailable: D,
12
+ cellProps: R,
13
+ buttonProps: k,
14
+ isSelected: o,
15
+ isOutsideVisibleRange: r,
16
+ isDisabled: x,
17
+ formattedDate: g,
18
+ isInvalid: y
19
+ } = I(c, s, l), e = s == null ? void 0 : s.highlightedRange, d = e == null ? void 0 : e.start, f = e == null ? void 0 : e.end, m = e && d ? p(t, d) : o, u = e && f ? p(t, f) : o, { locale: C } = L(), h = O(t, C), S = o && (m || h === 0 || t.day === 1), N = o && (u || h === 6 || t.day === t.calendar.getDaysInMonth(t)), { focusProps: P, isFocusVisible: F } = W(), n = {
20
+ isInvalid: y,
21
+ isDisabled: x,
22
+ isUnavailable: D,
23
+ isSelected: o,
24
+ isFocusVisible: F,
25
+ isOutsideVisibleRange: r,
26
+ ...b
31
27
  };
32
- const $ = B.createElement("div");
33
- function G(i, a) {
34
- const r = e.params.virtual;
35
- if (r.cache && e.virtual.cache[a])
36
- return e.virtual.cache[a];
37
- let s;
38
- return r.renderSlide ? (s = r.renderSlide.call(e, i, a), typeof s == "string" && ($.innerHTML = s, s = $.children[0])) : e.isElement ? s = I("swiper-slide") : s = I("div", e.params.slideClass), s.setAttribute("data-swiper-slide-index", a), r.renderSlide || (s.innerHTML = i), r.cache && (e.virtual.cache[a] = s), s;
39
- }
40
- function o(i, a) {
41
- const {
42
- slidesPerView: r,
43
- slidesPerGroup: s,
44
- centeredSlides: d,
45
- loop: n,
46
- initialSlide: w
47
- } = e.params;
48
- if (a && !n && w > 0)
49
- return;
50
- const {
51
- addSlidesBefore: m,
52
- addSlidesAfter: g
53
- } = e.params.virtual, {
54
- from: P,
55
- to: E,
56
- slides: c,
57
- slidesGrid: F,
58
- offset: N
59
- } = e.virtual;
60
- e.params.cssMode || e.updateActiveIndex();
61
- const b = e.activeIndex || 0;
62
- let A;
63
- e.rtlTranslate ? A = "right" : A = e.isHorizontal() ? "left" : "top";
64
- let x, f;
65
- d ? (x = Math.floor(r / 2) + s + g, f = Math.floor(r / 2) + s + m) : (x = r + (s - 1) + g, f = (n ? r : s) + m);
66
- let u = b - f, p = b + x;
67
- n || (u = Math.max(u, 0), p = Math.min(p, c.length - 1));
68
- let h = (e.slidesGrid[u] || 0) - (e.slidesGrid[0] || 0);
69
- n && b >= f ? (u -= f, d || (h += e.slidesGrid[0])) : n && b < f && (u = -f, d && (h += e.slidesGrid[0])), Object.assign(e.virtual, {
70
- from: u,
71
- to: p,
72
- offset: h,
73
- slidesGrid: e.slidesGrid,
74
- slidesBefore: f,
75
- slidesAfter: x
76
- });
77
- function j() {
78
- e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), T("virtualUpdate");
79
- }
80
- if (P === u && E === p && !i) {
81
- e.slidesGrid !== F && h !== N && e.slides.forEach((t) => {
82
- t.style[A] = `${h - Math.abs(e.cssOverflowAdjustment())}px`;
83
- }), e.updateProgress(), T("virtualUpdate");
84
- return;
85
- }
86
- if (e.params.virtual.renderExternal) {
87
- e.params.virtual.renderExternal.call(e, {
88
- offset: h,
89
- from: u,
90
- to: p,
91
- slides: function() {
92
- const l = [];
93
- for (let v = u; v <= p; v += 1)
94
- l.push(c[v]);
95
- return l;
96
- }()
97
- }), e.params.virtual.renderExternalUpdate ? j() : T("virtualUpdate");
98
- return;
99
- }
100
- const S = [], O = [], y = (t) => {
101
- let l = t;
102
- return t < 0 ? l = c.length + t : l >= c.length && (l = l - c.length), l;
103
- };
104
- if (i)
105
- e.slides.filter((t) => t.matches(`.${e.params.slideClass}, swiper-slide`)).forEach((t) => {
106
- t.remove();
107
- });
108
- else
109
- for (let t = P; t <= E; t += 1)
110
- if (t < u || t > p) {
111
- const l = y(t);
112
- e.slides.filter((v) => v.matches(`.${e.params.slideClass}[data-swiper-slide-index="${l}"], swiper-slide[data-swiper-slide-index="${l}"]`)).forEach((v) => {
113
- v.remove();
114
- });
28
+ return /* @__PURE__ */ i(
29
+ $,
30
+ {
31
+ as: "td",
32
+ ...R,
33
+ "aria-disabled": !1,
34
+ themeName: `${a}.cellContainer`,
35
+ tokens: n,
36
+ children: /* @__PURE__ */ i(
37
+ V,
38
+ {
39
+ ...v(k, P),
40
+ ref: l,
41
+ "aria-hidden": r,
42
+ themeName: `${a}.cell`,
43
+ tokens: { ...n, isRoundedLeft: S, isRoundedRight: N },
44
+ children: /* @__PURE__ */ i($, { themeName: `${a}.cellDate`, tokens: { ...n, isSelectionStart: m, isSelectionEnd: u }, children: g })
115
45
  }
116
- const R = n ? -c.length : 0, _ = n ? c.length * 2 : c.length;
117
- for (let t = R; t < _; t += 1)
118
- if (t >= u && t <= p) {
119
- const l = y(t);
120
- typeof E > "u" || i ? O.push(l) : (t > E && O.push(l), t < P && S.push(l));
121
- }
122
- if (O.forEach((t) => {
123
- e.slidesEl.append(G(c[t], t));
124
- }), n)
125
- for (let t = S.length - 1; t >= 0; t -= 1) {
126
- const l = S[t];
127
- e.slidesEl.prepend(G(c[l], l));
128
- }
129
- else
130
- S.sort((t, l) => l - t), S.forEach((t) => {
131
- e.slidesEl.prepend(G(c[t], t));
132
- });
133
- K(e.slidesEl, ".swiper-slide, swiper-slide").forEach((t) => {
134
- t.style[A] = `${h - Math.abs(e.cssOverflowAdjustment())}px`;
135
- }), j();
136
- }
137
- function H(i) {
138
- if (typeof i == "object" && "length" in i)
139
- for (let a = 0; a < i.length; a += 1)
140
- i[a] && e.virtual.slides.push(i[a]);
141
- else
142
- e.virtual.slides.push(i);
143
- o(!0);
144
- }
145
- function L(i) {
146
- const a = e.activeIndex;
147
- let r = a + 1, s = 1;
148
- if (Array.isArray(i)) {
149
- for (let d = 0; d < i.length; d += 1)
150
- i[d] && e.virtual.slides.unshift(i[d]);
151
- r = a + i.length, s = i.length;
152
- } else
153
- e.virtual.slides.unshift(i);
154
- if (e.params.virtual.cache) {
155
- const d = e.virtual.cache, n = {};
156
- Object.keys(d).forEach((w) => {
157
- const m = d[w], g = m.getAttribute("data-swiper-slide-index");
158
- g && m.setAttribute("data-swiper-slide-index", parseInt(g, 10) + s), n[parseInt(w, 10) + s] = m;
159
- }), e.virtual.cache = n;
160
- }
161
- o(!0), e.slideTo(r, 0);
162
- }
163
- function V(i) {
164
- if (typeof i > "u" || i === null) return;
165
- let a = e.activeIndex;
166
- if (Array.isArray(i))
167
- for (let r = i.length - 1; r >= 0; r -= 1)
168
- e.params.virtual.cache && (delete e.virtual.cache[i[r]], Object.keys(e.virtual.cache).forEach((s) => {
169
- s > i && (e.virtual.cache[s - 1] = e.virtual.cache[s], e.virtual.cache[s - 1].setAttribute("data-swiper-slide-index", s - 1), delete e.virtual.cache[s]);
170
- })), e.virtual.slides.splice(i[r], 1), i[r] < a && (a -= 1), a = Math.max(a, 0);
171
- else
172
- e.params.virtual.cache && (delete e.virtual.cache[i], Object.keys(e.virtual.cache).forEach((r) => {
173
- r > i && (e.virtual.cache[r - 1] = e.virtual.cache[r], e.virtual.cache[r - 1].setAttribute("data-swiper-slide-index", r - 1), delete e.virtual.cache[r]);
174
- })), e.virtual.slides.splice(i, 1), i < a && (a -= 1), a = Math.max(a, 0);
175
- o(!0), e.slideTo(a, 0);
176
- }
177
- function D() {
178
- e.virtual.slides = [], e.params.virtual.cache && (e.virtual.cache = {}), o(!0), e.slideTo(0, 0);
179
- }
180
- M("beforeInit", () => {
181
- if (!e.params.virtual.enabled) return;
182
- let i;
183
- if (typeof e.passedParams.virtual.slides > "u") {
184
- const a = [...e.slidesEl.children].filter((r) => r.matches(`.${e.params.slideClass}, swiper-slide`));
185
- a && a.length && (e.virtual.slides = [...a], i = !0, a.forEach((r, s) => {
186
- r.setAttribute("data-swiper-slide-index", s), e.virtual.cache[s] = r, r.remove();
187
- }));
46
+ )
188
47
  }
189
- i || (e.virtual.slides = e.params.virtual.slides), e.classNames.push(`${e.params.containerModifierClass}virtual`), e.params.watchSlidesProgress = !0, e.originalParams.watchSlidesProgress = !0, o(!1, !0);
190
- }), M("setTranslate", () => {
191
- e.params.virtual.enabled && (e.params.cssMode && !e._immediateVirtual ? (clearTimeout(C), C = setTimeout(() => {
192
- o();
193
- }, 100)) : o());
194
- }), M("init update resize", () => {
195
- e.params.virtual.enabled && e.params.cssMode && J(e.wrapperEl, "--swiper-virtual-size", `${e.virtualSize}px`);
196
- }), Object.assign(e.virtual, {
197
- appendSlide: H,
198
- prependSlide: L,
199
- removeSlide: V,
200
- removeAllSlides: D,
201
- update: o
202
- });
48
+ );
203
49
  }
204
50
  export {
205
- X as default
51
+ z as default
206
52
  };
package/index170.js CHANGED
@@ -1 +1 @@
1
- "use strict";const P=require("./index262.js"),b=require("./index263.js");function U(V){let{swiper:e,extendParams:x,on:y,emit:L}=V;const a=P.g(),m=P.a();e.keyboard={enabled:!1},x({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function g(N){if(!e.enabled)return;const{rtlTranslate:l}=e;let t=N;t.originalEvent&&(t=t.originalEvent);const i=t.keyCode||t.charCode,h=e.params.keyboard.pageUpDown,r=h&&i===33,o=h&&i===34,d=i===37,f=i===39,c=i===38,u=i===40;if(!e.allowSlideNext&&(e.isHorizontal()&&f||e.isVertical()&&u||o)||!e.allowSlidePrev&&(e.isHorizontal()&&d||e.isVertical()&&c||r))return!1;if(!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)&&!(a.activeElement&&a.activeElement.nodeName&&(a.activeElement.nodeName.toLowerCase()==="input"||a.activeElement.nodeName.toLowerCase()==="textarea"))){if(e.params.keyboard.onlyInViewport&&(r||o||d||f||c||u)){let D=!1;if(b.a(e.el,`.${e.params.slideClass}, swiper-slide`).length>0&&b.a(e.el,`.${e.params.slideActiveClass}`).length===0)return;const p=e.el,E=p.clientWidth,C=p.clientHeight,A=m.innerWidth,K=m.innerHeight,n=b.b(p);l&&(n.left-=p.scrollLeft);const H=[[n.left,n.top],[n.left+E,n.top],[n.left,n.top+C],[n.left+E,n.top+C]];for(let w=0;w<H.length;w+=1){const s=H[w];if(s[0]>=0&&s[0]<=A&&s[1]>=0&&s[1]<=K){if(s[0]===0&&s[1]===0)continue;D=!0}}if(!D)return}e.isHorizontal()?((r||o||d||f)&&(t.preventDefault?t.preventDefault():t.returnValue=!1),((o||f)&&!l||(r||d)&&l)&&e.slideNext(),((r||d)&&!l||(o||f)&&l)&&e.slidePrev()):((r||o||c||u)&&(t.preventDefault?t.preventDefault():t.returnValue=!1),(o||u)&&e.slideNext(),(r||c)&&e.slidePrev()),L("keyPress",i)}}function v(){e.keyboard.enabled||(a.addEventListener("keydown",g),e.keyboard.enabled=!0)}function k(){e.keyboard.enabled&&(a.removeEventListener("keydown",g),e.keyboard.enabled=!1)}y("init",()=>{e.params.keyboard.enabled&&v()}),y("destroy",()=>{e.keyboard.enabled&&k()}),Object.assign(e.keyboard,{enable:v,disable:k})}module.exports=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),v={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},x={...v,customError:!0,valid:!1},c={isInvalid:!1,validationDetails:v,validationErrors:[]},h=n.createContext({}),I="__formValidationState"+Date.now();function R(e){if(e[I]){let{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:d,commitValidation:l}=e[I];return{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:d,commitValidation:l}}return w(e)}function w(e){let{isInvalid:a,validationState:t,name:i,value:d,builtinValidation:l,validate:s,validationBehavior:o="aria"}=e;t&&(a||(a=t==="invalid"));let V=a!==void 0?{isInvalid:a,validationErrors:[],validationDetails:x}:null,m=n.useMemo(()=>{if(!s||d==null)return null;let r=F(s,d);return T(r)},[s,d]);l!=null&&l.validationDetails.valid&&(l=void 0);let u=n.useContext(h),A=n.useMemo(()=>i?Array.isArray(i)?i.flatMap(r=>D(u[r])):D(u[i]):[],[u,i]),[C,L]=n.useState(u),[g,$]=n.useState(!1);u!==C&&(L(u),$(!1));let b=n.useMemo(()=>T(g?[]:A),[g,A]),M=n.useRef(c),[E,p]=n.useState(c),f=n.useRef(c),_=()=>{if(!O)return;S(!1);let r=m||l||M.current;y(r,f.current)||(f.current=r,p(r))},[O,S]=n.useState(!1);return n.useEffect(_),{realtimeValidation:V||b||m||l||c,displayValidation:o==="native"?V||b||E:V||b||m||l||E,updateValidation(r){o==="aria"&&!y(E,r)?p(r):M.current=r},resetValidation(){let r=c;y(r,f.current)||(f.current=r,p(r)),o==="native"&&S(!1),$(!0)},commitValidation(){o==="native"&&S(!0),$(!0)}}}function D(e){return e?Array.isArray(e)?e:[e]:[]}function F(e,a){if(typeof e=="function"){let t=e(a);if(t&&typeof t!="boolean")return D(t)}return[]}function T(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:x}:null}function y(e,a){return e===a?!0:!!e&&!!a&&e.isInvalid===a.isInvalid&&e.validationErrors.length===a.validationErrors.length&&e.validationErrors.every((t,i)=>t===a.validationErrors[i])&&Object.entries(e.validationDetails).every(([t,i])=>a.validationDetails[t]===i)}function U(...e){let a=new Set,t=!1,i={...v};for(let s of e){var d,l;for(let o of s.validationErrors)a.add(o);t||(t=s.isInvalid);for(let o in i)(d=i)[l=o]||(d[l]=s.validationDetails[o])}return i.valid=!t,{isInvalid:t,validationErrors:[...a],validationDetails:i}}exports.DEFAULT_VALIDATION_RESULT=c;exports.FormValidationContext=h;exports.VALID_VALIDITY_STATE=v;exports.mergeValidation=U;exports.privateValidationStateProp=I;exports.useFormValidationState=R;
package/index170.mjs CHANGED
@@ -1,67 +1,128 @@
1
- import { g as K, a as U } from "./index262.mjs";
2
- import { a as C, b as W } from "./index263.mjs";
3
- function I(H) {
4
- let {
5
- swiper: e,
6
- extendParams: V,
7
- on: b,
8
- emit: x
9
- } = H;
10
- const o = K(), m = U();
11
- e.keyboard = {
12
- enabled: !1
13
- }, V({
14
- keyboard: {
15
- enabled: !1,
16
- onlyInViewport: !0,
17
- pageUpDown: !0
18
- }
19
- });
20
- function y(L) {
21
- if (!e.enabled) return;
22
- const {
23
- rtlTranslate: s
24
- } = e;
25
- let t = L;
26
- t.originalEvent && (t = t.originalEvent);
27
- const i = t.keyCode || t.charCode, k = e.params.keyboard.pageUpDown, r = k && i === 33, a = k && i === 34, d = i === 37, f = i === 39, c = i === 38, u = i === 40;
28
- if (!e.allowSlideNext && (e.isHorizontal() && f || e.isVertical() && u || a) || !e.allowSlidePrev && (e.isHorizontal() && d || e.isVertical() && c || r))
29
- return !1;
30
- if (!(t.shiftKey || t.altKey || t.ctrlKey || t.metaKey) && !(o.activeElement && o.activeElement.nodeName && (o.activeElement.nodeName.toLowerCase() === "input" || o.activeElement.nodeName.toLowerCase() === "textarea"))) {
31
- if (e.params.keyboard.onlyInViewport && (r || a || d || f || c || u)) {
32
- let h = !1;
33
- if (C(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && C(e.el, `.${e.params.slideActiveClass}`).length === 0)
34
- return;
35
- const p = e.el, D = p.clientWidth, E = p.clientHeight, N = m.innerWidth, A = m.innerHeight, n = W(p);
36
- s && (n.left -= p.scrollLeft);
37
- const P = [[n.left, n.top], [n.left + D, n.top], [n.left, n.top + E], [n.left + D, n.top + E]];
38
- for (let w = 0; w < P.length; w += 1) {
39
- const l = P[w];
40
- if (l[0] >= 0 && l[0] <= N && l[1] >= 0 && l[1] <= A) {
41
- if (l[0] === 0 && l[1] === 0) continue;
42
- h = !0;
43
- }
44
- }
45
- if (!h) return;
46
- }
47
- e.isHorizontal() ? ((r || a || d || f) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1), ((a || f) && !s || (r || d) && s) && e.slideNext(), ((r || d) && !s || (a || f) && s) && e.slidePrev()) : ((r || a || c || u) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1), (a || u) && e.slideNext(), (r || c) && e.slidePrev()), x("keyPress", i);
48
- }
1
+ import { createContext as O, useMemo as I, useContext as U, useState as f, useRef as T, useEffect as R } from "react";
2
+ const D = {
3
+ badInput: !1,
4
+ customError: !1,
5
+ patternMismatch: !1,
6
+ rangeOverflow: !1,
7
+ rangeUnderflow: !1,
8
+ stepMismatch: !1,
9
+ tooLong: !1,
10
+ tooShort: !1,
11
+ typeMismatch: !1,
12
+ valueMissing: !1,
13
+ valid: !0
14
+ }, L = {
15
+ ...D,
16
+ customError: !0,
17
+ valid: !1
18
+ }, u = {
19
+ isInvalid: !1,
20
+ validationDetails: D,
21
+ validationErrors: []
22
+ }, B = O({}), h = "__formValidationState" + Date.now();
23
+ function P(a) {
24
+ if (a[h]) {
25
+ let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
26
+ return {
27
+ realtimeValidation: e,
28
+ displayValidation: t,
29
+ updateValidation: i,
30
+ resetValidation: o,
31
+ commitValidation: l
32
+ };
49
33
  }
50
- function g() {
51
- e.keyboard.enabled || (o.addEventListener("keydown", y), e.keyboard.enabled = !0);
34
+ return Q(a);
35
+ }
36
+ function Q(a) {
37
+ let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
38
+ t && (e || (e = t === "invalid"));
39
+ let v = e !== void 0 ? {
40
+ isInvalid: e,
41
+ validationErrors: [],
42
+ validationDetails: L
43
+ } : null, V = I(() => {
44
+ if (!d || o == null) return null;
45
+ let r = Y(d, o);
46
+ return C(r);
47
+ }, [
48
+ d,
49
+ o
50
+ ]);
51
+ l != null && l.validationDetails.valid && (l = void 0);
52
+ let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
53
+ s,
54
+ i
55
+ ]), [M, _] = f(s), [x, m] = f(!1);
56
+ s !== M && (_(s), m(!1));
57
+ let $ = I(() => C(x ? [] : A), [
58
+ x,
59
+ A
60
+ ]), g = T(u), [b, E] = f(u), c = T(u), w = () => {
61
+ if (!F) return;
62
+ p(!1);
63
+ let r = V || l || g.current;
64
+ y(r, c.current) || (c.current = r, E(r));
65
+ }, [F, p] = f(!1);
66
+ return R(w), {
67
+ realtimeValidation: v || $ || V || l || u,
68
+ displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
69
+ updateValidation(r) {
70
+ n === "aria" && !y(b, r) ? E(r) : g.current = r;
71
+ },
72
+ resetValidation() {
73
+ let r = u;
74
+ y(r, c.current) || (c.current = r, E(r)), n === "native" && p(!1), m(!0);
75
+ },
76
+ commitValidation() {
77
+ n === "native" && p(!0), m(!0);
78
+ }
79
+ };
80
+ }
81
+ function S(a) {
82
+ return a ? Array.isArray(a) ? a : [
83
+ a
84
+ ] : [];
85
+ }
86
+ function Y(a, e) {
87
+ if (typeof a == "function") {
88
+ let t = a(e);
89
+ if (t && typeof t != "boolean") return S(t);
52
90
  }
53
- function v() {
54
- e.keyboard.enabled && (o.removeEventListener("keydown", y), e.keyboard.enabled = !1);
91
+ return [];
92
+ }
93
+ function C(a) {
94
+ return a.length ? {
95
+ isInvalid: !0,
96
+ validationErrors: a,
97
+ validationDetails: L
98
+ } : null;
99
+ }
100
+ function y(a, e) {
101
+ return a === e ? !0 : !!a && !!e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
102
+ }
103
+ function k(...a) {
104
+ let e = /* @__PURE__ */ new Set(), t = !1, i = {
105
+ ...D
106
+ };
107
+ for (let d of a) {
108
+ var o, l;
109
+ for (let n of d.validationErrors) e.add(n);
110
+ t || (t = d.isInvalid);
111
+ for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
55
112
  }
56
- b("init", () => {
57
- e.params.keyboard.enabled && g();
58
- }), b("destroy", () => {
59
- e.keyboard.enabled && v();
60
- }), Object.assign(e.keyboard, {
61
- enable: g,
62
- disable: v
63
- });
113
+ return i.valid = !t, {
114
+ isInvalid: t,
115
+ validationErrors: [
116
+ ...e
117
+ ],
118
+ validationDetails: i
119
+ };
64
120
  }
65
121
  export {
66
- I as default
122
+ u as DEFAULT_VALIDATION_RESULT,
123
+ B as FormValidationContext,
124
+ D as VALID_VALIDITY_STATE,
125
+ k as mergeValidation,
126
+ h as privateValidationStateProp,
127
+ P as useFormValidationState
67
128
  };
package/index171.js CHANGED
@@ -1 +1 @@
1
- "use strict";const B=require("./index262.js"),c=require("./index263.js");function N(P){let{swiper:e,extendParams:S,on:I,emit:T}=P;const Y=B.a();S({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),e.mousewheel={enabled:!1};let E,g=c.d(),u;const i=[];function L(t){let o=0,r=0,s=0,l=0;return"detail"in t&&(r=t.detail),"wheelDelta"in t&&(r=-t.wheelDelta/120),"wheelDeltaY"in t&&(r=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(o=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(o=r,r=0),s=o*10,l=r*10,"deltaY"in t&&(l=t.deltaY),"deltaX"in t&&(s=t.deltaX),t.shiftKey&&!s&&(s=l,l=0),(s||l)&&t.deltaMode&&(t.deltaMode===1?(s*=40,l*=40):(s*=800,l*=800)),s&&!o&&(o=s<1?-1:1),l&&!r&&(r=l<1?-1:1),{spinX:o,spinY:r,pixelX:s,pixelY:l}}function _(){e.enabled&&(e.mouseEntered=!0)}function G(){e.enabled&&(e.mouseEntered=!1)}function y(t){return e.params.mousewheel.thresholdDelta&&t.delta<e.params.mousewheel.thresholdDelta||e.params.mousewheel.thresholdTime&&c.d()-g<e.params.mousewheel.thresholdTime?!1:t.delta>=6&&c.d()-g<60?!0:(t.direction<0?(!e.isEnd||e.params.loop)&&!e.animating&&(e.slideNext(),T("scroll",t.raw)):(!e.isBeginning||e.params.loop)&&!e.animating&&(e.slidePrev(),T("scroll",t.raw)),g=new Y.Date().getTime(),!1)}function O(t){const a=e.params.mousewheel;if(t.direction<0){if(e.isEnd&&!e.params.loop&&a.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&a.releaseOnEdges)return!0;return!1}function w(t){let a=t,b=!0;if(!e.enabled||t.target.closest(`.${e.params.mousewheel.noMousewheelClass}`))return;const f=e.params.mousewheel;e.params.cssMode&&a.preventDefault();let o=e.el;e.params.mousewheel.eventsTarget!=="container"&&(o=document.querySelector(e.params.mousewheel.eventsTarget));const r=o&&o.contains(a.target);if(!e.mouseEntered&&!r&&!f.releaseOnEdges)return!0;a.originalEvent&&(a=a.originalEvent);let s=0;const l=e.rtlTranslate?-1:1,d=L(a);if(f.forceToAxis)if(e.isHorizontal())if(Math.abs(d.pixelX)>Math.abs(d.pixelY))s=-d.pixelX*l;else return!0;else if(Math.abs(d.pixelY)>Math.abs(d.pixelX))s=-d.pixelY;else return!0;else s=Math.abs(d.pixelX)>Math.abs(d.pixelY)?-d.pixelX*l:-d.pixelY;if(s===0)return!0;f.invert&&(s=-s);let h=e.getTranslate()+s*f.sensitivity;if(h>=e.minTranslate()&&(h=e.minTranslate()),h<=e.maxTranslate()&&(h=e.maxTranslate()),b=e.params.loop?!0:!(h===e.minTranslate()||h===e.maxTranslate()),b&&e.params.nested&&a.stopPropagation(),!e.params.freeMode||!e.params.freeMode.enabled){const n={time:c.d(),delta:Math.abs(s),direction:Math.sign(s),raw:t};i.length>=2&&i.shift();const m=i.length?i[i.length-1]:void 0;if(i.push(n),m?(n.direction!==m.direction||n.delta>m.delta||n.time>m.time+150)&&y(n):y(n),O(n))return!0}else{const n={time:c.d(),delta:Math.abs(s),direction:Math.sign(s)},m=u&&n.time<u.time+500&&n.delta<=u.delta&&n.direction===u.direction;if(!m){u=void 0;let p=e.getTranslate()+s*f.sensitivity;const A=e.isBeginning,C=e.isEnd;if(p>=e.minTranslate()&&(p=e.minTranslate()),p<=e.maxTranslate()&&(p=e.maxTranslate()),e.setTransition(0),e.setTranslate(p),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!A&&e.isBeginning||!C&&e.isEnd)&&e.updateSlidesClasses(),e.params.loop&&e.loopFix({direction:n.direction<0?"next":"prev",byMousewheel:!0}),e.params.freeMode.sticky){clearTimeout(E),E=void 0,i.length>=15&&i.shift();const M=i.length?i[i.length-1]:void 0,H=i[0];if(i.push(n),M&&(n.delta>M.delta||n.direction!==M.direction))i.splice(0);else if(i.length>=15&&n.time-H.time<500&&H.delta-n.delta>=1&&n.delta<=6){const X=s>0?.8:.2;u=n,i.splice(0),E=c.n(()=>{e.destroyed||!e.params||e.slideToClosest(e.params.speed,!0,void 0,X)},0)}E||(E=c.n(()=>{if(e.destroyed||!e.params)return;const X=.5;u=n,i.splice(0),e.slideToClosest(e.params.speed,!0,void 0,X)},500))}if(m||T("scroll",a),e.params.autoplay&&e.params.autoplayDisableOnInteraction&&e.autoplay.stop(),f.releaseOnEdges&&(p===e.minTranslate()||p===e.maxTranslate()))return!0}}return a.preventDefault?a.preventDefault():a.returnValue=!1,!1}function D(t){let a=e.el;e.params.mousewheel.eventsTarget!=="container"&&(a=document.querySelector(e.params.mousewheel.eventsTarget)),a[t]("mouseenter",_),a[t]("mouseleave",G),a[t]("wheel",w)}function v(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",w),!0):e.mousewheel.enabled?!1:(D("addEventListener"),e.mousewheel.enabled=!0,!0)}function x(){return e.params.cssMode?(e.wrapperEl.addEventListener(event,w),!0):e.mousewheel.enabled?(D("removeEventListener"),e.mousewheel.enabled=!1,!0):!1}I("init",()=>{!e.params.mousewheel.enabled&&e.params.cssMode&&x(),e.params.mousewheel.enabled&&v()}),I("destroy",()=>{e.params.cssMode&&v(),e.mousewheel.enabled&&x()}),Object.assign(e.mousewheel,{enable:v,disable:x})}module.exports=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function m(o,p,s){let[b,u]=l.useState(o||p),i=l.useRef(o!==void 0),e=o!==void 0;l.useEffect(()=>{let t=i.current;t!==e&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${e?"controlled":"uncontrolled"}.`),i.current=e},[e]);let n=e?o:b,S=l.useCallback((t,...f)=>{let d=(r,...c)=>{s&&(Object.is(n,r)||s(r,...c)),e||(n=r)};typeof t=="function"?(process.env.NODE_ENV!=="production"&&console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),u((c,...V)=>{let a=t(e?n:c,...V);return d(a,...f),e?c:a})):(e||u(t),d(t,...f))},[e,n,s]);return[n,S]}exports.useControlledState=m;
package/index171.mjs CHANGED
@@ -1,146 +1,30 @@
1
- import { a as N } from "./index262.mjs";
2
- import { n as P, d as T } from "./index263.mjs";
3
- function q(S) {
4
- let {
5
- swiper: e,
6
- extendParams: Y,
7
- on: I,
8
- emit: g
9
- } = S;
10
- const L = N();
11
- Y({
12
- mousewheel: {
13
- enabled: !1,
14
- releaseOnEdges: !1,
15
- invert: !1,
16
- forceToAxis: !1,
17
- sensitivity: 1,
18
- eventsTarget: "container",
19
- thresholdDelta: null,
20
- thresholdTime: null,
21
- noMousewheelClass: "swiper-no-mousewheel"
22
- }
23
- }), e.mousewheel = {
24
- enabled: !1
25
- };
26
- let c, w = T(), u;
27
- const i = [];
28
- function _(t) {
29
- let o = 0, r = 0, a = 0, l = 0;
30
- return "detail" in t && (r = t.detail), "wheelDelta" in t && (r = -t.wheelDelta / 120), "wheelDeltaY" in t && (r = -t.wheelDeltaY / 120), "wheelDeltaX" in t && (o = -t.wheelDeltaX / 120), "axis" in t && t.axis === t.HORIZONTAL_AXIS && (o = r, r = 0), a = o * 10, l = r * 10, "deltaY" in t && (l = t.deltaY), "deltaX" in t && (a = t.deltaX), t.shiftKey && !a && (a = l, l = 0), (a || l) && t.deltaMode && (t.deltaMode === 1 ? (a *= 40, l *= 40) : (a *= 800, l *= 800)), a && !o && (o = a < 1 ? -1 : 1), l && !r && (r = l < 1 ? -1 : 1), {
31
- spinX: o,
32
- spinY: r,
33
- pixelX: a,
34
- pixelY: l
1
+ import { useState as V, useRef as C, useEffect as E, useCallback as N } from "react";
2
+ function S(n, a, l) {
3
+ let [p, s] = V(n || a), i = C(n !== void 0), e = n !== void 0;
4
+ E(() => {
5
+ let t = i.current;
6
+ t !== e && process.env.NODE_ENV !== "production" && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), i.current = e;
7
+ }, [
8
+ e
9
+ ]);
10
+ let o = e ? n : p, b = N((t, ...u) => {
11
+ let f = (r, ...c) => {
12
+ l && (Object.is(o, r) || l(r, ...c)), e || (o = r);
35
13
  };
36
- }
37
- function G() {
38
- e.enabled && (e.mouseEntered = !0);
39
- }
40
- function O() {
41
- e.enabled && (e.mouseEntered = !1);
42
- }
43
- function y(t) {
44
- return e.params.mousewheel.thresholdDelta && t.delta < e.params.mousewheel.thresholdDelta || e.params.mousewheel.thresholdTime && T() - w < e.params.mousewheel.thresholdTime ? !1 : t.delta >= 6 && T() - w < 60 ? !0 : (t.direction < 0 ? (!e.isEnd || e.params.loop) && !e.animating && (e.slideNext(), g("scroll", t.raw)) : (!e.isBeginning || e.params.loop) && !e.animating && (e.slidePrev(), g("scroll", t.raw)), w = new L.Date().getTime(), !1);
45
- }
46
- function A(t) {
47
- const s = e.params.mousewheel;
48
- if (t.direction < 0) {
49
- if (e.isEnd && !e.params.loop && s.releaseOnEdges)
50
- return !0;
51
- } else if (e.isBeginning && !e.params.loop && s.releaseOnEdges)
52
- return !0;
53
- return !1;
54
- }
55
- function E(t) {
56
- let s = t, b = !0;
57
- if (!e.enabled || t.target.closest(`.${e.params.mousewheel.noMousewheelClass}`)) return;
58
- const f = e.params.mousewheel;
59
- e.params.cssMode && s.preventDefault();
60
- let o = e.el;
61
- e.params.mousewheel.eventsTarget !== "container" && (o = document.querySelector(e.params.mousewheel.eventsTarget));
62
- const r = o && o.contains(s.target);
63
- if (!e.mouseEntered && !r && !f.releaseOnEdges) return !0;
64
- s.originalEvent && (s = s.originalEvent);
65
- let a = 0;
66
- const l = e.rtlTranslate ? -1 : 1, d = _(s);
67
- if (f.forceToAxis)
68
- if (e.isHorizontal())
69
- if (Math.abs(d.pixelX) > Math.abs(d.pixelY)) a = -d.pixelX * l;
70
- else return !0;
71
- else if (Math.abs(d.pixelY) > Math.abs(d.pixelX)) a = -d.pixelY;
72
- else return !0;
73
- else
74
- a = Math.abs(d.pixelX) > Math.abs(d.pixelY) ? -d.pixelX * l : -d.pixelY;
75
- if (a === 0) return !0;
76
- f.invert && (a = -a);
77
- let h = e.getTranslate() + a * f.sensitivity;
78
- if (h >= e.minTranslate() && (h = e.minTranslate()), h <= e.maxTranslate() && (h = e.maxTranslate()), b = e.params.loop ? !0 : !(h === e.minTranslate() || h === e.maxTranslate()), b && e.params.nested && s.stopPropagation(), !e.params.freeMode || !e.params.freeMode.enabled) {
79
- const n = {
80
- time: T(),
81
- delta: Math.abs(a),
82
- direction: Math.sign(a),
83
- raw: t
84
- };
85
- i.length >= 2 && i.shift();
86
- const m = i.length ? i[i.length - 1] : void 0;
87
- if (i.push(n), m ? (n.direction !== m.direction || n.delta > m.delta || n.time > m.time + 150) && y(n) : y(n), A(n))
88
- return !0;
89
- } else {
90
- const n = {
91
- time: T(),
92
- delta: Math.abs(a),
93
- direction: Math.sign(a)
94
- }, m = u && n.time < u.time + 500 && n.delta <= u.delta && n.direction === u.direction;
95
- if (!m) {
96
- u = void 0;
97
- let p = e.getTranslate() + a * f.sensitivity;
98
- const C = e.isBeginning, B = e.isEnd;
99
- if (p >= e.minTranslate() && (p = e.minTranslate()), p <= e.maxTranslate() && (p = e.maxTranslate()), e.setTransition(0), e.setTranslate(p), e.updateProgress(), e.updateActiveIndex(), e.updateSlidesClasses(), (!C && e.isBeginning || !B && e.isEnd) && e.updateSlidesClasses(), e.params.loop && e.loopFix({
100
- direction: n.direction < 0 ? "next" : "prev",
101
- byMousewheel: !0
102
- }), e.params.freeMode.sticky) {
103
- clearTimeout(c), c = void 0, i.length >= 15 && i.shift();
104
- const M = i.length ? i[i.length - 1] : void 0, H = i[0];
105
- if (i.push(n), M && (n.delta > M.delta || n.direction !== M.direction))
106
- i.splice(0);
107
- else if (i.length >= 15 && n.time - H.time < 500 && H.delta - n.delta >= 1 && n.delta <= 6) {
108
- const X = a > 0 ? 0.8 : 0.2;
109
- u = n, i.splice(0), c = P(() => {
110
- e.destroyed || !e.params || e.slideToClosest(e.params.speed, !0, void 0, X);
111
- }, 0);
112
- }
113
- c || (c = P(() => {
114
- if (e.destroyed || !e.params) return;
115
- const X = 0.5;
116
- u = n, i.splice(0), e.slideToClosest(e.params.speed, !0, void 0, X);
117
- }, 500));
118
- }
119
- if (m || g("scroll", s), e.params.autoplay && e.params.autoplayDisableOnInteraction && e.autoplay.stop(), f.releaseOnEdges && (p === e.minTranslate() || p === e.maxTranslate()))
120
- return !0;
121
- }
122
- }
123
- return s.preventDefault ? s.preventDefault() : s.returnValue = !1, !1;
124
- }
125
- function D(t) {
126
- let s = e.el;
127
- e.params.mousewheel.eventsTarget !== "container" && (s = document.querySelector(e.params.mousewheel.eventsTarget)), s[t]("mouseenter", G), s[t]("mouseleave", O), s[t]("wheel", E);
128
- }
129
- function v() {
130
- return e.params.cssMode ? (e.wrapperEl.removeEventListener("wheel", E), !0) : e.mousewheel.enabled ? !1 : (D("addEventListener"), e.mousewheel.enabled = !0, !0);
131
- }
132
- function x() {
133
- return e.params.cssMode ? (e.wrapperEl.addEventListener(event, E), !0) : e.mousewheel.enabled ? (D("removeEventListener"), e.mousewheel.enabled = !1, !0) : !1;
134
- }
135
- I("init", () => {
136
- !e.params.mousewheel.enabled && e.params.cssMode && x(), e.params.mousewheel.enabled && v();
137
- }), I("destroy", () => {
138
- e.params.cssMode && v(), e.mousewheel.enabled && x();
139
- }), Object.assign(e.mousewheel, {
140
- enable: v,
141
- disable: x
142
- });
14
+ typeof t == "function" ? (process.env.NODE_ENV !== "production" && console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((c, ...m) => {
15
+ let d = t(e ? o : c, ...m);
16
+ return f(d, ...u), e ? c : d;
17
+ })) : (e || s(t), f(t, ...u));
18
+ }, [
19
+ e,
20
+ o,
21
+ l
22
+ ]);
23
+ return [
24
+ o,
25
+ b
26
+ ];
143
27
  }
144
28
  export {
145
- q as default
29
+ S as useControlledState
146
30
  };