@kumix/ui 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/README.md +115 -95
  2. package/dist/components/reui/alert.d.ts +12 -0
  3. package/dist/components/reui/alert.d.ts.map +1 -0
  4. package/dist/components/reui/alert.js +58 -0
  5. package/dist/components/reui/alert.js.map +1 -0
  6. package/dist/components/reui/autocomplete.d.ts +43 -0
  7. package/dist/components/reui/autocomplete.d.ts.map +1 -0
  8. package/dist/components/reui/autocomplete.js +165 -0
  9. package/dist/components/reui/autocomplete.js.map +1 -0
  10. package/dist/components/reui/badge.d.ts +17 -0
  11. package/dist/components/reui/badge.d.ts.map +1 -0
  12. package/dist/components/reui/badge.js +75 -0
  13. package/dist/components/reui/badge.js.map +1 -0
  14. package/dist/components/reui/data-grid/data-grid-column-filter.d.ts +17 -0
  15. package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -0
  16. package/dist/components/reui/data-grid/data-grid-column-filter.js +127 -0
  17. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -0
  18. package/dist/components/reui/data-grid/data-grid-column-header.d.ts +18 -0
  19. package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -0
  20. package/dist/components/reui/data-grid/data-grid-column-header.js +228 -0
  21. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -0
  22. package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts +10 -0
  23. package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -0
  24. package/dist/components/reui/data-grid/data-grid-column-visibility.js +28 -0
  25. package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -0
  26. package/dist/components/reui/data-grid/data-grid-pagination.d.ts +22 -0
  27. package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -0
  28. package/dist/components/reui/data-grid/data-grid-pagination.js +144 -0
  29. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -0
  30. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts +12 -0
  31. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -0
  32. package/dist/components/reui/data-grid/data-grid-scroll-area.js +289 -0
  33. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -0
  34. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +14 -0
  35. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -0
  36. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +166 -0
  37. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -0
  38. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +10 -0
  39. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -0
  40. package/dist/components/reui/data-grid/data-grid-table-dnd.js +171 -0
  41. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -0
  42. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +29 -0
  43. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -0
  44. package/dist/components/reui/data-grid/data-grid-table-virtual.js +269 -0
  45. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -0
  46. package/dist/components/reui/data-grid/data-grid-table.d.ts +116 -0
  47. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -0
  48. package/dist/components/reui/data-grid/data-grid-table.js +864 -0
  49. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -0
  50. package/dist/components/reui/data-grid/data-grid.d.ts +112 -0
  51. package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -0
  52. package/dist/components/reui/data-grid/data-grid.js +134 -0
  53. package/dist/components/reui/data-grid/data-grid.js.map +1 -0
  54. package/dist/components/reui/date-selector.d.ts +131 -0
  55. package/dist/components/reui/date-selector.d.ts.map +1 -0
  56. package/dist/components/reui/date-selector.js +783 -0
  57. package/dist/components/reui/date-selector.js.map +1 -0
  58. package/dist/components/reui/event-calendar/event-calendar-agenda-view.d.ts +7 -0
  59. package/dist/components/reui/event-calendar/event-calendar-agenda-view.d.ts.map +1 -0
  60. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +108 -0
  61. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -0
  62. package/dist/components/reui/event-calendar/event-calendar-content.d.ts +15 -0
  63. package/dist/components/reui/event-calendar/event-calendar-content.d.ts.map +1 -0
  64. package/dist/components/reui/event-calendar/event-calendar-content.js +44 -0
  65. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -0
  66. package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts +30 -0
  67. package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts.map +1 -0
  68. package/dist/components/reui/event-calendar/event-calendar-dnd.js +581 -0
  69. package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -0
  70. package/dist/components/reui/event-calendar/event-calendar-event.d.ts +73 -0
  71. package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -0
  72. package/dist/components/reui/event-calendar/event-calendar-event.js +299 -0
  73. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -0
  74. package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts +103 -0
  75. package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -0
  76. package/dist/components/reui/event-calendar/event-calendar-i18n.js +141 -0
  77. package/dist/components/reui/event-calendar/event-calendar-i18n.js.map +1 -0
  78. package/dist/components/reui/event-calendar/event-calendar-lib.d.ts +111 -0
  79. package/dist/components/reui/event-calendar/event-calendar-lib.d.ts.map +1 -0
  80. package/dist/components/reui/event-calendar/event-calendar-lib.js +398 -0
  81. package/dist/components/reui/event-calendar/event-calendar-lib.js.map +1 -0
  82. package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts +29 -0
  83. package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts.map +1 -0
  84. package/dist/components/reui/event-calendar/event-calendar-month-view.js +530 -0
  85. package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -0
  86. package/dist/components/reui/event-calendar/event-calendar-nav.d.ts +71 -0
  87. package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -0
  88. package/dist/components/reui/event-calendar/event-calendar-nav.js +319 -0
  89. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -0
  90. package/dist/components/reui/event-calendar/event-calendar-recurrence.d.ts +32 -0
  91. package/dist/components/reui/event-calendar/event-calendar-recurrence.d.ts.map +1 -0
  92. package/dist/components/reui/event-calendar/event-calendar-recurrence.js +300 -0
  93. package/dist/components/reui/event-calendar/event-calendar-recurrence.js.map +1 -0
  94. package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts +14 -0
  95. package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts.map +1 -0
  96. package/dist/components/reui/event-calendar/event-calendar-resource-view.js +355 -0
  97. package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -0
  98. package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts +35 -0
  99. package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts.map +1 -0
  100. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +651 -0
  101. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -0
  102. package/dist/components/reui/event-calendar/event-calendar-types.d.ts +236 -0
  103. package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -0
  104. package/dist/components/reui/event-calendar/event-calendar-types.js +2 -0
  105. package/dist/components/reui/event-calendar/event-calendar.d.ts +561 -0
  106. package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -0
  107. package/dist/components/reui/event-calendar/event-calendar.js +817 -0
  108. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -0
  109. package/dist/components/reui/filters.d.ts +176 -0
  110. package/dist/components/reui/filters.d.ts.map +1 -0
  111. package/dist/components/reui/filters.js +1216 -0
  112. package/dist/components/reui/filters.js.map +1 -0
  113. package/dist/components/reui/frame.d.ts +32 -0
  114. package/dist/components/reui/frame.d.ts.map +1 -0
  115. package/dist/components/reui/frame.js +115 -0
  116. package/dist/components/reui/frame.js.map +1 -0
  117. package/dist/components/reui/gantt/gantt-bar.d.ts +44 -0
  118. package/dist/components/reui/gantt/gantt-bar.d.ts.map +1 -0
  119. package/dist/components/reui/gantt/gantt-bar.js +229 -0
  120. package/dist/components/reui/gantt/gantt-bar.js.map +1 -0
  121. package/dist/components/reui/gantt/gantt-dnd.d.ts +36 -0
  122. package/dist/components/reui/gantt/gantt-dnd.d.ts.map +1 -0
  123. package/dist/components/reui/gantt/gantt-dnd.js +615 -0
  124. package/dist/components/reui/gantt/gantt-dnd.js.map +1 -0
  125. package/dist/components/reui/gantt/gantt-i18n.d.ts +91 -0
  126. package/dist/components/reui/gantt/gantt-i18n.d.ts.map +1 -0
  127. package/dist/components/reui/gantt/gantt-i18n.js +131 -0
  128. package/dist/components/reui/gantt/gantt-i18n.js.map +1 -0
  129. package/dist/components/reui/gantt/gantt-lib.d.ts +123 -0
  130. package/dist/components/reui/gantt/gantt-lib.d.ts.map +1 -0
  131. package/dist/components/reui/gantt/gantt-lib.js +354 -0
  132. package/dist/components/reui/gantt/gantt-lib.js.map +1 -0
  133. package/dist/components/reui/gantt/gantt-nav.d.ts +60 -0
  134. package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -0
  135. package/dist/components/reui/gantt/gantt-nav.js +266 -0
  136. package/dist/components/reui/gantt/gantt-nav.js.map +1 -0
  137. package/dist/components/reui/gantt/gantt-recurrence.d.ts +37 -0
  138. package/dist/components/reui/gantt/gantt-recurrence.d.ts.map +1 -0
  139. package/dist/components/reui/gantt/gantt-recurrence.js +230 -0
  140. package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -0
  141. package/dist/components/reui/gantt/gantt-types.d.ts +251 -0
  142. package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -0
  143. package/dist/components/reui/gantt/gantt-types.js +2 -0
  144. package/dist/components/reui/gantt/gantt-view.d.ts +10 -0
  145. package/dist/components/reui/gantt/gantt-view.d.ts.map +1 -0
  146. package/dist/components/reui/gantt/gantt-view.js +2193 -0
  147. package/dist/components/reui/gantt/gantt-view.js.map +1 -0
  148. package/dist/components/reui/gantt/gantt.d.ts +602 -0
  149. package/dist/components/reui/gantt/gantt.d.ts.map +1 -0
  150. package/dist/components/reui/gantt/gantt.js +796 -0
  151. package/dist/components/reui/gantt/gantt.js.map +1 -0
  152. package/dist/components/reui/icon-stack.d.ts +7 -0
  153. package/dist/components/reui/icon-stack.d.ts.map +1 -0
  154. package/dist/components/reui/icon-stack.js +76 -0
  155. package/dist/components/reui/icon-stack.js.map +1 -0
  156. package/dist/components/reui/kanban.d.ts +70 -0
  157. package/dist/components/reui/kanban.d.ts.map +1 -0
  158. package/dist/components/reui/kanban.js +519 -0
  159. package/dist/components/reui/kanban.js.map +1 -0
  160. package/dist/components/reui/number-field.d.ts +29 -0
  161. package/dist/components/reui/number-field.d.ts.map +1 -0
  162. package/dist/components/reui/number-field.js +127 -0
  163. package/dist/components/reui/number-field.js.map +1 -0
  164. package/dist/components/reui/phone-input.d.ts +13 -0
  165. package/dist/components/reui/phone-input.d.ts.map +1 -0
  166. package/dist/components/reui/phone-input.js +126 -0
  167. package/dist/components/reui/phone-input.js.map +1 -0
  168. package/dist/components/reui/rating.d.ts +34 -0
  169. package/dist/components/reui/rating.d.ts.map +1 -0
  170. package/dist/components/reui/rating.js +94 -0
  171. package/dist/components/reui/rating.js.map +1 -0
  172. package/dist/components/reui/scrollspy.d.ts +17 -0
  173. package/dist/components/reui/scrollspy.d.ts.map +1 -0
  174. package/dist/components/reui/scrollspy.js +130 -0
  175. package/dist/components/reui/scrollspy.js.map +1 -0
  176. package/dist/components/reui/sortable.d.ts +48 -0
  177. package/dist/components/reui/sortable.d.ts.map +1 -0
  178. package/dist/components/reui/sortable.js +230 -0
  179. package/dist/components/reui/sortable.js.map +1 -0
  180. package/dist/components/reui/stepper.d.ts +63 -0
  181. package/dist/components/reui/stepper.d.ts.map +1 -0
  182. package/dist/components/reui/stepper.js +234 -0
  183. package/dist/components/reui/stepper.js.map +1 -0
  184. package/dist/components/reui/timeline.d.ts +24 -0
  185. package/dist/components/reui/timeline.d.ts.map +1 -0
  186. package/dist/components/reui/timeline.js +123 -0
  187. package/dist/components/reui/timeline.js.map +1 -0
  188. package/dist/components/reui/tree.d.ts +23 -0
  189. package/dist/components/reui/tree.d.ts.map +1 -0
  190. package/dist/components/reui/tree.js +115 -0
  191. package/dist/components/reui/tree.js.map +1 -0
  192. package/dist/components/ui/accordion.d.ts +9 -0
  193. package/dist/components/ui/accordion.d.ts.map +1 -0
  194. package/dist/components/ui/accordion.js +56 -0
  195. package/dist/components/ui/accordion.js.map +1 -0
  196. package/dist/components/ui/alert-dialog.d.ts +21 -0
  197. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  198. package/dist/components/ui/alert-dialog.js +96 -0
  199. package/dist/components/ui/alert-dialog.js.map +1 -0
  200. package/dist/components/ui/alert.d.ts +13 -0
  201. package/dist/components/ui/alert.d.ts.map +1 -0
  202. package/dist/components/ui/alert.js +45 -0
  203. package/dist/components/ui/alert.js.map +1 -0
  204. package/dist/components/ui/aspect-ratio.d.ts +8 -0
  205. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  206. package/dist/components/ui/aspect-ratio.js +16 -0
  207. package/dist/components/ui/aspect-ratio.js.map +1 -0
  208. package/dist/components/ui/attachment.d.ts +26 -0
  209. package/dist/components/ui/attachment.d.ts.map +1 -0
  210. package/dist/components/ui/attachment.js +106 -0
  211. package/dist/components/ui/attachment.js.map +1 -0
  212. package/dist/components/ui/avatar.d.ts +14 -0
  213. package/dist/components/ui/avatar.d.ts.map +1 -0
  214. package/dist/components/ui/avatar.js +52 -0
  215. package/dist/components/ui/avatar.js.map +1 -0
  216. package/dist/components/ui/badge.d.ts +10 -0
  217. package/dist/components/ui/badge.d.ts.map +1 -0
  218. package/dist/components/ui/badge.js +32 -0
  219. package/dist/components/ui/badge.js.map +1 -0
  220. package/dist/components/ui/breadcrumb.d.ts +13 -0
  221. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  222. package/dist/components/ui/breadcrumb.js +72 -0
  223. package/dist/components/ui/breadcrumb.js.map +1 -0
  224. package/dist/components/ui/bubble.d.ts +19 -0
  225. package/dist/components/ui/bubble.d.ts.map +1 -0
  226. package/dist/components/ui/bubble.js +75 -0
  227. package/dist/components/ui/bubble.js.map +1 -0
  228. package/dist/components/ui/button-group.d.ts +14 -0
  229. package/dist/components/ui/button-group.d.ts.map +1 -0
  230. package/dist/components/ui/button-group.js +44 -0
  231. package/dist/components/ui/button-group.js.map +1 -0
  232. package/dist/components/ui/button.d.ts +11 -0
  233. package/dist/components/ui/button.d.ts.map +1 -0
  234. package/dist/components/ui/button.js +47 -0
  235. package/dist/components/ui/button.js.map +1 -0
  236. package/dist/components/ui/calendar.d.ts +13 -0
  237. package/dist/components/ui/calendar.d.ts.map +1 -0
  238. package/dist/components/ui/calendar.js +110 -0
  239. package/dist/components/ui/calendar.js.map +1 -0
  240. package/dist/components/ui/card.d.ts +14 -0
  241. package/dist/components/ui/card.d.ts.map +1 -0
  242. package/dist/components/ui/card.js +58 -0
  243. package/dist/components/ui/card.js.map +1 -0
  244. package/dist/components/ui/carousel.d.ts +31 -0
  245. package/dist/components/ui/carousel.d.ts.map +1 -0
  246. package/dist/components/ui/carousel.js +135 -0
  247. package/dist/components/ui/carousel.js.map +1 -0
  248. package/dist/components/ui/chart.d.ts +47 -0
  249. package/dist/components/ui/chart.d.ts.map +1 -0
  250. package/dist/components/ui/chart.js +151 -0
  251. package/dist/components/ui/chart.js.map +1 -0
  252. package/dist/components/ui/checkbox.d.ts +6 -0
  253. package/dist/components/ui/checkbox.d.ts.map +1 -0
  254. package/dist/components/ui/checkbox.js +22 -0
  255. package/dist/components/ui/checkbox.js.map +1 -0
  256. package/dist/components/ui/collapsible.d.ts +8 -0
  257. package/dist/components/ui/collapsible.d.ts.map +1 -0
  258. package/dist/components/ui/collapsible.js +26 -0
  259. package/dist/components/ui/collapsible.js.map +1 -0
  260. package/dist/components/ui/combobox.d.ts +27 -0
  261. package/dist/components/ui/combobox.d.ts.map +1 -0
  262. package/dist/components/ui/combobox.js +164 -0
  263. package/dist/components/ui/combobox.js.map +1 -0
  264. package/dist/components/ui/command.d.ts +22 -0
  265. package/dist/components/ui/command.d.ts.map +1 -0
  266. package/dist/components/ui/command.js +89 -0
  267. package/dist/components/ui/command.js.map +1 -0
  268. package/dist/components/ui/context-menu.d.ts +32 -0
  269. package/dist/components/ui/context-menu.d.ts.map +1 -0
  270. package/dist/components/ui/context-menu.js +134 -0
  271. package/dist/components/ui/context-menu.js.map +1 -0
  272. package/dist/components/ui/dialog.d.ts +20 -0
  273. package/dist/components/ui/dialog.d.ts.map +1 -0
  274. package/dist/components/ui/dialog.js +93 -0
  275. package/dist/components/ui/dialog.js.map +1 -0
  276. package/dist/components/ui/direction.d.ts +2 -0
  277. package/dist/components/ui/direction.js +3 -0
  278. package/dist/components/ui/drawer.d.ts +19 -0
  279. package/dist/components/ui/drawer.d.ts.map +1 -0
  280. package/dist/components/ui/drawer.js +125 -0
  281. package/dist/components/ui/drawer.js.map +1 -0
  282. package/dist/components/ui/dropdown-menu.d.ts +32 -0
  283. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  284. package/dist/components/ui/dropdown-menu.js +138 -0
  285. package/dist/components/ui/dropdown-menu.js.map +1 -0
  286. package/dist/components/ui/empty.d.ts +15 -0
  287. package/dist/components/ui/empty.d.ts.map +1 -0
  288. package/dist/components/ui/empty.js +62 -0
  289. package/dist/components/ui/empty.js.map +1 -0
  290. package/dist/components/ui/field.d.ts +28 -0
  291. package/dist/components/ui/field.d.ts.map +1 -0
  292. package/dist/components/ui/field.js +112 -0
  293. package/dist/components/ui/field.js.map +1 -0
  294. package/dist/components/ui/hover-card.d.ts +8 -0
  295. package/dist/components/ui/hover-card.d.ts.map +1 -0
  296. package/dist/components/ui/hover-card.js +38 -0
  297. package/dist/components/ui/hover-card.js.map +1 -0
  298. package/dist/components/ui/input-group.d.ts +21 -0
  299. package/dist/components/ui/input-group.d.ts.map +1 -0
  300. package/dist/components/ui/input-group.js +80 -0
  301. package/dist/components/ui/input-group.js.map +1 -0
  302. package/dist/components/ui/input-otp.d.ts +14 -0
  303. package/dist/components/ui/input-otp.d.ts.map +1 -0
  304. package/dist/components/ui/input-otp.js +49 -0
  305. package/dist/components/ui/input-otp.js.map +1 -0
  306. package/dist/components/ui/input.d.ts +6 -0
  307. package/dist/components/ui/input.d.ts.map +1 -0
  308. package/dist/components/ui/input.js +17 -0
  309. package/dist/components/ui/input.js.map +1 -0
  310. package/dist/components/ui/item.d.ts +25 -0
  311. package/dist/components/ui/item.d.ts.map +1 -0
  312. package/dist/components/ui/item.js +123 -0
  313. package/dist/components/ui/item.js.map +1 -0
  314. package/dist/components/ui/kbd.d.ts +7 -0
  315. package/dist/components/ui/kbd.d.ts.map +1 -0
  316. package/dist/components/ui/kbd.js +22 -0
  317. package/dist/components/ui/kbd.js.map +1 -0
  318. package/dist/components/ui/label.d.ts +6 -0
  319. package/dist/components/ui/label.d.ts.map +1 -0
  320. package/dist/components/ui/label.js +15 -0
  321. package/dist/components/ui/label.js.map +1 -0
  322. package/dist/components/ui/marker.d.ts +13 -0
  323. package/dist/components/ui/marker.d.ts.map +1 -0
  324. package/dist/components/ui/marker.js +45 -0
  325. package/dist/components/ui/marker.js.map +1 -0
  326. package/dist/components/ui/menubar.d.ts +32 -0
  327. package/dist/components/ui/menubar.d.ts.map +1 -0
  328. package/dist/components/ui/menubar.js +137 -0
  329. package/dist/components/ui/menubar.js.map +1 -0
  330. package/dist/components/ui/message-scroller.d.ts +13 -0
  331. package/dist/components/ui/message-scroller.d.ts.map +1 -0
  332. package/dist/components/ui/message-scroller.js +62 -0
  333. package/dist/components/ui/message-scroller.js.map +1 -0
  334. package/dist/components/ui/message.d.ts +13 -0
  335. package/dist/components/ui/message.d.ts.map +1 -0
  336. package/dist/components/ui/message.js +51 -0
  337. package/dist/components/ui/message.js.map +1 -0
  338. package/dist/components/ui/native-select.d.ts +11 -0
  339. package/dist/components/ui/native-select.d.ts.map +1 -0
  340. package/dist/components/ui/native-select.js +40 -0
  341. package/dist/components/ui/native-select.js.map +1 -0
  342. package/dist/components/ui/navigation-menu.d.ts +15 -0
  343. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  344. package/dist/components/ui/navigation-menu.js +85 -0
  345. package/dist/components/ui/navigation-menu.js.map +1 -0
  346. package/dist/components/ui/pagination.d.ts +20 -0
  347. package/dist/components/ui/pagination.d.ts.map +1 -0
  348. package/dist/components/ui/pagination.js +81 -0
  349. package/dist/components/ui/pagination.js.map +1 -0
  350. package/dist/components/ui/popover.d.ts +12 -0
  351. package/dist/components/ui/popover.d.ts.map +1 -0
  352. package/dist/components/ui/popover.js +56 -0
  353. package/dist/components/ui/popover.js.map +1 -0
  354. package/dist/components/ui/progress.d.ts +10 -0
  355. package/dist/components/ui/progress.d.ts.map +1 -0
  356. package/dist/components/ui/progress.js +46 -0
  357. package/dist/components/ui/progress.js.map +1 -0
  358. package/dist/components/ui/radio-group.d.ts +8 -0
  359. package/dist/components/ui/radio-group.d.ts.map +1 -0
  360. package/dist/components/ui/radio-group.js +29 -0
  361. package/dist/components/ui/radio-group.js.map +1 -0
  362. package/dist/components/ui/resizable.d.ts +10 -0
  363. package/dist/components/ui/resizable.d.ts.map +1 -0
  364. package/dist/components/ui/resizable.js +30 -0
  365. package/dist/components/ui/resizable.js.map +1 -0
  366. package/dist/components/ui/scroll-area.d.ts +7 -0
  367. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  368. package/dist/components/ui/scroll-area.js +38 -0
  369. package/dist/components/ui/scroll-area.js.map +1 -0
  370. package/dist/components/ui/select.d.ts +18 -0
  371. package/dist/components/ui/select.d.ts.map +1 -0
  372. package/dist/components/ui/select.js +99 -0
  373. package/dist/components/ui/select.js.map +1 -0
  374. package/dist/components/ui/separator.d.ts +6 -0
  375. package/dist/components/ui/separator.d.ts.map +1 -0
  376. package/dist/components/ui/separator.js +17 -0
  377. package/dist/components/ui/separator.js.map +1 -0
  378. package/dist/components/ui/sheet.d.ts +17 -0
  379. package/dist/components/ui/sheet.d.ts.map +1 -0
  380. package/dist/components/ui/sheet.js +90 -0
  381. package/dist/components/ui/sheet.js.map +1 -0
  382. package/dist/components/ui/sidebar.d.ts +66 -0
  383. package/dist/components/ui/sidebar.d.ts.map +1 -0
  384. package/dist/components/ui/sidebar.js +383 -0
  385. package/dist/components/ui/sidebar.js.map +1 -0
  386. package/dist/components/ui/skeleton.d.ts +6 -0
  387. package/dist/components/ui/skeleton.d.ts.map +1 -0
  388. package/dist/components/ui/skeleton.js +15 -0
  389. package/dist/components/ui/skeleton.js.map +1 -0
  390. package/dist/components/ui/slider.d.ts +6 -0
  391. package/dist/components/ui/slider.d.ts.map +1 -0
  392. package/dist/components/ui/slider.js +36 -0
  393. package/dist/components/ui/slider.js.map +1 -0
  394. package/dist/components/ui/sonner.d.ts +7 -0
  395. package/dist/components/ui/sonner.d.ts.map +1 -0
  396. package/dist/components/ui/sonner.js +32 -0
  397. package/dist/components/ui/sonner.js.map +1 -0
  398. package/dist/components/ui/spinner.d.ts +6 -0
  399. package/dist/components/ui/spinner.d.ts.map +1 -0
  400. package/dist/components/ui/spinner.js +18 -0
  401. package/dist/components/ui/spinner.js.map +1 -0
  402. package/dist/components/ui/switch.d.ts +8 -0
  403. package/dist/components/ui/switch.d.ts.map +1 -0
  404. package/dist/components/ui/switch.js +21 -0
  405. package/dist/components/ui/switch.js.map +1 -0
  406. package/dist/components/ui/table.d.ts +13 -0
  407. package/dist/components/ui/table.d.ts.map +1 -0
  408. package/dist/components/ui/table.js +68 -0
  409. package/dist/components/ui/table.js.map +1 -0
  410. package/dist/components/ui/tabs.d.ts +13 -0
  411. package/dist/components/ui/tabs.d.ts.map +1 -0
  412. package/dist/components/ui/tabs.js +47 -0
  413. package/dist/components/ui/tabs.js.map +1 -0
  414. package/dist/components/ui/textarea.d.ts +6 -0
  415. package/dist/components/ui/textarea.d.ts.map +1 -0
  416. package/dist/components/ui/textarea.js +15 -0
  417. package/dist/components/ui/textarea.js.map +1 -0
  418. package/dist/components/ui/toggle-group.d.ts +14 -0
  419. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  420. package/dist/components/ui/toggle-group.js +54 -0
  421. package/dist/components/ui/toggle-group.js.map +1 -0
  422. package/dist/components/ui/toggle.d.ts +11 -0
  423. package/dist/components/ui/toggle.d.ts.map +1 -0
  424. package/dist/components/ui/toggle.js +38 -0
  425. package/dist/components/ui/toggle.js.map +1 -0
  426. package/dist/components/ui/tooltip.d.ts +9 -0
  427. package/dist/components/ui/tooltip.d.ts.map +1 -0
  428. package/dist/components/ui/tooltip.js +43 -0
  429. package/dist/components/ui/tooltip.js.map +1 -0
  430. package/dist/hooks/use-body-classes.d.ts +27 -0
  431. package/dist/hooks/use-body-classes.d.ts.map +1 -0
  432. package/dist/hooks/use-body-classes.js +52 -0
  433. package/dist/hooks/use-body-classes.js.map +1 -0
  434. package/dist/hooks/use-copy-to-clipboard.d.ts +43 -0
  435. package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
  436. package/dist/hooks/use-copy-to-clipboard.js +69 -0
  437. package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
  438. package/dist/hooks/use-file-upload.d.ts +49 -0
  439. package/dist/hooks/use-file-upload.d.ts.map +1 -0
  440. package/dist/hooks/use-file-upload.js +227 -0
  441. package/dist/hooks/use-file-upload.js.map +1 -0
  442. package/dist/hooks/use-hydrated.d.ts +37 -0
  443. package/dist/hooks/use-hydrated.d.ts.map +1 -0
  444. package/dist/hooks/use-hydrated.js +50 -0
  445. package/dist/hooks/use-hydrated.js.map +1 -0
  446. package/dist/hooks/use-intersection-observer.d.ts +55 -0
  447. package/dist/hooks/use-intersection-observer.d.ts.map +1 -0
  448. package/dist/hooks/use-intersection-observer.js +144 -0
  449. package/dist/hooks/use-intersection-observer.js.map +1 -0
  450. package/dist/hooks/use-is-mac.d.ts +28 -0
  451. package/dist/hooks/use-is-mac.d.ts.map +1 -0
  452. package/dist/hooks/use-is-mac.js +38 -0
  453. package/dist/hooks/use-is-mac.js.map +1 -0
  454. package/dist/hooks/use-media-query.d.ts +44 -0
  455. package/dist/hooks/use-media-query.d.ts.map +1 -0
  456. package/dist/hooks/use-media-query.js +58 -0
  457. package/dist/hooks/use-media-query.js.map +1 -0
  458. package/dist/hooks/use-meta-color.d.ts +78 -0
  459. package/dist/hooks/use-meta-color.d.ts.map +1 -0
  460. package/dist/hooks/use-meta-color.js +138 -0
  461. package/dist/hooks/use-meta-color.js.map +1 -0
  462. package/dist/hooks/use-mobile.d.ts +5 -0
  463. package/dist/hooks/use-mobile.d.ts.map +1 -0
  464. package/dist/hooks/use-mobile.js +21 -0
  465. package/dist/hooks/use-mobile.js.map +1 -0
  466. package/dist/hooks/use-mutation-observer.d.ts +61 -0
  467. package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
  468. package/dist/hooks/use-mutation-observer.js +96 -0
  469. package/dist/hooks/use-mutation-observer.js.map +1 -0
  470. package/dist/hooks/use-scroll-position.d.ts +76 -0
  471. package/dist/hooks/use-scroll-position.d.ts.map +1 -0
  472. package/dist/hooks/use-scroll-position.js +97 -0
  473. package/dist/hooks/use-scroll-position.js.map +1 -0
  474. package/dist/hooks/use-slider-input.d.ts +94 -0
  475. package/dist/hooks/use-slider-input.d.ts.map +1 -0
  476. package/dist/hooks/use-slider-input.js +116 -0
  477. package/dist/hooks/use-slider-input.js.map +1 -0
  478. package/dist/hooks/use-viewport.d.ts +72 -0
  479. package/dist/hooks/use-viewport.d.ts.map +1 -0
  480. package/dist/hooks/use-viewport.js +91 -0
  481. package/dist/hooks/use-viewport.js.map +1 -0
  482. package/dist/style.css +0 -247
  483. package/dist/theme.css +244 -0
  484. package/dist/theme.css.d.ts +3 -0
  485. package/package.json +101 -40
  486. package/dist/hooks.d.ts +0 -957
  487. package/dist/hooks.d.ts.map +0 -1
  488. package/dist/hooks.js +0 -1391
  489. package/dist/hooks.js.map +0 -1
  490. package/dist/index.d.ts +0 -1993
  491. package/dist/index.d.ts.map +0 -1
  492. package/dist/index.js +0 -10647
  493. package/dist/index.js.map +0 -1
  494. package/dist/source.css +0 -1
  495. package/dist/source.css.d.ts +0 -3
  496. package/dist/use-is-mobile-Dln4-L1O.js +0 -210
  497. package/dist/use-is-mobile-Dln4-L1O.js.map +0 -1
