@okam/stack-ui 1.28.0 → 1.29.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 (569) hide show
  1. package/components/Button/interface.d.ts +2 -2
  2. package/components/Menu/interface.d.ts +5 -2
  3. package/components/Video/index.d.ts +3 -0
  4. package/components/Video/interface.d.ts +6 -0
  5. package/components/WysiwygBlock/attributes.d.ts +2 -0
  6. package/index.d.ts +1 -2
  7. package/index.js +1 -1
  8. package/index.mjs +101 -103
  9. package/index10.js +1 -1
  10. package/index10.mjs +1 -1
  11. package/index100.js +2 -1
  12. package/index100.mjs +22 -17
  13. package/index101.js +1 -2
  14. package/index101.mjs +63 -22
  15. package/index102.js +1 -1
  16. package/index102.mjs +24 -58
  17. package/index103.js +1 -1
  18. package/index103.mjs +52 -29
  19. package/index104.js +1 -1
  20. package/index107.js +1 -1
  21. package/index107.mjs +1 -1
  22. package/index108.js +1 -1
  23. package/index109.js +1 -1
  24. package/index109.mjs +2 -2
  25. package/index11.js +1 -1
  26. package/index11.mjs +3 -3
  27. package/index110.js +1 -1
  28. package/index111.js +1 -1
  29. package/index112.js +1 -1
  30. package/index112.mjs +1 -1
  31. package/index113.js +1 -1
  32. package/index113.mjs +1 -1
  33. package/index114.js +1 -1
  34. package/index114.mjs +1 -1
  35. package/index115.js +1 -1
  36. package/index115.mjs +9 -9
  37. package/index116.js +1 -1
  38. package/index116.mjs +3 -3
  39. package/index117.js +1 -1
  40. package/index118.js +1 -1
  41. package/index119.js +1 -1
  42. package/index12.js +1 -1
  43. package/index12.mjs +1 -1
  44. package/index120.js +1 -1
  45. package/index120.mjs +2 -2
  46. package/index121.js +1 -1
  47. package/index121.mjs +1 -1
  48. package/index122.js +1 -1
  49. package/index122.mjs +1 -1
  50. package/index123.js +1 -1
  51. package/index123.mjs +21 -5
  52. package/index124.js +1 -1
  53. package/index124.mjs +11 -21
  54. package/index125.js +2 -1
  55. package/index125.mjs +22 -11
  56. package/index126.js +1 -1
  57. package/index126.mjs +12 -42
  58. package/index127.js +1 -2
  59. package/index127.mjs +46 -22
  60. package/index128.js +1 -1
  61. package/index128.mjs +241 -12
  62. package/index129.js +2 -1
  63. package/index129.mjs +13 -46
  64. package/index13.js +1 -1
  65. package/index13.mjs +8 -5
  66. package/index130.js +1 -1
  67. package/index130.mjs +28 -239
  68. package/index131.js +1 -2
  69. package/index131.mjs +51 -13
  70. package/index132.js +1 -1
  71. package/index132.mjs +27 -30
  72. package/index133.js +1 -1
  73. package/index133.mjs +19 -49
  74. package/index134.js +1 -1
  75. package/index134.mjs +61 -26
  76. package/index135.js +1 -1
  77. package/index135.mjs +91 -17
  78. package/index136.js +1 -1
  79. package/index136.mjs +31 -3
  80. package/index137.js +1 -4
  81. package/index137.mjs +119 -244
  82. package/index138.js +1 -1
  83. package/index138.mjs +27 -61
  84. package/index139.js +1 -1
  85. package/index139.mjs +122 -92
  86. package/index14.js +1 -1
  87. package/index14.mjs +2 -2
  88. package/index140.js +1 -1
  89. package/index140.mjs +134 -31
  90. package/index141.js +1 -1
  91. package/index141.mjs +12 -119
  92. package/index142.js +1 -1
  93. package/index142.mjs +93 -25
  94. package/index143.js +1 -1
  95. package/index143.mjs +103 -121
  96. package/index144.js +1 -1
  97. package/index144.mjs +5 -134
  98. package/index145.js +1 -1
  99. package/index145.mjs +3 -14
  100. package/index146.js +1 -1
  101. package/index146.mjs +113 -83
  102. package/index147.js +1 -1
  103. package/index147.mjs +25 -102
  104. package/index148.js +1 -1
  105. package/index148.mjs +51 -5
  106. package/index149.js +1 -1
  107. package/index149.mjs +44 -3
  108. package/index15.js +1 -1
  109. package/index15.mjs +1 -1
  110. package/index150.js +1 -1
  111. package/index150.mjs +29 -117
  112. package/index151.js +1 -1
  113. package/index151.mjs +100 -16
  114. package/index152.js +1 -1
  115. package/index152.mjs +70 -44
  116. package/index153.js +1 -1
  117. package/index153.mjs +90 -33
  118. package/index154.js +1 -1
  119. package/index154.mjs +98 -38
  120. package/index155.js +1 -1
  121. package/index155.mjs +195 -109
  122. package/index156.js +1 -1
  123. package/index156.mjs +61 -74
  124. package/index157.js +1 -1
  125. package/index157.mjs +141 -101
  126. package/index158.js +1 -1
  127. package/index158.mjs +120 -98
  128. package/index159.js +1 -1
  129. package/index159.mjs +218 -2
  130. package/index16.js +1 -1
  131. package/index160.js +1 -1
  132. package/index160.mjs +190 -5
  133. package/index161.js +1 -1
  134. package/index161.mjs +68 -63
  135. package/index162.js +1 -1
  136. package/index162.mjs +255 -23
  137. package/index163.js +1 -1
  138. package/index163.mjs +94 -51
  139. package/index164.js +1 -1
  140. package/index164.mjs +171 -152
  141. package/index165.js +1 -1
  142. package/index165.mjs +83 -21
  143. package/index166.js +1 -1
  144. package/index166.mjs +57 -18
  145. package/index167.js +1 -1
  146. package/index167.mjs +123 -36
  147. package/index168.js +1 -1
  148. package/index168.mjs +113 -79
  149. package/index169.js +1 -1
  150. package/index169.mjs +119 -27
  151. package/index17.js +1 -1
  152. package/index17.mjs +1 -1
  153. package/index170.js +1 -1
  154. package/index170.mjs +70 -19
  155. package/index171.js +1 -1
  156. package/index171.mjs +110 -53
  157. package/index172.js +1 -1
  158. package/index172.mjs +53 -2
  159. package/index173.js +1 -11
  160. package/index173.mjs +92 -114
  161. package/index174.js +1 -1
  162. package/index174.mjs +63 -192
  163. package/index175.js +1 -1
  164. package/index175.mjs +51 -59
  165. package/index176.js +1 -1
  166. package/index176.mjs +93 -135
  167. package/index177.js +5 -1
  168. package/index177.mjs +75 -114
  169. package/index178.js +1 -1
  170. package/index178.mjs +1994 -200
  171. package/index179.js +1 -1
  172. package/index179.mjs +57 -188
  173. package/index18.js +1 -1
  174. package/index18.mjs +3 -3
  175. package/index180.js +1 -1
  176. package/index180.mjs +186 -67
  177. package/index181.js +1 -1
  178. package/index181.mjs +5 -258
  179. package/index182.js +1 -1
  180. package/index182.mjs +127 -94
  181. package/index183.js +1 -1
  182. package/index183.mjs +171 -166
  183. package/index184.js +1 -1
  184. package/index184.mjs +8 -83
  185. package/index185.js +1 -1
  186. package/index185.mjs +3 -58
  187. package/index186.js +1 -1
  188. package/index186.mjs +32 -122
  189. package/index187.js +1 -1
  190. package/index187.mjs +5 -116
  191. package/index188.js +1 -1
  192. package/index188.mjs +25 -118
  193. package/index189.js +1 -1
  194. package/index189.mjs +6 -72
  195. package/index19.js +1 -1
  196. package/index190.js +1 -1
  197. package/index190.mjs +306 -103
  198. package/index191.js +1 -1
  199. package/index191.mjs +189 -49
  200. package/index192.js +1 -1
  201. package/index192.mjs +8 -93
  202. package/index193.js +1 -1
  203. package/index193.mjs +24 -68
  204. package/index194.js +1 -1
  205. package/index194.mjs +54 -55
  206. package/index195.js +1 -1
  207. package/index195.mjs +42 -95
  208. package/index196.js +1 -5
  209. package/index196.mjs +123 -79
  210. package/index197.js +1 -1
  211. package/index197.mjs +5 -2011
  212. package/index198.js +1 -1
  213. package/index198.mjs +26 -57
  214. package/index199.js +1 -1
  215. package/index199.mjs +7 -189
  216. package/index2.js +1 -1
  217. package/index2.mjs +20 -20
  218. package/index20.js +1 -1
  219. package/index20.mjs +1 -1
  220. package/index200.js +1 -1
  221. package/index200.mjs +6 -4
  222. package/index201.js +1 -1
  223. package/index201.mjs +8 -2
  224. package/index202.js +1 -1
  225. package/index202.mjs +4 -52
  226. package/index203.js +1 -1
  227. package/index203.mjs +5 -20
  228. package/index204.js +1 -1
  229. package/index204.mjs +9 -23
  230. package/index21.js +1 -1
  231. package/index21.mjs +1 -1
  232. package/index22.js +1 -1
  233. package/index22.mjs +1 -1
  234. package/index23.js +1 -1
  235. package/index23.mjs +1 -1
  236. package/index24.js +1 -1
  237. package/index24.mjs +1 -1
  238. package/index25.js +1 -1
  239. package/index25.mjs +1 -1
  240. package/index26.js +1 -1
  241. package/index26.mjs +1 -1
  242. package/index27.js +1 -1
  243. package/index28.js +1 -1
  244. package/index28.mjs +2 -2
  245. package/index29.js +1 -1
  246. package/index29.mjs +1 -1
  247. package/index3.js +1 -1
  248. package/index3.mjs +1 -1
  249. package/index30.js +1 -1
  250. package/index31.js +1 -1
  251. package/index31.mjs +2 -2
  252. package/index32.js +1 -1
  253. package/index32.mjs +1 -1
  254. package/index33.js +1 -1
  255. package/index33.mjs +88 -65
  256. package/index34.js +1 -1
  257. package/index34.mjs +2 -2
  258. package/index35.js +1 -1
  259. package/index35.mjs +2 -2
  260. package/index36.js +1 -1
  261. package/index36.mjs +1 -1
  262. package/index37.js +1 -1
  263. package/index38.js +2 -1
  264. package/index38.mjs +20 -45
  265. package/index39.js +1 -2
  266. package/index39.mjs +5 -26
  267. package/index4.js +1 -1
  268. package/index4.mjs +4 -4
  269. package/index40.js +1 -1
  270. package/index40.mjs +7 -4
  271. package/index41.js +1 -1
  272. package/index41.mjs +5 -5
  273. package/index42.js +1 -1
  274. package/index42.mjs +5 -8
  275. package/index43.js +1 -1
  276. package/index43.mjs +2 -2
  277. package/index44.js +1 -1
  278. package/index44.mjs +1 -1
  279. package/index45.js +1 -1
  280. package/index45.mjs +4 -4
  281. package/index46.js +1 -1
  282. package/index46.mjs +9 -3
  283. package/index47.js +1 -1
  284. package/index47.mjs +9 -7
  285. package/index48.js +1 -1
  286. package/index48.mjs +9 -9
  287. package/index49.js +1 -1
  288. package/index49.mjs +46 -13
  289. package/index50.js +1 -1
  290. package/index50.mjs +8 -46
  291. package/index51.js +1 -1
  292. package/index51.mjs +69 -6
  293. package/index52.js +1 -1
  294. package/index52.mjs +8 -71
  295. package/index53.js +1 -1
  296. package/index53.mjs +12 -7
  297. package/index54.js +1 -1
  298. package/index54.mjs +9 -12
  299. package/index55.js +1 -1
  300. package/index55.mjs +17 -10
  301. package/index56.js +1 -1
  302. package/index56.mjs +13 -17
  303. package/index57.js +1 -1
  304. package/index57.mjs +5 -5
  305. package/index58.js +1 -1
  306. package/index58.mjs +6 -6
  307. package/index59.js +1 -1
  308. package/index59.mjs +8 -10
  309. package/index6.js +1 -1
  310. package/index6.mjs +1 -1
  311. package/index60.js +1 -1
  312. package/index60.mjs +5 -5
  313. package/index61.js +1 -1
  314. package/index61.mjs +8 -6
  315. package/index62.js +1 -1
  316. package/index62.mjs +14 -13
  317. package/index63.js +2 -1
  318. package/index63.mjs +23 -14
  319. package/index64.js +1 -1
  320. package/index64.mjs +15 -21
  321. package/index65.js +1 -1
  322. package/index65.mjs +14 -16
  323. package/index66.js +1 -1
  324. package/index66.mjs +40 -13
  325. package/index67.js +1 -1
  326. package/index67.mjs +36 -39
  327. package/index68.js +1 -1
  328. package/index68.mjs +11 -37
  329. package/index69.js +1 -1
  330. package/index69.mjs +10 -11
  331. package/index7.js +1 -1
  332. package/index7.mjs +1 -1
  333. package/index70.js +1 -1
  334. package/index70.mjs +13 -10
  335. package/index71.js +1 -1
  336. package/index71.mjs +10 -13
  337. package/index72.js +1 -2
  338. package/index72.mjs +2 -12
  339. package/index73.js +2 -1
  340. package/index73.mjs +9 -2
  341. package/index74.js +1 -1
  342. package/index74.mjs +6 -7
  343. package/index75.js +1 -1
  344. package/index75.mjs +6 -6
  345. package/index76.js +1 -1
  346. package/index76.mjs +6 -6
  347. package/index77.js +1 -2
  348. package/index77.mjs +25 -8
  349. package/index78.js +1 -1
  350. package/index78.mjs +2 -25
  351. package/index79.js +6 -1
  352. package/index79.mjs +94 -2
  353. package/index8.js +1 -1
  354. package/index8.mjs +3 -3
  355. package/index80.js +1 -6
  356. package/index80.mjs +54 -79
  357. package/index81.js +1 -1
  358. package/index81.mjs +33 -61
  359. package/index82.js +42 -1
  360. package/index82.mjs +67 -34
  361. package/index83.js +1 -42
  362. package/index83.mjs +154 -65
  363. package/index84.js +9 -1
  364. package/index84.mjs +47 -149
  365. package/index85.js +1 -9
  366. package/index85.mjs +36 -48
  367. package/index86.js +1 -1
  368. package/index86.mjs +8 -40
  369. package/index87.js +1 -1
  370. package/index87.mjs +31 -9
  371. package/index88.js +1 -1
  372. package/index88.mjs +6 -35
  373. package/index89.js +12 -1
  374. package/index89.mjs +40 -6
  375. package/index9.js +1 -1
  376. package/index9.mjs +38 -43
  377. package/index90.js +1 -12
  378. package/index90.mjs +25 -36
  379. package/index91.js +1 -1
  380. package/index91.mjs +8 -24
  381. package/index92.js +7 -1
  382. package/index92.mjs +13 -7
  383. package/index93.js +14 -6
  384. package/index93.mjs +65 -13
  385. package/index94.js +1 -15
  386. package/index94.mjs +7 -71
  387. package/index95.js +16 -1
  388. package/index95.mjs +25 -7
  389. package/index96.js +1 -16
  390. package/index96.mjs +37 -20
  391. package/index97.js +1 -1
  392. package/index97.mjs +43 -40
  393. package/index98.js +1 -1
  394. package/index98.mjs +47 -44
  395. package/index99.js +1 -1
  396. package/index99.mjs +17 -48
  397. package/package.json +1 -1
  398. package/theme/Alerts/index.d.ts +88 -0
  399. package/theme/Button/index.d.ts +28 -0
  400. package/theme/Carousel/index.d.ts +36 -0
  401. package/types/next-link.d.ts +16 -0
  402. package/components/DirectusImg/index.d.ts +0 -3
  403. package/components/DirectusImg/interface.d.ts +0 -20
  404. package/components/Img/index.d.ts +0 -3
  405. package/components/Img/interface.d.ts +0 -6
  406. package/index205.js +0 -1
  407. package/index205.mjs +0 -29
  408. package/index206.js +0 -1
  409. package/index206.mjs +0 -49
  410. package/index207.js +0 -1
  411. package/index207.mjs +0 -4
  412. package/index208.js +0 -1
  413. package/index208.mjs +0 -23
  414. package/index209.js +0 -1
  415. package/index209.mjs +0 -4
  416. package/index210.js +0 -1
  417. package/index210.mjs +0 -31
  418. package/index211.js +0 -1
  419. package/index211.mjs +0 -4
  420. package/index212.js +0 -1
  421. package/index212.mjs +0 -4
  422. package/index213.js +0 -1
  423. package/index213.mjs +0 -25
  424. package/index214.js +0 -1
  425. package/index214.mjs +0 -4
  426. package/index215.js +0 -1
  427. package/index215.mjs +0 -4
  428. package/index216.js +0 -1
  429. package/index216.mjs +0 -4
  430. package/index217.js +0 -1
  431. package/index217.mjs +0 -40
  432. package/index218.js +0 -1
  433. package/index218.mjs +0 -4
  434. package/index219.js +0 -1
  435. package/index219.mjs +0 -23
  436. package/index220.js +0 -1
  437. package/index220.mjs +0 -25
  438. package/index221.js +0 -1
  439. package/index221.mjs +0 -4
  440. package/index222.js +0 -1
  441. package/index222.mjs +0 -25
  442. package/index223.js +0 -1
  443. package/index223.mjs +0 -4
  444. package/index224.js +0 -1
  445. package/index224.mjs +0 -133
  446. package/index225.js +0 -1
  447. package/index225.mjs +0 -182
  448. package/index226.js +0 -1
  449. package/index226.mjs +0 -12
  450. package/index227.js +0 -1
  451. package/index227.mjs +0 -6
  452. package/index228.js +0 -1
  453. package/index228.mjs +0 -39
  454. package/index229.js +0 -1
  455. package/index229.mjs +0 -8
  456. package/index230.js +0 -1
  457. package/index230.mjs +0 -32
  458. package/index231.js +0 -1
  459. package/index231.mjs +0 -9
  460. package/index232.js +0 -1
  461. package/index232.mjs +0 -316
  462. package/index233.js +0 -1
  463. package/index233.mjs +0 -195
  464. package/index234.js +0 -1
  465. package/index234.mjs +0 -11
  466. package/index235.js +0 -1
  467. package/index235.mjs +0 -29
  468. package/index236.js +0 -1
  469. package/index236.mjs +0 -58
  470. package/index237.js +0 -1
  471. package/index237.mjs +0 -49
  472. package/index238.js +0 -1
  473. package/index238.mjs +0 -127
  474. package/index239.js +0 -1
  475. package/index239.mjs +0 -4
  476. package/index240.js +0 -1
  477. package/index240.mjs +0 -4
  478. package/index241.js +0 -1
  479. package/index241.mjs +0 -4
  480. package/index242.js +0 -1
  481. package/index242.mjs +0 -20
  482. package/index243.js +0 -1
  483. package/index243.mjs +0 -29
  484. package/index244.js +0 -1
  485. package/index244.mjs +0 -4
  486. package/index245.js +0 -1
  487. package/index245.mjs +0 -91
  488. package/index246.js +0 -1
  489. package/index246.mjs +0 -22
  490. package/index247.js +0 -1
  491. package/index247.mjs +0 -4
  492. package/index248.js +0 -1
  493. package/index248.mjs +0 -40
  494. package/index249.js +0 -1
  495. package/index249.mjs +0 -139
  496. package/index250.js +0 -1
  497. package/index250.mjs +0 -4
  498. package/index251.js +0 -1
  499. package/index251.mjs +0 -25
  500. package/index252.js +0 -1
  501. package/index252.mjs +0 -4
  502. package/index253.js +0 -1
  503. package/index253.mjs +0 -4
  504. package/index254.js +0 -1
  505. package/index254.mjs +0 -4
  506. package/index255.js +0 -1
  507. package/index255.mjs +0 -4
  508. package/index256.js +0 -1
  509. package/index256.mjs +0 -25
  510. package/index257.js +0 -1
  511. package/index257.mjs +0 -4
  512. package/index258.js +0 -1
  513. package/index258.mjs +0 -28
  514. package/index259.js +0 -1
  515. package/index259.mjs +0 -4
  516. package/index260.js +0 -1
  517. package/index260.mjs +0 -8
  518. package/index261.js +0 -1
  519. package/index261.mjs +0 -4
  520. package/index262.js +0 -1
  521. package/index262.mjs +0 -4
  522. package/index263.js +0 -1
  523. package/index263.mjs +0 -4
  524. package/index264.js +0 -1
  525. package/index264.mjs +0 -4
  526. package/index265.js +0 -1
  527. package/index265.mjs +0 -74
  528. package/index266.js +0 -1
  529. package/index266.mjs +0 -4
  530. package/index267.js +0 -1
  531. package/index267.mjs +0 -4
  532. package/index268.js +0 -1
  533. package/index268.mjs +0 -21
  534. package/index269.js +0 -1
  535. package/index269.mjs +0 -4
  536. package/index270.js +0 -1
  537. package/index270.mjs +0 -4
  538. package/index271.js +0 -1
  539. package/index271.mjs +0 -4
  540. package/index272.js +0 -1
  541. package/index272.mjs +0 -31
  542. package/index273.js +0 -1
  543. package/index273.mjs +0 -9
  544. package/index274.js +0 -1
  545. package/index274.mjs +0 -10
  546. package/index275.js +0 -1
  547. package/index275.mjs +0 -10
  548. package/index276.js +0 -1
  549. package/index276.mjs +0 -4
  550. package/index277.js +0 -1
  551. package/index277.mjs +0 -39
  552. package/index278.js +0 -1
  553. package/index278.mjs +0 -4
  554. package/index279.js +0 -1
  555. package/index279.mjs +0 -7
  556. package/index280.js +0 -1
  557. package/index280.mjs +0 -8
  558. package/index281.js +0 -1
  559. package/index281.mjs +0 -12
  560. package/index282.js +0 -1
  561. package/index282.mjs +0 -4
  562. package/index283.js +0 -1
  563. package/index283.mjs +0 -20
  564. package/index284.js +0 -1
  565. package/index284.mjs +0 -33
  566. package/index285.js +0 -1
  567. package/index285.mjs +0 -4
  568. package/index286.js +0 -1
  569. package/index286.mjs +0 -4
