@vlrc-fe/components 1.0.6 → 1.0.8

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 (452) hide show
  1. package/dist/Form/FormFileUpload/index.d.ts +1 -1
  2. package/dist/Form/FormFileUpload/index.d.ts.map +1 -1
  3. package/dist/Form/index.d.ts +1 -1
  4. package/dist/Form/index.d.ts.map +1 -1
  5. package/dist/MultiSelect/type.d.ts +2 -2
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.js +64 -40
  8. package/dist/index10.cjs +1 -1
  9. package/dist/index10.js +46 -80
  10. package/dist/index100.cjs +1 -1
  11. package/dist/index100.js +22 -60
  12. package/dist/index101.cjs +1 -1
  13. package/dist/index101.js +1147 -43
  14. package/dist/index102.cjs +1 -1
  15. package/dist/index102.js +30 -64
  16. package/dist/index103.cjs +1 -1
  17. package/dist/index103.js +31 -147
  18. package/dist/index104.cjs +1 -1
  19. package/dist/index104.js +93 -19
  20. package/dist/index105.cjs +1 -1
  21. package/dist/index105.js +80 -25
  22. package/dist/index106.cjs +1 -1
  23. package/dist/index106.js +9 -50
  24. package/dist/index107.cjs +1 -1
  25. package/dist/index107.js +30 -156
  26. package/dist/index108.cjs +1 -1
  27. package/dist/index108.js +350 -14
  28. package/dist/index109.cjs +1 -1
  29. package/dist/index109.js +11 -0
  30. package/dist/index11.cjs +1 -1
  31. package/dist/index11.js +55 -60
  32. package/dist/index110.cjs +1 -0
  33. package/dist/index110.js +430 -0
  34. package/dist/index111.cjs +1 -0
  35. package/dist/index111.js +36 -0
  36. package/dist/index112.cjs +1 -0
  37. package/dist/index112.js +28 -0
  38. package/dist/index113.cjs +1 -0
  39. package/dist/index113.js +14 -0
  40. package/dist/index114.cjs +1 -0
  41. package/dist/index114.js +156 -0
  42. package/dist/index115.cjs +1 -0
  43. package/dist/index115.js +19 -0
  44. package/dist/index116.cjs +1 -0
  45. package/dist/index116.js +67 -0
  46. package/dist/index117.cjs +1 -0
  47. package/dist/index117.js +118 -0
  48. package/dist/index118.cjs +1 -0
  49. package/dist/index118.js +36 -0
  50. package/dist/index119.cjs +1 -0
  51. package/dist/index119.js +13 -0
  52. package/dist/index12.cjs +1 -1
  53. package/dist/index12.js +44 -121
  54. package/dist/index120.cjs +1 -0
  55. package/dist/index120.js +31 -0
  56. package/dist/index121.cjs +1 -0
  57. package/dist/index121.js +37 -0
  58. package/dist/index122.cjs +1 -0
  59. package/dist/index122.js +123 -0
  60. package/dist/index123.cjs +1 -0
  61. package/dist/index123.js +44 -0
  62. package/dist/index124.cjs +1 -0
  63. package/dist/index124.js +43 -0
  64. package/dist/index125.cjs +1 -0
  65. package/dist/index125.js +14 -0
  66. package/dist/index126.cjs +1 -0
  67. package/dist/index126.js +64 -0
  68. package/dist/index127.cjs +1 -0
  69. package/dist/index127.js +23 -0
  70. package/dist/index128.cjs +1 -0
  71. package/dist/index128.js +34 -0
  72. package/dist/index129.cjs +1 -0
  73. package/dist/index129.js +27 -0
  74. package/dist/index13.cjs +1 -1
  75. package/dist/index13.js +30 -12
  76. package/dist/index130.cjs +1 -0
  77. package/dist/index130.js +26 -0
  78. package/dist/index131.cjs +1 -0
  79. package/dist/index131.js +157 -0
  80. package/dist/index132.cjs +1 -0
  81. package/dist/index132.js +34 -0
  82. package/dist/index133.cjs +1 -0
  83. package/dist/index133.js +46 -0
  84. package/dist/index134.cjs +1 -0
  85. package/dist/index134.js +142 -0
  86. package/dist/index135.cjs +1 -0
  87. package/dist/index135.js +125 -0
  88. package/dist/index136.cjs +1 -0
  89. package/dist/index136.js +26 -0
  90. package/dist/index137.cjs +1 -0
  91. package/dist/index137.js +88 -0
  92. package/dist/index138.cjs +1 -0
  93. package/dist/index138.js +221 -0
  94. package/dist/index139.cjs +1 -0
  95. package/dist/index139.js +166 -0
  96. package/dist/index14.cjs +1 -1
  97. package/dist/index14.js +8 -12
  98. package/dist/index140.cjs +1 -0
  99. package/dist/index140.js +126 -0
  100. package/dist/index141.cjs +1 -0
  101. package/dist/index141.js +15 -0
  102. package/dist/index142.cjs +1 -0
  103. package/dist/index142.js +9 -0
  104. package/dist/index143.cjs +1 -0
  105. package/dist/index143.js +17 -0
  106. package/dist/index144.cjs +1 -0
  107. package/dist/index144.js +22 -0
  108. package/dist/index145.cjs +1 -0
  109. package/dist/index145.js +18 -0
  110. package/dist/index146.cjs +1 -0
  111. package/dist/index146.js +6 -0
  112. package/dist/index147.cjs +1 -0
  113. package/dist/index147.js +7 -0
  114. package/dist/index148.cjs +1 -0
  115. package/dist/index148.js +8 -0
  116. package/dist/index149.cjs +1 -0
  117. package/dist/index149.js +7 -0
  118. package/dist/index15.cjs +1 -1
  119. package/dist/index15.js +12 -112
  120. package/dist/index150.cjs +1 -0
  121. package/dist/index150.js +7 -0
  122. package/dist/index151.cjs +1 -0
  123. package/dist/index151.js +9 -0
  124. package/dist/index152.cjs +1 -0
  125. package/dist/index152.js +69 -0
  126. package/dist/index153.cjs +1 -0
  127. package/dist/index153.js +11 -0
  128. package/dist/index154.cjs +1 -0
  129. package/dist/index154.js +202 -0
  130. package/dist/index155.cjs +1 -0
  131. package/dist/index155.js +124 -0
  132. package/dist/index156.cjs +1 -0
  133. package/dist/index156.js +32 -0
  134. package/dist/index157.cjs +1 -0
  135. package/dist/index157.js +20 -0
  136. package/dist/index158.cjs +1 -0
  137. package/dist/index158.js +69 -0
  138. package/dist/index159.cjs +1 -0
  139. package/dist/index159.js +32 -0
  140. package/dist/index16.cjs +1 -1
  141. package/dist/index16.js +4 -726
  142. package/dist/index160.cjs +1 -0
  143. package/dist/index160.js +11 -0
  144. package/dist/index161.cjs +1 -0
  145. package/dist/index161.js +280 -0
  146. package/dist/index162.cjs +1 -0
  147. package/dist/index162.js +157 -0
  148. package/dist/index163.cjs +1 -0
  149. package/dist/index163.js +20 -0
  150. package/dist/index164.cjs +1 -0
  151. package/dist/index164.js +10 -0
  152. package/dist/index165.cjs +1 -0
  153. package/dist/index165.js +14 -0
  154. package/dist/index166.cjs +1 -0
  155. package/dist/index166.js +8 -0
  156. package/dist/index167.cjs +1 -0
  157. package/dist/index167.js +8 -0
  158. package/dist/index168.cjs +1 -0
  159. package/dist/index168.js +11 -0
  160. package/dist/index169.cjs +1 -0
  161. package/dist/index169.js +10 -0
  162. package/dist/index17.cjs +1 -1
  163. package/dist/index17.js +79 -339
  164. package/dist/index170.cjs +1 -0
  165. package/dist/index170.js +6 -0
  166. package/dist/index171.cjs +1 -0
  167. package/dist/index171.js +8 -0
  168. package/dist/index172.cjs +1 -0
  169. package/dist/index172.js +8 -0
  170. package/dist/index173.cjs +1 -0
  171. package/dist/index173.js +10 -0
  172. package/dist/index174.cjs +1 -0
  173. package/dist/index174.js +11 -0
  174. package/dist/index175.cjs +1 -0
  175. package/dist/index175.js +15 -0
  176. package/dist/index176.cjs +1 -0
  177. package/dist/index176.js +11 -0
  178. package/dist/index177.cjs +1 -0
  179. package/dist/index177.js +11 -0
  180. package/dist/index178.cjs +1 -0
  181. package/dist/index178.js +6 -0
  182. package/dist/index179.cjs +1 -0
  183. package/dist/index179.js +43 -0
  184. package/dist/index18.cjs +1 -1
  185. package/dist/index18.js +19 -66
  186. package/dist/index180.cjs +1 -0
  187. package/dist/index180.js +382 -0
  188. package/dist/index181.cjs +1 -0
  189. package/dist/index181.js +40 -0
  190. package/dist/index182.cjs +1 -0
  191. package/dist/index182.js +23 -0
  192. package/dist/index183.cjs +1 -0
  193. package/dist/index183.js +59 -0
  194. package/dist/index184.cjs +1 -0
  195. package/dist/index184.js +55 -0
  196. package/dist/index185.cjs +1 -0
  197. package/dist/index185.js +54 -0
  198. package/dist/index186.cjs +1 -0
  199. package/dist/index186.js +57 -0
  200. package/dist/index187.cjs +1 -0
  201. package/dist/index187.js +57 -0
  202. package/dist/index188.cjs +1 -0
  203. package/dist/index188.js +88 -0
  204. package/dist/index189.cjs +1 -0
  205. package/dist/index189.js +66 -0
  206. package/dist/index19.cjs +1 -1
  207. package/dist/index19.js +18 -8
  208. package/dist/index190.cjs +1 -0
  209. package/dist/index190.js +594 -0
  210. package/dist/index191.cjs +9 -0
  211. package/dist/index191.js +30 -0
  212. package/dist/index192.cjs +1 -0
  213. package/dist/index192.js +50 -0
  214. package/dist/index193.cjs +1 -0
  215. package/dist/index193.js +65 -0
  216. package/dist/index194.cjs +1 -0
  217. package/dist/index194.js +48 -0
  218. package/dist/index195.cjs +1 -0
  219. package/dist/index195.js +67 -0
  220. package/dist/index196.cjs +1 -0
  221. package/dist/index196.js +151 -0
  222. package/dist/index197.cjs +1 -0
  223. package/dist/index197.js +23 -0
  224. package/dist/index198.cjs +1 -0
  225. package/dist/index198.js +27 -0
  226. package/dist/index199.cjs +1 -0
  227. package/dist/index199.js +53 -0
  228. package/dist/index20.cjs +1 -1
  229. package/dist/index20.js +51 -98
  230. package/dist/index200.cjs +1 -0
  231. package/dist/index200.js +161 -0
  232. package/dist/index201.cjs +1 -0
  233. package/dist/index201.js +16 -0
  234. package/dist/index202.cjs +1 -0
  235. package/dist/index21.cjs +1 -1
  236. package/dist/index21.js +81 -28
  237. package/dist/index22.cjs +1 -1
  238. package/dist/index22.js +64 -14
  239. package/dist/index23.cjs +1 -1
  240. package/dist/index23.js +25 -22
  241. package/dist/index24.cjs +1 -1
  242. package/dist/index24.js +1014 -33
  243. package/dist/index25.cjs +1 -1
  244. package/dist/index25.js +22 -96
  245. package/dist/index26.cjs +1 -1
  246. package/dist/index26.js +108 -25
  247. package/dist/index27.cjs +1 -1
  248. package/dist/index27.js +15 -9
  249. package/dist/index28.cjs +1 -1
  250. package/dist/index28.js +20 -66
  251. package/dist/index29.cjs +1 -1
  252. package/dist/index29.js +81 -11
  253. package/dist/index30.cjs +1 -1
  254. package/dist/index30.js +91 -29
  255. package/dist/index31.cjs +1 -1
  256. package/dist/index31.js +14 -41
  257. package/dist/index32.cjs +1 -1
  258. package/dist/index32.js +93 -12
  259. package/dist/index33.cjs +1 -1
  260. package/dist/index33.js +22 -62
  261. package/dist/index34.cjs +1 -1
  262. package/dist/index34.js +84 -22
  263. package/dist/index35.cjs +1 -1
  264. package/dist/index35.js +85 -33
  265. package/dist/index36.cjs +1 -1
  266. package/dist/index36.js +407 -25
  267. package/dist/index37.cjs +1 -1
  268. package/dist/index37.js +170 -25
  269. package/dist/index38.cjs +1 -1
  270. package/dist/index38.js +28 -154
  271. package/dist/index39.cjs +1 -1
  272. package/dist/index39.js +158 -33
  273. package/dist/index40.cjs +1 -1
  274. package/dist/index40.js +104 -45
  275. package/dist/index41.cjs +1 -1
  276. package/dist/index41.js +337 -140
  277. package/dist/index42.cjs +1 -1
  278. package/dist/index42.js +96 -124
  279. package/dist/index43.cjs +1 -1
  280. package/dist/index43.js +319 -23
  281. package/dist/index44.cjs +1 -1
  282. package/dist/index44.js +205 -81
  283. package/dist/index45.cjs +1 -1
  284. package/dist/index45.js +33 -220
  285. package/dist/index46.cjs +1 -1
  286. package/dist/index46.js +161 -163
  287. package/dist/index47.cjs +1 -1
  288. package/dist/index47.js +20 -125
  289. package/dist/index48.cjs +1 -1
  290. package/dist/index48.js +24 -14
  291. package/dist/index49.cjs +1 -1
  292. package/dist/index49.js +167 -7
  293. package/dist/index5.js +26 -14
  294. package/dist/index50.cjs +1 -1
  295. package/dist/index50.js +44 -15
  296. package/dist/index51.cjs +1 -1
  297. package/dist/index51.js +15 -18
  298. package/dist/index52.cjs +1 -1
  299. package/dist/index52.js +3 -17
  300. package/dist/index53.cjs +1 -1
  301. package/dist/index53.js +5 -5
  302. package/dist/index54.cjs +1 -1
  303. package/dist/index54.js +19 -4
  304. package/dist/index55.cjs +1 -1
  305. package/dist/index55.js +24 -6
  306. package/dist/index56.cjs +1 -1
  307. package/dist/index56.js +66 -4
  308. package/dist/index57.cjs +1 -1
  309. package/dist/index57.js +14 -5
  310. package/dist/index58.cjs +1 -1
  311. package/dist/index58.js +4 -8
  312. package/dist/index59.cjs +1 -1
  313. package/dist/index59.js +50 -67
  314. package/dist/index6.cjs +1 -1
  315. package/dist/index6.js +85 -46
  316. package/dist/index60.cjs +1 -1
  317. package/dist/index60.js +6 -10
  318. package/dist/index61.cjs +1 -1
  319. package/dist/index61.js +25 -199
  320. package/dist/index62.cjs +1 -1
  321. package/dist/index62.js +13 -122
  322. package/dist/index63.cjs +1 -1
  323. package/dist/index63.js +9 -30
  324. package/dist/index64.cjs +1 -1
  325. package/dist/index64.js +3 -20
  326. package/dist/index65.cjs +1 -1
  327. package/dist/index65.js +24 -66
  328. package/dist/index66.cjs +1 -1
  329. package/dist/index66.js +68 -30
  330. package/dist/index67.cjs +38 -1
  331. package/dist/index67.js +3 -11
  332. package/dist/index68.cjs +1 -1
  333. package/dist/index68.js +12 -279
  334. package/dist/index69.cjs +1 -1
  335. package/dist/index69.js +50 -155
  336. package/dist/index7.cjs +1 -1
  337. package/dist/index7.js +29 -85
  338. package/dist/index70.cjs +1 -1
  339. package/dist/index70.js +115 -19
  340. package/dist/index71.cjs +4 -1
  341. package/dist/index71.js +6 -9
  342. package/dist/index72.cjs +1 -1
  343. package/dist/index72.js +12 -12
  344. package/dist/index73.cjs +1 -1
  345. package/dist/index73.js +539 -6
  346. package/dist/index74.cjs +1 -1
  347. package/dist/index74.js +197 -6
  348. package/dist/index75.cjs +1 -1
  349. package/dist/index75.js +120 -9
  350. package/dist/index76.cjs +1 -1
  351. package/dist/index76.js +912 -8
  352. package/dist/index77.cjs +3 -1
  353. package/dist/index77.js +76 -4
  354. package/dist/index78.cjs +1 -1
  355. package/dist/index78.js +120 -6
  356. package/dist/index79.cjs +1 -1
  357. package/dist/index79.js +12 -6
  358. package/dist/index8.cjs +1 -1
  359. package/dist/index8.js +35 -62
  360. package/dist/index80.cjs +1 -1
  361. package/dist/index80.js +14 -8
  362. package/dist/index81.cjs +1 -1
  363. package/dist/index81.js +113 -9
  364. package/dist/index82.cjs +1 -1
  365. package/dist/index82.js +725 -13
  366. package/dist/index83.cjs +1 -1
  367. package/dist/index83.js +346 -9
  368. package/dist/index84.cjs +1 -1
  369. package/dist/index84.js +74 -9
  370. package/dist/index85.cjs +1 -1
  371. package/dist/index85.js +148 -4
  372. package/dist/index86.cjs +1 -1
  373. package/dist/index86.js +31 -42
  374. package/dist/index87.cjs +1 -1
  375. package/dist/index87.js +12 -380
  376. package/dist/index88.cjs +1 -1
  377. package/dist/index88.js +345 -37
  378. package/dist/index89.cjs +20 -1
  379. package/dist/index89.js +40 -18
  380. package/dist/index9.cjs +1 -1
  381. package/dist/index9.js +85 -17
  382. package/dist/index90.cjs +1 -1
  383. package/dist/index90.js +113 -56
  384. package/dist/index91.cjs +1 -1
  385. package/dist/index91.js +272 -51
  386. package/dist/index92.cjs +1 -1
  387. package/dist/index92.js +129 -50
  388. package/dist/index93.cjs +1 -1
  389. package/dist/index93.js +13 -54
  390. package/dist/index94.cjs +1 -1
  391. package/dist/index94.js +28 -55
  392. package/dist/index95.cjs +1 -1
  393. package/dist/index95.js +525 -80
  394. package/dist/index96.cjs +1 -1
  395. package/dist/index96.js +75 -61
  396. package/dist/index97.cjs +1 -1
  397. package/dist/index97.js +67 -583
  398. package/dist/index98.cjs +1 -9
  399. package/dist/index98.js +32 -27
  400. package/dist/index99.cjs +1 -1
  401. package/dist/index99.js +17 -49
  402. package/dist/ui/alert-dialog.d.ts +15 -0
  403. package/dist/ui/alert-dialog.d.ts.map +1 -0
  404. package/dist/ui/alert.d.ts +10 -0
  405. package/dist/ui/alert.d.ts.map +1 -0
  406. package/dist/ui/aspect-ratio.d.ts +4 -0
  407. package/dist/ui/aspect-ratio.d.ts.map +1 -0
  408. package/dist/ui/avatar.d.ts +7 -0
  409. package/dist/ui/avatar.d.ts.map +1 -0
  410. package/dist/ui/badge.d.ts +1 -1
  411. package/dist/ui/breadcrumb.d.ts +12 -0
  412. package/dist/ui/breadcrumb.d.ts.map +1 -0
  413. package/dist/ui/button.d.ts +1 -1
  414. package/dist/ui/carousel.d.ts +20 -0
  415. package/dist/ui/carousel.d.ts.map +1 -0
  416. package/dist/ui/collapsible.d.ts +6 -0
  417. package/dist/ui/collapsible.d.ts.map +1 -0
  418. package/dist/ui/context-menu.d.ts +26 -0
  419. package/dist/ui/context-menu.d.ts.map +1 -0
  420. package/dist/ui/drawer.d.ts +14 -0
  421. package/dist/ui/drawer.d.ts.map +1 -0
  422. package/dist/ui/hover-card.d.ts +7 -0
  423. package/dist/ui/hover-card.d.ts.map +1 -0
  424. package/dist/ui/index.d.ts +23 -0
  425. package/dist/ui/index.d.ts.map +1 -1
  426. package/dist/ui/input-otp.d.ts +12 -0
  427. package/dist/ui/input-otp.d.ts.map +1 -0
  428. package/dist/ui/menubar.d.ts +27 -0
  429. package/dist/ui/menubar.d.ts.map +1 -0
  430. package/dist/ui/navigation-menu.d.ts +15 -0
  431. package/dist/ui/navigation-menu.d.ts.map +1 -0
  432. package/dist/ui/pagination.d.ts +14 -0
  433. package/dist/ui/pagination.d.ts.map +1 -0
  434. package/dist/ui/resizable.d.ts +9 -0
  435. package/dist/ui/resizable.d.ts.map +1 -0
  436. package/dist/ui/sheet.d.ts +14 -0
  437. package/dist/ui/sheet.d.ts.map +1 -0
  438. package/dist/ui/sidebar.d.ts +70 -0
  439. package/dist/ui/sidebar.d.ts.map +1 -0
  440. package/dist/ui/skeleton.d.ts +3 -0
  441. package/dist/ui/skeleton.d.ts.map +1 -0
  442. package/dist/ui/slider.d.ts +5 -0
  443. package/dist/ui/slider.d.ts.map +1 -0
  444. package/dist/ui/switch.d.ts +5 -0
  445. package/dist/ui/switch.d.ts.map +1 -0
  446. package/dist/ui/tabs.d.ts +8 -0
  447. package/dist/ui/tabs.d.ts.map +1 -0
  448. package/dist/ui/toggle-group.d.ts +8 -0
  449. package/dist/ui/toggle-group.d.ts.map +1 -0
  450. package/dist/ui/toggle.d.ts +10 -0
  451. package/dist/ui/toggle.d.ts.map +1 -0
  452. package/package.json +23 -5
