@okam/stack-ui 1.25.6 → 1.27.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 (445) hide show
  1. package/components/Alerts/interface.d.ts +3 -28
  2. package/components/Button/index.d.ts +2 -2
  3. package/components/Button/interface.d.ts +2 -2
  4. package/components/Carousel/components/CarouselNavigationButton.d.ts +8 -0
  5. package/components/Carousel/components/CarouselSlide.d.ts +3 -0
  6. package/components/Carousel/components/CarouselSwiper.d.ts +3 -0
  7. package/components/Carousel/components/pagination/CarouselPagination.d.ts +3 -0
  8. package/components/Carousel/components/pagination/CarouselPaginationBullet.d.ts +3 -0
  9. package/components/Carousel/interface.d.ts +34 -17
  10. package/components/DirectusImg/interface.d.ts +2 -0
  11. package/index.d.ts +2 -2
  12. package/index.js +1 -1
  13. package/index.mjs +150 -149
  14. package/index100.js +2 -1
  15. package/index100.mjs +11 -64
  16. package/index101.js +1 -1
  17. package/index101.mjs +44 -141
  18. package/index102.js +1 -1
  19. package/index102.mjs +62 -119
  20. package/index103.js +1 -1
  21. package/index103.mjs +28 -217
  22. package/index104.js +1 -1
  23. package/index104.mjs +4 -175
  24. package/index105.js +1 -1
  25. package/index105.mjs +11 -127
  26. package/index106.js +1 -1
  27. package/index106.mjs +13 -240
  28. package/index107.js +1 -1
  29. package/index107.mjs +23 -4
  30. package/index108.js +1 -1
  31. package/index108.mjs +23 -11
  32. package/index109.js +1 -1
  33. package/index109.mjs +39 -14
  34. package/index11.js +1 -1
  35. package/index11.mjs +67 -60
  36. package/index110.js +2 -1
  37. package/index110.mjs +11 -21
  38. package/index111.js +1 -1
  39. package/index111.mjs +8 -23
  40. package/index112.js +1 -1
  41. package/index112.mjs +20 -37
  42. package/index113.js +1 -2
  43. package/index113.mjs +38 -12
  44. package/index114.js +1 -1
  45. package/index114.mjs +49 -7
  46. package/index115.js +1 -1
  47. package/index115.mjs +40 -21
  48. package/index116.js +1 -1
  49. package/index116.mjs +13 -38
  50. package/index117.js +1 -1
  51. package/index117.mjs +26 -50
  52. package/index118.js +1 -1
  53. package/index118.mjs +20 -41
  54. package/index119.js +1 -1
  55. package/index119.mjs +9 -14
  56. package/index120.js +1 -1
  57. package/index120.mjs +30 -26
  58. package/index121.js +1 -1
  59. package/index121.mjs +13 -18
  60. package/index122.js +1 -1
  61. package/index122.mjs +16 -8
  62. package/index123.js +1 -1
  63. package/index123.mjs +5 -30
  64. package/index124.js +1 -1
  65. package/index124.mjs +21 -15
  66. package/index125.js +1 -1
  67. package/index125.mjs +11 -17
  68. package/index126.js +1 -1
  69. package/index126.mjs +42 -5
  70. package/index127.js +2 -1
  71. package/index127.mjs +21 -20
  72. package/index128.js +1 -1
  73. package/index128.mjs +12 -11
  74. package/index129.js +1 -1
  75. package/index129.mjs +46 -104
  76. package/index13.js +1 -1
  77. package/index13.mjs +3 -3
  78. package/index130.js +1 -1
  79. package/index130.mjs +237 -38
  80. package/index131.js +1 -1
  81. package/index131.mjs +12 -21
  82. package/index132.js +1 -1
  83. package/index132.mjs +29 -11
  84. package/index133.js +1 -1
  85. package/index133.mjs +2 -2
  86. package/index135.js +1 -1
  87. package/index135.mjs +20 -24
  88. package/index136.js +1 -1
  89. package/index136.mjs +4 -46
  90. package/index137.js +4 -2
  91. package/index137.mjs +247 -12
  92. package/index138.js +1 -0
  93. package/index138.mjs +64 -0
  94. package/index139.js +1 -0
  95. package/index139.mjs +97 -0
  96. package/index140.js +1 -1
  97. package/index140.mjs +32 -42
  98. package/index141.js +1 -1
  99. package/index141.mjs +120 -27
  100. package/index142.js +1 -1
  101. package/index142.mjs +27 -20
  102. package/index143.js +1 -1
  103. package/index143.mjs +122 -197
  104. package/index144.js +1 -1
  105. package/index144.mjs +131 -187
  106. package/index145.js +1 -1
  107. package/index145.mjs +14 -69
  108. package/index146.js +1 -1
  109. package/index146.mjs +85 -248
  110. package/index147.js +1 -1
  111. package/index147.mjs +102 -93
  112. package/index148.js +1 -1
  113. package/index148.mjs +5 -84
  114. package/index149.js +1 -1
  115. package/index149.mjs +3 -58
  116. package/index15.js +1 -1
  117. package/index15.mjs +2 -2
  118. package/index150.js +1 -1
  119. package/index150.mjs +121 -112
  120. package/index151.js +1 -1
  121. package/index151.mjs +26 -119
  122. package/index152.js +1 -1
  123. package/index152.mjs +51 -72
  124. package/index153.js +1 -1
  125. package/index153.mjs +41 -107
  126. package/index154.js +1 -1
  127. package/index154.mjs +36 -51
  128. package/index155.js +1 -1
  129. package/index155.mjs +111 -91
  130. package/index156.js +1 -1
  131. package/index156.mjs +77 -70
  132. package/index157.js +1 -1
  133. package/index157.mjs +101 -56
  134. package/index158.js +1 -1
  135. package/index158.mjs +98 -100
  136. package/index159.js +1 -5
  137. package/index159.mjs +2 -81
  138. package/index160.js +1 -1
  139. package/index160.mjs +5 -2011
  140. package/index161.js +1 -1
  141. package/index161.mjs +64 -59
  142. package/index162.js +1 -1
  143. package/index162.mjs +25 -187
  144. package/index163.js +1 -1
  145. package/index163.mjs +54 -5
  146. package/index164.js +1 -4
  147. package/index164.mjs +148 -239
  148. package/index165.js +1 -1
  149. package/index165.mjs +23 -31
  150. package/index166.js +1 -1
  151. package/index166.mjs +18 -60
  152. package/index167.js +1 -1
  153. package/index167.mjs +38 -93
  154. package/index168.js +1 -1
  155. package/index168.mjs +82 -31
  156. package/index169.js +1 -1
  157. package/index169.mjs +28 -128
  158. package/index17.js +1 -1
  159. package/index17.mjs +1 -1
  160. package/index170.js +1 -1
  161. package/index170.mjs +19 -177
  162. package/index171.js +1 -1
  163. package/index171.mjs +52 -8
  164. package/index172.js +1 -1
  165. package/index172.mjs +2 -4
  166. package/index173.js +11 -1
  167. package/index173.mjs +114 -35
  168. package/index174.js +1 -1
  169. package/index174.mjs +199 -5
  170. package/index175.js +1 -1
  171. package/index175.mjs +61 -26
  172. package/index176.js +1 -1
  173. package/index176.mjs +141 -6
  174. package/index177.js +1 -1
  175. package/index177.mjs +114 -116
  176. package/index178.js +1 -1
  177. package/index178.mjs +217 -27
  178. package/index179.js +1 -1
  179. package/index179.mjs +188 -122
  180. package/index18.js +1 -1
  181. package/index18.mjs +2 -2
  182. package/index180.js +1 -1
  183. package/index180.mjs +67 -132
  184. package/index181.js +1 -1
  185. package/index181.mjs +258 -14
  186. package/index182.js +1 -1
  187. package/index182.mjs +92 -90
  188. package/index183.js +1 -1
  189. package/index183.mjs +172 -104
  190. package/index184.js +1 -1
  191. package/index184.mjs +84 -5
  192. package/index185.js +1 -1
  193. package/index185.mjs +58 -3
  194. package/index186.js +1 -1
  195. package/index186.mjs +123 -122
  196. package/index187.js +1 -1
  197. package/index187.mjs +113 -26
  198. package/index188.js +1 -1
  199. package/index188.mjs +119 -48
  200. package/index189.js +1 -1
  201. package/index189.mjs +72 -44
  202. package/index19.js +1 -1
  203. package/index19.mjs +1 -1
  204. package/index190.js +1 -1
  205. package/index190.mjs +107 -34
  206. package/index191.js +1 -1
  207. package/index191.mjs +50 -111
  208. package/index192.js +1 -1
  209. package/index192.mjs +93 -77
  210. package/index193.js +1 -1
  211. package/index193.mjs +70 -101
  212. package/index194.js +1 -1
  213. package/index194.mjs +57 -98
  214. package/index195.js +1 -1
  215. package/index195.mjs +100 -2
  216. package/index196.js +5 -1
  217. package/index196.mjs +80 -5
  218. package/index197.js +1 -1
  219. package/index197.mjs +2005 -58
  220. package/index198.js +1 -1
  221. package/index198.mjs +59 -26
  222. package/index199.js +1 -1
  223. package/index199.mjs +187 -53
  224. package/index200.js +1 -1
  225. package/index200.mjs +5 -155
  226. package/index201.js +1 -1
  227. package/index201.mjs +2 -23
  228. package/index202.js +1 -1
  229. package/index202.mjs +47 -14
  230. package/index203.js +1 -1
  231. package/index203.mjs +17 -36
  232. package/index204.js +1 -1
  233. package/index204.mjs +18 -77
  234. package/index205.js +1 -1
  235. package/index205.mjs +23 -27
  236. package/index206.js +1 -1
  237. package/index206.mjs +40 -15
  238. package/index207.js +1 -1
  239. package/index207.mjs +2 -61
  240. package/index208.js +1 -1
  241. package/index208.mjs +21 -2
  242. package/index209.js +1 -11
  243. package/index209.mjs +2 -116
  244. package/index210.js +1 -1
  245. package/index210.mjs +29 -2
  246. package/index211.js +1 -1
  247. package/index211.mjs +2 -6
  248. package/index212.mjs +2 -2
  249. package/index213.js +1 -1
  250. package/index213.mjs +18 -48
  251. package/index214.js +1 -1
  252. package/index214.mjs +2 -21
  253. package/index215.js +1 -1
  254. package/index215.mjs +2 -24
  255. package/index216.js +1 -1
  256. package/index216.mjs +2 -27
  257. package/index217.js +1 -1
  258. package/index217.mjs +34 -43
  259. package/index218.js +1 -1
  260. package/index218.mjs +2 -2
  261. package/index219.js +1 -1
  262. package/index219.mjs +12 -12
  263. package/index22.js +1 -1
  264. package/index22.mjs +3 -3
  265. package/index220.js +1 -1
  266. package/index220.mjs +23 -2
  267. package/index221.js +1 -1
  268. package/index221.mjs +2 -29
  269. package/index222.js +1 -1
  270. package/index222.mjs +23 -2
  271. package/index223.mjs +2 -2
  272. package/index224.js +1 -1
  273. package/index224.mjs +311 -20
  274. package/index225.js +1 -1
  275. package/index225.mjs +193 -2
  276. package/index226.js +1 -1
  277. package/index226.mjs +9 -2
  278. package/index227.js +1 -1
  279. package/index227.mjs +27 -2
  280. package/index228.js +1 -1
  281. package/index228.mjs +55 -37
  282. package/index229.js +1 -1
  283. package/index229.mjs +47 -2
  284. package/index23.js +1 -1
  285. package/index23.mjs +4 -4
  286. package/index230.js +1 -1
  287. package/index230.mjs +124 -20
  288. package/index231.js +1 -1
  289. package/index231.mjs +128 -20
  290. package/index232.js +1 -1
  291. package/index232.mjs +180 -2
  292. package/index233.js +1 -1
  293. package/index233.mjs +8 -21
  294. package/index234.js +1 -1
  295. package/index234.mjs +4 -2
  296. package/index235.js +1 -1
  297. package/index235.mjs +35 -312
  298. package/index236.js +1 -1
  299. package/index236.mjs +5 -192
  300. package/index237.js +1 -1
  301. package/index237.mjs +29 -8
  302. package/index238.js +1 -1
  303. package/index238.mjs +6 -26
  304. package/index239.js +1 -1
  305. package/index239.mjs +2 -56
  306. package/index240.js +1 -1
  307. package/index240.mjs +2 -47
  308. package/index241.js +1 -1
  309. package/index241.mjs +2 -125
  310. package/index242.js +1 -1
  311. package/index242.mjs +17 -5
  312. package/index243.js +1 -1
  313. package/index243.mjs +27 -2
  314. package/index244.mjs +2 -2
  315. package/index245.js +1 -1
  316. package/index245.mjs +89 -2
  317. package/index246.js +1 -1
  318. package/index246.mjs +11 -9
  319. package/index247.js +1 -1
  320. package/index247.mjs +2 -27
  321. package/index248.js +1 -1
  322. package/index248.mjs +38 -2
  323. package/index249.js +1 -1
  324. package/index249.mjs +131 -83
  325. package/index25.js +1 -1
  326. package/index25.mjs +2 -2
  327. package/index250.js +1 -1
  328. package/index250.mjs +2 -20
  329. package/index251.js +1 -1
  330. package/index251.mjs +23 -2
  331. package/index252.js +1 -1
  332. package/index252.mjs +2 -38
  333. package/index253.js +1 -1
  334. package/index253.mjs +2 -137
  335. package/index254.mjs +2 -2
  336. package/index255.js +1 -1
  337. package/index255.mjs +2 -23
  338. package/index256.js +1 -1
  339. package/index256.mjs +23 -2
  340. package/index257.js +1 -1
  341. package/index257.mjs +2 -2
  342. package/index258.js +1 -1
  343. package/index258.mjs +26 -2
  344. package/index259.js +1 -1
  345. package/index259.mjs +2 -2
  346. package/index26.js +1 -1
  347. package/index26.mjs +3 -3
  348. package/index260.js +1 -1
  349. package/index260.mjs +2 -23
  350. package/index261.js +1 -1
  351. package/index261.mjs +2 -2
  352. package/index262.js +1 -1
  353. package/index262.mjs +2 -26
  354. package/index264.js +1 -1
  355. package/index264.mjs +72 -2
  356. package/index265.mjs +2 -2
  357. package/index267.js +1 -1
  358. package/index267.mjs +19 -2
  359. package/index268.js +1 -1
  360. package/index268.mjs +2 -72
  361. package/index269.js +1 -1
  362. package/index269.mjs +6 -2
  363. package/index270.mjs +2 -2
  364. package/index271.js +1 -1
  365. package/index271.mjs +2 -19
  366. package/index272.js +1 -1
  367. package/index272.mjs +29 -2
  368. package/index273.js +1 -1
  369. package/index273.mjs +7 -2
  370. package/index274.js +1 -1
  371. package/index274.mjs +8 -2
  372. package/index275.js +1 -1
  373. package/index275.mjs +7 -28
  374. package/index276.js +1 -1
  375. package/index276.mjs +2 -7
  376. package/index277.js +1 -1
  377. package/index277.mjs +36 -7
  378. package/index278.js +1 -1
  379. package/index278.mjs +2 -8
  380. package/index279.js +1 -1
  381. package/index279.mjs +5 -2
  382. package/index28.js +1 -1
  383. package/index28.mjs +1 -1
  384. package/index280.js +1 -1
  385. package/index280.mjs +5 -36
  386. package/index281.js +1 -1
  387. package/index281.mjs +10 -2
  388. package/index282.js +1 -1
  389. package/index282.mjs +2 -5
  390. package/index283.js +1 -1
  391. package/index283.mjs +17 -5
  392. package/index284.js +1 -1
  393. package/index284.mjs +30 -9
  394. package/index285.mjs +2 -2
  395. package/index286.js +1 -1
  396. package/index286.mjs +2 -18
  397. package/index30.js +1 -1
  398. package/index30.mjs +2 -2
  399. package/index31.js +1 -1
  400. package/index31.mjs +1 -1
  401. package/index32.js +1 -1
  402. package/index32.mjs +1 -1
  403. package/index33.js +1 -1
  404. package/index33.mjs +1 -1
  405. package/index34.js +1 -1
  406. package/index34.mjs +30 -29
  407. package/index35.js +1 -1
  408. package/index35.mjs +16 -15
  409. package/index37.js +1 -1
  410. package/index37.mjs +35 -29
  411. package/index65.js +1 -1
  412. package/index65.mjs +1 -1
  413. package/index66.js +1 -1
  414. package/index66.mjs +1 -1
  415. package/index67.js +1 -1
  416. package/index67.mjs +1 -1
  417. package/index69.js +1 -1
  418. package/index69.mjs +1 -1
  419. package/index70.js +1 -1
  420. package/index70.mjs +1 -1
  421. package/index79.js +1 -1
  422. package/index79.mjs +13 -13
  423. package/index83.js +9 -1
  424. package/index83.mjs +52 -17
  425. package/index96.js +1 -1
  426. package/index96.mjs +3 -3
  427. package/index97.js +1 -1
  428. package/index97.mjs +1 -1
  429. package/package.json +1 -1
  430. package/providers/Swiper/index.d.ts +4 -0
  431. package/providers/{Alerts → Swiper}/interface.d.ts +2 -2
  432. package/theme/Alerts/index.d.ts +1 -1
  433. package/theme/Carousel/index.d.ts +216 -8
  434. package/components/Alerts/components/AlertsNavigationButton.d.ts +0 -8
  435. package/components/Alerts/components/AlertsSwiper.d.ts +0 -3
  436. package/components/Alerts/components/pagination/AlertsPagination.d.ts +0 -3
  437. package/components/Alerts/components/pagination/AlertsPaginationBullet.d.ts +0 -3
  438. package/index287.js +0 -1
  439. package/index287.mjs +0 -33
  440. package/index288.js +0 -1
  441. package/index288.mjs +0 -4
  442. package/index289.js +0 -1
  443. package/index289.mjs +0 -4
  444. package/providers/Alerts/index.d.ts +0 -4
  445. package/style.css +0 -1