package/index141.mjs CHANGED
@@ -1,124 +1,17 @@
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);
1
+ import { toCalendar as t } from "./index143.mjs";
2
+ import { GregorianCalendar as e } from "./index142.mjs";
3
+ function n(a) {
4
+ return `${String(a.hour).padStart(2, "0")}:${String(a.minute).padStart(2, "0")}:${String(a.second).padStart(2, "0")}${a.millisecond ? String(a.millisecond / 1e3).slice(1) : ""}`;
35
5
  }
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]) : [], [
49
- s,
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);
74
- }
75
- };
6
+ function o(a) {
7
+ let r = t(a, new e());
8
+ return `${String(r.year).padStart(4, "0")}-${String(r.month).padStart(2, "0")}-${String(r.day).padStart(2, "0")}`;
76
9
  }
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
- };
10
+ function i(a) {
11
+ return `${o(a)}T${n(a)}`;
116
12
  }
117
13
  export {
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
14
+ i as dateTimeToString,
15
+ o as dateToString,
16
+ n as timeToString
124
17
  };
package/index142.js CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./index139.js"),b=require("./index145.js"),y=1721426;function l(r,e,t,f){e=g(r,e);let a=e-1,n=-2;return t<=2?n=0:d(e)&&(n=-1),y-1+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+Math.floor((367*t-362)/12+n+f)}function d(r){return r%4===0&&(r%100!==0||r%400===0)}function g(r,e){return r==="BC"?1-e:e}function M(r){let e="AD";return r<=0&&(e="BC",r=1-r),[e,r]}const q={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class B{fromJulianDay(e){let t=e,f=t-y,a=Math.floor(f/146097),n=b.mod(f,146097),c=Math.floor(n/36524),s=b.mod(n,36524),D=Math.floor(s/1461),p=b.mod(s,1461),$=Math.floor(p/365),C=a*400+c*100+D*4+$+(c!==4&&$!==4?1:0),[i,o]=M(C),m=t-l(i,o,1,1),u=2;t<l(i,o,3,1)?u=0:d(o)&&(u=1);let h=Math.floor(((m+u)*12+373)/367),x=t-l(i,o,h,1)+1;return new Y.CalendarDate(i,o,h,x)}toJulianDay(e){return l(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return q[d(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return d(e.year)?366:365}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}exports.GregorianCalendar=B;exports.fromExtendedYear=M;exports.getExtendedYear=g;exports.gregorianToJulianDay=l;exports.isLeapYear=d;
package/index142.mjs CHANGED
@@ -1,30 +1,98 @@
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
- }, [
1
+ import { CalendarDate as m } from "./index139.mjs";
2
+ import { mod as s } from "./index145.mjs";
3
+ const p = 1721426;
4
+ function b(r, e, t, l) {
5
+ e = C(r, e);
6
+ let a = e - 1, n = -2;
7
+ return t <= 2 ? n = 0 : d(e) && (n = -1), p - 1 + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + Math.floor((367 * t - 362) / 12 + n + l);
8
+ }
9
+ function d(r) {
10
+ return r % 4 === 0 && (r % 100 !== 0 || r % 400 === 0);
11
+ }
12
+ function C(r, e) {
13
+ return r === "BC" ? 1 - e : e;
14
+ }
15
+ function Y(r) {
16
+ let e = "AD";
17
+ return r <= 0 && (e = "BC", r = 1 - r), [
19
18
  e,
20
- n,
21
- c
22
- ]);
23
- return [
24
- n,
25
- b
19
+ r
26
20
  ];
27
21
  }