package/dist/index37.js CHANGED
@@ -1,26 +1,171 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { noop as t } from "lodash-es";
3
- //#region src/DataTable/render/defaults.tsx
4
- var n = {
5
- placeholder: "Search...",
6
- debounceMs: 300
7
- }, r = { pageSizeOptions: [
8
- 10,
9
- 20,
10
- 50,
11
- 100
12
- ] }, i = { render: () => /* @__PURE__ */ e("div", {
13
- className: "text-muted-foreground py-8 text-center text-sm",
14
- children: "No results."
15
- }) }, a = {
16
- mode: "client",
17
- isFetching: !1,
18
- totalRows: 0,
19
- onQueryChange: t
20
- }, o = {
21
- enabled: !1,
22
- thresholdPx: 200,
23
- onEndReached: t
24
- }, s = () => ({ getRowActions: () => [] });
1
+ "use client";
2
+ import { useComposedRefs as e } from "./index7.js";
3
+ import { composeEventHandlers as t } from "./index8.js";
4
+ import { Primitive as n, dispatchDiscreteCustomEvent as r } from "./index12.js";
5
+ import { useCallbackRef as i } from "./index15.js";
6
+ import * as a from "react";
7
+ import { jsx as o } from "react/jsx-runtime";
8
+ //#region ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.19_@types+react-dom@19.2.3_@types+react@19.2.17___1726272c044b69ad8799cdb51c1704df/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
9
+ var s = Object.defineProperty, c = (e, t) => s(e, "name", {
10
+ value: t,
11
+ configurable: !0
12
+ }), l = "dismissableLayer.update", u = "dismissableLayer.pointerDownOutside", d = "dismissableLayer.focusOutside", f, p = a.createContext({
13
+ layers: /* @__PURE__ */ new Set(),
14
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
15
+ branches: /* @__PURE__ */ new Set(),
16
+ dismissableSurfaces: /* @__PURE__ */ new Set()
17
+ }), m = /* @__PURE__ */ a.forwardRef(/* @__PURE__ */ c(function(r, s) {
18
+ let { disableOutsidePointerEvents: u = !1, deferPointerDownOutside: d = !1, onEscapeKeyDown: m, onPointerDownOutside: h, onFocusOutside: g, onInteractOutside: b, onDismiss: x, ...S } = r, C = a.useContext(p), [w, T] = a.useState(null), E = w?.ownerDocument ?? globalThis?.document, [, D] = a.useState({}), O = e(s, T), k = Array.from(C.layers), [A] = [...C.layersWithOutsidePointerEventsDisabled].slice(-1), j = A ? k.indexOf(A) : -1, M = w ? k.indexOf(w) : -1, N = C.layersWithOutsidePointerEventsDisabled.size > 0, P = M >= j, F = a.useRef(!1), I = _((e) => {
19
+ h?.(e), b?.(e), e.defaultPrevented || x?.();
20
+ }, {
21
+ ownerDocument: E,
22
+ deferPointerDownOutside: d,
23
+ isDeferredPointerDownOutsideRef: F,
24
+ dismissableSurfaces: C.dismissableSurfaces,
25
+ shouldHandlePointerDownOutside: a.useCallback((e) => {
26
+ if (!(e instanceof Node)) return !1;
27
+ let t = [...C.branches].some((t) => t.contains(e));
28
+ return P && !t;
29
+ }, [C.branches, P])
30
+ }), L = v((e) => {
31
+ if (d && F.current) return;
32
+ let t = e.target;
33
+ [...C.branches].some((e) => e.contains(t)) || (g?.(e), b?.(e), e.defaultPrevented || x?.());
34
+ }, E), R = w ? M === k.length - 1 : !1, z = i((e) => {
35
+ e.key === "Escape" && (m?.(e), !e.defaultPrevented && x && (e.preventDefault(), x()));
36
+ });
37
+ return a.useEffect(() => {
38
+ if (R) return E.addEventListener("keydown", z, { capture: !0 }), () => E.removeEventListener("keydown", z, { capture: !0 });
39
+ }, [
40
+ E,
41
+ R,
42
+ z
43
+ ]), a.useEffect(() => {
44
+ if (w) return u && (C.layersWithOutsidePointerEventsDisabled.size === 0 && (f = E.body.style.pointerEvents, E.body.style.pointerEvents = "none"), C.layersWithOutsidePointerEventsDisabled.add(w)), C.layers.add(w), y(), () => {
45
+ u && (C.layersWithOutsidePointerEventsDisabled.delete(w), C.layersWithOutsidePointerEventsDisabled.size === 0 && (E.body.style.pointerEvents = f));
46
+ };
47
+ }, [
48
+ w,
49
+ E,
50
+ u,
51
+ C
52
+ ]), a.useEffect(() => () => {
53
+ w && (C.layers.delete(w), C.layersWithOutsidePointerEventsDisabled.delete(w), y());
54
+ }, [w, C]), a.useEffect(() => {
55
+ let e = /* @__PURE__ */ c(() => D({}), "handleUpdate");
56
+ return document.addEventListener(l, e), () => document.removeEventListener(l, e);
57
+ }, []), /* @__PURE__ */ o(n.div, {
58
+ ...S,
59
+ ref: O,
60
+ style: {
61
+ pointerEvents: N ? P ? "auto" : "none" : void 0,
62
+ ...r.style
63
+ },
64
+ onFocusCapture: t(r.onFocusCapture, L.onFocusCapture),
65
+ onBlurCapture: t(r.onBlurCapture, L.onBlurCapture),
66
+ onPointerDownCapture: t(r.onPointerDownCapture, I.onPointerDownCapture)
67
+ });
68
+ }, "DismissableLayer"));
69
+ function h() {
70
+ let e = a.useContext(p), [t, n] = a.useState(null);
71
+ return a.useEffect(() => {
72
+ if (t) return e.dismissableSurfaces.add(t), () => {
73
+ e.dismissableSurfaces.delete(t);
74
+ };
75
+ }, [t, e.dismissableSurfaces]), n;
76
+ }
77
+ c(h, "useDismissableLayerSurface");
78
+ var g = /* @__PURE__ */ c(() => !0, "IS_TRUE");
79
+ function _(e, t) {
80
+ let { ownerDocument: n = globalThis?.document, deferPointerDownOutside: r = !1, isDeferredPointerDownOutsideRef: o, dismissableSurfaces: s, shouldHandlePointerDownOutside: l = g } = t, d = i(e), f = a.useRef(!1), p = a.useRef(!1), m = a.useRef(/* @__PURE__ */ new Map()), h = a.useRef(() => {});
81
+ return a.useEffect(() => {
82
+ function e() {
83
+ p.current = !1, o.current = !1, m.current.clear();
84
+ }
85
+ c(e, "resetOutsideInteraction");
86
+ function t() {
87
+ return Array.from(m.current.values()).some(Boolean);
88
+ }
89
+ c(t, "isOutsideInteractionIntercepted");
90
+ function i(e) {
91
+ if (!p.current) return;
92
+ let t = e.target;
93
+ t instanceof Node && [...s].some((e) => e.contains(t)) || m.current.set(e.type, !0), e.type === "click" && window.setTimeout(() => {
94
+ p.current && h.current();
95
+ }, 0);
96
+ }
97
+ c(i, "handleInteractionCapture");
98
+ function a(e) {
99
+ p.current && m.current.set(e.type, !1);
100
+ }
101
+ c(a, "handleInteractionBubble");
102
+ let g = /* @__PURE__ */ c((i) => {
103
+ if (i.target && !f.current) {
104
+ let a = function() {
105
+ n.removeEventListener("click", h.current);
106
+ let r = t();
107
+ e(), r || b(u, d, s, { discrete: !0 });
108
+ };
109
+ if (c(a, "handleAndDispatchPointerDownOutsideEvent"), !l(i.target)) {
110
+ n.removeEventListener("click", h.current), e(), f.current = !1;
111
+ return;
112
+ }
113
+ let s = { originalEvent: i };
114
+ p.current = !0, o.current = r && i.button === 0, m.current.clear(), !r || i.button !== 0 ? a() : (n.removeEventListener("click", h.current), h.current = a, n.addEventListener("click", h.current, { once: !0 }));
115
+ } else n.removeEventListener("click", h.current), e();
116
+ f.current = !1;
117
+ }, "handlePointerDown"), _ = [
118
+ "pointerup",
119
+ "mousedown",
120
+ "mouseup",
121
+ "touchstart",
122
+ "touchend",
123
+ "click"
124
+ ];
125
+ for (let e of _) n.addEventListener(e, i, !0), n.addEventListener(e, a);
126
+ let v = window.setTimeout(() => {
127
+ n.addEventListener("pointerdown", g);
128
+ }, 0);
129
+ return () => {
130
+ window.clearTimeout(v), n.removeEventListener("pointerdown", g), n.removeEventListener("click", h.current);
131
+ for (let e of _) n.removeEventListener(e, i, !0), n.removeEventListener(e, a);
132
+ };
133
+ }, [
134
+ n,
135
+ d,
136
+ r,
137
+ o,
138
+ s,
139
+ l
140
+ ]), { onPointerDownCapture: /* @__PURE__ */ c(() => f.current = !0, "onPointerDownCapture") };
141
+ }
142
+ c(_, "usePointerDownOutside");
143
+ function v(e, t = globalThis?.document) {
144
+ let n = i(e), r = a.useRef(!1);
145
+ return a.useEffect(() => {
146
+ let e = /* @__PURE__ */ c((e) => {
147
+ e.target && !r.current && b(d, n, { originalEvent: e }, { discrete: !1 });
148
+ }, "handleFocus");
149
+ return t.addEventListener("focusin", e), () => t.removeEventListener("focusin", e);
150
+ }, [t, n]), {
151
+ onFocusCapture: /* @__PURE__ */ c(() => r.current = !0, "onFocusCapture"),
152
+ onBlurCapture: /* @__PURE__ */ c(() => r.current = !1, "onBlurCapture")
153
+ };
154
+ }
155
+ c(v, "useFocusOutside");
156
+ function y() {
157
+ let e = new CustomEvent(l);
158
+ document.dispatchEvent(e);
159
+ }
160
+ c(y, "dispatchUpdate");
161
+ function b(e, t, n, { discrete: i }) {
162
+ let a = n.originalEvent.target, o = new CustomEvent(e, {
163
+ bubbles: !1,
164
+ cancelable: !0,
165
+ detail: n
166
+ });
167
+ t && a.addEventListener(e, t, { once: !0 }), i ? r(a, o) : a.dispatchEvent(o);
168
+ }
169
+ c(b, "handleAndDispatchCustomEvent");
25
170
  //#endregion