package/index141.mjs CHANGED
@@ -1,31 +1,124 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { FocusScope as p } from "react-aria";
3
- import s from "./index24.mjs";
4
- import c from "./index165.mjs";
5
- const h = (a) => {
6
- const { themeName: r, tokens: o, alerts: t, activeIndex: i, paginationGroupLabel: n } = a;
7
- return /* @__PURE__ */ e(
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
+ }, c = {
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
+ };
33
+ }
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(() => C(Y(d, o)), [
44
+ d,
45
+ o
46
+ ]);
47
+ l != null && l.validationDetails.valid && (l = null);
48
+ let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
8
49
  s,
9
- {
10
- as: "div",
11
- themeName: `${r}.wrapper`,
12
- tokens: o,
13
- role: "group",
14
- "aria-label": n,
15
- children: /* @__PURE__ */ e(p, { children: t.map((m, l) => /* @__PURE__ */ e(
16
- c,
17
- {
18
- index: l,
19
- activeIndex: i,
20
- alerts: t,
21
- themeName: r,
22
- tokens: o
23
- },
24
- JSON.stringify(m)
25
- )) })
50
+ i
51
+ ]), [M, _] = f(s), [x, m] = f(!1);
52
+ s !== M && (_(s), m(!1));
53
+ let $ = I(() => C(x ? [] : A), [
54
+ x,
55
+ A
56
+ ]), g = T(c), [b, E] = f(c), u = T(c), w = () => {
57
+ if (!F) return;
58
+ p(!1);
59
+ let r = V || l || g.current;
60
+ y(r, u.current) || (u.current = r, E(r));
61
+ }, [F, p] = f(!1);
62
+ return R(w), {
63
+ realtimeValidation: v || $ || V || l || c,
64
+ displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
65
+ updateValidation(r) {
66
+ n === "aria" && !y(b, r) ? E(r) : g.current = r;
67
+ },
68
+ resetValidation() {
69
+ let r = c;
70
+ y(r, u.current) || (u.current = r, E(r)), n === "native" && p(!1), m(!0);
71
+ },
72
+ commitValidation() {
73
+ n === "native" && p(!0), m(!0);
26
74
  }
27
- );
28
- };
75
+ };
76
+ }
77
+ function S(a) {
78
+ return a ? Array.isArray(a) ? a : [
79
+ a
80
+ ] : [];
81
+ }
82
+ function Y(a, e) {
83
+ if (typeof a == "function") {
84
+ let t = a(e);
85
+ if (t && typeof t != "boolean") return S(t);
86
+ }
87
+ return [];
88
+ }
89
+ function C(a) {
90
+ return a.length ? {
91
+ isInvalid: !0,
92
+ validationErrors: a,
93
+ validationDetails: L
94
+ } : null;
95
+ }
96
+ function y(a, e) {
97
+ 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);
98
+ }
99
+ function k(...a) {
100
+ let e = /* @__PURE__ */ new Set(), t = !1, i = {
101
+ ...D
102
+ };
103
+ for (let d of a) {
104
+ var o, l;
105
+ for (let n of d.validationErrors) e.add(n);
106
+ t || (t = d.isInvalid);
107
+ for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
108
+ }
109
+ return i.valid = !t, {
110
+ isInvalid: t,
111
+ validationErrors: [
112
+ ...e
113
+ ],
114
+ validationDetails: i
115
+ };
116
+ }
29
117
  export {
30
- h as default
118
+ c as DEFAULT_VALIDATION_RESULT,
119
+ B as FormValidationContext,
120
+ D as VALID_VALIDITY_STATE,
121
+ k as mergeValidation,
122
+ h as privateValidationStateProp,
123
+ P as useFormValidationState
31
124
  };