22
+ const B = {
23
+ standard: [
24
+ 31,
25
+ 28,
26
+ 31,
27
+ 30,
28
+ 31,
29
+ 30,
30
+ 31,
31
+ 31,
32
+ 30,
33
+ 31,
34
+ 30,
35
+ 31
36
+ ],
37
+ leapyear: [
38
+ 31,
39
+ 29,
40
+ 31,
41
+ 30,
42
+ 31,
43
+ 30,
44
+ 31,
45
+ 31,
46
+ 30,
47
+ 31,
48
+ 30,
49
+ 31
50
+ ]
51
+ };
52
+ class q {
53
+ fromJulianDay(e) {
54
+ let t = e, l = t - p, a = Math.floor(l / 146097), n = s(l, 146097), $ = Math.floor(n / 36524), i = s(n, 36524), y = Math.floor(i / 1461), x = s(i, 1461), u = Math.floor(x / 365), M = a * 400 + $ * 100 + y * 4 + u + ($ !== 4 && u !== 4 ? 1 : 0), [f, o] = Y(M), g = t - b(f, o, 1, 1), c = 2;
55
+ t < b(f, o, 3, 1) ? c = 0 : d(o) && (c = 1);
56
+ let h = Math.floor(((g + c) * 12 + 373) / 367), D = t - b(f, o, h, 1) + 1;
57
+ return new m(f, o, h, D);
58
+ }
59
+ toJulianDay(e) {
60
+ return b(e.era, e.year, e.month, e.day);
61
+ }
62
+ getDaysInMonth(e) {
63
+ return B[d(e.year) ? "leapyear" : "standard"][e.month - 1];
64
+ }
65
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
66
+ getMonthsInYear(e) {
67
+ return 12;
68
+ }
69
+ getDaysInYear(e) {
70
+ return d(e.year) ? 366 : 365;
71
+ }
72
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
73
+ getYearsInEra(e) {
74
+ return 9999;
75
+ }
76
+ getEras() {
77
+ return [
78
+ "BC",
79
+ "AD"
80
+ ];
81
+ }
82
+ isInverseEra(e) {
83
+ return e.era === "BC";
84
+ }
85
+ balanceDate(e) {
86
+ e.year <= 0 && (e.era = e.era === "BC" ? "AD" : "BC", e.year = 1 - e.year);
87
+ }
88
+ constructor() {
89
+ this.identifier = "gregory";
90
+ }
91
+ }
28
92
  export {
29
- w as useControlledState
93
+ q as GregorianCalendar,
94
+ Y as fromExtendedYear,
95
+ C as getExtendedYear,
96
+ b as gregorianToJulianDay,
97
+ d as isLeapYear
30
98
  };
