@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.664.g9e89b805d
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.
- package/LICENSE +373 -0
- package/NOTICE +66 -0
- package/README.md +46 -2
- package/dist/_virtual/_vite/preload-helper.js +100 -0
- package/dist/brand/brand.d.ts +13 -0
- package/dist/brand/brand.js +14 -0
- package/dist/brand/landing_backdrop.d.ts +56 -0
- package/dist/brand/landing_backdrop.js +1019 -0
- package/dist/brand/wobble_morph.d.ts +54 -0
- package/dist/brand/wobble_morph.js +439 -0
- package/dist/components/action_list.d.ts +31 -0
- package/dist/components/action_list.js +63 -0
- package/dist/components/action_list.module.js +11 -0
- package/dist/components/anchored_overlay.d.ts +28 -0
- package/dist/components/anchored_overlay.js +93 -0
- package/dist/components/button.d.ts +42 -0
- package/dist/components/button.js +97 -0
- package/dist/components/button.module.js +20 -0
- package/dist/components/button_group.d.ts +7 -0
- package/dist/components/button_group.js +18 -0
- package/dist/components/button_group.module.js +3 -0
- package/dist/components/card_placeholder.d.ts +9 -0
- package/dist/components/card_placeholder.js +39 -0
- package/dist/components/card_placeholder.module.js +6 -0
- package/dist/components/clipboard.d.ts +19 -0
- package/dist/components/clipboard.js +54 -0
- package/dist/components/data_table/computation_tables.d.ts +12 -0
- package/dist/components/data_table/computation_tables.js +42 -0
- package/dist/components/data_table/data_table.d.ts +38 -0
- package/dist/components/data_table/data_table.js +378 -0
- package/dist/components/data_table/data_table.module.js +41 -0
- package/dist/components/data_table/data_table_cell.d.ts +7 -0
- package/dist/components/data_table/data_table_cell.js +9 -0
- package/dist/components/data_table/data_table_cell_data.d.ts +21 -0
- package/dist/components/data_table/data_table_cell_data.js +99 -0
- package/dist/components/data_table/data_table_cell_header_name.d.ts +17 -0
- package/dist/components/data_table/data_table_cell_header_name.js +73 -0
- package/dist/components/data_table/data_table_cell_header_plots.d.ts +31 -0
- package/dist/components/data_table/data_table_cell_header_plots.js +122 -0
- package/dist/components/data_table/data_table_colors.d.ts +19 -0
- package/dist/components/data_table/data_table_colors.js +27 -0
- package/dist/components/data_table/data_table_column_resize.d.ts +21 -0
- package/dist/components/data_table/data_table_column_resize.js +121 -0
- package/dist/components/data_table/data_table_focus.d.ts +15 -0
- package/dist/components/data_table/data_table_focus.js +53 -0
- package/dist/components/data_table/data_table_layout.d.ts +18 -0
- package/dist/components/data_table/data_table_layout.js +103 -0
- package/dist/components/data_table/data_table_ordering.d.ts +9 -0
- package/dist/components/data_table/data_table_ordering.js +39 -0
- package/dist/components/data_table/data_table_portals.d.ts +9 -0
- package/dist/components/data_table/data_table_portals.js +29 -0
- package/dist/components/data_table/data_table_sticky_views.d.ts +34 -0
- package/dist/components/data_table/data_table_sticky_views.js +161 -0
- package/dist/components/data_table/data_table_window.d.ts +18 -0
- package/dist/components/data_table/data_table_window.js +118 -0
- package/dist/components/data_table/format_peek.d.ts +2 -0
- package/dist/components/data_table/format_peek.js +17 -0
- package/dist/components/data_table/histogram_bars.d.ts +36 -0
- package/dist/components/data_table/histogram_bars.js +100 -0
- package/dist/components/data_table/histogram_brush.d.ts +23 -0
- package/dist/components/data_table/histogram_brush.js +107 -0
- package/dist/components/data_table/histogram_cell.d.ts +19 -0
- package/dist/components/data_table/histogram_cell.js +325 -0
- package/dist/components/data_table/histogram_cell.module.js +9 -0
- package/dist/components/data_table/histogram_label.d.ts +1 -0
- package/dist/components/data_table/histogram_label.js +7 -0
- package/dist/components/data_table/memo_props.d.ts +1 -0
- package/dist/components/data_table/memo_props.js +17 -0
- package/dist/components/data_table/mostfrequent_cell.d.ts +17 -0
- package/dist/components/data_table/mostfrequent_cell.js +316 -0
- package/dist/components/data_table/mostfrequent_cell.module.js +10 -0
- package/dist/components/data_table/use_cross_filters.d.ts +14 -0
- package/dist/components/data_table/use_cross_filters.js +47 -0
- package/dist/components/deferred.d.ts +11 -0
- package/dist/components/deferred.js +41 -0
- package/dist/components/deferred.module.js +5 -0
- package/dist/components/error_boundary.d.ts +18 -0
- package/dist/components/error_boundary.js +15 -0
- package/dist/components/graph.module.js +15 -0
- package/dist/components/graph_port.d.ts +10 -0
- package/dist/components/graph_port.js +34 -0
- package/dist/components/inspector_overlay.d.ts +32 -0
- package/dist/components/inspector_overlay.js +72 -0
- package/dist/components/inspector_overlay.module.js +18 -0
- package/dist/components/json/json_arrow_symbol.d.ts +4 -0
- package/dist/components/json/json_arrow_symbol.js +25 -0
- package/dist/components/json/json_copy_button.d.ts +11 -0
- package/dist/components/json/json_copy_button.js +61 -0
- package/dist/components/json/json_ellipsis_symbol.d.ts +7 -0
- package/dist/components/json/json_ellipsis_symbol.js +11 -0
- package/dist/components/json/json_item_count.d.ts +5 -0
- package/dist/components/json/json_item_count.js +12 -0
- package/dist/components/json/json_key_name.d.ts +6 -0
- package/dist/components/json/json_key_name.js +40 -0
- package/dist/components/json/json_key_values.d.ts +12 -0
- package/dist/components/json/json_key_values.js +99 -0
- package/dist/components/json/json_literal.d.ts +8 -0
- package/dist/components/json/json_literal.js +140 -0
- package/dist/components/json/json_nested_close.d.ts +11 -0
- package/dist/components/json/json_nested_close.js +31 -0
- package/dist/components/json/json_nested_open.d.ts +18 -0
- package/dist/components/json/json_nested_open.js +150 -0
- package/dist/components/json/json_nested_state.d.ts +14 -0
- package/dist/components/json/json_nested_state.js +28 -0
- package/dist/components/json/json_tool_state.d.ts +18 -0
- package/dist/components/json/json_tool_state.js +46 -0
- package/dist/components/json/json_value.d.ts +10 -0
- package/dist/components/json/json_value.js +46 -0
- package/dist/components/json/json_view.d.ts +14 -0
- package/dist/components/json/json_view.js +37 -0
- package/dist/components/json/json_view.module.js +41 -0
- package/dist/components/json/json_view_state.d.ts +14 -0
- package/dist/components/json/json_view_state.js +32 -0
- package/dist/components/json/unique_key.d.ts +1 -0
- package/dist/components/json/unique_key.js +8 -0
- package/dist/components/keyvalue_list.d.ts +25 -0
- package/dist/components/keyvalue_list.js +106 -0
- package/dist/components/keyvalue_list.module.js +15 -0
- package/dist/components/name_input.d.ts +11 -0
- package/dist/components/name_input.js +51 -0
- package/dist/components/overlay.d.ts +53 -0
- package/dist/components/overlay.js +183 -0
- package/dist/components/overlay.module.js +32 -0
- package/dist/components/panel_resize_handle.d.ts +12 -0
- package/dist/components/panel_resize_handle.js +39 -0
- package/dist/components/portal.d.ts +8 -0
- package/dist/components/portal.js +53 -0
- package/dist/components/progress_bar.d.ts +7 -0
- package/dist/components/progress_bar.js +21 -0
- package/dist/components/progress_bar.module.js +3 -0
- package/dist/components/query_history_viewer.d.ts +33 -0
- package/dist/components/query_history_viewer.js +268 -0
- package/dist/components/query_history_viewer.module.js +7 -0
- package/dist/components/query_profile/engine_profile_view.d.ts +19 -0
- package/dist/components/query_profile/engine_profile_view.js +94 -0
- package/dist/components/query_profile/numeric_limits.d.ts +1 -0
- package/dist/components/query_profile/numeric_limits.js +2 -0
- package/dist/components/query_profile/profile_execution_controller.d.ts +14 -0
- package/dist/components/query_profile/profile_execution_controller.js +56 -0
- package/dist/components/query_profile/profile_fit.d.ts +24 -0
- package/dist/components/query_profile/profile_fit.js +22 -0
- package/dist/components/query_profile/profile_navigation.d.ts +3 -0
- package/dist/components/query_profile/profile_navigation.js +34 -0
- package/dist/components/query_profile/profile_scene.d.ts +64 -0
- package/dist/components/query_profile/profile_scene.js +422 -0
- package/dist/components/query_profile/query_profile_view.d.ts +44 -0
- package/dist/components/query_profile/query_profile_view.js +961 -0
- package/dist/components/query_profile/query_profile_view.module.js +23 -0
- package/dist/components/query_progress/query_profile_overlay.d.ts +7 -0
- package/dist/components/query_progress/query_profile_overlay.js +67 -0
- package/dist/components/query_progress/query_profile_overlay.module.js +6 -0
- package/dist/components/query_progress/query_progress_panel.d.ts +14 -0
- package/dist/components/query_progress/query_progress_panel.js +255 -0
- package/dist/components/query_progress/query_progress_panel.module.js +10 -0
- package/dist/components/query_result/cell_detail_overlay.d.ts +34 -0
- package/dist/components/query_result/cell_detail_overlay.js +277 -0
- package/dist/components/query_result/cell_detail_overlay.module.js +21 -0
- package/dist/components/query_result/query_result_action_menu.d.ts +12 -0
- package/dist/components/query_result/query_result_action_menu.js +62 -0
- package/dist/components/query_result/query_result_action_menu.module.js +2 -0
- package/dist/components/query_result/query_result_details.d.ts +17 -0
- package/dist/components/query_result/query_result_details.js +46 -0
- package/dist/components/query_result/query_result_details.module.js +5 -0
- package/dist/components/query_result/query_result_download_button.d.ts +8 -0
- package/dist/components/query_result/query_result_download_button.js +38 -0
- package/dist/components/query_result/query_result_header.d.ts +21 -0
- package/dist/components/query_result/query_result_header.js +71 -0
- package/dist/components/query_result/query_result_header.module.js +3 -0
- package/dist/components/query_result/query_result_search_controls.d.ts +12 -0
- package/dist/components/query_result/query_result_search_controls.js +141 -0
- package/dist/components/query_result/query_result_search_controls.module.js +7 -0
- package/dist/components/query_result/query_result_toolbar.d.ts +21 -0
- package/dist/components/query_result/query_result_toolbar.js +74 -0
- package/dist/components/query_result/result_table_overlay.d.ts +9 -0
- package/dist/components/query_result/result_table_overlay.js +73 -0
- package/dist/components/query_result/result_table_overlay.module.js +6 -0
- package/dist/components/query_result/use_query_result_search.d.ts +8 -0
- package/dist/components/query_result/use_query_result_search.js +28 -0
- package/dist/components/segmented_control.d.ts +58 -0
- package/dist/components/segmented_control.js +116 -0
- package/dist/components/segmented_control.module.js +17 -0
- package/dist/components/separator.d.ts +21 -0
- package/dist/components/separator.js +79 -0
- package/dist/components/separator.module.js +7 -0
- package/dist/components/size_observer.d.ts +7 -0
- package/dist/components/size_observer.js +57 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +14 -0
- package/dist/components/skeleton.module.js +2 -0
- package/dist/components/spinners.d.ts +8 -0
- package/dist/components/spinners.js +33 -0
- package/dist/components/spinners.module.js +8 -0
- package/dist/components/status_indicator.d.ts +36 -0
- package/dist/components/status_indicator.js +182 -0
- package/dist/components/status_indicator.module.js +3 -0
- package/dist/components/symbol_icon.d.ts +65 -0
- package/dist/components/symbol_icon.js +213 -0
- package/dist/components/tab_header.d.ts +11 -0
- package/dist/components/tab_header.js +55 -0
- package/dist/components/tab_header.module.js +7 -0
- package/dist/components/tag.d.ts +10 -0
- package/dist/components/tag.js +17 -0
- package/dist/components/tag.module.js +4 -0
- package/dist/components/text_field.d.ts +44 -0
- package/dist/components/text_field.js +159 -0
- package/dist/components/text_field.module.js +15 -0
- package/dist/components/text_input.d.ts +25 -0
- package/dist/components/text_input.js +90 -0
- package/dist/components/text_input.module.js +13 -0
- package/dist/components/text_input_action.d.ts +19 -0
- package/dist/components/text_input_action.js +33 -0
- package/dist/components/text_input_action.module.js +2 -0
- package/dist/components/toggle_switch.d.ts +7 -0
- package/dist/components/toggle_switch.js +22 -0
- package/dist/components/toggle_switch.module.js +6 -0
- package/dist/components/tooltip.d.ts +22 -0
- package/dist/components/tooltip.js +139 -0
- package/dist/components/tooltip.module.js +2 -0
- package/dist/components/tree_entry.d.ts +17 -0
- package/dist/components/tree_entry.js +48 -0
- package/dist/components/tree_entry.module.js +9 -0
- package/dist/components/value_list.d.ts +17 -0
- package/dist/components/value_list.js +70 -0
- package/dist/components/value_list.module.js +8 -0
- package/dist/components/vegalite_chart.d.ts +18 -0
- package/dist/components/vegalite_chart.js +151 -0
- package/dist/components/vegalite_chart.module.js +3 -0
- package/dist/components/vegalite_view.d.ts +27 -0
- package/dist/components/vegalite_view.js +248 -0
- package/dist/components/vegalite_view.module.js +5 -0
- package/dist/components/vertical_scroll_shadows.d.ts +14 -0
- package/dist/components/vertical_scroll_shadows.js +55 -0
- package/dist/components/vertical_scroll_shadows.module.js +5 -0
- package/dist/components/vertical_split.d.ts +15 -0
- package/dist/components/vertical_split.js +112 -0
- package/dist/components/vertical_split.module.js +5 -0
- package/dist/components/vertical_tabs.d.ts +36 -0
- package/dist/components/vertical_tabs.js +169 -0
- package/dist/components/vertical_tabs.module.js +23 -0
- package/dist/components/visualization/capped_rows.d.ts +9 -0
- package/dist/components/visualization/capped_rows.js +23 -0
- package/dist/components/visualization/capped_rows.module.js +3 -0
- package/dist/components/visualization/chart_download_button.d.ts +12 -0
- package/dist/components/visualization/chart_download_button.js +41 -0
- package/dist/components/visualization/kpi_view.d.ts +10 -0
- package/dist/components/visualization/kpi_view.js +215 -0
- package/dist/components/visualization/kpi_view.module.js +17 -0
- package/dist/components/visualization/markdown_view.d.ts +17 -0
- package/dist/components/visualization/markdown_view.js +154 -0
- package/dist/components/visualization/markdown_view.module.js +4 -0
- package/dist/components/visualization/result_rows.d.ts +17 -0
- package/dist/components/visualization/result_rows.js +82 -0
- package/dist/components/visualization/vegalite_preview.d.ts +8 -0
- package/dist/components/visualization/vegalite_preview.js +17 -0
- package/dist/components/visualization/vegalite_preview.module.js +2 -0
- package/dist/components/visualization/visualization_dispatch.d.ts +14 -0
- package/dist/components/visualization/visualization_dispatch.js +41 -0
- package/dist/components/visualization/visualization_panel.d.ts +10 -0
- package/dist/components/visualization/visualization_panel.js +37 -0
- package/dist/components/visualization/visualization_panel.module.js +3 -0
- package/dist/dom/anchored_position.d.ts +42 -0
- package/dist/dom/anchored_position.js +255 -0
- package/dist/dom/app_host.d.ts +6 -0
- package/dist/dom/app_host.js +13 -0
- package/dist/dom/calm_frames.d.ts +24 -0
- package/dist/dom/calm_frames.js +96 -0
- package/dist/dom/classnames.d.ts +8 -0
- package/dist/dom/classnames.js +20 -0
- package/dist/dom/download_file.d.ts +1 -0
- package/dist/dom/download_file.js +12 -0
- package/dist/dom/focus.d.ts +29 -0
- package/dist/dom/focus.js +84 -0
- package/dist/dom/graph_edges.d.ts +53 -0
- package/dist/dom/graph_edges.js +450 -0
- package/dist/dom/key_events.d.ts +9 -0
- package/dist/dom/key_events.js +33 -0
- package/dist/dom/media_query.d.ts +2 -0
- package/dist/dom/media_query.js +15 -0
- package/dist/dom/outside_click.d.ts +8 -0
- package/dist/dom/outside_click.js +32 -0
- package/dist/dom/rerender_ref.d.ts +2 -0
- package/dist/dom/rerender_ref.js +11 -0
- package/dist/dom/row_context_menu.d.ts +7 -0
- package/dist/dom/row_context_menu.js +32 -0
- package/dist/dom/scrollbar.d.ts +3 -0
- package/dist/dom/scrollbar.js +23 -0
- package/dist/format/format.d.ts +11 -0
- package/dist/format/format.js +72 -0
- package/dist/format/query_progress_format.d.ts +17 -0
- package/dist/format/query_progress_format.js +69 -0
- package/dist/format/time_format.d.ts +5 -0
- package/dist/format/time_format.js +45 -0
- package/dist/hooks.d.ts +71 -0
- package/dist/hooks.js +302 -0
- package/dist/host.d.ts +10 -0
- package/dist/host.js +12 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +6 -0
- package/dist/models/computation_model.d.ts +14 -0
- package/dist/models/computation_model.js +27 -0
- package/dist/models/query_model.d.ts +12 -0
- package/dist/models/query_model.js +27 -0
- package/dist/models/script_model.d.ts +17 -0
- package/dist/models/script_model.js +69 -0
- package/dist/style.css +4226 -0
- package/dist/svg_symbols.d.ts +2 -0
- package/dist/svg_symbols.js +2 -0
- package/dist/symbols.svg +1197 -0
- package/dist/theme/color_scheme.d.ts +4 -0
- package/dist/theme/color_scheme.js +28 -0
- package/dist/theme/xcode_palette.d.ts +22 -0
- package/dist/theme/xcode_palette.js +4 -0
- package/dist/theme/xcode_palettes.js +41 -0
- package/dist/utils/plan_engine.d.ts +2 -0
- package/dist/utils/plan_engine.js +13 -0
- package/dist/vegalite/vegalite_check.d.ts +1 -0
- package/dist/vegalite/vegalite_check.js +7 -0
- package/dist/vegalite/vegalite_crossfilter.d.ts +54 -0
- package/dist/vegalite/vegalite_crossfilter.js +187 -0
- package/dist/vegalite/vegalite_image.d.ts +16 -0
- package/dist/vegalite/vegalite_image.js +28 -0
- package/dist/vegalite/vegalite_loader.d.ts +7 -0
- package/dist/vegalite/vegalite_loader.js +15 -0
- package/dist/vegalite/vegalite_rows.d.ts +3 -0
- package/dist/vegalite/vegalite_rows.js +17 -0
- package/dist/vegalite/vegalite_theme.d.ts +11 -0
- package/dist/vegalite/vegalite_theme.js +125 -0
- package/fonts/InstrumentSans-Bold.ttf +0 -0
- package/fonts/InstrumentSans-Medium.ttf +0 -0
- package/fonts/InstrumentSans-OFL.txt +93 -0
- package/fonts/InstrumentSans-Regular.ttf +0 -0
- package/fonts/InstrumentSans-SemiBold.ttf +0 -0
- package/fonts/JetBrainsMono-Bold.ttf +0 -0
- package/fonts/JetBrainsMono-Medium.ttf +0 -0
- package/fonts/JetBrainsMono-OFL.txt +93 -0
- package/fonts/JetBrainsMono-Regular.ttf +0 -0
- package/fonts/JetBrainsMono-SemiBold.ttf +0 -0
- package/fonts/fonts.css +61 -0
- package/package.json +43 -4
- package/styles/colors.css +110 -0
- package/styles/flavors/dbcom.css +48 -0
- package/styles/tokens.css +192 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Overlay, OverlayVisibility } from "./overlay.js";
|
|
2
|
+
import { useFocusTrap, useFocusZone } from "../dom/focus.js";
|
|
3
|
+
import { useAnchoredPosition } from "../dom/anchored_position.js";
|
|
4
|
+
import { useRenderForcingRef } from "../dom/rerender_ref.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function AnchoredOverlay(args) {
|
|
8
|
+
const altAnchorRef = React.useRef(null);
|
|
9
|
+
const anchorRef = args.anchorRef ?? altAnchorRef;
|
|
10
|
+
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
11
|
+
const anchorId = React.useId();
|
|
12
|
+
const { open, onOpen, onClose } = args;
|
|
13
|
+
const onClickOutside = React.useCallback(() => onClose?.("click-outside"), [onClose]);
|
|
14
|
+
const onEscape = React.useCallback(() => onClose?.("escape"), [onClose]);
|
|
15
|
+
const onAnchorKeyDown = React.useCallback((event) => {
|
|
16
|
+
if (!event.defaultPrevented) {
|
|
17
|
+
if (!open && [
|
|
18
|
+
"ArrowDown",
|
|
19
|
+
"ArrowUp",
|
|
20
|
+
" ",
|
|
21
|
+
"Enter"
|
|
22
|
+
].includes(event.key)) {
|
|
23
|
+
onOpen?.("anchor-key-press", event);
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, [open, onOpen]);
|
|
28
|
+
const onAnchorClick = React.useCallback((event) => {
|
|
29
|
+
if (event.defaultPrevented || event.button !== 0) return;
|
|
30
|
+
if (!open) onOpen?.("anchor-click");
|
|
31
|
+
else onClose?.("anchor-click");
|
|
32
|
+
}, [
|
|
33
|
+
open,
|
|
34
|
+
onOpen,
|
|
35
|
+
onClose
|
|
36
|
+
]);
|
|
37
|
+
const { position } = useAnchoredPosition({
|
|
38
|
+
anchorElementRef: anchorRef,
|
|
39
|
+
floatingElementRef: overlayRef,
|
|
40
|
+
side: args.side,
|
|
41
|
+
align: args.align,
|
|
42
|
+
alignmentOffset: args.alignmentOffset,
|
|
43
|
+
anchorOffset: args.anchorOffset,
|
|
44
|
+
observeWindow: open,
|
|
45
|
+
positionRevision: args.positionRevision
|
|
46
|
+
});
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
if (!args.open && overlayRef.current) updateOverlayRef(null);
|
|
49
|
+
}, [
|
|
50
|
+
args.open,
|
|
51
|
+
overlayRef,
|
|
52
|
+
updateOverlayRef
|
|
53
|
+
]);
|
|
54
|
+
useFocusZone({
|
|
55
|
+
containerRef: overlayRef,
|
|
56
|
+
disabled: !args.open || !position,
|
|
57
|
+
...args.focusZoneSettings
|
|
58
|
+
});
|
|
59
|
+
useFocusTrap({
|
|
60
|
+
containerRef: overlayRef,
|
|
61
|
+
disabled: !args.open || !position,
|
|
62
|
+
...args.focusTrapSettings
|
|
63
|
+
});
|
|
64
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [args.renderAnchor && args.renderAnchor({
|
|
65
|
+
ref: anchorRef,
|
|
66
|
+
id: anchorId,
|
|
67
|
+
"aria-haspopup": "true",
|
|
68
|
+
"aria-expanded": args.open,
|
|
69
|
+
tabIndex: 0,
|
|
70
|
+
onClick: onAnchorClick,
|
|
71
|
+
onKeyDown: onAnchorKeyDown
|
|
72
|
+
}), args.open ? /* @__PURE__ */ jsx(Overlay, {
|
|
73
|
+
ref: updateOverlayRef,
|
|
74
|
+
returnFocusRef: args.returnFocusRef,
|
|
75
|
+
onClickOutside,
|
|
76
|
+
ignoreClickRefs: [anchorRef],
|
|
77
|
+
onEscape,
|
|
78
|
+
role: "none",
|
|
79
|
+
preventFocusOnOpen: true,
|
|
80
|
+
visibility: position ? OverlayVisibility.Visible : OverlayVisibility.Hidden,
|
|
81
|
+
height: args.height,
|
|
82
|
+
width: args.width,
|
|
83
|
+
minWidth: args.minWidth,
|
|
84
|
+
maxWidth: args.maxWidth,
|
|
85
|
+
maxHeight: args.maxHeight,
|
|
86
|
+
top: position?.top || 0,
|
|
87
|
+
left: position?.left || 0,
|
|
88
|
+
anchorSide: position?.anchorSide,
|
|
89
|
+
...args.overlayProps,
|
|
90
|
+
children: args.children
|
|
91
|
+
}) : null] });
|
|
92
|
+
}
|
|
93
|
+
export { AnchoredOverlay };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type TooltipDirection } from './tooltip.js';
|
|
3
|
+
export declare enum ButtonVariant {
|
|
4
|
+
Default = 0,
|
|
5
|
+
Primary = 1,
|
|
6
|
+
Danger = 2,
|
|
7
|
+
Invisible = 3,
|
|
8
|
+
Outline = 4
|
|
9
|
+
}
|
|
10
|
+
export declare enum ButtonSize {
|
|
11
|
+
Tiny = 0,
|
|
12
|
+
Small = 1,
|
|
13
|
+
Medium = 2,
|
|
14
|
+
Large = 3
|
|
15
|
+
}
|
|
16
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
className?: string;
|
|
18
|
+
variant?: ButtonVariant;
|
|
19
|
+
size?: ButtonSize;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
inactive?: boolean;
|
|
23
|
+
block?: boolean;
|
|
24
|
+
leadingVisual?: React.ElementType | React.ReactElement;
|
|
25
|
+
trailingVisual?: React.ElementType | React.ReactElement;
|
|
26
|
+
trailingAction?: React.ReactElement<React.HTMLProps<HTMLButtonElement>>;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
interface IconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> {
|
|
31
|
+
className?: string;
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
|
+
size?: ButtonSize;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
inactive?: boolean;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
description?: string;
|
|
38
|
+
tooltipDirection?: TooltipDirection;
|
|
39
|
+
'aria-label': string;
|
|
40
|
+
}
|
|
41
|
+
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { block, button, button_content, button_size_large, button_size_medium, button_size_small, button_size_tiny, button_variant_danger, button_variant_default, button_variant_invisible, button_variant_primary, disabled, icon_button, inactive, no_visuals } from "./button.module.js";
|
|
2
|
+
import { Tooltip } from "./tooltip.js";
|
|
3
|
+
import { classNames } from "../dom/classnames.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var BUTTON_VARIANT_CLASSNAME = [
|
|
7
|
+
button_variant_default,
|
|
8
|
+
button_variant_primary,
|
|
9
|
+
button_variant_danger,
|
|
10
|
+
button_variant_invisible,
|
|
11
|
+
button_variant_invisible
|
|
12
|
+
];
|
|
13
|
+
var BUTTON_SIZE_CLASSNAME = [
|
|
14
|
+
button_size_tiny,
|
|
15
|
+
button_size_small,
|
|
16
|
+
button_size_medium,
|
|
17
|
+
button_size_large
|
|
18
|
+
];
|
|
19
|
+
var ButtonVariant = /* @__PURE__ */ function(ButtonVariant) {
|
|
20
|
+
ButtonVariant[ButtonVariant["Default"] = 0] = "Default";
|
|
21
|
+
ButtonVariant[ButtonVariant["Primary"] = 1] = "Primary";
|
|
22
|
+
ButtonVariant[ButtonVariant["Danger"] = 2] = "Danger";
|
|
23
|
+
ButtonVariant[ButtonVariant["Invisible"] = 3] = "Invisible";
|
|
24
|
+
ButtonVariant[ButtonVariant["Outline"] = 4] = "Outline";
|
|
25
|
+
return ButtonVariant;
|
|
26
|
+
}({});
|
|
27
|
+
var ButtonSize = /* @__PURE__ */ function(ButtonSize) {
|
|
28
|
+
ButtonSize[ButtonSize["Tiny"] = 0] = "Tiny";
|
|
29
|
+
ButtonSize[ButtonSize["Small"] = 1] = "Small";
|
|
30
|
+
ButtonSize[ButtonSize["Medium"] = 2] = "Medium";
|
|
31
|
+
ButtonSize[ButtonSize["Large"] = 3] = "Large";
|
|
32
|
+
return ButtonSize;
|
|
33
|
+
}({});
|
|
34
|
+
var Button = React.forwardRef((props, ref) => {
|
|
35
|
+
const { block: block$1, children, className, inactive: inactive$1, leadingVisual, size: _size, style, trailingAction, trailingVisual, type, variant: _variant, ...rest } = props;
|
|
36
|
+
const variantStyle = BUTTON_VARIANT_CLASSNAME[props.variant ?? ButtonVariant.Default];
|
|
37
|
+
const sizeStyle = BUTTON_SIZE_CLASSNAME[props.size ?? ButtonSize.Medium];
|
|
38
|
+
const leadingVisualElement = React.isValidElement(leadingVisual) ? leadingVisual : leadingVisual ? React.createElement(leadingVisual) : null;
|
|
39
|
+
const trailingVisualElement = React.isValidElement(trailingVisual) ? trailingVisual : trailingVisual ? React.createElement(trailingVisual) : null;
|
|
40
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
41
|
+
className: classNames(button, variantStyle, sizeStyle, {
|
|
42
|
+
[inactive]: inactive$1,
|
|
43
|
+
[block]: block$1,
|
|
44
|
+
[disabled]: props.disabled,
|
|
45
|
+
[no_visuals]: !leadingVisual && !trailingVisual && !trailingAction ? true : void 0
|
|
46
|
+
}, className),
|
|
47
|
+
...rest,
|
|
48
|
+
disabled: props.disabled,
|
|
49
|
+
ref,
|
|
50
|
+
style,
|
|
51
|
+
type: type ?? "button",
|
|
52
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
53
|
+
className: button_content,
|
|
54
|
+
children: [
|
|
55
|
+
leadingVisualElement && /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "dashql_leading_visual_aCTanx",
|
|
57
|
+
children: leadingVisualElement
|
|
58
|
+
}),
|
|
59
|
+
children && /* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: "dashql_text_vRTNZL",
|
|
61
|
+
children
|
|
62
|
+
}),
|
|
63
|
+
trailingVisualElement && /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "dashql_trailing_visual_U1an9G",
|
|
65
|
+
children: trailingVisualElement
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}), trailingAction && /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "dashql_trailing_action_4D0pCA",
|
|
70
|
+
children: trailingAction
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
var IconButton = React.forwardRef((props, ref) => {
|
|
75
|
+
const ariaLabel = props["aria-label"];
|
|
76
|
+
const variantStyle = BUTTON_VARIANT_CLASSNAME[props.variant ?? ButtonVariant.Default];
|
|
77
|
+
const sizeStyle = BUTTON_SIZE_CLASSNAME[props.size ?? ButtonSize.Medium];
|
|
78
|
+
const { className, children, description, disabled: disabled$1, inactive: inactive$2, tooltipDirection, size: _size, variant: _variant, ["aria-label"]: _ariaLabel, ...rest } = props;
|
|
79
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
80
|
+
text: description ?? ariaLabel,
|
|
81
|
+
type: description ? void 0 : "label",
|
|
82
|
+
direction: tooltipDirection,
|
|
83
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
84
|
+
...rest,
|
|
85
|
+
"aria-label": ariaLabel,
|
|
86
|
+
className: classNames(button, icon_button, variantStyle, sizeStyle, {
|
|
87
|
+
[inactive]: inactive$2,
|
|
88
|
+
[disabled]: disabled$1
|
|
89
|
+
}, className),
|
|
90
|
+
disabled: disabled$1,
|
|
91
|
+
ref,
|
|
92
|
+
type: props.type ?? "button",
|
|
93
|
+
children
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
export { Button, ButtonSize, ButtonVariant, IconButton };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var button = "dashql_button_M9drB9";
|
|
2
|
+
var inactive = "dashql_inactive_tF-fsU";
|
|
3
|
+
var disabled = "dashql_disabled_hrOP6v";
|
|
4
|
+
var block = "dashql_block_LC9AXu";
|
|
5
|
+
var icon_button = "dashql_icon_button_R_hv1u";
|
|
6
|
+
var leading_visual = "dashql_leading_visual_aCTanx";
|
|
7
|
+
var text = "dashql_text_vRTNZL";
|
|
8
|
+
var trailing_visual = "dashql_trailing_visual_U1an9G";
|
|
9
|
+
var trailing_action = "dashql_trailing_action_4D0pCA";
|
|
10
|
+
var button_content = "dashql_button_content_XJYE8O";
|
|
11
|
+
var button_size_tiny = "dashql_button_size_tiny_ozocvt";
|
|
12
|
+
var button_size_small = "dashql_button_size_small_ThSen_";
|
|
13
|
+
var button_size_medium = "dashql_button_size_medium_cdtyL2";
|
|
14
|
+
var button_size_large = "dashql_button_size_large_Gtbx0o";
|
|
15
|
+
var button_variant_default = "dashql_button_variant_default_ukusyN";
|
|
16
|
+
var no_visuals = "dashql_no_visuals_GfZFSk";
|
|
17
|
+
var button_variant_primary = "dashql_button_variant_primary_dAHSkm";
|
|
18
|
+
var button_variant_danger = "dashql_button_variant_danger_8F9vjM";
|
|
19
|
+
var button_variant_invisible = "dashql_button_variant_invisible_-4cRM_";
|
|
20
|
+
export { block, button, button_content, button_size_large, button_size_medium, button_size_small, button_size_tiny, button_variant_danger, button_variant_default, button_variant_invisible, button_variant_primary, disabled, icon_button, inactive, leading_visual, no_visuals, text, trailing_action, trailing_visual };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { item, root } from "./button_group.module.js";
|
|
2
|
+
import { classNames } from "../dom/classnames.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var ButtonGroup = React.forwardRef((props, ref) => {
|
|
6
|
+
const { className, children, ...rest } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
...rest,
|
|
9
|
+
ref,
|
|
10
|
+
className: classNames(root, className),
|
|
11
|
+
role: props.role ?? "group",
|
|
12
|
+
children: React.Children.toArray(children).map((child, index) => /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: item,
|
|
14
|
+
children: child
|
|
15
|
+
}, index))
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type QueryExecutionState } from '@akohn/dashql/platform/query/query_execution_state';
|
|
3
|
+
export declare function CardPlaceholder(props: {
|
|
4
|
+
message?: string;
|
|
5
|
+
hint?: boolean;
|
|
6
|
+
}): React.ReactElement;
|
|
7
|
+
export declare function QueryStatusPlaceholder(props: {
|
|
8
|
+
query: QueryExecutionState | null;
|
|
9
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { logo, logo_wordmark, root } from "./card_placeholder.module.js";
|
|
2
|
+
import { useBrand } from "../brand/brand.js";
|
|
3
|
+
import { classNames } from "../dom/classnames.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import symbols from "../svg_symbols.js";
|
|
7
|
+
import { QueryExecutionStatus, queryIsDone } from "@akohn/dashql/platform/query/query_execution_state";
|
|
8
|
+
var RUN_HINT = "Run the query to see the result";
|
|
9
|
+
function queryStatusMessage(query) {
|
|
10
|
+
if (query == null) return null;
|
|
11
|
+
if (!queryIsDone(query.status)) return "Running the query…";
|
|
12
|
+
if (query.status === QueryExecutionStatus.FAILED) return "The query failed";
|
|
13
|
+
if (query.status === QueryExecutionStatus.CANCELLED) return "The query was cancelled";
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function CardPlaceholder(props) {
|
|
17
|
+
const logo$1 = useBrand().logo;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: root,
|
|
20
|
+
"data-testid": "card-placeholder",
|
|
21
|
+
children: [/* @__PURE__ */ jsx("svg", {
|
|
22
|
+
className: classNames(logo, { [logo_wordmark]: logo$1.wordmark }),
|
|
23
|
+
style: logo$1.wordmark ? { aspectRatio: logo$1.aspectRatio } : void 0,
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
children: /* @__PURE__ */ jsx("use", { xlinkHref: `${symbols}#${logo$1.symbol}` })
|
|
26
|
+
}), props.message != null && /* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: props.hint ? "dashql_hint_3bfIB9" : "dashql_message_2Y8JKZ",
|
|
28
|
+
children: props.message
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function QueryStatusPlaceholder(props) {
|
|
33
|
+
const status = queryStatusMessage(props.query);
|
|
34
|
+
return status != null ? /* @__PURE__ */ jsx(CardPlaceholder, { message: status }) : /* @__PURE__ */ jsx(CardPlaceholder, {
|
|
35
|
+
message: RUN_HINT,
|
|
36
|
+
hint: true
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { CardPlaceholder, QueryStatusPlaceholder };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Icon } from './symbol_icon.js';
|
|
3
|
+
import { ButtonSize, ButtonVariant } from './button.js';
|
|
4
|
+
interface Props {
|
|
5
|
+
variant: ButtonVariant;
|
|
6
|
+
size: ButtonSize;
|
|
7
|
+
className?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
getValue?: () => string;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
logContext: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
icon?: Icon;
|
|
14
|
+
['aria-label']: string;
|
|
15
|
+
['aria-labelledby']: string;
|
|
16
|
+
['data-testid']?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function CopyToClipboardButton(props: Props): React.ReactElement;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CheckIcon, CopyIcon } from "./symbol_icon.js";
|
|
2
|
+
import { useLogger } from "../logger.js";
|
|
3
|
+
import { IconButton } from "./button.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { stringifyError } from "@akohn/dashql/platform/logger/logger";
|
|
7
|
+
var DEFAULT_COPY_TIMEOUT = 2e3;
|
|
8
|
+
function CopyToClipboardButton(props) {
|
|
9
|
+
const logger = useLogger();
|
|
10
|
+
const [lastCopied, setLastCopied] = React.useState(null);
|
|
11
|
+
const [wasRecentlyCopied, setWasRecentlyCopied] = React.useState(false);
|
|
12
|
+
const timeoutMs = props.timeoutMs ?? DEFAULT_COPY_TIMEOUT;
|
|
13
|
+
const { value: propValue, getValue, logContext } = props;
|
|
14
|
+
const copy = React.useCallback(async () => {
|
|
15
|
+
const value = propValue ?? (getValue ? getValue() : "");
|
|
16
|
+
try {
|
|
17
|
+
await navigator.clipboard.writeText(value);
|
|
18
|
+
logger.info("Copied to clipboard", { "chars": value.length.toString() }, logContext);
|
|
19
|
+
setLastCopied(Date.now());
|
|
20
|
+
} catch (e) {
|
|
21
|
+
logger.error("Copying failed", { "error": stringifyError(e) }, logContext);
|
|
22
|
+
}
|
|
23
|
+
}, [
|
|
24
|
+
propValue,
|
|
25
|
+
getValue,
|
|
26
|
+
logger,
|
|
27
|
+
logContext
|
|
28
|
+
]);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
if (lastCopied == null) return;
|
|
31
|
+
setWasRecentlyCopied(true);
|
|
32
|
+
const timeoutId = setTimeout(() => {
|
|
33
|
+
setWasRecentlyCopied(false);
|
|
34
|
+
}, timeoutMs);
|
|
35
|
+
return () => clearTimeout(timeoutId);
|
|
36
|
+
}, [lastCopied, timeoutMs]);
|
|
37
|
+
let InnerIcon;
|
|
38
|
+
if (wasRecentlyCopied) InnerIcon = CheckIcon;
|
|
39
|
+
else InnerIcon = props.icon ?? CopyIcon;
|
|
40
|
+
const ariaLabel = props["aria-label"];
|
|
41
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
42
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
43
|
+
className: props.className,
|
|
44
|
+
variant: props.variant,
|
|
45
|
+
size: props.size,
|
|
46
|
+
onClick: props.disabled ? void 0 : copy,
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
"aria-labelledby": ariaLabelledBy,
|
|
49
|
+
"data-testid": props["data-testid"],
|
|
50
|
+
disabled: props.disabled,
|
|
51
|
+
children: /* @__PURE__ */ jsx(InnerIcon, {})
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export { CopyToClipboardButton };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as arrow from 'apache-arrow';
|
|
2
|
+
import type { ComputationView } from '@akohn/dashql';
|
|
3
|
+
import { type SummaryTables } from '@akohn/dashql/platform/compute/computation_types';
|
|
4
|
+
export interface ComputationTables {
|
|
5
|
+
dataTable: arrow.Table | null;
|
|
6
|
+
filterTable: arrow.Table | null;
|
|
7
|
+
orderingTable: arrow.Table | null;
|
|
8
|
+
dataSearchTable: arrow.Table | null;
|
|
9
|
+
matchingRows: Map<number, number[]> | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveComputationTables(view: ComputationView | null, tables: SummaryTables | null): ComputationTables;
|
|
12
|
+
export declare function useComputationTables(view: ComputationView | null, tables: SummaryTables | null): ComputationTables;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { resolveDataSearchMatches } from "@akohn/dashql/platform/compute/computation_types";
|
|
3
|
+
function resolveTables(handles, tables) {
|
|
4
|
+
const table = (handle) => tables?.table(handle) ?? null;
|
|
5
|
+
return {
|
|
6
|
+
dataTable: table(handles.dataTable),
|
|
7
|
+
filterTable: table(handles.filterTable),
|
|
8
|
+
orderingTable: table(handles.orderingTable),
|
|
9
|
+
dataSearchTable: table(handles.dataSearchTable),
|
|
10
|
+
matchingRows: tables == null ? null : resolveDataSearchMatches(handles.hasMatchingRows, handles.dataSearchTable, tables)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function tableHandles(view) {
|
|
14
|
+
return {
|
|
15
|
+
dataTable: view?.dataTable,
|
|
16
|
+
filterTable: view?.filterTable?.dataTable,
|
|
17
|
+
orderingTable: view?.orderingTable?.dataTable,
|
|
18
|
+
dataSearchTable: view?.dataSearchTable?.dataTable,
|
|
19
|
+
hasMatchingRows: view?.dataSearch.hasMatchingRows ?? false
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function resolveComputationTables(view, tables) {
|
|
23
|
+
return resolveTables(tableHandles(view), tables);
|
|
24
|
+
}
|
|
25
|
+
function useComputationTables(view, tables) {
|
|
26
|
+
const { dataTable, filterTable, orderingTable, dataSearchTable, hasMatchingRows } = tableHandles(view);
|
|
27
|
+
return React.useMemo(() => resolveTables({
|
|
28
|
+
dataTable,
|
|
29
|
+
filterTable,
|
|
30
|
+
orderingTable,
|
|
31
|
+
dataSearchTable,
|
|
32
|
+
hasMatchingRows
|
|
33
|
+
}, tables), [
|
|
34
|
+
tables,
|
|
35
|
+
dataTable,
|
|
36
|
+
filterTable,
|
|
37
|
+
orderingTable,
|
|
38
|
+
dataSearchTable,
|
|
39
|
+
hasMatchingRows
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
export { resolveComputationTables, useComputationTables };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ComputationModel } from '../../models/computation_model.js';
|
|
3
|
+
import { TableColumnHeader } from './data_table_cell.js';
|
|
4
|
+
export { TableColumnHeader } from './data_table_cell.js';
|
|
5
|
+
export { resolveComputationTables, useComputationTables, type ComputationTables } from './computation_tables.js';
|
|
6
|
+
export type { ComputationDispatch } from './use_cross_filters.js';
|
|
7
|
+
export { peekFormat, type FormatHint } from './format_peek.js';
|
|
8
|
+
export interface CellDetailProps {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
formattedValue: string | null;
|
|
12
|
+
structuredValue: object | null;
|
|
13
|
+
columnName: string | null;
|
|
14
|
+
dataRow: number;
|
|
15
|
+
maxRow: number;
|
|
16
|
+
onNavigate: (delta: number) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface DataTableProps {
|
|
19
|
+
className?: string;
|
|
20
|
+
model: ComputationModel;
|
|
21
|
+
maxRows?: number;
|
|
22
|
+
columnHeader?: TableColumnHeader;
|
|
23
|
+
cellBackground?: string;
|
|
24
|
+
onShowTable?: () => void;
|
|
25
|
+
onShowMoreRows?: () => void;
|
|
26
|
+
onShowFewerRows?: () => void;
|
|
27
|
+
fitHeight?: boolean;
|
|
28
|
+
fillHeight?: boolean;
|
|
29
|
+
maxHeight?: number;
|
|
30
|
+
compact?: boolean;
|
|
31
|
+
cellDetail?: React.ComponentType<CellDetailProps>;
|
|
32
|
+
}
|
|
33
|
+
type Props = DataTableProps;
|
|
34
|
+
export declare const COLUMN_HEADER_HEIGHT = 32;
|
|
35
|
+
export declare const ROW_HEIGHT = 26;
|
|
36
|
+
export declare function computeGridHeight(baseRowCount: number, visibleRowCount: number, headerHeight: number, scrollbarHeight: number, fitHeight: boolean, maxHeight?: number, measuredHeight?: number, maxRows?: number): number;
|
|
37
|
+
export declare function fittingRowCount(height: number): number;
|
|
38
|
+
export declare const DataTable: React.MemoExoticComponent<(props: Props) => React.JSX.Element | null>;
|