26
- export { a as DEFAULT_API, i as DEFAULT_EMPTY, o as DEFAULT_INFINITE_SCROLL, r as DEFAULT_PAGINATION, n as DEFAULT_SEARCH, s as createDefaultActions };
171
+ export { m as DismissableLayer };
package/dist/index38.cjs CHANGED
@@ -1 +1 @@
1
- let e=require("react/jsx-runtime"),t=require("lodash-es");var n={placeholder:`Search...`,debounceMs:300},r={pageSizeOptions:[10,20,50,100]},i={render:()=>(0,e.jsx)(`div`,{className:`text-muted-foreground py-8 text-center text-sm`,children:`No results.`})},a={mode:`client`,isFetching:!1,totalRows:0,onQueryChange:t.noop},o={enabled:!1,thresholdPx:200,onEndReached:t.noop},s=()=>({getRowActions:()=>[]});exports.DEFAULT_API=a,exports.DEFAULT_EMPTY=i,exports.DEFAULT_INFINITE_SCROLL=o,exports.DEFAULT_PAGINATION=r,exports.DEFAULT_SEARCH=n,exports.createDefaultActions=s;
1
+ "use client";const e=require("./index2.cjs"),t=require("./index8.cjs"),n=require("./index9.cjs"),r=require("./index13.cjs"),i=require("./index16.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=Object.defineProperty,c=(e,t)=>s(e,`name`,{value:t,configurable:!0}),l=`dismissableLayer.update`,u=`dismissableLayer.pointerDownOutside`,d=`dismissableLayer.focusOutside`,f,p=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),m=a.forwardRef(c(function(e,s){let{disableOutsidePointerEvents:u=!1,deferPointerDownOutside:d=!1,onEscapeKeyDown:m,onPointerDownOutside:h,onFocusOutside:g,onInteractOutside:b,onDismiss:x,...S}=e,C=a.useContext(p),[w,T]=a.useState(null),E=w?.ownerDocument??globalThis?.document,[,D]=a.useState({}),O=t.useComposedRefs(s,T),k=Array.from(C.layers),[A]=[...C.layersWithOutsidePointerEventsDisabled].slice(-1),j=A?k.indexOf(A):-1,M=w?k.indexOf(w):-1,N=C.layersWithOutsidePointerEventsDisabled.size>0,P=M>=j,F=a.useRef(!1),I=_(e=>{h?.(e),b?.(e),e.defaultPrevented||x?.()},{ownerDocument:E,deferPointerDownOutside:d,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:C.dismissableSurfaces,shouldHandlePointerDownOutside:a.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...C.branches].some(t=>t.contains(e));return P&&!t},[C.branches,P])}),L=v(e=>{if(d&&F.current)return;let t=e.target;[...C.branches].some(e=>e.contains(t))||(g?.(e),b?.(e),e.defaultPrevented||x?.())},E),R=w?M===k.length-1:!1,z=i.useCallbackRef(e=>{e.key===`Escape`&&(m?.(e),!e.defaultPrevented&&x&&(e.preventDefault(),x()))});return a.useEffect(()=>{if(R)return E.addEventListener(`keydown`,z,{capture:!0}),()=>E.removeEventListener(`keydown`,z,{capture:!0})},[E,R,z]),a.useEffect(()=>{if(w)return u&&(C.layersWithOutsidePointerEventsDisabled.size===0&&(f=E.body.style.pointerEvents,E.body.style.pointerEvents=`none`),C.layersWithOutsidePointerEventsDisabled.add(w)),C.layers.add(w),y(),()=>{u&&(C.layersWithOutsidePointerEventsDisabled.delete(w),C.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=f))}},[w,E,u,C]),a.useEffect(()=>()=>{w&&(C.layers.delete(w),C.layersWithOutsidePointerEventsDisabled.delete(w),y())},[w,C]),a.useEffect(()=>{let e=c(()=>D({}),`handleUpdate`);return document.addEventListener(l,e),()=>document.removeEventListener(l,e)},[]),(0,o.jsx)(r.Primitive.div,{...S,ref:O,style:{pointerEvents:N?P?`auto`:`none`:void 0,...e.style},onFocusCapture:n.composeEventHandlers(e.onFocusCapture,L.onFocusCapture),onBlurCapture:n.composeEventHandlers(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:n.composeEventHandlers(e.onPointerDownCapture,I.onPointerDownCapture)})},`DismissableLayer`));function h(){let e=a.useContext(p),[t,n]=a.useState(null);return a.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}c(h,`useDismissableLayerSurface`);var g=c(()=>!0,`IS_TRUE`);function _(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:l=g}=t,d=i.useCallbackRef(e),f=a.useRef(!1),p=a.useRef(!1),m=a.useRef(new Map),h=a.useRef(()=>{});return a.useEffect(()=>{function e(){p.current=!1,o.current=!1,m.current.clear()}c(e,`resetOutsideInteraction`);function t(){return Array.from(m.current.values()).some(Boolean)}c(t,`isOutsideInteractionIntercepted`);function i(e){if(!p.current)return;let t=e.target;t instanceof Node&&[...s].some(e=>e.contains(t))||m.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{p.current&&h.current()},0)}c(i,`handleInteractionCapture`);function a(e){p.current&&m.current.set(e.type,!1)}c(a,`handleInteractionBubble`);let g=c(i=>{if(i.target&&!f.current){let a=function(){n.removeEventListener(`click`,h.current);let r=t();e(),r||b(u,d,s,{discrete:!0})};if(c(a,`handleAndDispatchPointerDownOutsideEvent`),!l(i.target)){n.removeEventListener(`click`,h.current),e(),f.current=!1;return}let s={originalEvent:i};p.current=!0,o.current=r&&i.button===0,m.current.clear(),!r||i.button!==0?a():(n.removeEventListener(`click`,h.current),h.current=a,n.addEventListener(`click`,h.current,{once:!0}))}else n.removeEventListener(`click`,h.current),e();f.current=!1},`handlePointerDown`),_=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of _)n.addEventListener(e,i,!0),n.addEventListener(e,a);let v=window.setTimeout(()=>{n.addEventListener(`pointerdown`,g)},0);return()=>{window.clearTimeout(v),n.removeEventListener(`pointerdown`,g),n.removeEventListener(`click`,h.current);for(let e of _)n.removeEventListener(e,i,!0),n.removeEventListener(e,a)}},[n,d,r,o,s,l]),{onPointerDownCapture:c(()=>f.current=!0,`onPointerDownCapture`)}}c(_,`usePointerDownOutside`);function v(e,t=globalThis?.document){let n=i.useCallbackRef(e),r=a.useRef(!1);return a.useEffect(()=>{let e=c(e=>{e.target&&!r.current&&b(d,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:c(()=>r.current=!0,`onFocusCapture`),onBlurCapture:c(()=>r.current=!1,`onBlurCapture`)}}c(v,`useFocusOutside`);function y(){let e=new CustomEvent(l);document.dispatchEvent(e)}c(y,`dispatchUpdate`);function b(e,t,n,{discrete:i}){let a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),i?r.dispatchDiscreteCustomEvent(a,o):a.dispatchEvent(o)}c(b,`handleAndDispatchCustomEvent`),exports.DismissableLayer=m;
package/dist/index38.js CHANGED
@@ -1,157 +1,31 @@
1
- import { cn as e } from "./index3.js";
2
- import { DataTablePagination as t } from "./index33.js";
3
- import { DataTableTable as n } from "./index34.js";
4
- import { DataTableToolbar as r } from "./index35.js";
5
- import { DataTableViewOptions as ee } from "./index36.js";
6
- import { DEFAULT_API as te, DEFAULT_EMPTY as ne, DEFAULT_INFINITE_SCROLL as re, DEFAULT_PAGINATION as ie, DEFAULT_SEARCH as ae, createDefaultActions as oe } from "./index37.js";
7
- import { useEffect as i, useRef as se, useState as a } from "react";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { clamp as ce, debounce as c } from "lodash-es";
10
- import { useUpdateEffect as l } from "ahooks";
11
- import { functionalUpdate as u, getCoreRowModel as le, getExpandedRowModel as ue, getFilteredRowModel as de, getPaginationRowModel as d, getSortedRowModel as f, useReactTable as p } from "@tanstack/react-table";
12
- //#region src/DataTable/DataTable.tsx
13
- var m = {
14
- sorting: [],
15
- columnFilters: [],
16
- globalFilter: "",
17
- columnVisibility: {},
18
- rowSelection: {},
19
- pagination: {
20
- pageIndex: 0,
21
- pageSize: 10
22
- },
23
- expanded: {}
24
- }, h = () => ({
25
- enabled: !1,
26
- renderSubComponent: () => null,
27
- getSubRows: () => []
28
- }), g = () => null, _ = (e, t) => String(t), v = ({ data: v, columns: fe, initialState: y, empty: b, search: x, pagination: S, actions: C, api: w, infiniteScroll: T, expand: E, className: D, containerClassName: O, getRowId: k, renderToolbarRight: A }) => {
29
- let j = y === void 0 ? m : y, M = b === void 0 ? ne : b, N = x === void 0 ? ae : x, P = S === void 0 ? ie : S, F = C === void 0 ? oe() : C, I = w === void 0 ? te : w, L = T === void 0 ? re : T, R = E === void 0 ? h() : E, z = k === void 0 ? _ : k, B = A === void 0 ? g : A, [V, pe] = a(j.sorting), [H, me] = a(j.columnFilters), [U, he] = a(j.globalFilter), [W, ge] = a(j.columnVisibility), [_e, ve] = a(j.rowSelection), [G, K] = a(j.pagination), [q, J] = a(j.expanded), Y = I.mode === "server", ye = Y && G.pageSize > 0 ? Math.ceil(I.totalRows / G.pageSize) : void 0, X = p({
30
- data: v,
31
- columns: fe,
32
- state: {
33
- sorting: V,
34
- columnFilters: H,
35
- globalFilter: U,
36
- columnVisibility: W,
37
- rowSelection: _e,
38
- pagination: G,
39
- expanded: q
40
- },
41
- manualSorting: Y,
42
- manualFiltering: Y,
43
- manualPagination: Y,
44
- pageCount: ye,
45
- meta: { getRowActions: F.getRowActions },
46
- enableRowSelection: !0,
47
- getRowId: (e, t, n) => z(e, t, n === void 0 ? null : n),
48
- onSortingChange: (e) => pe((t) => u(e, t)),
49
- onColumnFiltersChange: (e) => me((t) => u(e, t)),
50
- onGlobalFilterChange: (e) => he((t) => u(e, t)),
51
- onColumnVisibilityChange: (e) => ge((t) => u(e, t)),
52
- onRowSelectionChange: (e) => ve((t) => u(e, t)),
53
- onPaginationChange: (e) => K((t) => u(e, t)),
54
- onExpandedChange: (e) => J((t) => u(e, t)),
55
- getCoreRowModel: le(),
56
- getSortedRowModel: Y ? void 0 : f(),
57
- getFilteredRowModel: Y ? void 0 : de(),
58
- getPaginationRowModel: Y ? void 0 : d(),
59
- getExpandedRowModel: ue(),
60
- getSubRows: R.enabled ? R.getSubRows : void 0,
61
- getRowCanExpand: () => R.enabled
62
- }), Z = {
63
- sorting: V,
64
- columnFilters: H,
65
- globalFilter: U,
66
- pagination: G
67
- };
68
- l(() => {
69
- Y || K((e) => ({
70
- ...e,
71
- pageIndex: 0
72
- }));
73
- }, [
74
- Y,
75
- U,
76
- H,
77
- V
78
- ]), i(() => {
79
- if (Y) return;
80
- let e = X.getFilteredRowModel().rows.length, t = G.pageSize, n = t > 0 ? Math.ceil(e / t) : 0, r = n === 0 ? 0 : n - 1;
81
- K((e) => ({
82
- ...e,
83
- pageIndex: ce(e.pageIndex, 0, r)
84
- }));
85
- }, [
86
- Y,
87
- G.pageSize,
88
- X
89
- ]);
90
- let Q = se(c((e) => {
91
- I.onQueryChange(e);
92
- }, N.debounceMs));
93
- i(() => (Q.current = c((e) => {
94
- I.onQueryChange(e);
95
- }, N.debounceMs), () => {
96
- Q.current.cancel();
97
- }), [I, N.debounceMs]), l(() => {
98
- if (I.mode === "server") return Q.current(Z), () => {
99
- Q.current.cancel();
1
+ "use client";
2
+ import * as e from "react";
3
+ //#region ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.6_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
4
+ var t = Object.defineProperty, n = (e, n) => t(e, "name", {
5
+ value: n,
6
+ configurable: !0
7
+ }), r = 0, i = null;
8
+ function a(e) {
9
+ return o(), e.children;
10
+ }
11
+ n(a, "FocusGuards");
12
+ function o() {
13
+ e.useEffect(() => {
14
+ i ||= {
15
+ start: s(),
16
+ end: s()
100
17
  };
101
- }, [Z, I]);
102
- let [$, be] = a(null);
103
- i(() => {
104
- if (L.enabled === !1 || $ === null) return;
105
- let e = () => {
106
- if (I.isFetching) return;
107
- let e = $.scrollTop;
108
- $.scrollHeight - (e + $.clientHeight) <= L.thresholdPx && L.onEndReached(Z);
18
+ let { start: e, end: t } = i;
19
+ return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t), r++, () => {
20
+ r === 1 && (i?.start.remove(), i?.end.remove(), i = null), r = Math.max(0, r - 1);
109
21
  };
110
- return $.addEventListener("scroll", e, { passive: !0 }), () => {
111
- $.removeEventListener("scroll", e);
112
- };
113
- }, [
114
- I.isFetching,
115
- L,
116
- Z,
117
- $
118
- ]);
119
- let xe = X.getVisibleLeafColumns().length;
120
- return /* @__PURE__ */ s("div", {
121
- className: e("w-full", D === void 0 ? "" : D),
122
- children: [
123
- /* @__PURE__ */ o(r, {
124
- table: X,
125
- placeholder: N.placeholder,
126
- debounceMs: N.debounceMs,
127
- right: /* @__PURE__ */ s("div", {
128
- className: "ml-auto flex items-center gap-2",
129
- children: [B(X), /* @__PURE__ */ o(ee, {
130
- table: X,
131
- columnVisibility: W
132
- })]
133
- })
134
- }),
135
- /* @__PURE__ */ o("div", {
136
- ref: (e) => be(e),
137
- className: e(O === void 0 ? "overflow-auto" : O),
138
- children: /* @__PURE__ */ o(n, {
139
- table: X,
140
- columnVisibility: W,
141
- expandedState: q,
142
- expandConfig: R,
143
- empty: M,
144
- columnsCount: xe
145
- })
146
- }),
147
- /* @__PURE__ */ o(t, {
148
- table: X,
149
- tableState: X.getState(),
150
- pageSizeOptions: P.pageSizeOptions,
151
- apiConfig: I
152
- })
153
- ]
154
- });
155
- };
22
+ }, []);
23
+ }
24
+ n(o, "useFocusGuards");
25
+ function s() {
26
+ let e = document.createElement("span");
27
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
28
+ }
29
+ n(s, "createFocusGuard");
156
30
  //#endregion
157
- export { v as default };
31
+ export { o as useFocusGuards };
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index4.cjs"),t=require("./index34.cjs"),n=require("./index35.cjs"),r=require("./index36.cjs"),ee=require("./index37.cjs"),i=require("./index38.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("lodash-es"),c=require("ahooks"),l=require("@tanstack/react-table");var u={sorting:[],columnFilters:[],globalFilter:``,columnVisibility:{},rowSelection:{},pagination:{pageIndex:0,pageSize:10},expanded:{}},te=()=>({enabled:!1,renderSubComponent:()=>null,getSubRows:()=>[]}),d=()=>null,ne=(e,t)=>String(t),f=({data:f,columns:p,initialState:m,empty:h,search:g,pagination:_,actions:v,api:y,infiniteScroll:b,expand:x,className:S,containerClassName:C,getRowId:w,renderToolbarRight:T})=>{let E=m===void 0?u:m,D=h===void 0?i.DEFAULT_EMPTY:h,O=g===void 0?i.DEFAULT_SEARCH:g,k=_===void 0?i.DEFAULT_PAGINATION:_,A=v===void 0?i.createDefaultActions():v,j=y===void 0?i.DEFAULT_API:y,M=b===void 0?i.DEFAULT_INFINITE_SCROLL:b,N=x===void 0?te():x,P=w===void 0?ne:w,re=T===void 0?d:T,[F,ie]=(0,a.useState)(E.sorting),[I,L]=(0,a.useState)(E.columnFilters),[R,z]=(0,a.useState)(E.globalFilter),[B,V]=(0,a.useState)(E.columnVisibility),[H,U]=(0,a.useState)(E.rowSelection),[W,G]=(0,a.useState)(E.pagination),[K,q]=(0,a.useState)(E.expanded),J=j.mode===`server`,Y=J&&W.pageSize>0?Math.ceil(j.totalRows/W.pageSize):void 0,X=(0,l.useReactTable)({data:f,columns:p,state:{sorting:F,columnFilters:I,globalFilter:R,columnVisibility:B,rowSelection:H,pagination:W,expanded:K},manualSorting:J,manualFiltering:J,manualPagination:J,pageCount:Y,meta:{getRowActions:A.getRowActions},enableRowSelection:!0,getRowId:(e,t,n)=>P(e,t,n===void 0?null:n),onSortingChange:e=>ie(t=>(0,l.functionalUpdate)(e,t)),onColumnFiltersChange:e=>L(t=>(0,l.functionalUpdate)(e,t)),onGlobalFilterChange:e=>z(t=>(0,l.functionalUpdate)(e,t)),onColumnVisibilityChange:e=>V(t=>(0,l.functionalUpdate)(e,t)),onRowSelectionChange:e=>U(t=>(0,l.functionalUpdate)(e,t)),onPaginationChange:e=>G(t=>(0,l.functionalUpdate)(e,t)),onExpandedChange:e=>q(t=>(0,l.functionalUpdate)(e,t)),getCoreRowModel:(0,l.getCoreRowModel)(),getSortedRowModel:J?void 0:(0,l.getSortedRowModel)(),getFilteredRowModel:J?void 0:(0,l.getFilteredRowModel)(),getPaginationRowModel:J?void 0:(0,l.getPaginationRowModel)(),getExpandedRowModel:(0,l.getExpandedRowModel)(),getSubRows:N.enabled?N.getSubRows:void 0,getRowCanExpand:()=>N.enabled}),Z={sorting:F,columnFilters:I,globalFilter:R,pagination:W};(0,c.useUpdateEffect)(()=>{J||G(e=>({...e,pageIndex:0}))},[J,R,I,F]),(0,a.useEffect)(()=>{if(J)return;let e=X.getFilteredRowModel().rows.length,t=W.pageSize,n=t>0?Math.ceil(e/t):0,r=n===0?0:n-1;G(e=>({...e,pageIndex:(0,s.clamp)(e.pageIndex,0,r)}))},[J,W.pageSize,X]);let Q=(0,a.useRef)((0,s.debounce)(e=>{j.onQueryChange(e)},O.debounceMs));(0,a.useEffect)(()=>(Q.current=(0,s.debounce)(e=>{j.onQueryChange(e)},O.debounceMs),()=>{Q.current.cancel()}),[j,O.debounceMs]),(0,c.useUpdateEffect)(()=>{if(j.mode===`server`)return Q.current(Z),()=>{Q.current.cancel()}},[Z,j]);let[$,ae]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(M.enabled===!1||$===null)return;let e=()=>{if(j.isFetching)return;let e=$.scrollTop;$.scrollHeight-(e+$.clientHeight)<=M.thresholdPx&&M.onEndReached(Z)};return $.addEventListener(`scroll`,e,{passive:!0}),()=>{$.removeEventListener(`scroll`,e)}},[j.isFetching,M,Z,$]);let oe=X.getVisibleLeafColumns().length;return(0,o.jsxs)(`div`,{className:e.cn(`w-full`,S===void 0?``:S),children:[(0,o.jsx)(r.DataTableToolbar,{table:X,placeholder:O.placeholder,debounceMs:O.debounceMs,right:(0,o.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[re(X),(0,o.jsx)(ee.DataTableViewOptions,{table:X,columnVisibility:B})]})}),(0,o.jsx)(`div`,{ref:e=>ae(e),className:e.cn(C===void 0?`overflow-auto`:C),children:(0,o.jsx)(n.DataTableTable,{table:X,columnVisibility:B,expandedState:K,expandConfig:N,empty:D,columnsCount:oe})}),(0,o.jsx)(t.DataTablePagination,{table:X,tableState:X.getState(),pageSizeOptions:k.pageSizeOptions,apiConfig:j})]})};exports.default=f;
1
+ "use client";const e=require("./index2.cjs");let t=require("react");t=e.__toESM(t,1);var n=Object.defineProperty,r=(e,t)=>n(e,`name`,{value:t,configurable:!0}),i=0,a=null;function o(e){return s(),e.children}r(o,`FocusGuards`);function s(){t.useEffect(()=>{a||={start:c(),end:c()};let{start:e,end:t}=a;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),i++,()=>{i===1&&(a?.start.remove(),a?.end.remove(),a=null),i=Math.max(0,i-1)}},[])}r(s,`useFocusGuards`);function c(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}r(c,`createFocusGuard`),exports.useFocusGuards=s;
package/dist/index39.js CHANGED
@@ -1,34 +1,159 @@
1
- import { Button as e } from "./index6.js";
2
- import { DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuLabel as i, DropdownMenuSeparator as a, DropdownMenuTrigger as o } from "./index12.js";
3
- import { MoreHorizontal as s } from "lucide-react";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import { get as u, isEmpty as d, map as f } from "lodash-es";
6
- import { useTranslation as p } from "react-i18next";
7
- //#region src/DataTable/components/DataTableRowActions.tsx
8
- var m = ({ row: m, table: h }) => {
9
- let { t: g } = p(), _ = h.options.meta, v = u(_, "getRowActions"), y = v === void 0 ? [] : v(m);
10
- return d(y) ? null : /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(o, {
11
- asChild: !0,
12
- children: /* @__PURE__ */ l(e, {
13
- variant: "ghost",
14
- className: "h-8 w-8 p-0",
15
- children: [/* @__PURE__ */ c("span", {
16
- className: "sr-only",
17
- children: g("datatable_open_menu")
18
- }), /* @__PURE__ */ c(s, {})]
19
- })
20
- }), /* @__PURE__ */ l(n, {
21
- align: "end",
22
- children: [
23
- /* @__PURE__ */ c(i, { children: g("datatable_actions") }),
24
- /* @__PURE__ */ c(a, {}),
25
- f(y, (e) => /* @__PURE__ */ c(r, {
26
- disabled: e.disabled,
27
- onClick: () => e.onSelect(m),
28
- children: e.label
29
- }, e.id))
30
- ]
31
- })] });
32
- };
1
+ "use client";
2
+ import { useComposedRefs as e } from "./index7.js";
3
+ import { Primitive as t } from "./index12.js";
4
+ import { useCallbackRef as n } from "./index15.js";
5
+ import * as r from "react";
6
+ import { jsx as i } from "react/jsx-runtime";
7
+ //#region ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.16_@types+react-dom@19.2.3_@types+react@19.2.17__@types_688a7092b7a27f27c45d3c59450c400f/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
8
+ var a = Object.defineProperty, o = (e, t) => a(e, "name", {
9
+ value: t,
10
+ configurable: !0
11
+ }), s = "focusScope.autoFocusOnMount", c = "focusScope.autoFocusOnUnmount", l = {
12
+ bubbles: !1,
13
+ cancelable: !0
14
+ }, u = /* @__PURE__ */ r.forwardRef(/* @__PURE__ */ o(function(a, u) {
15
+ let { loop: m = !1, trapped: h = !1, onMountAutoFocus: g, onUnmountAutoFocus: y, ...b } = a, [S, C] = r.useState(null), w = n(g), T = n(y), E = r.useRef(null), D = e(u, C), O = r.useRef({
16
+ paused: !1,
17
+ pause() {
18
+ this.paused = !0;
19
+ },
20
+ resume() {
21
+ this.paused = !1;
22
+ }
23
+ }).current;
24
+ r.useEffect(() => {
25
+ if (h) {
26
+ let e = function(e) {
27
+ if (O.paused || !S) return;
28
+ let t = e.target;
29
+ S.contains(t) ? E.current = t : _(E.current, { select: !0 });
30
+ }, t = function(e) {
31
+ if (O.paused || !S) return;
32
+ let t = e.relatedTarget;
33
+ t !== null && (S.contains(t) || _(E.current, { select: !0 }));
34
+ }, n = function(e) {
35
+ if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 && _(S);
36
+ };
37
+ o(e, "handleFocusIn"), o(t, "handleFocusOut"), o(n, "handleMutations"), document.addEventListener("focusin", e), document.addEventListener("focusout", t);
38
+ let r = new MutationObserver(n);
39
+ return S && r.observe(S, {
40
+ childList: !0,
41
+ subtree: !0
42
+ }), () => {
43
+ document.removeEventListener("focusin", e), document.removeEventListener("focusout", t), r.disconnect();
44
+ };
45
+ }
46
+ }, [
47
+ h,
48
+ S,
49
+ O.paused
50
+ ]), r.useEffect(() => {
51
+ if (S) {
52
+ v.add(O);
53
+ let e = document.activeElement;
54
+ if (!S.contains(e)) {
55
+ let t = new CustomEvent(s, l);
56
+ S.addEventListener(s, w), S.dispatchEvent(t), t.defaultPrevented || (d(x(p(S)), { select: !0 }), document.activeElement === e && _(S));
57
+ }
58
+ return () => {
59
+ S.removeEventListener(s, w), setTimeout(() => {
60
+ let t = new CustomEvent(c, l);
61
+ S.addEventListener(c, T), S.dispatchEvent(t), t.defaultPrevented || _(e ?? document.body, { select: !0 }), S.removeEventListener(c, T), v.remove(O);
62
+ }, 0);
63
+ };
64
+ }
65
+ }, [
66
+ S,
67
+ w,
68
+ T,
69
+ O
70
+ ]);
71
+ let k = r.useCallback((e) => {
72
+ if (!m && !h || O.paused) return;
73
+ let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, n = document.activeElement;
74
+ if (t && n) {
75
+ let t = e.currentTarget, [r, i] = f(t);
76
+ r && i ? !e.shiftKey && n === i ? (e.preventDefault(), m && _(r, { select: !0 })) : e.shiftKey && n === r && (e.preventDefault(), m && _(i, { select: !0 })) : n === t && e.preventDefault();
77
+ }
78
+ }, [
79
+ m,
80
+ h,
81
+ O.paused
82
+ ]);
83
+ return /* @__PURE__ */ i(t.div, {
84
+ tabIndex: -1,
85
+ ...b,
86
+ ref: D,
87
+ onKeyDown: k
88
+ });
89
+ }, "FocusScope"));
90
+ function d(e, { select: t = !1 } = {}) {
91
+ let n = document.activeElement;
92
+ for (let r of e) if (_(r, { select: t }), document.activeElement !== n) return;
93
+ }
94
+ o(d, "focusFirst");
95
+ function f(e) {
96
+ let t = p(e);
97
+ return [m(t, e), m(t.reverse(), e)];
98
+ }
99
+ o(f, "getTabbableEdges");
100
+ function p(e) {
101
+ let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ o((e) => {
102
+ let t = e.tagName === "INPUT" && e.type === "hidden";
103
+ return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
104
+ }, "acceptNode") });
105
+ for (; n.nextNode();) t.push(n.currentNode);
106
+ return t;
107
+ }
108
+ o(p, "getTabbableCandidates");
109
+ function m(e, t) {
110
+ let n = typeof t.checkVisibility == "function" && t.checkVisibility({ checkVisibilityCSS: !0 });
111
+ for (let r of e) if (!(n ? !r.checkVisibility({ checkVisibilityCSS: !0 }) : h(r, { upTo: t }))) return r;
112
+ }
113
+ o(m, "findVisible");
114
+ function h(e, { upTo: t }) {
115
+ if (getComputedStyle(e).visibility === "hidden") return !0;
116
+ for (; e;) {
117
+ if (t !== void 0 && e === t) return !1;
118
+ if (getComputedStyle(e).display === "none") return !0;
119
+ e = e.parentElement;
120
+ }
121
+ return !1;
122
+ }
123
+ o(h, "isHidden");
124
+ function g(e) {
125
+ return e instanceof HTMLInputElement && "select" in e;
126
+ }
127
+ o(g, "isSelectableInput");
128
+ function _(e, { select: t = !1 } = {}) {
129
+ if (e && e.focus) {
130
+ let n = document.activeElement;
131
+ e.focus({ preventScroll: !0 }), e !== n && g(e) && t && e.select();
132
+ }
133
+ }
134
+ o(_, "focus");
135
+ var v = y();
136
+ function y() {
137
+ let e = [];
138
+ return {
139
+ add(t) {
140
+ let n = e[0];
141
+ t !== n && n?.pause(), e = b(e, t), e.unshift(t);
142
+ },
143
+ remove(t) {
144
+ e = b(e, t), e[0]?.resume();
145
+ }
146
+ };
147
+ }
148
+ o(y, "createFocusScopesStack");
149
+ function b(e, t) {
150
+ let n = [...e], r = n.indexOf(t);
151
+ return r !== -1 && n.splice(r, 1), n;
152
+ }
153
+ o(b, "arrayRemove");
154
+ function x(e) {
155
+ return e.filter((e) => e.tagName !== "A");
156
+ }
157
+ o(x, "removeLinks");
33
158
  //#endregion