package/index143.js CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index139.js"),D=require("./index140.js"),f=require("./index142.js"),y=require("./index131.js");function c(e){e=m(e,new f.GregorianCalendar);let t=f.getExtendedYear(e.era,e.year);return $(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function $(e,t,n,r,o,a,u){let i=new Date;return i.setUTCHours(r,o,a,u),i.setUTCFullYear(e,t-1,n),i.getTime()}function s(e,t){if(t==="UTC")return 0;if(e>0&&t===y.getLocalTimeZone())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:a,minute:u,second:i}=p(e,t);return $(n,r,o,a,u,i,0)-Math.floor(e/1e3)*1e3}const d=new Map;function p(e,t){let n=d.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),d.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let a of r)a.type!=="literal"&&(o[a.type]=a.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const h=864e5;function C(e,t,n,r){return(n===r?[n]:[n,r]).filter(a=>v(e,t,a))}function v(e,t,n){let r=p(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function b(e,t,n="compatible"){let r=T(e);if(t==="UTC")return c(r);if(t===y.getLocalTimeZone()&&n==="compatible"){r=m(r,new f.GregorianCalendar);let l=new Date,g=f.getExtendedYear(r.era,r.year);return l.setFullYear(g,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=c(r),a=s(o-h,t),u=s(o+h,t),i=C(r,t,o-a,o-u);if(i.length===1)return i[0];if(i.length>1)switch(n){case"compatible":case"earlier":return i[0];case"later":return i[i.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-a,o-u);case"compatible":case"later":return Math.max(o-a,o-u);case"reject":throw new RangeError("No such absolute time found")}}function x(e,t,n="compatible"){return new Date(b(e,t,n))}function T(e,t){let n=0,r=0,o=0,a=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:a}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:a}=t),new w.CalendarDateTime(e.calendar,e.era,e.year,e.month,e.day,n,r,o,a)}function m(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,D.constrain(r),r}exports.epochFromDate=c;exports.getTimeZoneOffset=s;exports.toAbsolute=b;exports.toCalendar=m;exports.toCalendarDateTime=T;exports.toDate=x;
package/index143.mjs CHANGED
@@ -1,127 +1,109 @@
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
- ];
1
+ import { CalendarDateTime as w } from "./index139.mjs";
2
+ import { constrain as x } from "./index140.mjs";
3
+ import { GregorianCalendar as $, getExtendedYear as d } from "./index142.mjs";
4
+ import { getLocalTimeZone as h } from "./index131.mjs";
5
+ function u(e) {
6
+ e = b(e, new $());
7
+ let t = d(e.era, e.year);
8
+ return y(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
22
9
  }
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
64
- });
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
- }
10
+ function y(e, t, n, r, o, a, c) {
11
+ let f = /* @__PURE__ */ new Date();
12
+ return f.setUTCHours(r, o, a, c), f.setUTCFullYear(e, t - 1, n), f.getTime();
68
13
  }
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);
100
- }
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);
14
+ function l(e, t) {
15
+ if (t === "UTC") return 0;
16
+ if (e > 0 && t === h()) return new Date(e).getTimezoneOffset() * -6e4;
17
+ let { year: n, month: r, day: o, hour: a, minute: c, second: f } = p(e, t);
18
+ return y(n, r, o, a, c, f, 0) - Math.floor(e / 1e3) * 1e3;
19
+ }
20
+ const s = /* @__PURE__ */ new Map();
21
+ function p(e, t) {
22
+ let n = s.get(t);
23
+ n || (n = new Intl.DateTimeFormat("en-US", {
24
+ timeZone: t,
25
+ hour12: !1,
26
+ era: "short",
27
+ year: "numeric",
28
+ month: "numeric",
29
+ day: "numeric",
30
+ hour: "numeric",
31
+ minute: "numeric",
32
+ second: "numeric"
33
+ }), s.set(t, n));
34
+ let r = n.formatToParts(new Date(e)), o = {};
35
+ for (let a of r) a.type !== "literal" && (o[a.type] = a.value);
36
+ return {
37
+ // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
38
+ year: o.era === "BC" || o.era === "B" ? -o.year + 1 : +o.year,
39
+ month: +o.month,
40
+ day: +o.day,
41
+ hour: o.hour === "24" ? 0 : +o.hour,
42
+ minute: +o.minute,
43
+ second: +o.second
44
+ };
45
+ }
46
+ const m = 864e5;
47
+ function D(e, t, n, r) {
48
+ return (n === r ? [
49
+ n
50
+ ] : [
51
+ n,
52
+ r
53
+ ]).filter((a) => g(e, t, a));
54
+ }
55
+ function g(e, t, n) {
56
+ let r = p(n, t);
57
+ return e.year === r.year && e.month === r.month && e.day === r.day && e.hour === r.hour && e.minute === r.minute && e.second === r.second;
58
+ }
59
+ function C(e, t, n = "compatible") {
60
+ let r = v(e);
61
+ if (t === "UTC") return u(r);
62
+ if (t === h() && n === "compatible") {
63
+ r = b(r, new $());
64
+ let i = /* @__PURE__ */ new Date(), T = d(r.era, r.year);
65
+ return i.setFullYear(T, r.month - 1, r.day), i.setHours(r.hour, r.minute, r.second, r.millisecond), i.getTime();
66
+ }
67
+ let o = u(r), a = l(o - m, t), c = l(o + m, t), f = D(r, t, o - a, o - c);
68
+ if (f.length === 1) return f[0];
69
+ if (f.length > 1) switch (n) {
70
+ case "compatible":
71
+ case "earlier":
72
+ return f[0];
73
+ case "later":
74
+ return f[f.length - 1];
75
+ case "reject":
76
+ throw new RangeError("Multiple possible absolute times found");
77
+ }
78
+ switch (n) {
79
+ case "earlier":
80
+ return Math.min(o - a, o - c);
81
+ case "compatible":
82
+ case "later":
83
+ return Math.max(o - a, o - c);
84
+ case "reject":
85
+ throw new RangeError("No such absolute time found");
122
86
  }
123
87
  }
