@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.1001.g5e5121808

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 (356) hide show
  1. package/LICENSE +373 -0
  2. package/NOTICE +118 -0
  3. package/README.md +133 -2
  4. package/dist/_virtual/_vite/preload-helper.js +100 -0
  5. package/dist/brand/brand.d.ts +13 -0
  6. package/dist/brand/brand.js +14 -0
  7. package/dist/brand/landing_backdrop.d.ts +56 -0
  8. package/dist/brand/landing_backdrop.js +1019 -0
  9. package/dist/brand/wobble_morph.d.ts +54 -0
  10. package/dist/brand/wobble_morph.js +439 -0
  11. package/dist/components/action_list.d.ts +31 -0
  12. package/dist/components/action_list.js +63 -0
  13. package/dist/components/action_list.module.js +11 -0
  14. package/dist/components/anchored_overlay.d.ts +28 -0
  15. package/dist/components/anchored_overlay.js +93 -0
  16. package/dist/components/button.d.ts +42 -0
  17. package/dist/components/button.js +97 -0
  18. package/dist/components/button.module.js +20 -0
  19. package/dist/components/button_group.d.ts +7 -0
  20. package/dist/components/button_group.js +18 -0
  21. package/dist/components/button_group.module.js +3 -0
  22. package/dist/components/card_placeholder.d.ts +9 -0
  23. package/dist/components/card_placeholder.js +39 -0
  24. package/dist/components/card_placeholder.module.js +6 -0
  25. package/dist/components/clipboard.d.ts +19 -0
  26. package/dist/components/clipboard.js +54 -0
  27. package/dist/components/data_table/computation_tables.d.ts +12 -0
  28. package/dist/components/data_table/computation_tables.js +42 -0
  29. package/dist/components/data_table/data_table.d.ts +39 -0
  30. package/dist/components/data_table/data_table.js +415 -0
  31. package/dist/components/data_table/data_table.module.js +41 -0
  32. package/dist/components/data_table/data_table_cell.d.ts +7 -0
  33. package/dist/components/data_table/data_table_cell.js +9 -0
  34. package/dist/components/data_table/data_table_cell_data.d.ts +22 -0
  35. package/dist/components/data_table/data_table_cell_data.js +103 -0
  36. package/dist/components/data_table/data_table_cell_header_name.d.ts +17 -0
  37. package/dist/components/data_table/data_table_cell_header_name.js +73 -0
  38. package/dist/components/data_table/data_table_cell_header_plots.d.ts +29 -0
  39. package/dist/components/data_table/data_table_cell_header_plots.js +120 -0
  40. package/dist/components/data_table/data_table_colors.d.ts +19 -0
  41. package/dist/components/data_table/data_table_colors.js +27 -0
  42. package/dist/components/data_table/data_table_column_resize.d.ts +21 -0
  43. package/dist/components/data_table/data_table_column_resize.js +121 -0
  44. package/dist/components/data_table/data_table_focus.d.ts +15 -0
  45. package/dist/components/data_table/data_table_focus.js +53 -0
  46. package/dist/components/data_table/data_table_layout.d.ts +18 -0
  47. package/dist/components/data_table/data_table_layout.js +103 -0
  48. package/dist/components/data_table/data_table_ordering.d.ts +9 -0
  49. package/dist/components/data_table/data_table_ordering.js +39 -0
  50. package/dist/components/data_table/data_table_portals.d.ts +9 -0
  51. package/dist/components/data_table/data_table_portals.js +29 -0
  52. package/dist/components/data_table/data_table_row_detail.d.ts +22 -0
  53. package/dist/components/data_table/data_table_row_detail.js +68 -0
  54. package/dist/components/data_table/data_table_row_detail.module.js +7 -0
  55. package/dist/components/data_table/data_table_sticky_views.d.ts +35 -0
  56. package/dist/components/data_table/data_table_sticky_views.js +161 -0
  57. package/dist/components/data_table/data_table_window.d.ts +18 -0
  58. package/dist/components/data_table/data_table_window.js +118 -0
  59. package/dist/components/data_table/format_peek.d.ts +2 -0
  60. package/dist/components/data_table/format_peek.js +17 -0
  61. package/dist/components/data_table/histogram_bars.d.ts +36 -0
  62. package/dist/components/data_table/histogram_bars.js +100 -0
  63. package/dist/components/data_table/histogram_brush.d.ts +22 -0
  64. package/dist/components/data_table/histogram_brush.js +105 -0
  65. package/dist/components/data_table/histogram_cell.d.ts +17 -0
  66. package/dist/components/data_table/histogram_cell.js +324 -0
  67. package/dist/components/data_table/histogram_cell.module.js +9 -0
  68. package/dist/components/data_table/histogram_label.d.ts +1 -0
  69. package/dist/components/data_table/histogram_label.js +7 -0
  70. package/dist/components/data_table/memo_props.d.ts +1 -0
  71. package/dist/components/data_table/memo_props.js +17 -0
  72. package/dist/components/data_table/mostfrequent_cell.d.ts +17 -0
  73. package/dist/components/data_table/mostfrequent_cell.js +316 -0
  74. package/dist/components/data_table/mostfrequent_cell.module.js +10 -0
  75. package/dist/components/data_table/use_cross_filters.d.ts +14 -0
  76. package/dist/components/data_table/use_cross_filters.js +47 -0
  77. package/dist/components/deferred.d.ts +11 -0
  78. package/dist/components/deferred.js +41 -0
  79. package/dist/components/deferred.module.js +5 -0
  80. package/dist/components/error_boundary.d.ts +18 -0
  81. package/dist/components/error_boundary.js +15 -0
  82. package/dist/components/graph.module.js +15 -0
  83. package/dist/components/graph_port.d.ts +10 -0
  84. package/dist/components/graph_port.js +34 -0
  85. package/dist/components/inspector_overlay.d.ts +32 -0
  86. package/dist/components/inspector_overlay.js +72 -0
  87. package/dist/components/inspector_overlay.module.js +18 -0
  88. package/dist/components/json/json_arrow_symbol.d.ts +4 -0
  89. package/dist/components/json/json_arrow_symbol.js +25 -0
  90. package/dist/components/json/json_copy_button.d.ts +11 -0
  91. package/dist/components/json/json_copy_button.js +61 -0
  92. package/dist/components/json/json_ellipsis_symbol.d.ts +7 -0
  93. package/dist/components/json/json_ellipsis_symbol.js +11 -0
  94. package/dist/components/json/json_item_count.d.ts +5 -0
  95. package/dist/components/json/json_item_count.js +12 -0
  96. package/dist/components/json/json_key_name.d.ts +6 -0
  97. package/dist/components/json/json_key_name.js +40 -0
  98. package/dist/components/json/json_key_values.d.ts +12 -0
  99. package/dist/components/json/json_key_values.js +99 -0
  100. package/dist/components/json/json_literal.d.ts +8 -0
  101. package/dist/components/json/json_literal.js +140 -0
  102. package/dist/components/json/json_nested_close.d.ts +11 -0
  103. package/dist/components/json/json_nested_close.js +31 -0
  104. package/dist/components/json/json_nested_open.d.ts +18 -0
  105. package/dist/components/json/json_nested_open.js +150 -0
  106. package/dist/components/json/json_nested_state.d.ts +14 -0
  107. package/dist/components/json/json_nested_state.js +28 -0
  108. package/dist/components/json/json_tool_state.d.ts +18 -0
  109. package/dist/components/json/json_tool_state.js +46 -0
  110. package/dist/components/json/json_value.d.ts +10 -0
  111. package/dist/components/json/json_value.js +46 -0
  112. package/dist/components/json/json_view.d.ts +14 -0
  113. package/dist/components/json/json_view.js +37 -0
  114. package/dist/components/json/json_view.module.js +41 -0
  115. package/dist/components/json/json_view_state.d.ts +14 -0
  116. package/dist/components/json/json_view_state.js +32 -0
  117. package/dist/components/json/unique_key.d.ts +1 -0
  118. package/dist/components/json/unique_key.js +8 -0
  119. package/dist/components/keyvalue_list.d.ts +25 -0
  120. package/dist/components/keyvalue_list.js +106 -0
  121. package/dist/components/keyvalue_list.module.js +15 -0
  122. package/dist/components/name_input.d.ts +12 -0
  123. package/dist/components/name_input.js +63 -0
  124. package/dist/components/overlay.d.ts +53 -0
  125. package/dist/components/overlay.js +183 -0
  126. package/dist/components/overlay.module.js +32 -0
  127. package/dist/components/panel_resize_handle.d.ts +12 -0
  128. package/dist/components/panel_resize_handle.js +39 -0
  129. package/dist/components/portal.d.ts +8 -0
  130. package/dist/components/portal.js +53 -0
  131. package/dist/components/progress_bar.d.ts +7 -0
  132. package/dist/components/progress_bar.js +21 -0
  133. package/dist/components/progress_bar.module.js +3 -0
  134. package/dist/components/query_history_viewer.d.ts +31 -0
  135. package/dist/components/query_history_viewer.js +271 -0
  136. package/dist/components/query_history_viewer.module.js +7 -0
  137. package/dist/components/query_profile/engine_profile_view.d.ts +19 -0
  138. package/dist/components/query_profile/engine_profile_view.js +94 -0
  139. package/dist/components/query_profile/numeric_limits.d.ts +1 -0
  140. package/dist/components/query_profile/numeric_limits.js +2 -0
  141. package/dist/components/query_profile/profile_execution_controller.d.ts +12 -0
  142. package/dist/components/query_profile/profile_execution_controller.js +44 -0
  143. package/dist/components/query_profile/profile_fit.d.ts +24 -0
  144. package/dist/components/query_profile/profile_fit.js +22 -0
  145. package/dist/components/query_profile/profile_navigation.d.ts +3 -0
  146. package/dist/components/query_profile/profile_navigation.js +34 -0
  147. package/dist/components/query_profile/profile_scene.d.ts +64 -0
  148. package/dist/components/query_profile/profile_scene.js +422 -0
  149. package/dist/components/query_profile/query_profile_view.d.ts +36 -0
  150. package/dist/components/query_profile/query_profile_view.js +953 -0
  151. package/dist/components/query_profile/query_profile_view.module.js +23 -0
  152. package/dist/components/query_progress/query_profile_overlay.d.ts +7 -0
  153. package/dist/components/query_progress/query_profile_overlay.js +67 -0
  154. package/dist/components/query_progress/query_profile_overlay.module.js +6 -0
  155. package/dist/components/query_progress/query_progress_panel.d.ts +14 -0
  156. package/dist/components/query_progress/query_progress_panel.js +255 -0
  157. package/dist/components/query_progress/query_progress_panel.module.js +10 -0
  158. package/dist/components/query_result/cell_detail_overlay.d.ts +34 -0
  159. package/dist/components/query_result/cell_detail_overlay.js +277 -0
  160. package/dist/components/query_result/cell_detail_overlay.module.js +21 -0
  161. package/dist/components/query_result/query_result_action_menu.d.ts +12 -0
  162. package/dist/components/query_result/query_result_action_menu.js +62 -0
  163. package/dist/components/query_result/query_result_action_menu.module.js +2 -0
  164. package/dist/components/query_result/query_result_details.d.ts +17 -0
  165. package/dist/components/query_result/query_result_details.js +46 -0
  166. package/dist/components/query_result/query_result_details.module.js +5 -0
  167. package/dist/components/query_result/query_result_download_button.d.ts +8 -0
  168. package/dist/components/query_result/query_result_download_button.js +38 -0
  169. package/dist/components/query_result/query_result_header.d.ts +21 -0
  170. package/dist/components/query_result/query_result_header.js +72 -0
  171. package/dist/components/query_result/query_result_header.module.js +3 -0
  172. package/dist/components/query_result/query_result_search_controls.d.ts +12 -0
  173. package/dist/components/query_result/query_result_search_controls.js +141 -0
  174. package/dist/components/query_result/query_result_search_controls.module.js +7 -0
  175. package/dist/components/query_result/query_result_toolbar.d.ts +21 -0
  176. package/dist/components/query_result/query_result_toolbar.js +74 -0
  177. package/dist/components/query_result/result_table_overlay.d.ts +9 -0
  178. package/dist/components/query_result/result_table_overlay.js +73 -0
  179. package/dist/components/query_result/result_table_overlay.module.js +6 -0
  180. package/dist/components/query_result/use_query_result_search.d.ts +8 -0
  181. package/dist/components/query_result/use_query_result_search.js +28 -0
  182. package/dist/components/segmented_control.d.ts +58 -0
  183. package/dist/components/segmented_control.js +116 -0
  184. package/dist/components/segmented_control.module.js +17 -0
  185. package/dist/components/separator.d.ts +21 -0
  186. package/dist/components/separator.js +79 -0
  187. package/dist/components/separator.module.js +7 -0
  188. package/dist/components/sheet.d.ts +11 -0
  189. package/dist/components/sheet.js +65 -0
  190. package/dist/components/sheet.module.js +7 -0
  191. package/dist/components/size_observer.d.ts +7 -0
  192. package/dist/components/size_observer.js +57 -0
  193. package/dist/components/skeleton.d.ts +2 -0
  194. package/dist/components/skeleton.js +14 -0
  195. package/dist/components/skeleton.module.js +2 -0
  196. package/dist/components/spinners.d.ts +8 -0
  197. package/dist/components/spinners.js +33 -0
  198. package/dist/components/spinners.module.js +8 -0
  199. package/dist/components/status_indicator.d.ts +36 -0
  200. package/dist/components/status_indicator.js +182 -0
  201. package/dist/components/status_indicator.module.js +3 -0
  202. package/dist/components/symbol_icon.d.ts +65 -0
  203. package/dist/components/symbol_icon.js +213 -0
  204. package/dist/components/tab_header.d.ts +11 -0
  205. package/dist/components/tab_header.js +55 -0
  206. package/dist/components/tab_header.module.js +7 -0
  207. package/dist/components/tag.d.ts +10 -0
  208. package/dist/components/tag.js +17 -0
  209. package/dist/components/tag.module.js +4 -0
  210. package/dist/components/text_field.d.ts +44 -0
  211. package/dist/components/text_field.js +159 -0
  212. package/dist/components/text_field.module.js +15 -0
  213. package/dist/components/text_input.d.ts +25 -0
  214. package/dist/components/text_input.js +90 -0
  215. package/dist/components/text_input.module.js +13 -0
  216. package/dist/components/text_input_action.d.ts +19 -0
  217. package/dist/components/text_input_action.js +33 -0
  218. package/dist/components/text_input_action.module.js +2 -0
  219. package/dist/components/toggle_switch.d.ts +7 -0
  220. package/dist/components/toggle_switch.js +22 -0
  221. package/dist/components/toggle_switch.module.js +6 -0
  222. package/dist/components/tooltip.d.ts +22 -0
  223. package/dist/components/tooltip.js +139 -0
  224. package/dist/components/tooltip.module.js +2 -0
  225. package/dist/components/tree_entry.d.ts +17 -0
  226. package/dist/components/tree_entry.js +48 -0
  227. package/dist/components/tree_entry.module.js +9 -0
  228. package/dist/components/value_list.d.ts +17 -0
  229. package/dist/components/value_list.js +70 -0
  230. package/dist/components/value_list.module.js +8 -0
  231. package/dist/components/vegalite_chart.d.ts +16 -0
  232. package/dist/components/vegalite_chart.js +149 -0
  233. package/dist/components/vegalite_chart.module.js +3 -0
  234. package/dist/components/vegalite_view.d.ts +26 -0
  235. package/dist/components/vegalite_view.js +239 -0
  236. package/dist/components/vegalite_view.module.js +5 -0
  237. package/dist/components/vertical_scroll_shadows.d.ts +14 -0
  238. package/dist/components/vertical_scroll_shadows.js +55 -0
  239. package/dist/components/vertical_scroll_shadows.module.js +5 -0
  240. package/dist/components/vertical_split.d.ts +15 -0
  241. package/dist/components/vertical_split.js +112 -0
  242. package/dist/components/vertical_split.module.js +5 -0
  243. package/dist/components/vertical_tabs.d.ts +36 -0
  244. package/dist/components/vertical_tabs.js +169 -0
  245. package/dist/components/vertical_tabs.module.js +23 -0
  246. package/dist/components/visualization/capped_rows.d.ts +9 -0
  247. package/dist/components/visualization/capped_rows.js +23 -0
  248. package/dist/components/visualization/capped_rows.module.js +3 -0
  249. package/dist/components/visualization/chart_download_button.d.ts +12 -0
  250. package/dist/components/visualization/chart_download_button.js +41 -0
  251. package/dist/components/visualization/kpi_view.d.ts +10 -0
  252. package/dist/components/visualization/kpi_view.js +215 -0
  253. package/dist/components/visualization/kpi_view.module.js +17 -0
  254. package/dist/components/visualization/markdown_view.d.ts +17 -0
  255. package/dist/components/visualization/markdown_view.js +154 -0
  256. package/dist/components/visualization/markdown_view.module.js +4 -0
  257. package/dist/components/visualization/result_rows.d.ts +17 -0
  258. package/dist/components/visualization/result_rows.js +82 -0
  259. package/dist/components/visualization/vegalite_preview.d.ts +8 -0
  260. package/dist/components/visualization/vegalite_preview.js +17 -0
  261. package/dist/components/visualization/vegalite_preview.module.js +2 -0
  262. package/dist/components/visualization/visualization_dispatch.d.ts +13 -0
  263. package/dist/components/visualization/visualization_dispatch.js +40 -0
  264. package/dist/components/visualization/visualization_panel.d.ts +10 -0
  265. package/dist/components/visualization/visualization_panel.js +36 -0
  266. package/dist/components/visualization/visualization_panel.module.js +3 -0
  267. package/dist/dom/anchored_position.d.ts +42 -0
  268. package/dist/dom/anchored_position.js +255 -0
  269. package/dist/dom/app_host.d.ts +2 -0
  270. package/dist/dom/app_host.js +7 -0
  271. package/dist/dom/calm_frames.d.ts +29 -0
  272. package/dist/dom/calm_frames.js +120 -0
  273. package/dist/dom/classnames.d.ts +8 -0
  274. package/dist/dom/classnames.js +20 -0
  275. package/dist/dom/download_file.d.ts +1 -0
  276. package/dist/dom/download_file.js +12 -0
  277. package/dist/dom/focus.d.ts +29 -0
  278. package/dist/dom/focus.js +84 -0
  279. package/dist/dom/graph_edges.d.ts +53 -0
  280. package/dist/dom/graph_edges.js +450 -0
  281. package/dist/dom/key_events.d.ts +9 -0
  282. package/dist/dom/key_events.js +33 -0
  283. package/dist/dom/media_query.d.ts +5 -0
  284. package/dist/dom/media_query.js +18 -0
  285. package/dist/dom/outside_click.d.ts +8 -0
  286. package/dist/dom/outside_click.js +32 -0
  287. package/dist/dom/rerender_ref.d.ts +2 -0
  288. package/dist/dom/rerender_ref.js +11 -0
  289. package/dist/dom/row_context_menu.d.ts +7 -0
  290. package/dist/dom/row_context_menu.js +32 -0
  291. package/dist/dom/scrollbar.d.ts +3 -0
  292. package/dist/dom/scrollbar.js +23 -0
  293. package/dist/format/format.d.ts +11 -0
  294. package/dist/format/format.js +72 -0
  295. package/dist/format/query_progress_format.d.ts +17 -0
  296. package/dist/format/query_progress_format.js +69 -0
  297. package/dist/format/time_format.d.ts +5 -0
  298. package/dist/format/time_format.js +45 -0
  299. package/dist/hooks.d.ts +72 -0
  300. package/dist/hooks.js +305 -0
  301. package/dist/host.d.ts +10 -0
  302. package/dist/host.js +12 -0
  303. package/dist/logger.d.ts +4 -0
  304. package/dist/logger.js +13 -0
  305. package/dist/models/computation_model.d.ts +14 -0
  306. package/dist/models/computation_model.js +27 -0
  307. package/dist/models/query_model.d.ts +12 -0
  308. package/dist/models/query_model.js +27 -0
  309. package/dist/models/script_model.d.ts +17 -0
  310. package/dist/models/script_model.js +59 -0
  311. package/dist/platform/content_length.d.ts +1 -0
  312. package/dist/platform/content_length.js +7 -0
  313. package/dist/platform/core_provider.d.ts +18 -0
  314. package/dist/platform/core_provider.js +106 -0
  315. package/dist/platform/embedded_database_provider.d.ts +19 -0
  316. package/dist/platform/embedded_database_provider.js +53 -0
  317. package/dist/platform/page_runtime.d.ts +3 -0
  318. package/dist/platform/page_runtime.js +29 -0
  319. package/dist/style.css +4386 -0
  320. package/dist/svg_symbols.d.ts +2 -0
  321. package/dist/svg_symbols.js +2 -0
  322. package/dist/symbols.svg +1197 -0
  323. package/dist/theme/color_scheme.d.ts +4 -0
  324. package/dist/theme/color_scheme.js +28 -0
  325. package/dist/theme/xcode_palette.d.ts +22 -0
  326. package/dist/theme/xcode_palette.js +4 -0
  327. package/dist/theme/xcode_palettes.js +41 -0
  328. package/dist/utils/plan_engine.d.ts +2 -0
  329. package/dist/utils/plan_engine.js +13 -0
  330. package/dist/vegalite/vegalite_check.d.ts +1 -0
  331. package/dist/vegalite/vegalite_check.js +7 -0
  332. package/dist/vegalite/vegalite_crossfilter.d.ts +54 -0
  333. package/dist/vegalite/vegalite_crossfilter.js +187 -0
  334. package/dist/vegalite/vegalite_image.d.ts +14 -0
  335. package/dist/vegalite/vegalite_image.js +28 -0
  336. package/dist/vegalite/vegalite_loader.d.ts +7 -0
  337. package/dist/vegalite/vegalite_loader.js +15 -0
  338. package/dist/vegalite/vegalite_rows.d.ts +3 -0
  339. package/dist/vegalite/vegalite_rows.js +23 -0
  340. package/dist/vegalite/vegalite_theme.d.ts +13 -0
  341. package/dist/vegalite/vegalite_theme.js +141 -0
  342. package/fonts/InstrumentSans-Bold.ttf +0 -0
  343. package/fonts/InstrumentSans-Medium.ttf +0 -0
  344. package/fonts/InstrumentSans-OFL.txt +93 -0
  345. package/fonts/InstrumentSans-Regular.ttf +0 -0
  346. package/fonts/InstrumentSans-SemiBold.ttf +0 -0
  347. package/fonts/JetBrainsMono-Bold.ttf +0 -0
  348. package/fonts/JetBrainsMono-Medium.ttf +0 -0
  349. package/fonts/JetBrainsMono-OFL.txt +93 -0
  350. package/fonts/JetBrainsMono-Regular.ttf +0 -0
  351. package/fonts/JetBrainsMono-SemiBold.ttf +0 -0
  352. package/fonts/fonts.css +61 -0
  353. package/package.json +403 -4
  354. package/styles/colors.css +110 -0
  355. package/styles/flavors/dbcom.css +48 -0
  356. package/styles/tokens.css +192 -0