package/index142.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index242.js"),l=require("@react-aria/utils"),u=require("@react-aria/focus");function t(a,e,r){let n=u.useHasTabbableChild(r)?void 0:0;var i;const b=d.generateId(e,(i=a.id)!==null&&i!==void 0?i:e==null?void 0:e.selectedKey,"tabpanel"),o=l.useLabels({...a,id:b,"aria-labelledby":d.generateId(e,e==null?void 0:e.selectedKey,"tab")});return{tabPanelProps:l.mergeProps(o,{tabIndex:n,role:"tabpanel","aria-describedby":a["aria-describedby"],"aria-details":a["aria-details"]})}}exports.useTabPanel=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function C(o,b,u){let[p,s]=l.useState(o||b),i=l.useRef(o!==void 0),e=o!==void 0;l.useEffect(()=>{let t=i.current;t!==e&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${e?"controlled":"uncontrolled"}.`),i.current=e},[e]);let n=e?o:p,S=l.useCallback((t,...f)=>{let a=(r,...c)=>{u&&(Object.is(n,r)||u(r,...c)),e||(n=r)};typeof t=="function"?(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)=>{let d=t(e?n:c,...m);return a(d,...f),e?c:d})):(e||s(t),a(t,...f))},[e,n,u]);return[n,S]}exports.useControlledState=C;
package/index142.mjs CHANGED
@@ -1,23 +1,30 @@
1
- import { generateId as i } from "./index242.mjs";
2
- import { useLabels as n, mergeProps as c } from "@react-aria/utils";
3
- import { useHasTabbableChild as f } from "@react-aria/focus";
4
- function m(a, e, l) {
5
- let r = f(l) ? void 0 : 0;
6
- var d;
7
- const b = i(e, (d = a.id) !== null && d !== void 0 ? d : e == null ? void 0 : e.selectedKey, "tabpanel"), o = n({
8
- ...a,
9
- id: b,
10
- "aria-labelledby": i(e, e == null ? void 0 : e.selectedKey, "tab")
11
- });
12
- return {
13
- tabPanelProps: c(o, {
14
- tabIndex: r,
15
- role: "tabpanel",
16
- "aria-describedby": a["aria-describedby"],
17
- "aria-details": a["aria-details"]
18
- })
19
- };
1
+ import { useState as C, useRef as $, useEffect as S, useCallback as V } from "react";
2
+ function w(o, d, c) {
3
+ let [p, s] = C(o || d), u = $(o !== void 0), e = o !== void 0;
4
+ S(() => {
5
+ let t = u.current;
6
+ t !== e && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), u.current = e;
7
+ }, [
8
+ e
9
+ ]);
10
+ let n = e ? o : p, b = V((t, ...i) => {
11
+ let f = (r, ...l) => {
12
+ c && (Object.is(n, r) || c(r, ...l)), e || (n = r);
13
+ };
14
+ typeof t == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((l, ...m) => {
15
+ let a = t(e ? n : l, ...m);
16
+ return f(a, ...i), e ? l : a;
17
+ })) : (e || s(t), f(t, ...i));
18
+ }, [
19
+ e,
20
+ n,
21
+ c
22
+ ]);
23
+ return [
24
+ n,
25
+ b
26
+ ];
20
27
  }