88
+ function P(e, t, n = "compatible") {
89
+ return new Date(C(e, t, n));
90
+ }
91
+ function v(e, t) {
92
+ let n = 0, r = 0, o = 0, a = 0;
93
+ if ("timeZone" in e) ({ hour: n, minute: r, second: o, millisecond: a } = e);
94
+ else if ("hour" in e && !t) return e;
95
+ return t && ({ hour: n, minute: r, second: o, millisecond: a } = t), new w(e.calendar, e.era, e.year, e.month, e.day, n, r, o, a);
96
+ }
97
+ function b(e, t) {
98
+ if (e.calendar.identifier === t.identifier) return e;
99
+ let n = t.fromJulianDay(e.calendar.toJulianDay(e)), r = e.copy();
100
+ return r.calendar = t, r.era = n.era, r.year = n.year, r.month = n.month, r.day = n.day, x(r), r;
101
+ }
124
102
  export {
125
- d as CalendarDate,
126
- c as CalendarDateTime
103
+ u as epochFromDate,
104
+ l as getTimeZoneOffset,
105
+ C as toAbsolute,
106
+ b as toCalendar,
107
+ v as toCalendarDateTime,
108
+ P as toDate
127
109
  };
package/index144.js CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index181.js");function t(e,i,_){r._check_private_redeclaration(e,i),i.set(e,_)}exports._=t;exports._class_private_field_init=t;