34
- export { m as DataTableRowActions };
159
+ export { u as FocusScope };
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index7.cjs"),t=require("./index13.cjs");let n=require("lucide-react"),r=require("react/jsx-runtime"),i=require("lodash-es"),a=require("react-i18next");var o=({row:o,table:s})=>{let{t:c}=(0,a.useTranslation)(),l=s.options.meta,u=(0,i.get)(l,`getRowActions`),d=u===void 0?[]:u(o);return(0,i.isEmpty)(d)?null:(0,r.jsxs)(t.DropdownMenu,{children:[(0,r.jsx)(t.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsxs)(e.Button,{variant:`ghost`,className:`h-8 w-8 p-0`,children:[(0,r.jsx)(`span`,{className:`sr-only`,children:c(`datatable_open_menu`)}),(0,r.jsx)(n.MoreHorizontal,{})]})}),(0,r.jsxs)(t.DropdownMenuContent,{align:`end`,children:[(0,r.jsx)(t.DropdownMenuLabel,{children:c(`datatable_actions`)}),(0,r.jsx)(t.DropdownMenuSeparator,{}),(0,i.map)(d,e=>(0,r.jsx)(t.DropdownMenuItem,{disabled:e.disabled,onClick:()=>e.onSelect(o),children:e.label},e.id))]})]})};exports.DataTableRowActions=o;
1
+ "use client";const e=require("./index2.cjs"),t=require("./index8.cjs"),n=require("./index13.cjs"),r=require("./index16.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=Object.defineProperty,s=(e,t)=>o(e,`name`,{value:t,configurable:!0}),c=`focusScope.autoFocusOnMount`,l=`focusScope.autoFocusOnUnmount`,u={bubbles:!1,cancelable:!0},d=i.forwardRef(s(function(e,o){let{loop:d=!1,trapped:h=!1,onMountAutoFocus:g,onUnmountAutoFocus:_,...b}=e,[x,C]=i.useState(null),w=r.useCallbackRef(g),T=r.useCallbackRef(_),E=i.useRef(null),D=t.useComposedRefs(o,C),O=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(h){let e=function(e){if(O.paused||!x)return;let t=e.target;x.contains(t)?E.current=t:v(E.current,{select:!0})},t=function(e){if(O.paused||!x)return;let t=e.relatedTarget;t!==null&&(x.contains(t)||v(E.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&v(x)};s(e,`handleFocusIn`),s(t,`handleFocusOut`),s(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return x&&r.observe(x,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[h,x,O.paused]),i.useEffect(()=>{if(x){y.add(O);let e=document.activeElement;if(!x.contains(e)){let t=new CustomEvent(c,u);x.addEventListener(c,w),x.dispatchEvent(t),t.defaultPrevented||(f(S(m(x)),{select:!0}),document.activeElement===e&&v(x))}return()=>{x.removeEventListener(c,w),setTimeout(()=>{let t=new CustomEvent(l,u);x.addEventListener(l,T),x.dispatchEvent(t),t.defaultPrevented||v(e??document.body,{select:!0}),x.removeEventListener(l,T),y.remove(O)},0)}}},[x,w,T,O]);let k=i.useCallback(e=>{if(!d&&!h||O.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[r,i]=p(t);r&&i?!e.shiftKey&&n===i?(e.preventDefault(),d&&v(r,{select:!0})):e.shiftKey&&n===r&&(e.preventDefault(),d&&v(i,{select:!0})):n===t&&e.preventDefault()}},[d,h,O.paused]);return(0,a.jsx)(n.Primitive.div,{tabIndex:-1,...b,ref:D,onKeyDown:k})},`FocusScope`));function f(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(v(r,{select:t}),document.activeElement!==n)return}s(f,`focusFirst`);function p(e){let t=m(e);return[h(t,e),h(t.reverse(),e)]}s(p,`getTabbableEdges`);function m(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}s(m,`getTabbableCandidates`);function h(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):g(r,{upTo:t})))return r}s(h,`findVisible`);function g(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}s(g,`isHidden`);function _(e){return e instanceof HTMLInputElement&&`select`in e}s(_,`isSelectableInput`);function v(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_(e)&&t&&e.select()}}s(v,`focus`);var y=b();function b(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=x(e,t),e.unshift(t)},remove(t){e=x(e,t),e[0]?.resume()}}}s(b,`createFocusScopesStack`);function x(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}s(x,`arrayRemove`);function S(e){return e.filter(e=>e.tagName!==`A`)}s(S,`removeLinks`),exports.FocusScope=d;