@@ -0,0 +1,415 @@
1
+ import { data_grid, grid_container, more_rows, more_rows_clickable, root, root_compact, root_more_rows } from "./data_table.module.js";
2
+ import { resolveComputationTables, useComputationTables } from "./computation_tables.js";
3
+ import { TableColumnHeader } from "./data_table_cell.js";
4
+ import { classNames } from "../../dom/classnames.js";
5
+ import { computeTableLayout } from "./data_table_layout.js";
6
+ import { useCrossFilters } from "./use_cross_filters.js";
7
+ import { useObservedSize } from "../size_observer.js";
8
+ import { useLogger } from "../../logger.js";
9
+ import { DataCell } from "./data_table_cell_data.js";
10
+ import { useScrollbarHeight, useScrollbarsOverlay } from "../../dom/scrollbar.js";
11
+ import { useMediaQuery } from "../../dom/media_query.js";
12
+ import { useDataTableOrdering } from "./data_table_ordering.js";
13
+ import { useDataTablePortalContainers } from "./data_table_portals.js";
14
+ import { useDataTableColumnResize } from "./data_table_column_resize.js";
15
+ import { DataTableStickyColumn, DataTableStickyHeaders } from "./data_table_sticky_views.js";
16
+ import { DataTableFocusStore } from "./data_table_focus.js";
17
+ import { useDataTableWindow } from "./data_table_window.js";
18
+ import { DataTableRowDetail, rowDetailOf } from "./data_table_row_detail.js";
19
+ import { peekFormat } from "./format_peek.js";
20
+ import * as React from "react";
21
+ import { jsx, jsxs } from "react/jsx-runtime";
22
+ import { stringifyError } from "@akohn/dashql/platform/logger/logger";
23
+ import { resolveSummaries } from "@akohn/dashql/platform/compute/computation_types";
24
+ import * as arrow from "apache-arrow";
25
+ import { Grid, useGridCallbackRef } from "react-window";
26
+ import { ArrowTableFormatter, arrowValueToJson, isArrowStructuredType } from "@akohn/dashql/platform/compute/arrow_formatter";
27
+ var MIN_GRID_HEIGHT = 200;
28
+ var MIN_GRID_WIDTH = 100;
29
+ var COLUMN_HEADER_HEIGHT = 32;
30
+ var COLUMN_HEADER_PLOTS_HEIGHT = 76;
31
+ var COLUMN_HEADER_PLOTS_COLLAPSED_HEIGHT = 18;
32
+ var ROW_HEIGHT = 26;
33
+ var TOUCH_ROW_HEIGHT = 36;
34
+ function useDataTableRowHeight() {
35
+ return useMediaQuery("(pointer: coarse)") ? 36 : 26;
36
+ }
37
+ var MORE_ROWS_HEIGHT = 24;
38
+ var GRID_OVERSCAN_COUNT = 10;
39
+ function computeGridHeight(baseRowCount, visibleRowCount, headerHeight, scrollbarHeight, fitHeight, maxHeight, measuredHeight = 0, maxRows, rowHeight = 26) {
40
+ const contentHeight = headerHeight + visibleRowCount * rowHeight + scrollbarHeight;
41
+ if (fitHeight) return Math.min(headerHeight + (maxRows == null ? baseRowCount : Math.min(baseRowCount, maxRows)) * rowHeight + scrollbarHeight, maxHeight ?? Number.POSITIVE_INFINITY);
42
+ return maxRows != null ? contentHeight : Math.max(measuredHeight, MIN_GRID_HEIGHT);
43
+ }
44
+ function fittingRowCount(height, rowHeight = 26) {
45
+ return Math.max(1, Math.ceil((height - 32) / rowHeight));
46
+ }
47
+ var DataTable = React.memo((props) => {
48
+ const tables = useComputationTables(props.model.computation, props.model.tables);
49
+ if (tables.dataTable == null) return null;
50
+ return /* @__PURE__ */ jsx(DataTableGrid, {
51
+ ...props,
52
+ dataTable: tables.dataTable,
53
+ matchingRows: tables.matchingRows
54
+ });
55
+ });
56
+ function DataTableGrid(props) {
57
+ const logger = useLogger();
58
+ const computationState = props.model.computation;
59
+ const summaryTables = props.model.tables;
60
+ const dispatchComputation = props.model.dispatch;
61
+ const dataTable = props.dataTable;
62
+ const matchingRows = props.matchingRows;
63
+ const { tableAggregation, columnAggregates, filteredColumnAggregates, columnGroups } = computationState;
64
+ const dataTableHandle = computationState.dataTable;
65
+ const summaries = React.useMemo(() => resolveSummaries({
66
+ dataTable: dataTableHandle,
67
+ tableAggregation,
68
+ columnAggregates,
69
+ filteredColumnAggregates,
70
+ columnGroups
71
+ }, summaryTables, logger), [
72
+ summaryTables,
73
+ logger,
74
+ tableAggregation,
75
+ columnAggregates,
76
+ filteredColumnAggregates,
77
+ columnGroups,
78
+ dataTableHandle
79
+ ]);
80
+ const [gridApi, setGridApi] = useGridCallbackRef(null);
81
+ const gridContainerElement = React.useRef(null);
82
+ const gridContainerSize = useObservedSize(gridContainerElement);
83
+ const gridContainerWidth = Math.max(gridContainerSize?.width ?? 0, MIN_GRID_WIDTH);
84
+ const columnHeader = props.columnHeader ?? TableColumnHeader.OnlyColumnName;
85
+ const [plotsCollapsed, setPlotsCollapsed] = React.useState(false);
86
+ const togglePlots = React.useCallback(() => setPlotsCollapsed((c) => !c), []);
87
+ const plotsHeight = plotsCollapsed ? COLUMN_HEADER_PLOTS_COLLAPSED_HEIGHT : COLUMN_HEADER_PLOTS_HEIGHT;
88
+ const [renderedCells, setRenderedCells] = React.useState({
89
+ rowStart: 0,
90
+ rowStop: 0,
91
+ columnStart: 0,
92
+ columnStop: 0
93
+ });
94
+ const { window: rowWindow, rows: totalRowCount, error: rowsError, retry: retryRows } = useDataTableWindow(props.model, renderedCells.rowStart, renderedCells.rowStop);
95
+ const readRows = props.model.readRows;
96
+ const rowHeight = useDataTableRowHeight();
97
+ const dataRowCount = props.maxRows != null ? Math.min(totalRowCount, props.maxRows) : totalRowCount;
98
+ const hiddenRowCount = totalRowCount - dataRowCount;
99
+ const showFewerRows = hiddenRowCount === 0 ? props.onShowFewerRows : void 0;
100
+ const footerRowCount = (rowsError != null ? 1 : 0) + (hiddenRowCount > 0 ? 1 : 0) + (showFewerRows != null ? 1 : 0);
101
+ const hasFooterRow = footerRowCount > 0;
102
+ const headerRowCount = columnHeader === TableColumnHeader.WithColumnPlots ? 2 : 1;
103
+ const visibleColumnGroups = React.useMemo(() => {
104
+ const matches = computationState.columnSearch.matchingColumnGroups;
105
+ return matches == null ? null : new Set(matches);
106
+ }, [computationState.columnSearch.matchingColumnGroups]);
107
+ const searchColumnIndexByGroup = React.useMemo(() => new Map(computationState.searchColumns.map((column) => [column.columnGroupIdx, column.columnIdx])), [computationState.searchColumns]);
108
+ const [resizedColumnWidths, setResizedColumnWidths] = React.useState(() => /* @__PURE__ */ new Map());
109
+ const schema = dataTable.schema;
110
+ const gridLayout = React.useMemo(() => computeTableLayout({
111
+ columnGroups,
112
+ schema
113
+ }, headerRowCount, gridContainerWidth, visibleColumnGroups, resizedColumnWidths), [
114
+ columnGroups,
115
+ schema,
116
+ gridContainerWidth,
117
+ headerRowCount,
118
+ visibleColumnGroups,
119
+ resizedColumnWidths
120
+ ]);
121
+ const getColumnWidth = React.useCallback((column) => gridLayout.columnXOffsets[column + 1] - gridLayout.columnXOffsets[column], [gridLayout]);
122
+ const { crossFilters, histogramFilter, mostFrequentValueFilter, requestFilteredColumnAggregation } = useCrossFilters(computationState, dispatchComputation, gridLayout);
123
+ const { orderByColumn, getSortDirection } = useDataTableOrdering(computationState, dataTable, dispatchComputation);
124
+ const [focusStore] = React.useState(() => new DataTableFocusStore());
125
+ const onMouseEnterCell = React.useCallback((event) => {
126
+ const tableRow = Number.parseInt(event.currentTarget.dataset["tableRow"]);
127
+ const tableCol = Number.parseInt(event.currentTarget.dataset["tableCol"]);
128
+ focusStore.setFocus(tableRow, tableCol);
129
+ }, [focusStore]);
130
+ const onMouseLeaveCell = React.useCallback((_event) => {
131
+ focusStore.setFocus(null, null);
132
+ }, [focusStore]);
133
+ const [cellDetail, setCellDetail] = React.useState(null);
134
+ const onClickCell = React.useCallback((event) => {
135
+ const visibleRow = Number.parseInt(event.currentTarget.dataset["visibleRow"]);
136
+ const fieldId = Number.parseInt(event.currentTarget.dataset["tableCol"]);
137
+ if (rowWindow == null) return;
138
+ const detail = cellDetailOf(rowWindow.table, rowWindow.formatter, visibleRow - rowWindow.offset, visibleRow, fieldId);
139
+ if (detail != null) setCellDetail(detail);
140
+ }, [rowWindow]);
141
+ const onNavigateCell = React.useCallback((delta) => {
142
+ const prev = cellDetail;
143
+ if (prev == null) return;
144
+ const visibleRow = prev.visibleRow + delta;
145
+ if (visibleRow < 0 || visibleRow >= dataRowCount) return;
146
+ const detail = rowWindow == null ? null : cellDetailOf(rowWindow.table, rowWindow.formatter, visibleRow - rowWindow.offset, visibleRow, prev.fieldId);
147
+ if (detail != null) {
148
+ setCellDetail(detail);
149
+ return;
150
+ }
151
+ readRows(visibleRow, 1).then((result) => {
152
+ const formatter = new ArrowTableFormatter(result.table.schema, result.table.batches, logger);
153
+ const read = cellDetailOf(result.table, formatter, visibleRow - result.offset, visibleRow, prev.fieldId);
154
+ if (read != null) setCellDetail((current) => current === prev ? read : current);
155
+ }, (error) => logger.warn("Failed to read the row of a cell", { error: stringifyError(error) }, "data_table"));
156
+ }, [
157
+ cellDetail,
158
+ rowWindow,
159
+ readRows,
160
+ dataRowCount,
161
+ logger
162
+ ]);
163
+ const [rowDetail, setRowDetail] = React.useState(null);
164
+ const showRow = React.useCallback((visibleRow) => {
165
+ if (visibleRow < 0 || visibleRow >= dataRowCount) return;
166
+ const detail = rowWindow == null ? null : rowDetailOf(rowWindow.table, rowWindow.formatter, gridLayout, visibleRow - rowWindow.offset, visibleRow);
167
+ if (detail != null) {
168
+ setRowDetail(detail);
169
+ return;
170
+ }
171
+ readRows(visibleRow, 1).then((result) => {
172
+ const formatter = new ArrowTableFormatter(result.table.schema, result.table.batches, logger);
173
+ const read = rowDetailOf(result.table, formatter, gridLayout, visibleRow - result.offset, visibleRow);
174
+ if (read != null) setRowDetail(read);
175
+ }, (error) => logger.warn("Failed to read a row", { error: stringifyError(error) }, "data_table"));
176
+ }, [
177
+ rowWindow,
178
+ gridLayout,
179
+ readRows,
180
+ dataRowCount,
181
+ logger
182
+ ]);
183
+ const onClickRowHeader = React.useCallback((event) => {
184
+ showRow(Number.parseInt(event.currentTarget.dataset["visibleRow"]));
185
+ }, [showRow]);
186
+ const navigateRow = React.useCallback((delta) => {
187
+ if (rowDetail != null) showRow(rowDetail.visibleRow + delta);
188
+ }, [rowDetail, showRow]);
189
+ const gridData = React.useMemo(() => ({
190
+ window: rowWindow,
191
+ gridLayout,
192
+ hideRowHeader: true,
193
+ columnGroups: computationState.columnGroups,
194
+ onMouseEnter: onMouseEnterCell,
195
+ onMouseLeave: onMouseLeaveCell,
196
+ onClick: onClickCell,
197
+ onClickRowHeader,
198
+ focus: focusStore,
199
+ rightmostVisibleColumn: gridLayout.columnCount - 1,
200
+ matchingRows,
201
+ searchColumnIndexByGroup,
202
+ rowsFailed: rowsError != null
203
+ }), [
204
+ computationState.columnGroups,
205
+ rowWindow,
206
+ rowsError,
207
+ gridLayout,
208
+ matchingRows,
209
+ searchColumnIndexByGroup,
210
+ focusStore,
211
+ onMouseEnterCell,
212
+ onMouseLeaveCell,
213
+ onClickCell,
214
+ onClickRowHeader
215
+ ]);
216
+ const onCellsRendered = React.useCallback((_visibleCells, allCells) => {
217
+ setRenderedCells((prev) => {
218
+ if (prev.rowStart === allCells.rowStartIndex && prev.rowStop === allCells.rowStopIndex && prev.columnStart === allCells.columnStartIndex && prev.columnStop === allCells.columnStopIndex) return prev;
219
+ return {
220
+ rowStart: allCells.rowStartIndex,
221
+ rowStop: allCells.rowStopIndex,
222
+ columnStart: allCells.columnStartIndex,
223
+ columnStop: allCells.columnStopIndex
224
+ };
225
+ });
226
+ }, []);
227
+ const totalColumnsWidth = gridLayout.columnXOffsets[gridLayout.columnCount] ?? 0;
228
+ const firstColumnWidth = getColumnWidth(0);
229
+ const headerHeight = columnHeader === TableColumnHeader.WithColumnPlots ? 32 + plotsHeight : 32;
230
+ const scrollbarHeight = useScrollbarHeight();
231
+ const scrollbarsOverlay = useScrollbarsOverlay();
232
+ const horizontalScrollbarHeight = totalColumnsWidth > gridContainerWidth && !(scrollbarsOverlay && hasFooterRow) ? scrollbarHeight : 0;
233
+ const gridContainerHeight = props.fillHeight ? gridContainerSize?.height ?? 0 : computeGridHeight(totalRowCount, dataRowCount, headerHeight, horizontalScrollbarHeight, props.fitHeight ?? false, props.maxHeight, gridContainerSize?.height ?? 0, props.maxRows, rowHeight);
234
+ const firstRenderedColumn = gridLayout.columnCount > 1 ? Math.max(1, Math.min(renderedCells.columnStart, gridLayout.columnCount - 1)) : 1;
235
+ const lastRenderedColumn = gridLayout.columnCount > 1 ? Math.max(firstRenderedColumn, Math.min(renderedCells.columnStop, gridLayout.columnCount - 1)) : 0;
236
+ const renderedColumnCount = Math.max(0, lastRenderedColumn - firstRenderedColumn + 1);
237
+ const leftHeaderSpacerWidth = gridLayout.columnCount > 1 ? gridLayout.columnXOffsets[firstRenderedColumn] - firstColumnWidth : 0;
238
+ const rightHeaderSpacerWidth = lastRenderedColumn > 0 ? totalColumnsWidth - gridLayout.columnXOffsets[lastRenderedColumn + 1] : 0;
239
+ const nameCellProps = React.useMemo(() => ({
240
+ table: dataTable,
241
+ gridLayout,
242
+ dataFrame: computationState.dataFrame,
243
+ rightmostVisibleColumn: gridLayout.columnCount - 1,
244
+ getSortDirection,
245
+ onOrderByColumn: orderByColumn,
246
+ onShowTable: props.onShowTable
247
+ }), [
248
+ dataTable,
249
+ gridLayout,
250
+ computationState.dataFrame,
251
+ getSortDirection,
252
+ orderByColumn,
253
+ props.onShowTable
254
+ ]);
255
+ const selectionEpoch = computationState.filterTable?.version ?? computationState.version;
256
+ const dataSearchRequestId = computationState.dataSearchTable?.requestId ?? null;
257
+ const plotCellProps = React.useMemo(() => ({
258
+ gridLayout,
259
+ columnGroups: computationState.columnGroups,
260
+ columnAggregations: summaries.columnAggregates,
261
+ columnAggregationTasks: computationState.tasks.columnAggregationTasks,
262
+ filteredColumnAggregations: summaries.filteredColumnAggregates,
263
+ filteredColumnAggregationTasks: computationState.tasks.filteredColumnAggregationTasks,
264
+ filteredColumnAggregationOutdated: computationState.filteredColumnAggregatesOutdated,
265
+ tableAggregation: summaries.tableAggregation,
266
+ selectionEpoch,
267
+ dataSearchRequestId,
268
+ crossFilters,
269
+ rightmostVisibleColumn: gridLayout.columnCount - 1,
270
+ onRequestFilteredColumnAggregation: requestFilteredColumnAggregation,
271
+ onHistogramFilter: histogramFilter,
272
+ onMostFrequentValueFilter: mostFrequentValueFilter
273
+ }), [
274
+ gridLayout,
275
+ computationState.columnGroups,
276
+ summaries,
277
+ computationState.tasks.columnAggregationTasks,
278
+ computationState.tasks.filteredColumnAggregationTasks,
279
+ computationState.filteredColumnAggregatesOutdated,
280
+ selectionEpoch,
281
+ dataSearchRequestId,
282
+ crossFilters,
283
+ requestFilteredColumnAggregation,
284
+ histogramFilter,
285
+ mostFrequentValueFilter
286
+ ]);
287
+ const portalContainers = useDataTablePortalContainers(gridApi);
288
+ const columnResize = useDataTableColumnResize(gridApi, gridLayout, dataTable, setResizedColumnWidths);
289
+ const totalDataHeight = dataRowCount * rowHeight;
290
+ return /* @__PURE__ */ jsxs("div", {
291
+ className: classNames(root, props.className, {
292
+ [root_compact]: props.compact,
293
+ [root_more_rows]: hasFooterRow
294
+ }),
295
+ "data-electron-drag-region": "false",
296
+ style: { ...props.fitHeight ? { height: gridContainerHeight + footerRowCount * 23 } : {} },
297
+ children: [
298
+ /* @__PURE__ */ jsxs("div", {
299
+ className: grid_container,
300
+ ref: gridContainerElement,
301
+ ...columnResize,
302
+ children: [
303
+ /* @__PURE__ */ jsx(Grid, {
304
+ gridRef: setGridApi,
305
+ style: {
306
+ width: gridContainerWidth,
307
+ height: gridContainerHeight,
308
+ overflowY: props.maxRows != null ? "hidden" : void 0
309
+ },
310
+ columnCount: gridLayout.columnCount,
311
+ columnWidth: getColumnWidth,
312
+ rowCount: dataRowCount,
313
+ rowHeight,
314
+ onCellsRendered,
315
+ overscanCount: GRID_OVERSCAN_COUNT,
316
+ cellComponent: DataCell,
317
+ cellProps: gridData,
318
+ className: data_grid
319
+ }),
320
+ /* @__PURE__ */ jsx(DataTableStickyHeaders, {
321
+ container: portalContainers?.header ?? null,
322
+ totalWidth: totalColumnsWidth,
323
+ headerHeight,
324
+ firstColumnWidth,
325
+ leftSpacerWidth: leftHeaderSpacerWidth,
326
+ rightSpacerWidth: rightHeaderSpacerWidth,
327
+ firstRenderedColumn,
328
+ renderedColumnCount,
329
+ getColumnWidth,
330
+ columnHeader,
331
+ plotsHeight,
332
+ plotsCollapsed,
333
+ onTogglePlots: togglePlots,
334
+ nameCellProps,
335
+ plotCellProps
336
+ }),
337
+ /* @__PURE__ */ jsx(DataTableStickyColumn, {
338
+ container: portalContainers?.data ?? null,
339
+ rowHeight,
340
+ firstColumnWidth,
341
+ totalDataHeight,
342
+ startRow: Math.max(0, renderedCells.rowStart),
343
+ stopRow: Math.min(dataRowCount - 1, renderedCells.rowStop),
344
+ gridData
345
+ })
346
+ ]
347
+ }),
348
+ rowsError != null && /* @__PURE__ */ jsx(TableFooterRow, {
349
+ label: `Failed to read the rows: ${rowsError}. Click to try again.`,
350
+ onClick: retryRows,
351
+ testId: "data-table-rows-failed"
352
+ }),
353
+ hiddenRowCount > 0 && /* @__PURE__ */ jsx(TableFooterRow, {
354
+ label: `${hiddenRowCount.toLocaleString()} more ${hiddenRowCount === 1 ? "row" : "rows"}`,
355
+ onClick: props.onShowMoreRows ?? props.onShowTable,
356
+ testId: "data-table-more-rows"
357
+ }),
358
+ showFewerRows != null && /* @__PURE__ */ jsx(TableFooterRow, {
359
+ label: "Show fewer rows",
360
+ onClick: showFewerRows,
361
+ testId: "data-table-fewer-rows"
362
+ }),
363
+ props.cellDetail && /* @__PURE__ */ jsx(props.cellDetail, {
364
+ isOpen: cellDetail != null,
365
+ onClose: () => setCellDetail(null),
366
+ formattedValue: cellDetail?.formattedValue ?? null,
367
+ structuredValue: cellDetail?.structuredValue ?? null,
368
+ columnName: cellDetail?.columnName ?? null,
369
+ dataRow: cellDetail?.visibleRow ?? 0,
370
+ maxRow: dataRowCount - 1,
371
+ onNavigate: onNavigateCell
372
+ }),
373
+ rowDetail != null && /* @__PURE__ */ jsx(DataTableRowDetail, {
374
+ detail: rowDetail,
375
+ rowCount: dataRowCount,
376
+ onNavigate: navigateRow,
377
+ onClose: () => setRowDetail(null)
378
+ })
379
+ ]
380
+ });
381
+ }
382
+ function cellDetailOf(table, formatter, row, visibleRow, fieldId) {
383
+ if (row < 0 || row >= table.numRows) return null;
384
+ const field = table.schema.fields[fieldId];
385
+ if (field == null) return null;
386
+ const isText = field.type.typeId === arrow.Type.Utf8 || field.type.typeId === arrow.Type.LargeUtf8;
387
+ const isStructured = isArrowStructuredType(field.type);
388
+ if (!isText && !isStructured) return null;
389
+ const formattedValue = formatter.getValue(row, fieldId);
390
+ const rawValue = isStructured ? table.getChildAt(fieldId)?.get(row) : null;
391
+ return {
392
+ visibleRow,
393
+ fieldId,
394
+ formattedValue,
395
+ structuredValue: rawValue == null ? null : arrowValueToJson(rawValue),
396
+ columnName: field.name ?? null
397
+ };
398
+ }
399
+ function TableFooterRow(props) {
400
+ if (props.onClick == null) return /* @__PURE__ */ jsx("div", {
401
+ className: more_rows,
402
+ style: { height: MORE_ROWS_HEIGHT },
403
+ "data-testid": props.testId,
404
+ children: props.label
405
+ });
406
+ return /* @__PURE__ */ jsx("button", {
407
+ type: "button",
408
+ className: classNames(more_rows, more_rows_clickable),
409
+ style: { height: MORE_ROWS_HEIGHT },
410
+ onClick: props.onClick,
411
+ "data-testid": props.testId,
412
+ children: props.label
413
+ });
414
+ }
415
+ export { COLUMN_HEADER_HEIGHT, DataTable, ROW_HEIGHT, TOUCH_ROW_HEIGHT, TableColumnHeader, computeGridHeight, fittingRowCount, peekFormat, resolveComputationTables, useComputationTables, useDataTableRowHeight };
@@ -0,0 +1,41 @@
1
+ var root = "dashql_root_jWkKoT";
2
+ var root_more_rows = "dashql_root_more_rows_w5qlLT";
3
+ var root_compact = "dashql_root_compact_I-tzLT";
4
+ var header_cell_name = "dashql_header_cell_name_GEtQya";
5
+ var header_cell_rightmost = "dashql_header_cell_rightmost_1JWMJe";
6
+ var grid_container = "dashql_grid_container_nrAIoP";
7
+ var more_rows = "dashql_more_rows_2ng0J5";
8
+ var more_rows_clickable = "dashql_more_rows_clickable_gXnkOt";
9
+ var column_resize_hover = "dashql_column_resize_hover_k7JEK7";
10
+ var data_grid = "dashql_data_grid_qzlw9F";
11
+ var sticky_header_portal = "dashql_sticky_header_portal_e21ld5";
12
+ var sticky_column_portal = "dashql_sticky_column_portal_LsXkAX";
13
+ var sticky_column_container = "dashql_sticky_column_container_RSWgjb";
14
+ var sticky_header_container = "dashql_sticky_header_container_8nz-iC";
15
+ var sticky_header_row = "dashql_sticky_header_row_k4jXSK";
16
+ var header_cell = "dashql_header_cell_k1wD7P";
17
+ var header_cell_clickable = "dashql_header_cell_clickable_MgOuEO";
18
+ var header_cell_actions = "dashql_header_cell_actions_7ZEjUb";
19
+ var header_corner_cell = "dashql_header_corner_cell_1SM_t4";
20
+ var plots_cell = "dashql_plots_cell_tKLgvS";
21
+ var plots_cell_rightmost = "dashql_plots_cell_rightmost_Qwapbw";
22
+ var plots_empty_cell = "dashql_plots_empty_cell_uHF1JJ";
23
+ var plots_no_summary_cell = "dashql_plots_no_summary_cell_Kcn03h";
24
+ var plots_no_summary_label = "dashql_plots_no_summary_label_QMlnhw";
25
+ var plots_progress = "dashql_plots_progress_Yhk4x0";
26
+ var plots_progress_spinner = "dashql_plots_progress_spinner_n8DYbU";
27
+ var plots_toggle = "dashql_plots_toggle_3vXAdD";
28
+ var plots_collapsed_cell = "dashql_plots_collapsed_cell_Zb3ndp";
29
+ var plots_corner_cell = "dashql_plots_corner_cell_T3tfrj";
30
+ var row_header_cell = "dashql_row_header_cell_Jmi9dz";
31
+ var data_cell = "dashql_data_cell_dmjbw0";
32
+ var data_cell_null = "dashql_data_cell_null_Lo4LHV";
33
+ var data_cell_rightmost = "dashql_data_cell_rightmost_Jbu5Yi";
34
+ var data_cell_focused_primary = "dashql_data_cell_focused_primary_wYX8aJ";
35
+ var data_cell_focused_secondary = "dashql_data_cell_focused_secondary_3AdBHa";
36
+ var data_cell_search_match = "dashql_data_cell_search_match_Ypa-yr";
37
+ var data_cell_text = "dashql_data_cell_text_vnDSPE";
38
+ var format_bean = "dashql_format_bean_y1cccz";
39
+ var data_cell_skeleton = "dashql_data_cell_skeleton_VIU2XN";
40
+ var data_cell_skeleton_bar = "dashql_data_cell_skeleton_bar_fKafAg";
41
+ export { column_resize_hover, data_cell, data_cell_focused_primary, data_cell_focused_secondary, data_cell_null, data_cell_rightmost, data_cell_search_match, data_cell_skeleton, data_cell_skeleton_bar, data_cell_text, data_grid, format_bean, grid_container, header_cell, header_cell_actions, header_cell_clickable, header_cell_name, header_cell_rightmost, header_corner_cell, more_rows, more_rows_clickable, plots_cell, plots_cell_rightmost, plots_collapsed_cell, plots_corner_cell, plots_empty_cell, plots_no_summary_cell, plots_no_summary_label, plots_progress, plots_progress_spinner, plots_toggle, root, root_compact, root_more_rows, row_header_cell, sticky_column_container, sticky_column_portal, sticky_header_container, sticky_header_portal, sticky_header_row };
@@ -0,0 +1,7 @@
1
+ export { HeaderNameCell, type HeaderNameCellProps } from './data_table_cell_header_name.js';
2
+ export { HeaderPlotsCell, type HeaderPlotsCellProps } from './data_table_cell_header_plots.js';
3
+ export { DataCell, type DataCellData } from './data_table_cell_data.js';
4
+ export declare enum TableColumnHeader {
5
+ OnlyColumnName = 0,
6
+ WithColumnPlots = 1
7
+ }
@@ -0,0 +1,9 @@
1
+ import { HeaderNameCell } from "./data_table_cell_header_name.js";
2
+ import { HeaderPlotsCell } from "./data_table_cell_header_plots.js";
3
+ import { DataCell } from "./data_table_cell_data.js";
4
+ var TableColumnHeader = /* @__PURE__ */ function(TableColumnHeader) {
5
+ TableColumnHeader[TableColumnHeader["OnlyColumnName"] = 0] = "OnlyColumnName";
6
+ TableColumnHeader[TableColumnHeader["WithColumnPlots"] = 1] = "WithColumnPlots";
7
+ return TableColumnHeader;
8
+ }({});
9
+ export { DataCell, HeaderNameCell, HeaderPlotsCell, TableColumnHeader };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import type { CellComponentProps } from 'react-window';
3
+ import type { ComputationColumnGroup } from '@akohn/dashql';
4
+ import { DataTableLayout } from './data_table_layout.js';
5
+ import type { DataTableWindow } from './data_table_window.js';
6
+ import { DataTableFocusStore } from './data_table_focus.js';
7
+ export interface DataCellData {
8
+ columnGroups: ComputationColumnGroup[];
9
+ focus: DataTableFocusStore;
10
+ gridLayout: DataTableLayout;
11
+ hideRowHeader: boolean;
12
+ window: DataTableWindow | null;
13
+ rowsFailed: boolean;
14
+ rightmostVisibleColumn: number;
15
+ matchingRows: ReadonlyMap<number, number[]> | null;
16
+ searchColumnIndexByGroup: ReadonlyMap<number, number>;
17
+ onMouseEnter: (event: React.PointerEvent<HTMLDivElement>) => void;
18
+ onMouseLeave: (event: React.PointerEvent<HTMLDivElement>) => void;
19
+ onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
20
+ onClickRowHeader: (event: React.MouseEvent<HTMLDivElement>) => void;
21
+ }
22
+ export declare function DataCell(props: CellComponentProps<DataCellData>): React.ReactElement | null;
@@ -0,0 +1,103 @@
1
+ import { data_cell, data_cell_focused_primary, data_cell_focused_secondary, data_cell_null, data_cell_rightmost, data_cell_search_match, data_cell_text, format_bean, row_header_cell } from "./data_table.module.js";
2
+ import { Tag } from "../tag.js";
3
+ import { peekFormat } from "./format_peek.js";
4
+ import { CellFocus, useCellFocus } from "./data_table_focus.js";
5
+ import * as React from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import * as arrow from "apache-arrow";
8
+ import { isArrowListType } from "@akohn/dashql/platform/compute/arrow_formatter";
9
+ var MAX_CELL_TEXT_LENGTH = 256;
10
+ function truncateCellText(text) {
11
+ return text.length > MAX_CELL_TEXT_LENGTH ? `${text.slice(0, MAX_CELL_TEXT_LENGTH)}…` : text;
12
+ }
13
+ var SKELETON_PULSE_MS = 1600;
14
+ function skeletonWidth(row, column) {
15
+ return 35 + (row * 7 + column * 13) % 5 * 10;
16
+ }
17
+ function DataCell(props) {
18
+ const inLayout = props.columnIndex < props.gridLayout.arrowFieldByColumnIndex.length;
19
+ const isHiddenRowHeader = props.columnIndex === 0 && props.hideRowHeader;
20
+ const fieldId = inLayout ? props.gridLayout.arrowFieldByColumnIndex[props.columnIndex] : -1;
21
+ const rowWindow = props.window;
22
+ const windowRow = rowWindow == null ? -1 : props.rowIndex - rowWindow.offset;
23
+ const loaded = rowWindow != null && windowRow >= 0 && windowRow < rowWindow.table.numRows;
24
+ const dataRow = loaded ? rowWindow.dataRows[windowRow] : -1;
25
+ const focus = useCellFocus(props.focus, inLayout && !isHiddenRowHeader && loaded ? dataRow : -1, fieldId);
26
+ const formatted = inLayout && !isHiddenRowHeader && loaded ? rowWindow.formatter.getValue(windowRow, fieldId) : null;
27
+ const peekText = inLayout && props.columnIndex !== 0 && props.gridLayout.isTextColumn[props.columnIndex] === 1;
28
+ const peekedFormat = React.useMemo(() => peekText ? peekFormat(formatted) : null, [peekText, formatted]);
29
+ if (!inLayout) return /* @__PURE__ */ jsx("div", { style: props.style });
30
+ if (isHiddenRowHeader) return null;
31
+ if (!loaded) return /* @__PURE__ */ jsx("div", {
32
+ className: props.columnIndex == 0 ? row_header_cell : data_cell,
33
+ style: props.style,
34
+ "data-table-col": fieldId,
35
+ "data-visible-row": props.rowIndex,
36
+ "data-loading": props.rowsFailed ? void 0 : "true",
37
+ children: !props.rowsFailed && /* @__PURE__ */ jsx("span", {
38
+ className: "dashql_data_cell_skeleton_VIU2XN",
39
+ children: /* @__PURE__ */ jsx("span", {
40
+ className: "dashql_data_cell_skeleton_bar_fKafAg",
41
+ style: {
42
+ width: `${skeletonWidth(props.rowIndex, props.columnIndex)}%`,
43
+ animationDelay: `${-(performance.now() % SKELETON_PULSE_MS)}ms`
44
+ }
45
+ })
46
+ })
47
+ });
48
+ const isRowFocused = focus !== CellFocus.None;
49
+ if (props.columnIndex == 0) {
50
+ const className = isRowFocused ? `${row_header_cell} ${data_cell_focused_secondary}` : row_header_cell;
51
+ return /* @__PURE__ */ jsx("div", {
52
+ className,
53
+ style: props.style,
54
+ "data-visible-row": props.rowIndex,
55
+ "data-testid": "data-table-row-number",
56
+ title: "Show the fields of the row",
57
+ onClick: props.onClickRowHeader,
58
+ children: formatted ?? ""
59
+ });
60
+ } else {
61
+ const isNull = formatted == null;
62
+ const displayText = isNull ? null : truncateCellText(formatted);
63
+ const isRightmost = props.columnIndex === props.rightmostVisibleColumn;
64
+ const searchColumnIndex = props.searchColumnIndexByGroup.get(props.gridLayout.columnGroupByColumnIndex[props.columnIndex]);
65
+ const isSearchMatch = searchColumnIndex != null && props.matchingRows?.get(dataRow + 1)?.includes(searchColumnIndex) === true;
66
+ let className;
67
+ if (isNull) className = `${data_cell} ${data_cell_null}`;
68
+ else className = data_cell;
69
+ if (isRowFocused) className += focus === CellFocus.Primary ? ` ${data_cell_focused_primary}` : ` ${data_cell_focused_secondary}`;
70
+ if (isRightmost) className += ` ${data_cell_rightmost}`;
71
+ if (isSearchMatch) className += ` ${data_cell_search_match}`;
72
+ const field = rowWindow.table.schema.fields[fieldId];
73
+ const canOpenDetail = field.type.typeId === arrow.Type.Utf8 || field.type.typeId === arrow.Type.LargeUtf8 || isArrowListType(field.type) || field.type.typeId === arrow.Type.Struct;
74
+ const hint = !isNull && isArrowListType(field.type) ? "array" : !isNull && field.type.typeId === arrow.Type.Struct ? "struct" : peekedFormat;
75
+ return /* @__PURE__ */ jsx("div", {
76
+ className,
77
+ style: props.style,
78
+ role: "gridcell",
79
+ "aria-label": isSearchMatch ? `${isNull ? "NULL" : displayText}${hint == null ? "" : `, ${hint}`}, search match` : void 0,
80
+ tabIndex: canOpenDetail ? 0 : -1,
81
+ "data-table-col": fieldId,
82
+ "data-table-row": dataRow,
83
+ "data-visible-row": props.rowIndex,
84
+ onMouseEnter: props.onMouseEnter,
85
+ onMouseLeave: props.onMouseLeave,
86
+ onClick: props.onClick,
87
+ onKeyDown: (event) => {
88
+ if (canOpenDetail && (event.key === "Enter" || event.key === " ")) {
89
+ event.preventDefault();
90
+ event.currentTarget.click();
91
+ }
92
+ },
93
+ children: hint != null ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
94
+ className: data_cell_text,
95
+ children: displayText
96
+ }), /* @__PURE__ */ jsx(Tag, {
97
+ className: format_bean,
98
+ children: hint
99
+ })] }) : isNull ? "NULL" : displayText
100
+ });
101
+ }
102
+ }
103
+ export { DataCell };
@@ -0,0 +1,17 @@
1
+ import * as arrow from 'apache-arrow';
2
+ import * as React from 'react';
3
+ import { DataTableLayout } from './data_table_layout.js';
4
+ export interface HeaderNameCellProps {
5
+ columnIndex: number;
6
+ style: React.CSSProperties;
7
+ table: arrow.Table;
8
+ gridLayout: DataTableLayout;
9
+ dataFrame: number | null;
10
+ rightmostVisibleColumn: number;
11
+ sortAscending: boolean | null;
12
+ onOrderByColumn: (col: number) => void;
13
+ onShowTable?: () => void;
14
+ }
15
+ declare function HeaderNameCellImpl(props: HeaderNameCellProps): React.ReactElement;
16
+ export declare const HeaderNameCell: React.MemoExoticComponent<typeof HeaderNameCellImpl>;
17
+ export {};