21
28
  export {
22
- m as useTabPanel
29
+ w as useControlledState
23
30
  };
package/index143.js CHANGED
@@ -1 +1 @@
1
- "use strict";const R=require("./index169.js"),x=require("./index170.js");function _(I){let{swiper:e,extendParams:U,on:M,emit:T}=I;U({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let P;const y=R.g();e.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const $=y.createElement("div");function G(i,r){const a=e.params.virtual;if(a.cache&&e.virtual.cache[r])return e.virtual.cache[r];let s;return a.renderSlide?(s=a.renderSlide.call(e,i,r),typeof s=="string"&&($.innerHTML=s,s=$.children[0])):e.isElement?s=x.c("swiper-slide"):s=x.c("div",e.params.slideClass),s.setAttribute("data-swiper-slide-index",r),a.renderSlide||(s.innerHTML=i),a.cache&&(e.virtual.cache[r]=s),s}function u(i){const{slidesPerView:r,slidesPerGroup:a,centeredSlides:s,loop:d}=e.params,{addSlidesBefore:g,addSlidesAfter:w}=e.params.virtual,{from:p,to:h,slides:n,slidesGrid:V,offset:q}=e.virtual;e.params.cssMode||e.updateActiveIndex();const S=e.activeIndex||0;let b;e.rtlTranslate?b="right":b=e.isHorizontal()?"left":"top";let A,o;s?(A=Math.floor(r/2)+a+w,o=Math.floor(r/2)+a+g):(A=r+(a-1)+w,o=(d?r:a)+g);let c=S-o,f=S+A;d||(c=Math.max(c,0),f=Math.min(f,n.length-1));let v=(e.slidesGrid[c]||0)-(e.slidesGrid[0]||0);d&&S>=o?(c-=o,s||(v+=e.slidesGrid[0])):d&&S<o&&(c=-o,s&&(v+=e.slidesGrid[0])),Object.assign(e.virtual,{from:c,to:f,offset:v,slidesGrid:e.slidesGrid,slidesBefore:o,slidesAfter:A});function j(){e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),T("virtualUpdate")}if(p===c&&h===f&&!i){e.slidesGrid!==V&&v!==q&&e.slides.forEach(t=>{t.style[b]=`${v-Math.abs(e.cssOverflowAdjustment())}px`}),e.updateProgress(),T("virtualUpdate");return}if(e.params.virtual.renderExternal){e.params.virtual.renderExternal.call(e,{offset:v,from:c,to:f,slides:function(){const l=[];for(let m=c;m<=f;m+=1)l.push(n[m]);return l}()}),e.params.virtual.renderExternalUpdate?j():T("virtualUpdate");return}const E=[],O=[],C=t=>{let l=t;return t<0?l=n.length+t:l>=n.length&&(l=l-n.length),l};if(i)e.slides.filter(t=>t.matches(`.${e.params.slideClass}, swiper-slide`)).forEach(t=>{t.remove()});else for(let t=p;t<=h;t+=1)if(t<c||t>f){const l=C(t);e.slides.filter(m=>m.matches(`.${e.params.slideClass}[data-swiper-slide-index="${l}"], swiper-slide[data-swiper-slide-index="${l}"]`)).forEach(m=>{m.remove()})}const F=d?-n.length:0,N=d?n.length*2:n.length;for(let t=F;t<N;t+=1)if(t>=c&&t<=f){const l=C(t);typeof h>"u"||i?O.push(l):(t>h&&O.push(l),t<p&&E.push(l))}if(O.forEach(t=>{e.slidesEl.append(G(n[t],t))}),d)for(let t=E.length-1;t>=0;t-=1){const l=E[t];e.slidesEl.prepend(G(n[l],l))}else E.sort((t,l)=>l-t),E.forEach(t=>{e.slidesEl.prepend(G(n[t],t))});x.e(e.slidesEl,".swiper-slide, swiper-slide").forEach(t=>{t.style[b]=`${v-Math.abs(e.cssOverflowAdjustment())}px`}),j()}function z(i){if(typeof i=="object"&&"length"in i)for(let r=0;r<i.length;r+=1)i[r]&&e.virtual.slides.push(i[r]);else e.virtual.slides.push(i);u(!0)}function B(i){const r=e.activeIndex;let a=r+1,s=1;if(Array.isArray(i)){for(let d=0;d<i.length;d+=1)i[d]&&e.virtual.slides.unshift(i[d]);a=r+i.length,s=i.length}else e.virtual.slides.unshift(i);if(e.params.virtual.cache){const d=e.virtual.cache,g={};Object.keys(d).forEach(w=>{const p=d[w],h=p.getAttribute("data-swiper-slide-index");h&&p.setAttribute("data-swiper-slide-index",parseInt(h,10)+s),g[parseInt(w,10)+s]=p}),e.virtual.cache=g}u(!0),e.slideTo(a,0)}function H(i){if(typeof i>"u"||i===null)return;let r=e.activeIndex;if(Array.isArray(i))for(let a=i.length-1;a>=0;a-=1)e.params.virtual.cache&&(delete e.virtual.cache[i[a]],Object.keys(e.virtual.cache).forEach(s=>{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])})),e.virtual.slides.splice(i[a],1),i[a]<r&&(r-=1),r=Math.max(r,0);else e.params.virtual.cache&&(delete e.virtual.cache[i],Object.keys(e.virtual.cache).forEach(a=>{a>i&&(e.virtual.cache[a-1]=e.virtual.cache[a],e.virtual.cache[a-1].setAttribute("data-swiper-slide-index",a-1),delete e.virtual.cache[a])})),e.virtual.slides.splice(i,1),i<r&&(r-=1),r=Math.max(r,0);u(!0),e.slideTo(r,0)}function L(){e.virtual.slides=[],e.params.virtual.cache&&(e.virtual.cache={}),u(!0),e.slideTo(0,0)}M("beforeInit",()=>{if(!e.params.virtual.enabled)return;let i;if(typeof e.passedParams.virtual.slides>"u"){const r=[...e.slidesEl.children].filter(a=>a.matches(`.${e.params.slideClass}, swiper-slide`));r&&r.length&&(e.virtual.slides=[...r],i=!0,r.forEach((a,s)=>{a.setAttribute("data-swiper-slide-index",s),e.virtual.cache[s]=a,a.remove()}))}i||(e.virtual.slides=e.params.virtual.slides),e.classNames.push(`${e.params.containerModifierClass}virtual`),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0,u()}),M("setTranslate",()=>{e.params.virtual.enabled&&(e.params.cssMode&&!e._immediateVirtual?(clearTimeout(P),P=setTimeout(()=>{u()},100)):u())}),M("init update resize",()=>{e.params.virtual.enabled&&e.params.cssMode&&x.s(e.wrapperEl,"--swiper-virtual-size",`${e.virtualSize}px`)}),Object.assign(e.virtual,{appendSlide:z,prependSlide:B,removeSlide:H,removeAllSlides:L,update:u})}module.exports=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index144.js"),l=require("./index133.js"),d=require("./index145.js"),f=require("./index146.js"),u=require("./index147.js"),y=require("./index148.js");function m(s){let t=typeof s[0]=="object"?s.shift():new f.GregorianCalendar,e;if(typeof s[0]=="string")e=s.shift();else{let a=t.getEras();e=a[a.length-1]}let r=s.shift(),n=s.shift(),h=s.shift();return[t,e,r,n,h]}var p=new WeakMap;class c{copy(){return this.era?new c(this.calendar,this.era,this.year,this.month,this.day):new c(this.calendar,this.year,this.month,this.day)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(this,t)}cycle(t,e,r){return i.cycleDate(this,t,e,r)}toDate(t){return u.toDate(this,t)}toString(){return d.dateToString(this)}compare(t){return l.compareDate(this,t)}constructor(...t){y._class_private_field_init(this,p,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,i.constrain(this)}}var v=new WeakMap;class o{copy(){return this.era?new o(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new o(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(i.setTime(this,t),t)}cycle(t,e,r){switch(t){case"era":case"year":case"month":case"day":return i.cycleDate(this,t,e,r);default:return i.cycleTime(this,t,e,r)}}toDate(t,e){return u.toDate(this,t,e)}toString(){return d.dateTimeToString(this)}compare(t){let e=l.compareDate(this,t);return e===0?l.compareTime(this,u.toCalendarDateTime(t)):e}constructor(...t){y._class_private_field_init(this,v,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,i.constrain(this)}}exports.CalendarDate=c;exports.CalendarDateTime=o;
package/index143.mjs CHANGED
@@ -1,202 +1,127 @@
1
- import { g as R } from "./index169.mjs";
2
- import { s as _, e as q, c as j } from "./index170.mjs";
3
- function Q(y) {
4
- let {
5
- swiper: e,
6
- extendParams: I,
7
- on: x,
8
- emit: M
9
- } = y;
10
- I({
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 P;
23
- const U = R();
24
- e.virtual = {
25
- cache: {},
26
- from: void 0,
27
- to: void 0,
28
- slides: [],
29
- offset: 0,
30
- slidesGrid: []
31
- };
32
- const O = U.createElement("div");
33
- function T(i, r) {
34
- const a = e.params.virtual;
35
- if (a.cache && e.virtual.cache[r])
36
- return e.virtual.cache[r];
37
- let s;
38
- return a.renderSlide ? (s = a.renderSlide.call(e, i, r), typeof s == "string" && (O.innerHTML = s, s = O.children[0])) : e.isElement ? s = j("swiper-slide") : s = j("div", e.params.slideClass), s.setAttribute("data-swiper-slide-index", r), a.renderSlide || (s.innerHTML = i), a.cache && (e.virtual.cache[r] = s), s;
39
- }
40
- function o(i) {
41
- const {
42
- slidesPerView: r,
43
- slidesPerGroup: a,
44
- centeredSlides: s,
45
- loop: d
46
- } = e.params, {
47
- addSlidesBefore: g,
48
- addSlidesAfter: S
49
- } = e.params.virtual, {
50
- from: p,
51
- to: h,
52
- slides: n,
53
- slidesGrid: V,
54
- offset: D
55
- } = e.virtual;
56
- e.params.cssMode || e.updateActiveIndex();
57
- const E = e.activeIndex || 0;
58
- let b;
59
- e.rtlTranslate ? b = "right" : b = e.isHorizontal() ? "left" : "top";
60
- let A, u;
61
- s ? (A = Math.floor(r / 2) + a + S, u = Math.floor(r / 2) + a + g) : (A = r + (a - 1) + S, u = (d ? r : a) + g);
62
- let c = E - u, f = E + A;
63
- d || (c = Math.max(c, 0), f = Math.min(f, n.length - 1));
64
- let v = (e.slidesGrid[c] || 0) - (e.slidesGrid[0] || 0);
65
- d && E >= u ? (c -= u, s || (v += e.slidesGrid[0])) : d && E < u && (c = -u, s && (v += e.slidesGrid[0])), Object.assign(e.virtual, {
66
- from: c,
67
- to: f,
68
- offset: v,
69
- slidesGrid: e.slidesGrid,
70
- slidesBefore: u,
71
- slidesAfter: A
1
+ import { add as n, subtract as o, set as $, cycleDate as f, constrain as l, setTime as b, cycleTime as x } from "./index144.mjs";
2
+ import { compareDate as m, compareTime as v } from "./index133.mjs";
3
+ import { dateToString as w, dateTimeToString as D } from "./index145.mjs";
4
+ import { GregorianCalendar as T } from "./index146.mjs";
5
+ import { toDate as u, toCalendarDateTime as C } from "./index147.mjs";
6
+ import { _class_private_field_init as p } from "./index148.mjs";
7
+ function y(r) {
8
+ let t = typeof r[0] == "object" ? r.shift() : new T(), e;
9
+ if (typeof r[0] == "string") e = r.shift();
10
+ else {
11
+ let s = t.getEras();
12
+ e = s[s.length - 1];
13
+ }
14
+ let a = r.shift(), i = r.shift(), h = r.shift();
15
+ return [
16
+ t,
17
+ e,
18
+ a,
19
+ i,
20
+ h
21
+ ];
22
+ }
23
+ var S = /* @__PURE__ */ new WeakMap();
24
+ class d {
25
+ /** Returns a copy of this date. */
26
+ copy() {
27
+ return this.era ? new d(this.calendar, this.era, this.year, this.month, this.day) : new d(this.calendar, this.year, this.month, this.day);
28
+ }
29
+ /** Returns a new `CalendarDate` with the given duration added to it. */
30
+ add(t) {
31
+ return n(this, t);
32
+ }
33
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */
34
+ subtract(t) {
35
+ return o(this, t);
36
+ }
37
+ /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
38
+ set(t) {
39
+ return $(this, t);
40
+ }
41
+ /**
42
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
43
+ * When the resulting value reaches the limits of the field, it wraps around.
44
+ */
45
+ cycle(t, e, a) {
46
+ return f(this, t, e, a);
47
+ }
48
+ /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
49
+ toDate(t) {
50
+ return u(this, t);
51
+ }
52
+ /** Converts the date to an ISO 8601 formatted string. */
53
+ toString() {
54
+ return w(this);
55
+ }
56
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
57
+ compare(t) {
58
+ return m(this, t);
59
+ }
60
+ constructor(...t) {
61
+ p(this, S, {
62
+ writable: !0,
63
+ value: void 0
72
64
  });
73
- function C() {
74
- e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), M("virtualUpdate");
75
- }
76
- if (p === c && h === f && !i) {
77
- e.slidesGrid !== V && v !== D && e.slides.forEach((t) => {
78
- t.style[b] = `${v - Math.abs(e.cssOverflowAdjustment())}px`;
79
- }), e.updateProgress(), M("virtualUpdate");
80
- return;
81
- }
82
- if (e.params.virtual.renderExternal) {
83
- e.params.virtual.renderExternal.call(e, {
84
- offset: v,
85
- from: c,
86
- to: f,
87
- slides: function() {
88
- const l = [];
89
- for (let m = c; m <= f; m += 1)
90
- l.push(n[m]);
91
- return l;
92
- }()
93
- }), e.params.virtual.renderExternalUpdate ? C() : M("virtualUpdate");
94
- return;
95
- }
96
- const w = [], G = [], $ = (t) => {
97
- let l = t;
98
- return t < 0 ? l = n.length + t : l >= n.length && (l = l - n.length), l;
99
- };
100
- if (i)
101
- e.slides.filter((t) => t.matches(`.${e.params.slideClass}, swiper-slide`)).forEach((t) => {
102
- t.remove();
103
- });
104
- else
105
- for (let t = p; t <= h; t += 1)
106
- if (t < c || t > f) {
107
- const l = $(t);
108
- e.slides.filter((m) => m.matches(`.${e.params.slideClass}[data-swiper-slide-index="${l}"], swiper-slide[data-swiper-slide-index="${l}"]`)).forEach((m) => {
109
- m.remove();
110
- });
111
- }
112
- const F = d ? -n.length : 0, N = d ? n.length * 2 : n.length;
113
- for (let t = F; t < N; t += 1)
114
- if (t >= c && t <= f) {
115
- const l = $(t);
116
- typeof h > "u" || i ? G.push(l) : (t > h && G.push(l), t < p && w.push(l));
117
- }
118
- if (G.forEach((t) => {
119
- e.slidesEl.append(T(n[t], t));
120
- }), d)
121
- for (let t = w.length - 1; t >= 0; t -= 1) {
122
- const l = w[t];
123
- e.slidesEl.prepend(T(n[l], l));
124
- }
125
- else
126
- w.sort((t, l) => l - t), w.forEach((t) => {
127
- e.slidesEl.prepend(T(n[t], t));
128
- });
129
- q(e.slidesEl, ".swiper-slide, swiper-slide").forEach((t) => {
130
- t.style[b] = `${v - Math.abs(e.cssOverflowAdjustment())}px`;
131
- }), C();
132
- }
133
- function z(i) {
134
- if (typeof i == "object" && "length" in i)
135
- for (let r = 0; r < i.length; r += 1)
136
- i[r] && e.virtual.slides.push(i[r]);
137
- else
138
- e.virtual.slides.push(i);
139
- o(!0);
140
- }
141
- function B(i) {
142
- const r = e.activeIndex;
143
- let a = r + 1, s = 1;
144
- if (Array.isArray(i)) {
145
- for (let d = 0; d < i.length; d += 1)
146
- i[d] && e.virtual.slides.unshift(i[d]);
147
- a = r + i.length, s = i.length;
148
- } else
149
- e.virtual.slides.unshift(i);
150
- if (e.params.virtual.cache) {
151
- const d = e.virtual.cache, g = {};
152
- Object.keys(d).forEach((S) => {
153
- const p = d[S], h = p.getAttribute("data-swiper-slide-index");
154
- h && p.setAttribute("data-swiper-slide-index", parseInt(h, 10) + s), g[parseInt(S, 10) + s] = p;
155
- }), e.virtual.cache = g;
156
- }
157
- o(!0), e.slideTo(a, 0);
158
- }
159
- function H(i) {
160
- if (typeof i > "u" || i === null) return;
161
- let r = e.activeIndex;
162
- if (Array.isArray(i))
163
- for (let a = i.length - 1; a >= 0; a -= 1)
164
- e.params.virtual.cache && (delete e.virtual.cache[i[a]], Object.keys(e.virtual.cache).forEach((s) => {
165
- 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]);
166
- })), e.virtual.slides.splice(i[a], 1), i[a] < r && (r -= 1), r = Math.max(r, 0);
167
- else
168
- e.params.virtual.cache && (delete e.virtual.cache[i], Object.keys(e.virtual.cache).forEach((a) => {
169
- a > i && (e.virtual.cache[a - 1] = e.virtual.cache[a], e.virtual.cache[a - 1].setAttribute("data-swiper-slide-index", a - 1), delete e.virtual.cache[a]);
170
- })), e.virtual.slides.splice(i, 1), i < r && (r -= 1), r = Math.max(r, 0);
171
- o(!0), e.slideTo(r, 0);
172
- }
173
- function L() {
174
- e.virtual.slides = [], e.params.virtual.cache && (e.virtual.cache = {}), o(!0), e.slideTo(0, 0);
175
- }
176
- x("beforeInit", () => {
177
- if (!e.params.virtual.enabled) return;
178
- let i;
179
- if (typeof e.passedParams.virtual.slides > "u") {
180
- const r = [...e.slidesEl.children].filter((a) => a.matches(`.${e.params.slideClass}, swiper-slide`));
181
- r && r.length && (e.virtual.slides = [...r], i = !0, r.forEach((a, s) => {
182
- a.setAttribute("data-swiper-slide-index", s), e.virtual.cache[s] = a, a.remove();
183
- }));
65
+ let [e, a, i, h, s] = y(t);
66
+ this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, l(this);
67
+ }
68
+ }
69
+ var k = /* @__PURE__ */ new WeakMap();
70
+ class c {
71
+ /** Returns a copy of this date. */
72
+ copy() {
73
+ return this.era ? new c(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new c(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
74
+ }
75
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */
76
+ add(t) {
77
+ return n(this, t);
78
+ }
79
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
80
+ subtract(t) {
81
+ return o(this, t);
82
+ }
83
+ /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
84
+ set(t) {
85
+ return $(b(this, t), t);
86
+ }
87
+ /**
88
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
89
+ * When the resulting value reaches the limits of the field, it wraps around.
90
+ */
91
+ cycle(t, e, a) {
92
+ switch (t) {
93
+ case "era":
94
+ case "year":
95
+ case "month":
96
+ case "day":
97
+ return f(this, t, e, a);
98
+ default:
99
+ return x(this, t, e, a);
184
100
  }
185
- i || (e.virtual.slides = e.params.virtual.slides), e.classNames.push(`${e.params.containerModifierClass}virtual`), e.params.watchSlidesProgress = !0, e.originalParams.watchSlidesProgress = !0, o();
186
- }), x("setTranslate", () => {
187
- e.params.virtual.enabled && (e.params.cssMode && !e._immediateVirtual ? (clearTimeout(P), P = setTimeout(() => {
188
- o();
189
- }, 100)) : o());
190
- }), x("init update resize", () => {
191
- e.params.virtual.enabled && e.params.cssMode && _(e.wrapperEl, "--swiper-virtual-size", `${e.virtualSize}px`);
192
- }), Object.assign(e.virtual, {
193
- appendSlide: z,
194
- prependSlide: B,
195
- removeSlide: H,
196
- removeAllSlides: L,
197
- update: o
198
- });
101
+ }
102
+ /** Converts the date to a native JavaScript Date object in the given time zone. */
103
+ toDate(t, e) {
104
+ return u(this, t, e);
105
+ }
106
+ /** Converts the date to an ISO 8601 formatted string. */
107
+ toString() {
108
+ return D(this);
109
+ }
110
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
111
+ compare(t) {
112
+ let e = m(this, t);
113
+ return e === 0 ? v(this, C(t)) : e;
114
+ }
115
+ constructor(...t) {
116
+ p(this, k, {
117
+ writable: !0,
118
+ value: void 0
119
+ });
120
+ let [e, a, i, h, s] = y(t);
121
+ this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, l(this);
122
+ }
199
123
  }
200
124
  export {
201
- Q as default
125
+ d as CalendarDate,
126
+ c as CalendarDateTime
202
127
  };
package/index144.js CHANGED
@@ -1 +1 @@
1
- "use strict";const A=require("./index169.js"),n=require("./index170.js"),I=require("./index171.js"),j=require("./index172.js");function B(x){let{swiper:s,extendParams:q,on:f,emit:g}=x;const y=A.g();let b=!1,w=null,h=null,v,i,p,D;q({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),s.scrollbar={el:null,dragEl:null};function u(){if(!s.params.scrollbar.el||!s.scrollbar.el)return;const{scrollbar:l,rtlTranslate:a}=s,{dragEl:r,el:e}=l,t=s.params.scrollbar,c=s.params.loop?s.progressLoop:s.progress;let d=i,o=(p-i)*c;a?(o=-o,o>0?(d=i-o,o=0):-o+i>p&&(d=p+o)):o<0?(d=i+o,o=0):o+i>p&&(d=p-o),s.isHorizontal()?(r.style.transform=`translate3d(${o}px, 0, 0)`,r.style.width=`${d}px`):(r.style.transform=`translate3d(0px, ${o}px, 0)`,r.style.height=`${d}px`),t.hide&&(clearTimeout(w),e.style.opacity=1,w=setTimeout(()=>{e.style.opacity=0,e.style.transitionDuration="400ms"},1e3))}function H(l){!s.params.scrollbar.el||!s.scrollbar.el||(s.scrollbar.dragEl.style.transitionDuration=`${l}ms`)}function m(){if(!s.params.scrollbar.el||!s.scrollbar.el)return;const{scrollbar:l}=s,{dragEl:a,el:r}=l;a.style.width="",a.style.height="",p=s.isHorizontal()?r.offsetWidth:r.offsetHeight,D=s.size/(s.virtualSize+s.params.slidesOffsetBefore-(s.params.centeredSlides?s.snapGrid[0]:0)),s.params.scrollbar.dragSize==="auto"?i=p*D:i=parseInt(s.params.scrollbar.dragSize,10),s.isHorizontal()?a.style.width=`${i}px`:a.style.height=`${i}px`,D>=1?r.style.display="none":r.style.display="",s.params.scrollbar.hide&&(r.style.opacity=0),s.params.watchOverflow&&s.enabled&&l.el.classList[s.isLocked?"add":"remove"](s.params.scrollbar.lockClass)}function E(l){return s.isHorizontal()?l.clientX:l.clientY}function S(l){const{scrollbar:a,rtlTranslate:r}=s,{el:e}=a;let t;t=(E(l)-n.b(e)[s.isHorizontal()?"left":"top"]-(v!==null?v:i/2))/(p-i),t=Math.max(Math.min(t,1),0),r&&(t=1-t);const c=s.minTranslate()+(s.maxTranslate()-s.minTranslate())*t;s.updateProgress(c),s.setTranslate(c),s.updateActiveIndex(),s.updateSlidesClasses()}function k(l){const a=s.params.scrollbar,{scrollbar:r,wrapperEl:e}=s,{el:t,dragEl:c}=r;b=!0,v=l.target===c?E(l)-l.target.getBoundingClientRect()[s.isHorizontal()?"left":"top"]:null,l.preventDefault(),l.stopPropagation(),e.style.transitionDuration="100ms",c.style.transitionDuration="100ms",S(l),clearTimeout(h),t.style.transitionDuration="0ms",a.hide&&(t.style.opacity=1),s.params.cssMode&&(s.wrapperEl.style["scroll-snap-type"]="none"),g("scrollbarDragStart",l)}function P(l){const{scrollbar:a,wrapperEl:r}=s,{el:e,dragEl:t}=a;b&&(l.preventDefault?l.preventDefault():l.returnValue=!1,S(l),r.style.transitionDuration="0ms",e.style.transitionDuration="0ms",t.style.transitionDuration="0ms",g("scrollbarDragMove",l))}function M(l){const a=s.params.scrollbar,{scrollbar:r,wrapperEl:e}=s,{el:t}=r;b&&(b=!1,s.params.cssMode&&(s.wrapperEl.style["scroll-snap-type"]="",e.style.transitionDuration=""),a.hide&&(clearTimeout(h),h=n.n(()=>{t.style.opacity=0,t.style.transitionDuration="400ms"},1e3)),g("scrollbarDragEnd",l),a.snapOnRelease&&s.slideToClosest())}function L(l){const{scrollbar:a,params:r}=s,e=a.el;if(!e)return;const t=e,c=r.passiveListeners?{passive:!1,capture:!1}:!1,d=r.passiveListeners?{passive:!0,capture:!1}:!1;if(!t)return;const o=l==="on"?"addEventListener":"removeEventListener";t[o]("pointerdown",k,c),y[o]("pointermove",P,c),y[o]("pointerup",M,d)}function $(){!s.params.scrollbar.el||!s.scrollbar.el||L("on")}function O(){!s.params.scrollbar.el||!s.scrollbar.el||L("off")}function z(){const{scrollbar:l,el:a}=s;s.params.scrollbar=I.c(s,s.originalParams.scrollbar,s.params.scrollbar,{el:"swiper-scrollbar"});const r=s.params.scrollbar;if(!r.el)return;let e;if(typeof r.el=="string"&&s.isElement&&(e=s.el.querySelector(r.el)),!e&&typeof r.el=="string"){if(e=y.querySelectorAll(r.el),!e.length)return}else e||(e=r.el);s.params.uniqueNavElements&&typeof r.el=="string"&&e.length>1&&a.querySelectorAll(r.el).length===1&&(e=a.querySelector(r.el)),e.length>0&&(e=e[0]),e.classList.add(s.isHorizontal()?r.horizontalClass:r.verticalClass);let t;e&&(t=e.querySelector(j.c(s.params.scrollbar.dragClass)),t||(t=n.c("div",s.params.scrollbar.dragClass),e.append(t))),Object.assign(l,{el:e,dragEl:t}),r.draggable&&$(),e&&e.classList[s.enabled?"remove":"add"](...n.h(s.params.scrollbar.lockClass))}function C(){const l=s.params.scrollbar,a=s.scrollbar.el;a&&a.classList.remove(...n.h(s.isHorizontal()?l.horizontalClass:l.verticalClass)),O()}f("changeDirection",()=>{if(!s.scrollbar||!s.scrollbar.el)return;const l=s.params.scrollbar;let{el:a}=s.scrollbar;a=n.m(a),a.forEach(r=>{r.classList.remove(l.horizontalClass,l.verticalClass),r.classList.add(s.isHorizontal()?l.horizontalClass:l.verticalClass)})}),f("init",()=>{s.params.scrollbar.enabled===!1?T():(z(),m(),u())}),f("update resize observerUpdate lock unlock changeDirection",()=>{m()}),f("setTranslate",()=>{u()}),f("setTransition",(l,a)=>{H(a)}),f("enable disable",()=>{const{el:l}=s.scrollbar;l&&l.classList[s.enabled?"remove":"add"](...n.h(s.params.scrollbar.lockClass))}),f("destroy",()=>{C()});const R=()=>{s.el.classList.remove(...n.h(s.params.scrollbar.scrollbarDisabledClass)),s.scrollbar.el&&s.scrollbar.el.classList.remove(...n.h(s.params.scrollbar.scrollbarDisabledClass)),z(),m(),u()},T=()=>{s.el.classList.add(...n.h(s.params.scrollbar.scrollbarDisabledClass)),s.scrollbar.el&&s.scrollbar.el.classList.add(...n.h(s.params.scrollbar.scrollbarDisabledClass)),C()};Object.assign(s.scrollbar,{enable:R,disable:T,updateSize:m,setTranslate:u,init:z,destroy:C})}module.exports=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function $(n,e){let r=n.copy(),a="hour"in r?Y(r,e):0;f(r,e.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,n),r.month+=e.months||0,s(r),M(r),r.day+=(e.weeks||0)*7,r.day+=e.days||0,r.day+=a,b(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let c=r.calendar.getYearsInEra(r);if(r.year>c){var d,h;let o=(d=(h=r.calendar).isInverseEra)===null||d===void 0?void 0:d.call(h,r);r.year=c,r.month=o?1:r.calendar.getMonthsInYear(r),r.day=o?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let l=r.calendar.getMonthsInYear(r);return r.month>l&&(r.month=l,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function f(n,e){var r,a;!((r=(a=n.calendar).isInverseEra)===null||r===void 0)&&r.call(a,n)&&(e=-e),n.year+=e}function s(n){for(;n.month<1;)f(n,-1),n.month+=n.calendar.getMonthsInYear(n);let e=0;for(;n.month>(e=n.calendar.getMonthsInYear(n));)n.month-=e,f(n,1)}function b(n){for(;n.day<1;)n.month--,s(n),n.day+=n.calendar.getDaysInMonth(n);for(;n.day>n.calendar.getDaysInMonth(n);)n.day-=n.calendar.getDaysInMonth(n),n.month++,s(n)}function M(n){n.month=Math.max(1,Math.min(n.calendar.getMonthsInYear(n),n.month)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day))}function y(n){n.calendar.constrainDate&&n.calendar.constrainDate(n),n.year=Math.max(1,Math.min(n.calendar.getYearsInEra(n),n.year)),M(n)}function u(n){let e={};for(let r in n)typeof n[r]=="number"&&(e[r]=-n[r]);return e}function g(n,e){return $(n,u(e))}function I(n,e){let r=n.copy();return e.era!=null&&(r.era=e.era),e.year!=null&&(r.year=e.year),e.month!=null&&(r.month=e.month),e.day!=null&&(r.day=e.day),y(r),r}function x(n,e){let r=n.copy();return e.hour!=null&&(r.hour=e.hour),e.minute!=null&&(r.minute=e.minute),e.second!=null&&(r.second=e.second),e.millisecond!=null&&(r.millisecond=e.millisecond),m(r),r}function D(n){n.second+=Math.floor(n.millisecond/1e3),n.millisecond=i(n.millisecond,1e3),n.minute+=Math.floor(n.second/60),n.second=i(n.second,60),n.hour+=Math.floor(n.minute/60),n.minute=i(n.minute,60);let e=Math.floor(n.hour/24);return n.hour=i(n.hour,24),e}function m(n){n.millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23))}function i(n,e){let r=n%e;return r<0&&(r+=e),r}function Y(n,e){return n.hour+=e.hours||0,n.minute+=e.minutes||0,n.second+=e.seconds||0,n.millisecond+=e.milliseconds||0,D(n)}function w(n,e,r,a){let c=n.copy();switch(e){case"era":{let l=n.calendar.getEras(),o=l.indexOf(n.era);if(o<0)throw new Error("Invalid era: "+n.era);o=t(o,r,0,l.length-1,a==null?void 0:a.round),c.era=l[o],y(c);break}case"year":var d,h;!((d=(h=c.calendar).isInverseEra)===null||d===void 0)&&d.call(h,c)&&(r=-r),c.year=t(n.year,r,-1/0,9999,a==null?void 0:a.round),c.year===-1/0&&(c.year=1),c.calendar.balanceYearMonth&&c.calendar.balanceYearMonth(c,n);break;case"month":c.month=t(n.month,r,1,n.calendar.getMonthsInYear(n),a==null?void 0:a.round);break;case"day":c.day=t(n.day,r,1,n.calendar.getDaysInMonth(n),a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return n.calendar.balanceDate&&n.calendar.balanceDate(c),y(c),c}function k(n,e,r,a){let c=n.copy();switch(e){case"hour":{let d=n.hour,h=0,l=23;if((a==null?void 0:a.hourCycle)===12){let o=d>=12;h=o?12:0,l=o?23:11}c.hour=t(d,r,h,l,a==null?void 0:a.round);break}case"minute":c.minute=t(n.minute,r,0,59,a==null?void 0:a.round);break;case"second":c.second=t(n.second,r,0,59,a==null?void 0:a.round);break;case"millisecond":c.millisecond=t(n.millisecond,r,0,999,a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return c}function t(n,e,r,a,c=!1){if(c){n+=Math.sign(e),n<r&&(n=a);let d=Math.abs(e);e>0?n=Math.ceil(n/d)*d:n=Math.floor(n/d)*d,n>a&&(n=r)}else n+=e,n<r?n=a-(r-n-1):n>a&&(n=r+(n-a-1));return n}exports.add=$;exports.constrain=y;exports.constrainTime=m;exports.cycleDate=w;exports.cycleTime=k;exports.invertDuration=u;exports.set=I;exports.setTime=x;exports.subtract=g;