@@ -0,0 +1,864 @@
1
+ "use client";
2
+ "use no memo";
3
+ import { Checkbox } from "../../ui/checkbox.js";
4
+ import { Spinner } from "../../ui/spinner.js";
5
+ import { useDataGrid } from "./data-grid.js";
6
+ import { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react";
7
+ import { cn } from "@kumix/utils";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import { flexRender } from "@tanstack/react-table";
10
+ //#region src/components/reui/data-grid/data-grid-table.tsx
11
+ const headerCellSpacingVariants = ({ size }) => size === "dense" ? "px-2 h-8" : "px-3";
12
+ const bodyCellSpacingVariants = ({ size }) => size === "dense" ? "px-2 py-1.5" : "px-3 py-2";
13
+ const footerCellSpacingVariants = ({ size }) => size === "dense" ? "px-2 py-1.5" : "px-3 py-2";
14
+ function getPinningStyles(column) {
15
+ const isPinned = column.getIsPinned();
16
+ return {
17
+ insetInlineStart: isPinned === "left" ? `${column.getStart("left")}px` : void 0,
18
+ insetInlineEnd: isPinned === "right" ? `${column.getAfter("right")}px` : void 0,
19
+ position: isPinned ? "sticky" : void 0,
20
+ transform: isPinned ? "translateZ(0)" : void 0,
21
+ contain: isPinned ? "paint" : void 0,
22
+ width: column.getSize(),
23
+ zIndex: isPinned ? 30 : void 0,
24
+ backgroundClip: isPinned ? "padding-box" : void 0
25
+ };
26
+ }
27
+ function assignRef(ref, value) {
28
+ if (!ref) return;
29
+ if (typeof ref === "function") {
30
+ ref(value);
31
+ return;
32
+ }
33
+ ref.current = value;
34
+ }
35
+ /**
36
+ * Nearest scroll-area viewport that belongs to THIS grid. A viewport outside
37
+ * the grid's own container (e.g. a page-level ScrollArea) would make the
38
+ * width measurement - and the virtualizer - bind the wrong box.
39
+ */
40
+ function getDataGridScrollAreaViewport(node) {
41
+ const scrollViewport = node.closest("[data-slot=\"scroll-area-viewport\"]");
42
+ if (!scrollViewport) return null;
43
+ const gridContainer = node.closest("[data-slot=\"data-grid\"]");
44
+ if (gridContainer && !gridContainer.contains(scrollViewport)) return null;
45
+ return scrollViewport;
46
+ }
47
+ function isDataGridTouchEvent(event) {
48
+ return "touches" in event;
49
+ }
50
+ function findTouchClientX(list, identifier) {
51
+ for (let i = 0; i < list.length; i++) {
52
+ const touch = list.item(i);
53
+ if (touch && touch.identifier === identifier) return touch.clientX;
54
+ }
55
+ }
56
+ function getDataGridResizeEventClientX(event, touchIdentifier) {
57
+ if (isDataGridTouchEvent(event)) {
58
+ if (typeof touchIdentifier === "number") return findTouchClientX(event.touches, touchIdentifier) ?? findTouchClientX(event.changedTouches, touchIdentifier);
59
+ return event.touches[0]?.clientX ?? event.changedTouches[0]?.clientX;
60
+ }
61
+ return event.clientX;
62
+ }
63
+ function startDataGridColumnResizeOnEnd(event, header, table) {
64
+ const column = table.getColumn(header.column.id);
65
+ if (!column?.getCanResize()) return;
66
+ const isTouchSession = isDataGridTouchEvent(event);
67
+ if (isTouchSession && event.touches.length > 1) return;
68
+ event.persist?.();
69
+ const ownerDocument = event.currentTarget.ownerDocument;
70
+ const ownerWindow = ownerDocument.defaultView;
71
+ const previousBodyCursor = ownerDocument.body.style.cursor;
72
+ const previousDocumentCursor = ownerDocument.documentElement.style.cursor;
73
+ const startSize = header.getSize();
74
+ const touchIdentifier = isTouchSession ? event.touches[0]?.identifier : void 0;
75
+ const dragStartClientX = getDataGridResizeEventClientX(event, touchIdentifier);
76
+ const headerRect = event.currentTarget.closest("th")?.getBoundingClientRect();
77
+ const startOffset = headerRect && Number.isFinite(table.options.columnResizeDirection === "rtl" ? headerRect.left : headerRect.right) ? table.options.columnResizeDirection === "rtl" ? headerRect.left : headerRect.right : dragStartClientX;
78
+ if (typeof dragStartClientX !== "number" || typeof startOffset !== "number") return;
79
+ ownerDocument.body.style.cursor = "col-resize";
80
+ ownerDocument.documentElement.style.cursor = "col-resize";
81
+ const columnSizingStart = header.getLeafHeaders().map((leafHeader) => [leafHeader.column.id, leafHeader.column.getSize()]);
82
+ const directionMultiplier = table.options.columnResizeDirection === "rtl" ? -1 : 1;
83
+ let minDeltaPercentage = -.999999;
84
+ let maxDeltaPercentage = Number.POSITIVE_INFINITY;
85
+ columnSizingStart.forEach(([columnId, headerSize]) => {
86
+ if (headerSize <= 0) return;
87
+ const leafColumn = table.getColumn(columnId);
88
+ const minSize = leafColumn?.columnDef.minSize;
89
+ const maxSize = leafColumn?.columnDef.maxSize;
90
+ if (typeof minSize === "number") minDeltaPercentage = Math.max(minDeltaPercentage, minSize / headerSize - 1);
91
+ if (typeof maxSize === "number" && Number.isFinite(maxSize)) maxDeltaPercentage = Math.min(maxDeltaPercentage, maxSize / headerSize - 1);
92
+ });
93
+ let lastClientX = dragStartClientX;
94
+ let ended = false;
95
+ const stopListeners = [];
96
+ const updateOffset = (clientXPos, commit = false) => {
97
+ if (typeof clientXPos !== "number") return;
98
+ lastClientX = clientXPos;
99
+ const nextColumnSizing = {};
100
+ const deltaPercentage = Math.min(Math.max((clientXPos - dragStartClientX) * directionMultiplier / startSize, minDeltaPercentage), maxDeltaPercentage);
101
+ const deltaOffset = deltaPercentage * startSize;
102
+ columnSizingStart.forEach(([columnId, headerSize]) => {
103
+ nextColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
104
+ });
105
+ table.setColumnSizingInfo((old) => ({
106
+ ...old,
107
+ startOffset,
108
+ startSize,
109
+ deltaOffset,
110
+ deltaPercentage,
111
+ columnSizingStart,
112
+ isResizingColumn: column.id
113
+ }));
114
+ if (commit) table.setColumnSizing((old) => ({
115
+ ...old,
116
+ ...nextColumnSizing
117
+ }));
118
+ };
119
+ const endResize = (clientXPos) => {
120
+ if (ended) return;
121
+ ended = true;
122
+ for (const stop of stopListeners) stop();
123
+ updateOffset(clientXPos, true);
124
+ table.setColumnSizingInfo((old) => ({
125
+ ...old,
126
+ isResizingColumn: false,
127
+ startOffset: null,
128
+ startSize: null,
129
+ deltaOffset: null,
130
+ deltaPercentage: null,
131
+ columnSizingStart: []
132
+ }));
133
+ ownerDocument.body.style.cursor = previousBodyCursor;
134
+ ownerDocument.documentElement.style.cursor = previousDocumentCursor;
135
+ };
136
+ const mouseMoveHandler = (moveEvent) => {
137
+ updateOffset(moveEvent.clientX);
138
+ };
139
+ const mouseUpHandler = (upEvent) => {
140
+ endResize(upEvent.clientX);
141
+ };
142
+ const touchMoveHandler = (moveEvent) => {
143
+ if (moveEvent.cancelable) {
144
+ moveEvent.preventDefault();
145
+ moveEvent.stopPropagation();
146
+ }
147
+ updateOffset(getDataGridResizeEventClientX(moveEvent, touchIdentifier));
148
+ };
149
+ const touchEndHandler = (endEvent) => {
150
+ const clientXPos = typeof touchIdentifier === "number" ? findTouchClientX(endEvent.changedTouches, touchIdentifier) : getDataGridResizeEventClientX(endEvent);
151
+ if (typeof clientXPos !== "number") return;
152
+ if (endEvent.cancelable) {
153
+ endEvent.preventDefault();
154
+ endEvent.stopPropagation();
155
+ }
156
+ endResize(clientXPos);
157
+ };
158
+ const touchCancelHandler = () => {
159
+ endResize(lastClientX);
160
+ };
161
+ const windowBlurHandler = () => {
162
+ endResize(lastClientX);
163
+ };
164
+ const passiveIfSupported = { passive: false };
165
+ if (isTouchSession) {
166
+ ownerDocument.addEventListener("touchmove", touchMoveHandler, passiveIfSupported);
167
+ ownerDocument.addEventListener("touchend", touchEndHandler, passiveIfSupported);
168
+ ownerDocument.addEventListener("touchcancel", touchCancelHandler);
169
+ stopListeners.push(() => {
170
+ ownerDocument.removeEventListener("touchmove", touchMoveHandler);
171
+ ownerDocument.removeEventListener("touchend", touchEndHandler);
172
+ ownerDocument.removeEventListener("touchcancel", touchCancelHandler);
173
+ });
174
+ } else {
175
+ ownerDocument.addEventListener("mousemove", mouseMoveHandler, passiveIfSupported);
176
+ ownerDocument.addEventListener("mouseup", mouseUpHandler, passiveIfSupported);
177
+ stopListeners.push(() => {
178
+ ownerDocument.removeEventListener("mousemove", mouseMoveHandler);
179
+ ownerDocument.removeEventListener("mouseup", mouseUpHandler);
180
+ });
181
+ }
182
+ if (ownerWindow) {
183
+ ownerWindow.addEventListener("blur", windowBlurHandler);
184
+ stopListeners.push(() => ownerWindow.removeEventListener("blur", windowBlurHandler));
185
+ }
186
+ table.setColumnSizingInfo((old) => ({
187
+ ...old,
188
+ startOffset,
189
+ startSize,
190
+ deltaOffset: 0,
191
+ deltaPercentage: 0,
192
+ columnSizingStart,
193
+ isResizingColumn: column.id
194
+ }));
195
+ return () => endResize(lastClientX);
196
+ }
197
+ function getDataGridTableRowSections(table, rowsPinnable) {
198
+ if (!rowsPinnable) return {
199
+ topRows: [],
200
+ centerRows: table.getRowModel().rows,
201
+ bottomRows: []
202
+ };
203
+ return {
204
+ topRows: table.getTopRows(),
205
+ centerRows: table.getCenterRows(),
206
+ bottomRows: table.getBottomRows()
207
+ };
208
+ }
209
+ function getDataGridTableResolvedRows(table, rowsPinnable) {
210
+ const { topRows, centerRows, bottomRows } = getDataGridTableRowSections(table, rowsPinnable);
211
+ const resolvedRows = [];
212
+ topRows.forEach((row, index) => {
213
+ resolvedRows.push({
214
+ row,
215
+ pinnedBoundary: index === topRows.length - 1 && (centerRows.length > 0 || bottomRows.length > 0) ? "top" : void 0
216
+ });
217
+ });
218
+ centerRows.forEach((row) => {
219
+ resolvedRows.push({ row });
220
+ });
221
+ bottomRows.forEach((row, index) => {
222
+ resolvedRows.push({
223
+ row,
224
+ pinnedBoundary: index === 0 && (centerRows.length > 0 || topRows.length > 0) ? "bottom" : void 0
225
+ });
226
+ });
227
+ return resolvedRows;
228
+ }
229
+ function getDataGridTableOrderedVisibleColumns(table) {
230
+ return [
231
+ ...table.getLeftVisibleLeafColumns(),
232
+ ...table.getCenterVisibleLeafColumns(),
233
+ ...table.getRightVisibleLeafColumns()
234
+ ];
235
+ }
236
+ function getDataGridTableOrderedVisibleCells(row) {
237
+ return [
238
+ ...row.getLeftVisibleCells(),
239
+ ...row.getCenterVisibleCells(),
240
+ ...row.getRightVisibleCells()
241
+ ];
242
+ }
243
+ function getDataGridTableMergedHeaderGroups(table) {
244
+ const leftHeaderGroups = table.getLeftHeaderGroups();
245
+ const centerHeaderGroups = table.getCenterHeaderGroups();
246
+ const rightHeaderGroups = table.getRightHeaderGroups();
247
+ const headerGroupCount = Math.max(leftHeaderGroups.length, centerHeaderGroups.length, rightHeaderGroups.length);
248
+ return Array.from({ length: headerGroupCount }, (_, index) => {
249
+ const leftGroup = leftHeaderGroups[index];
250
+ const centerGroup = centerHeaderGroups[index];
251
+ const rightGroup = rightHeaderGroups[index];
252
+ return {
253
+ id: [
254
+ leftGroup?.id,
255
+ centerGroup?.id,
256
+ rightGroup?.id
257
+ ].filter(Boolean).join(":") || `header-group-${index}`,
258
+ headers: [
259
+ ...leftGroup?.headers ?? [],
260
+ ...centerGroup?.headers ?? [],
261
+ ...rightGroup?.headers ?? []
262
+ ]
263
+ };
264
+ });
265
+ }
266
+ function hasDataGridTableRightPinnedColumns(table) {
267
+ return (table.getState().columnPinning.right?.length ?? 0) > 0;
268
+ }
269
+ function DataGridTableFillCol() {
270
+ const { props } = useDataGrid();
271
+ if (!props.tableLayout?.columnsResizable) return null;
272
+ return /* @__PURE__ */ jsx("col", {
273
+ "data-slot": "data-grid-table-fill-col",
274
+ style: { width: "var(--data-grid-fill-size, 0px)" }
275
+ });
276
+ }
277
+ function DataGridTableFillHeadCell() {
278
+ const { props } = useDataGrid();
279
+ if (!props.tableLayout?.columnsResizable) return null;
280
+ return /* @__PURE__ */ jsx("th", {
281
+ "data-slot": "data-grid-table-fill-head-cell",
282
+ style: { width: "var(--data-grid-fill-size, 0px)" },
283
+ className: cn("p-0", props.tableLayout?.headerBackground && "bg-muted")
284
+ });
285
+ }
286
+ function DataGridTableFillBodyCell() {
287
+ const { props } = useDataGrid();
288
+ if (!props.tableLayout?.columnsResizable) return null;
289
+ return /* @__PURE__ */ jsx("td", {
290
+ "aria-hidden": "true",
291
+ "data-slot": "data-grid-table-fill-body-cell",
292
+ style: { width: "var(--data-grid-fill-size, 0px)" },
293
+ className: "p-0"
294
+ });
295
+ }
296
+ function DataGridTableFillFootCell() {
297
+ const { props } = useDataGrid();
298
+ if (!props.tableLayout?.columnsResizable) return null;
299
+ return /* @__PURE__ */ jsx("td", {
300
+ "aria-hidden": "true",
301
+ "data-slot": "data-grid-table-fill-foot-cell",
302
+ style: { width: "var(--data-grid-fill-size, 0px)" },
303
+ className: "p-0"
304
+ });
305
+ }
306
+ function DataGridTableBase({ children }) {
307
+ const { props, table } = useDataGrid();
308
+ const leftVisibleColumns = table.getLeftVisibleLeafColumns();
309
+ const centerVisibleColumns = table.getCenterVisibleLeafColumns();
310
+ const rightVisibleColumns = table.getRightVisibleLeafColumns();
311
+ const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
312
+ /**
313
+ * Compute column widths as CSS custom properties once upfront (memoized).
314
+ * Cells reference these via calc(var(--col-X-size) * 1px) so the browser
315
+ * handles width propagation without per-cell getSize() calls or React
316
+ * re-renders of the body.
317
+ */
318
+ const columnSizeVars = useMemo(() => {
319
+ if (!props.tableLayout?.columnsResizable) return void 0;
320
+ const headers = table.getFlatHeaders();
321
+ const colSizes = {};
322
+ for (let i = 0; i < headers.length; i++) {
323
+ const header = headers[i];
324
+ colSizes[`--header-${header.id}-size`] = header.getSize();
325
+ colSizes[`--col-${header.column.id}-size`] = header.column.getSize();
326
+ }
327
+ return colSizes;
328
+ }, [props.tableLayout?.columnsResizable, table.getFlatHeaders]);
329
+ return /* @__PURE__ */ jsxs("table", {
330
+ "data-slot": "data-grid-table",
331
+ className: cn("caption-bottom text-left align-middle font-normal text-foreground text-sm rtl:text-right", props.tableLayout?.columnsResizable ? "min-w-0" : "w-full min-w-full", props.tableLayout?.width === "auto" ? "table-auto" : "table-fixed", !props.tableLayout?.columnsResizable && "", !props.tableLayout?.columnsDraggable && "border-separate border-spacing-0", props.tableClassNames?.base),
332
+ style: props.tableLayout?.columnsResizable ? {
333
+ ...columnSizeVars,
334
+ width: `calc(${table.getTotalSize()}px + var(--data-grid-fill-size, 0px))`
335
+ } : void 0,
336
+ children: [/* @__PURE__ */ jsxs("colgroup", { children: [
337
+ [...leftVisibleColumns, ...centerVisibleColumns].map((column) => /* @__PURE__ */ jsx("col", { style: props.tableLayout?.columnsResizable ? { width: `calc(var(--col-${column.id}-size) * 1px)` } : props.tableLayout?.width === "fixed" ? { width: column.getSize() } : void 0 }, column.id)),
338
+ hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillCol, {}) : null,
339
+ rightVisibleColumns.map((column) => /* @__PURE__ */ jsx("col", { style: props.tableLayout?.columnsResizable ? { width: `calc(var(--col-${column.id}-size) * 1px)` } : props.tableLayout?.width === "fixed" ? { width: column.getSize() } : void 0 }, column.id)),
340
+ !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillCol, {}) : null
341
+ ] }), children]
342
+ });
343
+ }
344
+ function DataGridTableViewport({ children, className, viewportRef, style }) {
345
+ const { props, table, autoSize } = useDataGrid();
346
+ const isColumnsResizable = !!props.tableLayout?.columnsResizable;
347
+ const viewportNodeRef = useRef(null);
348
+ const fillStateRef = useRef({
349
+ containerWidth: 0,
350
+ appliedFill: -1
351
+ });
352
+ const stopContainerObserverRef = useRef(null);
353
+ const syncFillWidth = useCallback(() => {
354
+ const node = viewportNodeRef.current;
355
+ if (!node) return;
356
+ const fillWidth = Math.max(0, fillStateRef.current.containerWidth - table.getTotalSize());
357
+ if (fillStateRef.current.appliedFill !== fillWidth) {
358
+ fillStateRef.current.appliedFill = fillWidth;
359
+ node.style.setProperty("--data-grid-fill-size", `${fillWidth}px`);
360
+ }
361
+ autoSize?.apply(fillWidth);
362
+ }, [autoSize, table]);
363
+ const handleViewportRef = useCallback((node) => {
364
+ stopContainerObserverRef.current?.();
365
+ stopContainerObserverRef.current = null;
366
+ viewportNodeRef.current = node;
367
+ assignRef(viewportRef, node);
368
+ if (!node) return;
369
+ if (!isColumnsResizable) {
370
+ fillStateRef.current.appliedFill = -1;
371
+ node.style.removeProperty("--data-grid-fill-size");
372
+ return;
373
+ }
374
+ const measurementTarget = getDataGridScrollAreaViewport(node) ?? node.parentElement ?? node;
375
+ const measure = () => {
376
+ fillStateRef.current.containerWidth = measurementTarget.clientWidth;
377
+ syncFillWidth();
378
+ };
379
+ measure();
380
+ if (typeof ResizeObserver !== "undefined") {
381
+ const observer = new ResizeObserver(measure);
382
+ observer.observe(measurementTarget);
383
+ stopContainerObserverRef.current = () => observer.disconnect();
384
+ }
385
+ }, [
386
+ isColumnsResizable,
387
+ syncFillWidth,
388
+ viewportRef
389
+ ]);
390
+ useLayoutEffect(() => {
391
+ if (!isColumnsResizable) return;
392
+ syncFillWidth();
393
+ });
394
+ return /* @__PURE__ */ jsxs("div", {
395
+ "data-slot": "data-grid-table-viewport",
396
+ ref: handleViewportRef,
397
+ className: cn("relative min-w-full align-top", className),
398
+ style: {
399
+ ...isColumnsResizable ? { width: `calc(${table.getTotalSize()}px + var(--data-grid-fill-size, 0px))` } : void 0,
400
+ ...style
401
+ },
402
+ children: [children, /* @__PURE__ */ jsx(DataGridTableResizeIndicator, { viewportNodeRef })]
403
+ });
404
+ }
405
+ function DataGridTableHead({ children }) {
406
+ const { props } = useDataGrid();
407
+ return /* @__PURE__ */ jsx("thead", {
408
+ className: cn(props.tableClassNames?.header, props.tableLayout?.headerSticky && props.tableClassNames?.headerSticky),
409
+ children
410
+ });
411
+ }
412
+ function DataGridTableHeadRow({ children }) {
413
+ const { props } = useDataGrid();
414
+ return /* @__PURE__ */ jsx("tr", {
415
+ className: cn(props.tableLayout?.headerBorder && "[&>th]:border-b", props.tableLayout?.cellBorder && "*:last:border-e-0", props.tableLayout?.stripped && "bg-transparent", props.tableLayout?.headerBackground === false && "bg-transparent", props.tableClassNames?.headerRow),
416
+ children
417
+ });
418
+ }
419
+ function DataGridTableHeadRowCell({ children, header, dndRef, dndStyle }) {
420
+ const { props } = useDataGrid();
421
+ const { column } = header;
422
+ const isPinned = column.getIsPinned();
423
+ const isFirstLeftPinned = isPinned === "left" && column.getIsFirstColumn("left");
424
+ const isLastLeftPinned = isPinned === "left" && column.getIsLastColumn("left");
425
+ const isFirstRightPinned = isPinned === "right" && column.getIsFirstColumn("right");
426
+ const isLastRightPinned = isPinned === "right" && column.getIsLastColumn("right");
427
+ const isLastVisibleColumn = column.getIndex() === header.getContext().table.getVisibleLeafColumns().length - 1;
428
+ const headerCellSpacing = headerCellSpacingVariants({ size: props.tableLayout?.dense ? "dense" : "default" });
429
+ const sortDirection = column.getIsSorted();
430
+ return /* @__PURE__ */ jsx("th", {
431
+ ref: dndRef,
432
+ scope: "col",
433
+ colSpan: header.colSpan > 1 ? header.colSpan : void 0,
434
+ "aria-sort": sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : void 0,
435
+ style: {
436
+ ...props.tableLayout?.width === "fixed" && !props.tableLayout?.columnsResizable && { width: header.getSize() },
437
+ ...props.tableLayout?.columnsPinnable && column.getCanPin() && getPinningStyles(column),
438
+ ...props.tableLayout?.columnsResizable && { width: `calc(var(--header-${header.id}-size) * 1px)` },
439
+ ...dndStyle ? dndStyle : null
440
+ },
441
+ "data-pinned": isPinned || void 0,
442
+ "data-outer-pinned-col": isFirstLeftPinned ? "left" : isLastRightPinned ? "right" : void 0,
443
+ "data-last-col": isLastLeftPinned ? "left" : isFirstRightPinned ? "right" : void 0,
444
+ className: cn("relative h-10 text-left align-middle font-medium text-foreground rtl:text-right [&:has([role=checkbox])]:pe-0", headerCellSpacing, props.tableLayout?.headerBackground && "bg-muted", props.tableLayout?.cellBorder && "border-e", props.tableLayout?.columnsResizable && column.getCanResize() && (isPinned ? "overflow-hidden" : "overflow-visible"), props.tableLayout?.columnsResizable && column.getCanResize() && isLastVisibleColumn && "pe-8", props.tableLayout?.columnsPinnable && column.getCanPin() && cn("data-pinned:isolate data-pinned:bg-muted data-outer-pinned-col:bg-clip-padding", "[&[data-pinned=left][data-last-col=left]]:shadow-[inset_-1px_0_0_0_var(--border)] [&[data-pinned=right]:last-child_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=right][data-last-col=right]]:shadow-[inset_1px_0_0_0_var(--border)]", "[&:not([data-pinned]):has(+[data-pinned])_div.cursor-col-resize:last-child]:opacity-0 [&[data-last-col=left]_div.cursor-col-resize:last-child]:opacity-0"), header.column.columnDef.meta?.headerClassName, column.getIndex() === 0 || isLastVisibleColumn ? props.tableClassNames?.edgeCell : ""),
445
+ children
446
+ });
447
+ }
448
+ function DataGridTableHeadRowCellResize({ header }) {
449
+ const { props, table } = useDataGrid();
450
+ const { column } = header;
451
+ const isPinned = column.getIsPinned();
452
+ const isLastVisibleColumn = column.getIndex() === header.getContext().table.getVisibleLeafColumns().length - 1;
453
+ const isResizeModeOnEnd = (props.tableLayout?.columnsResizeMode ?? table.options.columnResizeMode) === "onEnd";
454
+ const stopResizeSessionRef = useRef(void 0);
455
+ useEffect(() => {
456
+ return () => {
457
+ stopResizeSessionRef.current?.();
458
+ stopResizeSessionRef.current = void 0;
459
+ };
460
+ }, []);
461
+ const handleMouseDown = (event) => {
462
+ if (event.button !== 0) return;
463
+ event.preventDefault();
464
+ event.stopPropagation();
465
+ if (isResizeModeOnEnd) {
466
+ stopResizeSessionRef.current?.();
467
+ stopResizeSessionRef.current = startDataGridColumnResizeOnEnd(event, header, table);
468
+ return;
469
+ }
470
+ header.getResizeHandler()(event);
471
+ };
472
+ const handleTouchStart = (event) => {
473
+ event.preventDefault();
474
+ event.stopPropagation();
475
+ if (isResizeModeOnEnd) {
476
+ stopResizeSessionRef.current?.();
477
+ stopResizeSessionRef.current = startDataGridColumnResizeOnEnd(event, header, table);
478
+ return;
479
+ }
480
+ header.getResizeHandler()(event);
481
+ };
482
+ return /* @__PURE__ */ jsx("div", {
483
+ onDoubleClick: () => column.resetSize(),
484
+ onMouseDown: handleMouseDown,
485
+ onTouchStart: handleTouchStart,
486
+ className: cn("user-select-none absolute top-0 z-10 flex h-full cursor-col-resize touch-none", isLastVisibleColumn ? "end-0 w-5 justify-end before:hidden" : isPinned ? "end-0 w-5 justify-end before:hidden" : "-end-2 w-5 justify-center before:absolute before:inset-y-0 before:w-px before:-translate-x-px before:bg-border", column.getIsResizing() && (isResizeModeOnEnd ? "opacity-100" : isLastVisibleColumn ? "opacity-100 before:absolute before:inset-y-0 before:end-0 before:block before:w-0.5 before:bg-primary" : "opacity-100 before:block before:w-0.5 before:bg-primary"))
487
+ });
488
+ }
489
+ function DataGridTableResizeIndicator({ viewportNodeRef }) {
490
+ const { props, table } = useDataGrid();
491
+ const indicatorRef = useRef(null);
492
+ const indicatorHeadRef = useRef(null);
493
+ const headerHeightCacheRef = useRef({
494
+ key: false,
495
+ value: 0
496
+ });
497
+ const columnSizingInfo = table.getState().columnSizingInfo;
498
+ const resizingColumnId = columnSizingInfo.isResizingColumn;
499
+ const resizeMode = props.tableLayout?.columnsResizeMode ?? table.options.columnResizeMode;
500
+ const isActive = !!(props.tableLayout?.columnsResizable && resizeMode === "onEnd" && resizingColumnId);
501
+ useLayoutEffect(() => {
502
+ const indicator = indicatorRef.current;
503
+ const indicatorHead = indicatorHeadRef.current;
504
+ const viewportElement = viewportNodeRef.current;
505
+ if (!isActive || !indicator || !indicatorHead || !resizingColumnId) return;
506
+ const resizingHeader = table.getFlatHeaders().find((header) => header.column.id === resizingColumnId || header.id === resizingColumnId);
507
+ if (!resizingHeader) return;
508
+ const directionMultiplier = table.options.columnResizeDirection === "rtl" ? -1 : 1;
509
+ const deltaOffset = (columnSizingInfo.deltaOffset ?? 0) * directionMultiplier;
510
+ if (headerHeightCacheRef.current.key !== resizingColumnId) headerHeightCacheRef.current = {
511
+ key: resizingColumnId,
512
+ value: viewportElement?.querySelector("[data-slot=\"data-grid-table\"] thead")?.getBoundingClientRect().height ?? 0
513
+ };
514
+ const headerHeight = headerHeightCacheRef.current.value;
515
+ const indicatorLeft = typeof columnSizingInfo.startOffset === "number" && viewportElement ? columnSizingInfo.startOffset - viewportElement.getBoundingClientRect().left : resizingHeader.getStart() + resizingHeader.getSize();
516
+ indicator.style.left = `${indicatorLeft}px`;
517
+ indicator.style.transform = `translateX(${deltaOffset}px)`;
518
+ indicatorHead.style.height = `${Math.max(headerHeight, 6)}px`;
519
+ });
520
+ if (!isActive) return null;
521
+ return /* @__PURE__ */ jsxs("div", {
522
+ ref: indicatorRef,
523
+ "aria-hidden": "true",
524
+ className: "pointer-events-none absolute inset-y-0 z-20",
525
+ children: [/* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 w-px -translate-x-1/2 bg-primary/85" }), /* @__PURE__ */ jsx("div", {
526
+ ref: indicatorHeadRef,
527
+ className: "absolute top-0 left-0 -translate-x-1/2 rounded-b-sm bg-primary shadow-xs",
528
+ style: { width: 5 }
529
+ })]
530
+ });
531
+ }
532
+ function DataGridTableRowSpacer() {
533
+ return /* @__PURE__ */ jsx("tbody", {
534
+ "aria-hidden": "true",
535
+ className: "h-2",
536
+ "data-slot": "data-grid-table-body-spacer"
537
+ });
538
+ }
539
+ function DataGridTableBody({ children }) {
540
+ const { props } = useDataGrid();
541
+ return /* @__PURE__ */ jsx("tbody", {
542
+ "data-slot": "data-grid-table-body",
543
+ className: cn(props.tableLayout?.rowRounded && "[&_td:first-child]:rounded-l-lg", props.tableLayout?.rowRounded && "[&_td:last-child]:rounded-r-lg", props.tableClassNames?.body),
544
+ children
545
+ });
546
+ }
547
+ function DataGridTableFoot({ children }) {
548
+ const { props } = useDataGrid();
549
+ return /* @__PURE__ */ jsx("tfoot", {
550
+ "data-slot": "data-grid-table-foot",
551
+ className: cn(props.tableClassNames?.footer),
552
+ children
553
+ });
554
+ }
555
+ function DataGridTableFootRow({ children }) {
556
+ const { props } = useDataGrid();
557
+ return /* @__PURE__ */ jsxs("tr", {
558
+ "data-slot": "data-grid-table-foot-row",
559
+ className: cn(props.tableLayout?.footerBackground && "bg-muted/40 dark:bg-background", props.tableLayout?.rowBorder && "[&:not(:last-child)>td]:border-b", props.tableLayout?.cellBorder && "*:last:border-e-0"),
560
+ children: [children, /* @__PURE__ */ jsx(DataGridTableFillFootCell, {})]
561
+ });
562
+ }
563
+ function DataGridTableFootRowCell({ children, colSpan, className }) {
564
+ const { props } = useDataGrid();
565
+ return /* @__PURE__ */ jsx("td", {
566
+ colSpan,
567
+ className: cn("align-middle font-medium text-secondary-foreground/80", footerCellSpacingVariants({ size: props.tableLayout?.dense ? "dense" : "default" }), props.tableLayout?.footerBackground && "bg-muted/40 dark:bg-background", props.tableLayout?.cellBorder && "border-e", className),
568
+ children
569
+ });
570
+ }
571
+ function DataGridTableBodyRowSkeleton({ children }) {
572
+ const { table, props } = useDataGrid();
573
+ return /* @__PURE__ */ jsx("tr", {
574
+ className: cn("hover:bg-muted/40 data-[state=selected]:bg-muted/50", props.onRowClick && "cursor-pointer", !props.tableLayout?.stripped && props.tableLayout?.rowBorder && "border-border border-b [&:not(:last-child)>td]:border-b", props.tableLayout?.cellBorder && "*:last:border-e-0", props.tableLayout?.stripped && "odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted", table.options.enableRowSelection && "*:first:relative", props.tableClassNames?.bodyRow),
575
+ children
576
+ });
577
+ }
578
+ function DataGridTableBodyRowSkeletonCell({ children, column }) {
579
+ const { props, table } = useDataGrid();
580
+ const bodyCellSpacing = bodyCellSpacingVariants({ size: props.tableLayout?.dense ? "dense" : "default" });
581
+ return /* @__PURE__ */ jsx("td", {
582
+ style: props.tableLayout?.columnsResizable ? { width: `calc(var(--col-${column.id}-size) * 1px)` } : void 0,
583
+ className: cn("align-middle", bodyCellSpacing, props.tableLayout?.cellBorder && "border-e", props.tableLayout?.columnsResizable && column.getCanResize() && "truncate", column.columnDef.meta?.cellClassName, props.tableLayout?.columnsPinnable && column.getCanPin() && "data-pinned:isolate data-pinned:bg-background [&[data-pinned=left][data-last-col=left]]:shadow-[inset_-1px_0_0_0_var(--border)] [&[data-pinned=right][data-last-col=right]]:shadow-[inset_1px_0_0_0_var(--border)]", column.getIndex() === 0 || column.getIndex() === table.getVisibleLeafColumns().length - 1 ? props.tableClassNames?.edgeCell : ""),
584
+ children
585
+ });
586
+ }
587
+ function DataGridTableBodyRow({ children, row, pinnedBoundary, rowRef, dndRef, dndStyle, dataIndex }) {
588
+ const { props, table } = useDataGrid();
589
+ const isRowPinned = row.getIsPinned();
590
+ const bodyRowBottomBorderClasses = "[&:not(:last-child)>td]:border-b [tbody:has(+tfoot)_&:last-child>td]:border-b [*:has(>[data-slot=data-grid]+[data-slot=data-grid-pagination])_[data-slot=data-grid]_&:last-child>td]:border-b";
591
+ return /* @__PURE__ */ jsx("tr", {
592
+ ref: (node) => {
593
+ assignRef(rowRef, node);
594
+ assignRef(dndRef, node);
595
+ },
596
+ style: { ...dndStyle ? dndStyle : null },
597
+ "data-state": table.options.enableRowSelection && row.getIsSelected() ? "selected" : void 0,
598
+ "data-index": dataIndex,
599
+ "data-row-pinned": isRowPinned || void 0,
600
+ "data-row-pinned-boundary": pinnedBoundary,
601
+ onClick: () => props.onRowClick?.(row.original),
602
+ className: cn("hover:bg-muted/40 data-[state=selected]:bg-muted/50", props.onRowClick && "cursor-pointer", !props.tableLayout?.stripped && props.tableLayout?.rowBorder && bodyRowBottomBorderClasses, props.tableLayout?.cellBorder && `*:last:border-e-0 ${bodyRowBottomBorderClasses}`, props.tableLayout?.stripped && (typeof dataIndex === "number" ? cn("hover:bg-transparent", dataIndex % 2 === 0 && "bg-muted/90 hover:bg-muted") : "odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted"), table.options.enableRowSelection && "*:first:relative", props.tableLayout?.rowsPinnable && isRowPinned && "bg-muted/30 hover:bg-muted/50", pinnedBoundary === "top" && "[&>td]:shadow-[0_2px_0_rgba(0,0,0,0.03)] dark:[&>td]:shadow-[0_2px_0_rgba(255,255,255,0.06)]", pinnedBoundary === "bottom" && "[&>td]:shadow-[0_2px_0_rgba(0,0,0,0.03)] dark:[&>td]:shadow-[0_2px_0_rgba(255,255,255,0.06)]", props.tableClassNames?.bodyRow),
603
+ children
604
+ });
605
+ }
606
+ function DataGridTableBodyRowExpandded({ row }) {
607
+ const { props, table } = useDataGrid();
608
+ return /* @__PURE__ */ jsx("tr", {
609
+ className: cn(props.tableLayout?.rowBorder && "[&:not(:last-child)>td]:border-b [tbody:has(+tfoot)_&:last-child>td]:border-b [*:has(>[data-slot=data-grid]+[data-slot=data-grid-pagination])_[data-slot=data-grid]_&:last-child>td]:border-b"),
610
+ children: /* @__PURE__ */ jsx("td", {
611
+ colSpan: getDataGridTableOrderedVisibleCells(row).length + (props.tableLayout?.columnsResizable ? 1 : 0),
612
+ children: table.getAllColumns().find((column) => column.columnDef.meta?.expandedContent)?.columnDef.meta?.expandedContent?.(row.original)
613
+ })
614
+ });
615
+ }
616
+ function DataGridTableBodyRowCell({ children, cell, dndRef, dndStyle }) {
617
+ const { props } = useDataGrid();
618
+ const { column, row } = cell;
619
+ const isPinned = column.getIsPinned();
620
+ const isLastLeftPinned = isPinned === "left" && column.getIsLastColumn("left");
621
+ const isFirstRightPinned = isPinned === "right" && column.getIsFirstColumn("right");
622
+ const bodyCellSpacing = bodyCellSpacingVariants({ size: props.tableLayout?.dense ? "dense" : "default" });
623
+ return /* @__PURE__ */ jsx("td", {
624
+ ref: dndRef,
625
+ style: {
626
+ ...props.tableLayout?.columnsPinnable && column.getCanPin() && getPinningStyles(column),
627
+ ...props.tableLayout?.columnsResizable && { width: `calc(var(--col-${column.id}-size) * 1px)` },
628
+ ...dndStyle ? dndStyle : null
629
+ },
630
+ "data-pinned": isPinned || void 0,
631
+ "data-last-col": isLastLeftPinned ? "left" : isFirstRightPinned ? "right" : void 0,
632
+ className: cn("align-middle", bodyCellSpacing, props.tableLayout?.cellBorder && "border-e", props.tableLayout?.columnsResizable && column.getCanResize() && "truncate", cell.column.columnDef.meta?.cellClassName, props.tableLayout?.columnsPinnable && column.getCanPin() && cn("data-pinned:isolate data-pinned:bg-background", "[&[data-pinned=left][data-last-col=left]]:shadow-[inset_-1px_0_0_0_var(--border)]", "[&[data-pinned=right][data-last-col=right]]:shadow-[inset_1px_0_0_0_var(--border)]"), column.getIndex() === 0 || column.getIndex() === row.getVisibleCells().length - 1 ? props.tableClassNames?.edgeCell : ""),
633
+ children
634
+ });
635
+ }
636
+ function DataGridTableRenderedRow({ row, pinnedBoundary, rowRef, rowIndex }) {
637
+ const { props, table } = useDataGrid();
638
+ const leftVisibleCells = row.getLeftVisibleCells();
639
+ const centerVisibleCells = row.getCenterVisibleCells();
640
+ const rightVisibleCells = row.getRightVisibleCells();
641
+ const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
642
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(DataGridTableBodyRow, {
643
+ row,
644
+ pinnedBoundary,
645
+ rowRef,
646
+ dataIndex: rowIndex,
647
+ children: [
648
+ [...leftVisibleCells, ...centerVisibleCells].map((cell) => /* @__PURE__ */ jsx(DataGridTableBodyRowCell, {
649
+ cell,
650
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
651
+ }, cell.id)),
652
+ props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillBodyCell, {}) : null,
653
+ rightVisibleCells.map((cell) => /* @__PURE__ */ jsx(DataGridTableBodyRowCell, {
654
+ cell,
655
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
656
+ }, cell.id)),
657
+ props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillBodyCell, {}) : null
658
+ ]
659
+ }), row.getIsExpanded() && /* @__PURE__ */ jsx(DataGridTableBodyRowExpandded, { row })] });
660
+ }
661
+ function DataGridTableEmpty() {
662
+ const { table, props } = useDataGrid();
663
+ const visibleColumnCount = getDataGridTableOrderedVisibleColumns(table).length + (props.tableLayout?.columnsResizable ? 1 : 0);
664
+ return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
665
+ colSpan: Math.max(visibleColumnCount, 1),
666
+ className: "py-6 text-center text-muted-foreground text-sm",
667
+ children: props.emptyMessage || "No data available"
668
+ }) });
669
+ }
670
+ function DataGridTableLoader() {
671
+ const { props } = useDataGrid();
672
+ return /* @__PURE__ */ jsx("div", {
673
+ className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
674
+ children: /* @__PURE__ */ jsxs("div", {
675
+ className: "flex items-center gap-2 rounded-lg border bg-card px-4 py-2 font-medium text-muted-foreground text-sm leading-none",
676
+ children: [/* @__PURE__ */ jsx(Spinner, { className: "size-5 opacity-60" }), props.loadingMessage || "Loading..."]
677
+ })
678
+ });
679
+ }
680
+ function DataGridTableRowPin({ row }) {
681
+ const isPinned = row.getIsPinned();
682
+ return /* @__PURE__ */ jsx("button", {
683
+ type: "button",
684
+ "aria-label": isPinned ? "Unpin row" : "Pin row",
685
+ onClick: (event) => {
686
+ event.stopPropagation();
687
+ if (isPinned) row.pin(false);
688
+ else row.pin("top");
689
+ },
690
+ className: cn("inline-flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground", isPinned && "text-primary hover:text-primary/80"),
691
+ children: isPinned ? /* @__PURE__ */ jsx("svg", {
692
+ xmlns: "http://www.w3.org/2000/svg",
693
+ width: "16",
694
+ height: "16",
695
+ viewBox: "0 0 24 24",
696
+ fill: "currentColor",
697
+ stroke: "none",
698
+ children: /* @__PURE__ */ jsx("path", { d: "M16 2l4.585 4.586-2.122 2.121L17.05 7.293l-3.535 3.536 1.413 5.658-2.12 2.121-4.244-4.243L4.322 18.6l-1.414-1.41 4.242-4.244-4.243-4.243 2.122-2.121 5.656 1.414 3.536-3.536-1.414-1.414z" })
699
+ }) : /* @__PURE__ */ jsxs("svg", {
700
+ xmlns: "http://www.w3.org/2000/svg",
701
+ width: "16",
702
+ height: "16",
703
+ viewBox: "0 0 24 24",
704
+ fill: "none",
705
+ stroke: "currentColor",
706
+ strokeWidth: "2",
707
+ strokeLinecap: "round",
708
+ strokeLinejoin: "round",
709
+ children: [/* @__PURE__ */ jsx("line", {
710
+ x1: "12",
711
+ y1: "17",
712
+ x2: "12",
713
+ y2: "22"
714
+ }), /* @__PURE__ */ jsx("path", { d: "M5 17h14v-1.76a2 2 0 00-1.11-1.79l-1.78-.9A2 2 0 0115 10.76V6h1a2 2 0 000-4H8a2 2 0 000 4h1v4.76a2 2 0 01-1.11 1.79l-1.78.9A2 2 0 005 15.24z" })]
715
+ })
716
+ });
717
+ }
718
+ function DataGridTableRowSelect({ row }) {
719
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", { className: cn("absolute inset-s-0 top-0 bottom-0 hidden w-[2px] bg-primary", row.getIsSelected() && "block") }), /* @__PURE__ */ jsx(Checkbox, {
720
+ checked: row.getIsSelected(),
721
+ onCheckedChange: (value) => row.toggleSelected(!!value),
722
+ onClick: (event) => {
723
+ event.stopPropagation();
724
+ },
725
+ "aria-label": "Select row",
726
+ className: "align-[inherit]"
727
+ })] });
728
+ }
729
+ function DataGridTableRowSelectAll() {
730
+ const { table, recordCount, isLoading } = useDataGrid();
731
+ const isAllSelected = table.getIsAllPageRowsSelected();
732
+ return /* @__PURE__ */ jsx(Checkbox, {
733
+ checked: isAllSelected,
734
+ indeterminate: table.getIsSomePageRowsSelected() && !isAllSelected,
735
+ disabled: isLoading || recordCount === 0,
736
+ onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
737
+ "aria-label": "Select all",
738
+ className: "align-[inherit]"
739
+ });
740
+ }
741
+ function DataGridTableBodyRows({ table }) {
742
+ const { isLoading, props } = useDataGrid();
743
+ const pagination = table.getState().pagination;
744
+ if (isLoading && props.loadingMode === "skeleton" && pagination?.pageSize) {
745
+ const leftVisibleColumns = table.getLeftVisibleLeafColumns();
746
+ const centerVisibleColumns = table.getCenterVisibleLeafColumns();
747
+ const rightVisibleColumns = table.getRightVisibleLeafColumns();
748
+ const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
749
+ return /* @__PURE__ */ jsx(Fragment$1, { children: Array.from({ length: pagination.pageSize }).map((_, rowIndex) => /* @__PURE__ */ jsxs(DataGridTableBodyRowSkeleton, { children: [
750
+ [...leftVisibleColumns, ...centerVisibleColumns].map((column) => /* @__PURE__ */ jsx(DataGridTableBodyRowSkeletonCell, {
751
+ column,
752
+ children: column.columnDef.meta?.skeleton
753
+ }, column.id)),
754
+ props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillBodyCell, {}) : null,
755
+ rightVisibleColumns.map((column) => /* @__PURE__ */ jsx(DataGridTableBodyRowSkeletonCell, {
756
+ column,
757
+ children: column.columnDef.meta?.skeleton
758
+ }, column.id)),
759
+ props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillBodyCell, {}) : null
760
+ ] }, rowIndex)) });
761
+ }
762
+ if (isLoading && props.loadingMode === "spinner") return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
763
+ colSpan: table.getVisibleFlatColumns().length + (props.tableLayout?.columnsResizable ? 1 : 0),
764
+ className: "p-8",
765
+ children: /* @__PURE__ */ jsxs("div", {
766
+ className: "flex items-center justify-center",
767
+ children: [/* @__PURE__ */ jsxs("svg", {
768
+ className: "mr-3 -ml-1 h-5 w-5 animate-spin text-muted-foreground",
769
+ xmlns: "http://www.w3.org/2000/svg",
770
+ fill: "none",
771
+ viewBox: "0 0 24 24",
772
+ children: [/* @__PURE__ */ jsx("circle", {
773
+ className: "opacity-25",
774
+ cx: "12",
775
+ cy: "12",
776
+ r: "10",
777
+ stroke: "currentColor",
778
+ strokeWidth: "4"
779
+ }), /* @__PURE__ */ jsx("path", {
780
+ className: "opacity-75",
781
+ fill: "currentColor",
782
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
783
+ })]
784
+ }), props.loadingMessage || "Loading..."]
785
+ })
786
+ }) });
787
+ const resolvedRows = getDataGridTableResolvedRows(table, props.tableLayout?.rowsPinnable);
788
+ if (!resolvedRows.length) return /* @__PURE__ */ jsx(DataGridTableEmpty, {});
789
+ return /* @__PURE__ */ jsx(Fragment$1, { children: resolvedRows.map(({ row, pinnedBoundary }) => /* @__PURE__ */ jsx(DataGridTableRenderedRow, {
790
+ row,
791
+ pinnedBoundary
792
+ }, row.id)) });
793
+ }
794
+ /**
795
+ * Memoized body rows: skip re-renders during active column resize.
796
+ * Column widths update via CSS variables on the <table> element,
797
+ * so the browser handles width changes without React re-renders.
798
+ */
799
+ const MemoizedDataGridTableBodyRows = memo(DataGridTableBodyRows, (_prev, next) => !!next.table.getState().columnSizingInfo.isResizingColumn);
800
+ function DataGridTableHeader() {
801
+ const { table, props } = useDataGrid();
802
+ const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);
803
+ const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
804
+ return /* @__PURE__ */ jsx(DataGridTableViewport, { children: /* @__PURE__ */ jsx(DataGridTableBase, { children: /* @__PURE__ */ jsx(DataGridTableHead, { children: mergedHeaderGroups.map((headerGroup) => {
805
+ return /* @__PURE__ */ jsxs(DataGridTableHeadRow, {
806
+ rowId: headerGroup.id,
807
+ children: [
808
+ headerGroup.headers.filter((header) => header.column.getIsPinned() !== "right").map((header) => {
809
+ const { column } = header;
810
+ return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
811
+ header,
812
+ children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
813
+ }, header.id);
814
+ }),
815
+ props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null,
816
+ headerGroup.headers.filter((header) => header.column.getIsPinned() === "right").map((header) => {
817
+ const { column } = header;
818
+ return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
819
+ header,
820
+ children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
821
+ }, header.id);
822
+ }),
823
+ props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null
824
+ ]
825
+ }, headerGroup.id);
826
+ }) }) }) });
827
+ }
828
+ function DataGridTable({ footerContent, renderHeader = true }) {
829
+ const { table, props } = useDataGrid();
830
+ const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);
831
+ const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
832
+ return /* @__PURE__ */ jsx(DataGridTableViewport, { children: /* @__PURE__ */ jsxs(DataGridTableBase, { children: [
833
+ renderHeader && /* @__PURE__ */ jsx(DataGridTableHead, { children: mergedHeaderGroups.map((headerGroup) => {
834
+ return /* @__PURE__ */ jsxs(DataGridTableHeadRow, {
835
+ rowId: headerGroup.id,
836
+ children: [
837
+ headerGroup.headers.filter((header) => header.column.getIsPinned() !== "right").map((header) => {
838
+ const { column } = header;
839
+ return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
840
+ header,
841
+ children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
842
+ }, header.id);
843
+ }),
844
+ props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null,
845
+ headerGroup.headers.filter((header) => header.column.getIsPinned() === "right").map((header) => {
846
+ const { column } = header;
847
+ return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
848
+ header,
849
+ children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
850
+ }, header.id);
851
+ }),
852
+ props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null
853
+ ]
854
+ }, headerGroup.id);
855
+ }) }),
856
+ renderHeader && (props.tableLayout?.stripped || !props.tableLayout?.rowBorder) && /* @__PURE__ */ jsx(DataGridTableRowSpacer, {}),
857
+ /* @__PURE__ */ jsx(DataGridTableBody, { children: /* @__PURE__ */ jsx(MemoizedDataGridTableBodyRows, { table }) }),
858
+ footerContent && /* @__PURE__ */ jsx(DataGridTableFoot, { children: footerContent })
859
+ ] }) });
860
+ }
861
+ //#endregion
862
+ export { DataGridTable, DataGridTableBase, DataGridTableBody, DataGridTableBodyRow, DataGridTableBodyRowCell, DataGridTableBodyRowExpandded, DataGridTableBodyRowSkeleton, DataGridTableBodyRowSkeletonCell, DataGridTableEmpty, DataGridTableFillBodyCell, DataGridTableFillHeadCell, DataGridTableFoot, DataGridTableFootRow, DataGridTableFootRowCell, DataGridTableHead, DataGridTableHeadRow, DataGridTableHeadRowCell, DataGridTableHeadRowCellResize, DataGridTableHeader, DataGridTableLoader, DataGridTableRenderedRow, DataGridTableRowPin, DataGridTableRowSelect, DataGridTableRowSelectAll, DataGridTableRowSpacer, DataGridTableViewport, getDataGridScrollAreaViewport, getDataGridTableMergedHeaderGroups, getDataGridTableResolvedRows, getDataGridTableRowSections, getPinningStyles, hasDataGridTableRightPinnedColumns };
863
+
864
+ //# sourceMappingURL=data-grid-table.js.map