serverside_pivot 0.0.0-stage → 0.0.91
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/README.md +182 -3
- package/dist/react/chunks/ContextMenu-Bt5_3bmD.mjs +192 -0
- package/dist/react/chunks/DetailDrawer-Eb4EpVHG.mjs +37 -0
- package/dist/react/chunks/DetailSidePanel-BTcHOiKr.mjs +36 -0
- package/dist/react/chunks/DetailSurfaceContent-B3ZNKh7q.mjs +200 -0
- package/dist/react/chunks/ECharts2dRenderer-C3Qv0uAa.mjs +3299 -0
- package/dist/react/chunks/ECharts3dRenderer-BB_7-fOt.mjs +21573 -0
- package/dist/react/chunks/EditSidePanel-C2cAvxlK.mjs +298 -0
- package/dist/react/chunks/InlineDetailPanel-BXLAw1o3.mjs +41 -0
- package/dist/react/chunks/PivotCharts-Bw6Swoa3.mjs +4252 -0
- package/dist/react/chunks/ReportEditor-D4V0ry2B.mjs +1726 -0
- package/dist/react/chunks/SidebarPanel-xO59p_2o.mjs +3339 -0
- package/dist/react/chunks/SparklineDetailGraph-Bu85X7OJ.mjs +200 -0
- package/dist/react/chunks/installCanvasRenderer-B7sfDGoL.mjs +21281 -0
- package/dist/react/chunks/react-CPZZxtSo.mjs +26999 -0
- package/dist/react/chunks/xlsx.mini.min-vfxHk3Ry.mjs +7996 -0
- package/dist/react/components/Charts/ChartRenderers.d.ts +73 -0
- package/dist/react/components/Charts/ChartWorkspace.d.ts +38 -0
- package/dist/react/components/Charts/ECharts2dRenderer.d.ts +5 -0
- package/dist/react/components/Charts/ECharts3dRenderer.d.ts +6 -0
- package/dist/react/components/Charts/PivotCharts.d.ts +9 -0
- package/dist/react/components/Charts/chartEnhancements.d.ts +66 -0
- package/dist/react/components/Charts/chartExportPresentation.d.ts +19 -0
- package/dist/react/components/Charts/chartMath.d.ts +4 -0
- package/dist/react/components/Charts/useChartExportMenu.d.ts +12 -0
- package/dist/react/components/DashTanstackPivot.react.d.ts +372 -0
- package/dist/react/components/Filters/ColumnFilter.d.ts +13 -0
- package/dist/react/components/Filters/DateRangeFilter.d.ts +8 -0
- package/dist/react/components/Filters/FilterPopover.d.ts +14 -0
- package/dist/react/components/Filters/MultiSelectFilter.d.ts +12 -0
- package/dist/react/components/Filters/NumericRangeFilter.d.ts +8 -0
- package/dist/react/components/Notification.d.ts +7 -0
- package/dist/react/components/PivotAppBar.d.ts +2 -0
- package/dist/react/components/PivotErrorBoundary.d.ts +15 -0
- package/dist/react/components/PivotSmallComponents.d.ts +6 -0
- package/dist/react/components/PivotWorkspace.d.ts +19 -0
- package/dist/react/components/PivotWorkspaceCanvas.d.ts +5 -0
- package/dist/react/components/PivotWorkspaceControls.d.ts +12 -0
- package/dist/react/components/PivotWorkspaceShell.d.ts +12 -0
- package/dist/react/components/RuntimeDataError.d.ts +7 -0
- package/dist/react/components/Sidebar/ColumnTreeItem.d.ts +14 -0
- package/dist/react/components/Sidebar/ReportEditor.d.ts +21 -0
- package/dist/react/components/Sidebar/SidebarFilterItem.d.ts +14 -0
- package/dist/react/components/Sidebar/SidebarPanel.d.ts +2 -0
- package/dist/react/components/Sidebar/ToolPanelSection.d.ts +14 -0
- package/dist/react/components/Sidebar/customCategoryUtils.d.ts +62 -0
- package/dist/react/components/Sidebar/formulaUtils.d.ts +22 -0
- package/dist/react/components/SkeletonRow.d.ts +6 -0
- package/dist/react/components/Table/ContextMenu.d.ts +9 -0
- package/dist/react/components/Table/DetailDrawer.d.ts +12 -0
- package/dist/react/components/Table/DetailSidePanel.d.ts +12 -0
- package/dist/react/components/Table/DetailSurfaceContent.d.ts +12 -0
- package/dist/react/components/Table/EditSidePanel.d.ts +21 -0
- package/dist/react/components/Table/EditableCell.d.ts +29 -0
- package/dist/react/components/Table/InlineDetailPanel.d.ts +14 -0
- package/dist/react/components/Table/PivotTableBody.d.ts +9 -0
- package/dist/react/components/Table/SparklineCell.d.ts +17 -0
- package/dist/react/components/Table/SparklineDetailGraph.d.ts +5 -0
- package/dist/react/components/Table/StatusBar.d.ts +8 -0
- package/dist/react/contexts/PivotConfigContext.d.ts +34 -0
- package/dist/react/contexts/PivotThemeContext.d.ts +7 -0
- package/dist/react/contexts/PivotValueDisplayContext.d.ts +10 -0
- package/dist/react/hooks/useCellInteraction.d.ts +31 -0
- package/dist/react/hooks/useChartState.d.ts +76 -0
- package/dist/react/hooks/useColumnDefs.d.ts +82 -0
- package/dist/react/hooks/useColumnVirtualizer.d.ts +30 -0
- package/dist/react/hooks/useDetailDrillThrough.d.ts +38 -0
- package/dist/react/hooks/useFilteredData.d.ts +2 -0
- package/dist/react/hooks/useFormatState.d.ts +44 -0
- package/dist/react/hooks/usePersistence.d.ts +5 -0
- package/dist/react/hooks/usePivotFieldInteractions.d.ts +28 -0
- package/dist/react/hooks/usePivotNormalization.d.ts +483 -0
- package/dist/react/hooks/usePivotRenderCounter.d.ts +1 -0
- package/dist/react/hooks/usePivotTransactions.d.ts +29 -0
- package/dist/react/hooks/useRenderHelpers.d.ts +85 -0
- package/dist/react/hooks/useReportMode.d.ts +32 -0
- package/dist/react/hooks/useRowCache.d.ts +19 -0
- package/dist/react/hooks/useRuntimeDataCommit.d.ts +26 -0
- package/dist/react/hooks/useRuntimeProfiling.d.ts +19 -0
- package/dist/react/hooks/useRuntimeTransport.d.ts +24 -0
- package/dist/react/hooks/useServerSideRowModel.d.ts +50 -0
- package/dist/react/hooks/useServerSideViewportController.d.ts +64 -0
- package/dist/react/hooks/useSidebarUI.d.ts +37 -0
- package/dist/react/hooks/useStickyStyles.d.ts +24 -0
- package/dist/react/index.mjs +16 -0
- package/dist/react/presentation/headerFormatting.d.ts +13 -0
- package/dist/react/presentation/safeCellContent.d.ts +16 -0
- package/dist/react/react.d.ts +8 -0
- package/dist/react/runtime/PivotRuntimeRoot.d.ts +7 -0
- package/dist/react/runtime/cellSelectionAnchor.d.ts +45 -0
- package/dist/react/runtime/client/clientPivotTransport.d.ts +28 -0
- package/dist/react/runtime/client/clientResponsePostProcessor.d.ts +20 -0
- package/dist/react/runtime/client/clientSqlPlanner.d.ts +5 -0
- package/dist/react/runtime/client/duckdbWasmExecutor.d.ts +36 -0
- package/dist/react/runtime/client/index.d.ts +6 -0
- package/dist/react/runtime/client/modeResolver.d.ts +16 -0
- package/dist/react/runtime/client/types.d.ts +202 -0
- package/dist/react/runtime/createRuntimeCellPresentation.d.ts +7 -0
- package/dist/react/runtime/createRuntimeExportCommands.d.ts +77 -0
- package/dist/react/runtime/createRuntimeRowPinCommand.d.ts +9 -0
- package/dist/react/runtime/createWorkspacePresentation.d.ts +7 -0
- package/dist/react/runtime/displayColumnOrder.d.ts +4 -0
- package/dist/react/runtime/httpTransport.d.ts +65 -0
- package/dist/react/runtime/runtime-contract.generated.d.ts +48 -0
- package/dist/react/runtime/runtime-response-contract.generated.d.ts +34 -0
- package/dist/react/runtime/runtimeContract.d.ts +115 -0
- package/dist/react/runtime/runtimeDomains.d.ts +642 -0
- package/dist/react/runtime/runtimeDomains.type-test.d.ts +1 -0
- package/dist/react/runtime/runtimeResponseDedup.d.ts +36 -0
- package/dist/react/runtime/useChartWorkspacePresentation.d.ts +50 -0
- package/dist/react/runtime/useCommandRuntime.d.ts +3 -0
- package/dist/react/runtime/useCommandRuntimeStage.d.ts +1 -0
- package/dist/react/runtime/useCoreRuntime.d.ts +3 -0
- package/dist/react/runtime/useCoreRuntimeStage.d.ts +3 -0
- package/dist/react/runtime/useRuntimeCellSelection.d.ts +44 -0
- package/dist/react/runtime/useRuntimeChartCanvasCommands.d.ts +36 -0
- package/dist/react/runtime/useRuntimeChartCanvasResize.d.ts +13 -0
- package/dist/react/runtime/useRuntimeChartCanvasVerticalResize.d.ts +9 -0
- package/dist/react/runtime/useRuntimeChartDefinitionCommands.d.ts +14 -0
- package/dist/react/runtime/useRuntimeChartFloatingInteractions.d.ts +28 -0
- package/dist/react/runtime/useRuntimeChartModels.d.ts +69 -0
- package/dist/react/runtime/useRuntimeChartPanelSizing.d.ts +12 -0
- package/dist/react/runtime/useRuntimeChartRequestDispatch.d.ts +7 -0
- package/dist/react/runtime/useRuntimeClipboardExportPresentation.d.ts +159 -0
- package/dist/react/runtime/useRuntimeClipboardPaste.d.ts +7 -0
- package/dist/react/runtime/useRuntimeColorScalePresentation.d.ts +55 -0
- package/dist/react/runtime/useRuntimeColumnAutoSizing.d.ts +26 -0
- package/dist/react/runtime/useRuntimeColumnCommands.d.ts +22 -0
- package/dist/react/runtime/useRuntimeColumnMeasurement.d.ts +16 -0
- package/dist/react/runtime/useRuntimeDataRetry.d.ts +12 -0
- package/dist/react/runtime/useRuntimeDisplayNavigation.d.ts +17 -0
- package/dist/react/runtime/useRuntimeEditCellIdentity.d.ts +22 -0
- package/dist/react/runtime/useRuntimeEditChangeTracking.d.ts +28 -0
- package/dist/react/runtime/useRuntimeEditComparisonState.d.ts +35 -0
- package/dist/react/runtime/useRuntimeEditDispatch.d.ts +47 -0
- package/dist/react/runtime/useRuntimeEditOwnership.d.ts +32 -0
- package/dist/react/runtime/useRuntimeEditPresentation.d.ts +32 -0
- package/dist/react/runtime/useRuntimeEditStatePersistence.d.ts +28 -0
- package/dist/react/runtime/useRuntimeExportState.d.ts +20 -0
- package/dist/react/runtime/useRuntimeFilterPopover.d.ts +23 -0
- package/dist/react/runtime/useRuntimeLayoutHistory.d.ts +44 -0
- package/dist/react/runtime/useRuntimeOptimisticCellState.d.ts +27 -0
- package/dist/react/runtime/useRuntimeRequestSession.d.ts +79 -0
- package/dist/react/runtime/useRuntimeResponseLifecycle.d.ts +47 -0
- package/dist/react/runtime/useRuntimeResponsePostCommit.d.ts +15 -0
- package/dist/react/runtime/useRuntimeRowEditSessions.d.ts +28 -0
- package/dist/react/runtime/useRuntimeRowEditing.d.ts +18 -0
- package/dist/react/runtime/useRuntimeRowSelection.d.ts +14 -0
- package/dist/react/runtime/useRuntimeSelectionFormatting.d.ts +36 -0
- package/dist/react/runtime/useRuntimeStructuralSync.d.ts +65 -0
- package/dist/react/runtime/useRuntimeViewRestoreScroll.d.ts +9 -0
- package/dist/react/runtime/useRuntimeViewSnapshot.d.ts +203 -0
- package/dist/react/runtime/useRuntimeViewportTableData.d.ts +23 -0
- package/dist/react/runtime/useTransportRuntime.d.ts +12 -0
- package/dist/react/runtime/useViewportRuntime.d.ts +3 -0
- package/dist/react/runtime/useViewportRuntimeStage.d.ts +1 -0
- package/dist/react/runtime/useWorkspaceRuntime.d.ts +3 -0
- package/dist/react/runtime/useWorkspaceRuntimeStage.d.ts +1 -0
- package/dist/react/runtime/useWorkspaceStatusPresentation.d.ts +115 -0
- package/dist/react/runtime/workspaceViewModel.d.ts +7 -0
- package/dist/react/utils/Icons.d.ts +46 -0
- package/dist/react/utils/chartModelBuilders.d.ts +236 -0
- package/dist/react/utils/columnOrder.d.ts +12 -0
- package/dist/react/utils/dataBars.d.ts +7 -0
- package/dist/react/utils/domEvents.d.ts +1 -0
- package/dist/react/utils/editing.d.ts +47 -0
- package/dist/react/utils/exportUtils.d.ts +121 -0
- package/dist/react/utils/fieldPanelLayout.d.ts +61 -0
- package/dist/react/utils/filterOptions.d.ts +4 -0
- package/dist/react/utils/formatting.d.ts +1 -0
- package/dist/react/utils/helpers.d.ts +20 -0
- package/dist/react/utils/horizontalViewport.d.ts +12 -0
- package/dist/react/utils/layoutRows.d.ts +3 -0
- package/dist/react/utils/measureAxis.d.ts +22 -0
- package/dist/react/utils/pivotLayoutUtils.d.ts +2 -0
- package/dist/react/utils/pivotProfiler.d.ts +4 -0
- package/dist/react/utils/rawTableTsv.d.ts +21 -0
- package/dist/react/utils/reportEditorSelection.d.ts +23 -0
- package/dist/react/utils/rowSpanning.d.ts +6 -0
- package/dist/react/utils/savedReports.d.ts +7 -0
- package/dist/react/utils/sorting.d.ts +14 -0
- package/dist/react/utils/sparklineDetail.d.ts +8 -0
- package/dist/react/utils/sparklines.d.ts +78 -0
- package/dist/react/utils/styles.d.ts +957 -0
- package/package.json +114 -6
package/README.md
CHANGED
|
@@ -1,3 +1,182 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# ⚡ serverside_pivot
|
|
2
|
+
|
|
3
|
+
### **Turnkey Analytical Pivot Table & Virtualized Data Grid for React**
|
|
4
|
+
#### *Dual-Engine Architecture: Zero-Network In-Browser Analytics (DuckDB-WASM & In-Memory) + Scalable Server-Side Pushdown.*
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/serverside_pivot)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](https://react.dev/)
|
|
10
|
+
[](https://duckdb.org/docs/api/wasm/overview)
|
|
11
|
+
[](https://echarts.apache.org/)
|
|
12
|
+
|
|
13
|
+
`serverside_pivot` is an enterprise-grade, low-code analytical pivot table and 2D virtualized grid for **React**. Built on **TanStack Table v8**, **DuckDB-WASM**, and **Apache ECharts 6**, it bridges the gap between lightweight client tables and heavy server-side BI tools.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🚀 Why `serverside_pivot`?
|
|
18
|
+
|
|
19
|
+
Unlike traditional grid components that either crash browser memory with large datasets or force you to spend months building custom SQL backends:
|
|
20
|
+
|
|
21
|
+
1. **Dual Execution Engine (Hybrid)**:
|
|
22
|
+
- **Client-Side Mode (`DuckDB-WASM` & In-Memory)**: Run complete multi-dimensional pivots, $\mathcal{O}(D)$ level-based hierarchy expansions, multi-column sorting, Excel formulas, window functions, and ECharts visualizations **100% inside the browser with ZERO server roundtrips and zero latency**.
|
|
23
|
+
- **Server-Side Pushdown Mode**: Connect seamlessly to Python backend services (`serverside-pivot`) backed by **Snowflake, BigQuery, PostgreSQL, ClickHouse, MotherDuck, or DuckDB** to query hundreds of millions of rows with bounded 50-row virtual slices.
|
|
24
|
+
2. **2D Virtualization (Row + Column)**: Smoothly virtualizes both vertical rows (millions of records) and horizontal pivoted columns (1,000+ columns) with a **constant < 80 MB client RAM footprint**.
|
|
25
|
+
3. **Turnkey BI Analytics**: Built-in 23+ chart families (ECharts 2D/3D), inline cell sparklines, heatmaps, Excel-like calculated formulas (`[revenue] - [cost]`), window functions (`percent_of_grand_total`), 11 enterprise themes, and client-side SheetJS XLSX/CSV export.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 📦 Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install serverside_pivot
|
|
33
|
+
# or
|
|
34
|
+
yarn add serverside_pivot
|
|
35
|
+
# or
|
|
36
|
+
pnpm add serverside_pivot
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Peer Dependencies
|
|
40
|
+
```bash
|
|
41
|
+
npm install react react-dom styled-components
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## ⚡ Quickstart
|
|
47
|
+
|
|
48
|
+
### 1. Zero-Backend Client-Side Pivot (DuckDB-WASM / In-Memory)
|
|
49
|
+
|
|
50
|
+
Feed your JSON records or CSV/Parquet data directly into `PivotWorkspace`. The internal `ClientPivotTransport` executes all groupings, multi-column aggregations, and expansions in browser WebAssembly:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import React from 'react';
|
|
54
|
+
import { PivotWorkspace, ClientPivotTransport } from 'serverside_pivot/react';
|
|
55
|
+
|
|
56
|
+
const salesData = [
|
|
57
|
+
{ region: 'North America', country: 'USA', rep: 'Alice', year: '2024', revenue: 150000, cost: 95000 },
|
|
58
|
+
{ region: 'North America', country: 'USA', rep: 'Bob', year: '2025', revenue: 180000, cost: 110000 },
|
|
59
|
+
{ region: 'North America', country: 'Canada', rep: 'Charlie', year: '2024', revenue: 90000, cost: 60000 },
|
|
60
|
+
{ region: 'Europe', country: 'Germany', rep: 'David', year: '2024', revenue: 130000, cost: 85000 },
|
|
61
|
+
{ region: 'Europe', country: 'France', rep: 'Emma', year: '2025', revenue: 140000, cost: 90000 },
|
|
62
|
+
// ... up to 50,000+ rows
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
// Initialize client transport (runs 100% in-browser)
|
|
66
|
+
const clientTransport = new ClientPivotTransport({
|
|
67
|
+
tableName: 'sales',
|
|
68
|
+
data: salesData,
|
|
69
|
+
clientEngine: 'auto', // 'auto' (>= 1000 rows activates DuckDB-Wasm), 'duckdb-wasm', or 'memory'
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export function App() {
|
|
73
|
+
return (
|
|
74
|
+
<div style={{ height: '800px', width: '100%' }}>
|
|
75
|
+
<PivotWorkspace
|
|
76
|
+
table="sales"
|
|
77
|
+
transport={clientTransport}
|
|
78
|
+
rowFields={['region', 'country', 'rep']}
|
|
79
|
+
colFields={['year']}
|
|
80
|
+
valConfigs={[
|
|
81
|
+
{ field: 'revenue', agg: 'sum', format: 'currency', label: 'Revenue ($)' },
|
|
82
|
+
{ field: 'cost', agg: 'sum', format: 'currency', label: 'Cost ($)' },
|
|
83
|
+
{
|
|
84
|
+
field: 'profit',
|
|
85
|
+
label: 'Gross Profit',
|
|
86
|
+
formula: '[revenue] - [cost]',
|
|
87
|
+
format: 'currency',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
field: 'rev_pct',
|
|
91
|
+
label: '% Total Revenue',
|
|
92
|
+
agg: 'sum',
|
|
93
|
+
windowFn: 'percent_of_grand_total',
|
|
94
|
+
format: 'percent',
|
|
95
|
+
},
|
|
96
|
+
]}
|
|
97
|
+
showRowTotals={true}
|
|
98
|
+
showColTotals={true}
|
|
99
|
+
defaultTheme="flash" // 'dark' | 'light' | 'bloomberg_black' | 'flash' | 'material' | ...
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 2. Scalable Server-Side Pushdown Mode
|
|
109
|
+
|
|
110
|
+
For datasets with millions or billions of rows, connect to any backend implementing the standard V1 runtime protocol:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import React from 'react';
|
|
114
|
+
import {
|
|
115
|
+
PivotWorkspace,
|
|
116
|
+
HttpPivotTransport,
|
|
117
|
+
LatestViewportScheduler,
|
|
118
|
+
} from 'serverside_pivot/react';
|
|
119
|
+
|
|
120
|
+
// Wraps HTTP requests with auto-cancellation (latest-viewport-wins)
|
|
121
|
+
const transport = new LatestViewportScheduler(
|
|
122
|
+
new HttpPivotTransport({
|
|
123
|
+
endpoint: '/v1/runtime',
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
export function EnterpriseAnalytics() {
|
|
128
|
+
return (
|
|
129
|
+
<div style={{ height: '100vh', width: '100%' }}>
|
|
130
|
+
<PivotWorkspace
|
|
131
|
+
table="warehouse_orders"
|
|
132
|
+
transport={transport}
|
|
133
|
+
rowFields={['department', 'category', 'product']}
|
|
134
|
+
colFields={['quarter']}
|
|
135
|
+
valConfigs={[
|
|
136
|
+
{ field: 'sales_amount', agg: 'sum', format: 'currency' },
|
|
137
|
+
{ field: 'order_count', agg: 'count' },
|
|
138
|
+
]}
|
|
139
|
+
showRowTotals={true}
|
|
140
|
+
showColTotals={true}
|
|
141
|
+
defaultTheme="dark"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## ✨ Key Enterprise Capabilities
|
|
151
|
+
|
|
152
|
+
| Feature | Description |
|
|
153
|
+
| :--- | :--- |
|
|
154
|
+
| **Dual Execution Engine** | Seamlessly toggle between 100% in-browser WebAssembly execution (`ClientPivotTransport`) and server-side warehouse pushdown (`HttpPivotTransport`). |
|
|
155
|
+
| **2D Virtualization** | Constant < 80 MB browser memory whether scrolling through 10,000 rows or 1,000,000,000+ rows with 1,000+ dynamic pivoted columns. |
|
|
156
|
+
| **$\mathcal{O}(D)$ Level-Based Hierarchy** | Multi-level tree group expansions execute one single batched query per hierarchy depth level ($D$) rather than sequential $N$-query waterfalls. |
|
|
157
|
+
| **Visual Analytics & Charting** | Integrated **ECharts 6** & **ECharts-GL 3D**: 23+ chart types across 11 families (Bar, Line, Area, Pie, Radar, Scatter, Waterfall, 3D Bar/Surface) linked to live pivot state. |
|
|
158
|
+
| **In-Cell Sparklines & Data Bars** | High-performance inline SVG sparklines (Line, Area, Bar) and proportional cell data bars rendered directly inside grid cells with zero DOM bloat. |
|
|
159
|
+
| **Excel AST Formulas & Window Functions** | Excel-like calculated measures using `[Field]` syntax and built-in pivot window functions (`percent_of_row`, `percent_of_col`, `percent_of_grand_total`). |
|
|
160
|
+
| **4 Layout Modes** | Multidimensional Pivot (`pivot`), Parent-Child Tree (`tree`), Flat Record Grid (`table`), and Financial P&L Report Mode (`report`). |
|
|
161
|
+
| **Client SheetJS & Clipboard** | Instant client-side Excel XLSX and CSV streaming export with merged headers and formatting preserved. RFC-compliant HTML/TSV clipboard copy. |
|
|
162
|
+
| **11 Enterprise Themes** | Complete theme system: `light`, `dark`, `flash`, `material`, `balham`, `bloomberg`, `bloomberg_black`, `strata`, `crystal`, `alabaster`, `satin` with full `--sp-*` CSS variables. |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 🌐 Multi-Framework Ecosystem
|
|
167
|
+
|
|
168
|
+
`serverside_pivot` is part of the `serverside-pivot` ecosystem:
|
|
169
|
+
- **Standalone React**: `serverside_pivot` (this package)
|
|
170
|
+
- **Python Plotly Dash**: `pip install serverside-pivot`
|
|
171
|
+
- **Streamlit**: `pip install "serverside-pivot[streamlit]"`
|
|
172
|
+
- **Backend Pushdown**: Powered by **DuckDB**, **PyArrow**, and **Ibis** (Snowflake, BigQuery, Postgres, ClickHouse, MotherDuck, Databricks, Trino)
|
|
173
|
+
|
|
174
|
+
For comprehensive documentation, live Python/Dash showcases, and interactive examples, visit the **[GitHub Repository](https://github.com/Ramzy22/serverside_pivot)**.
|
|
175
|
+
|
|
176
|
+
> Cell editing and edit transactions are not a supported public capability in this release. Legacy edit-related Dash inputs are accepted as no-ops only for layout compatibility.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 📄 License
|
|
181
|
+
|
|
182
|
+
Distributed under the **MIT License**.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import p, { useState as T, useRef as R, useCallback as v, useEffect as B, useLayoutEffect as O } from "react";
|
|
2
|
+
const G = 80, J = 220, N = ({ actions: e, theme: t, onClose: b, itemRefs: f, onItemMouseEnter: g, onKeyDown: D }) => /* @__PURE__ */ p.createElement(p.Fragment, null, e.map((u, o) => {
|
|
3
|
+
if (u === "separator")
|
|
4
|
+
return /* @__PURE__ */ p.createElement(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
key: o,
|
|
8
|
+
role: "presentation",
|
|
9
|
+
style: { height: "1px", background: (t == null ? void 0 : t.border) || "#e0e0e0", margin: "4px 0" }
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
const a = !!u.disabled, d = Array.isArray(u.children) && u.children.length > 0;
|
|
13
|
+
return /* @__PURE__ */ p.createElement(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
key: o,
|
|
17
|
+
ref: (l) => {
|
|
18
|
+
f && (f.current[o] = l);
|
|
19
|
+
},
|
|
20
|
+
role: "menuitem",
|
|
21
|
+
"aria-haspopup": d ? "menu" : void 0,
|
|
22
|
+
"aria-disabled": a || void 0,
|
|
23
|
+
tabIndex: a ? -1 : 0,
|
|
24
|
+
title: u.title || (typeof u.label == "string" ? u.label : void 0),
|
|
25
|
+
onMouseEnter: (l) => {
|
|
26
|
+
l.currentTarget.style.backgroundColor = a ? "" : (t == null ? void 0 : t.hover) || "#f5f5f5", g && g(o, d, a);
|
|
27
|
+
},
|
|
28
|
+
onMouseLeave: (l) => {
|
|
29
|
+
l.currentTarget.style.backgroundColor = "";
|
|
30
|
+
},
|
|
31
|
+
onClick: (l) => {
|
|
32
|
+
if (a || d) {
|
|
33
|
+
l.stopPropagation();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
typeof u.onClick == "function" && u.onClick(), b();
|
|
37
|
+
},
|
|
38
|
+
onKeyDown: (l) => {
|
|
39
|
+
a || (l.key === "Enter" || l.key === " " ? (l.preventDefault(), l.stopPropagation(), !d && typeof u.onClick == "function" && u.onClick(), d ? g && g(o, !0, !1) : b()) : D && D(l, o));
|
|
40
|
+
},
|
|
41
|
+
style: {
|
|
42
|
+
padding: "7px 12px 7px 14px",
|
|
43
|
+
cursor: a ? "not-allowed" : "pointer",
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
gap: "8px",
|
|
47
|
+
color: a ? (t == null ? void 0 : t.textSec) || "#757575" : (t == null ? void 0 : t.text) || "#111",
|
|
48
|
+
opacity: a ? 0.48 : 1,
|
|
49
|
+
userSelect: "none"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
u.icon && /* @__PURE__ */ p.createElement("span", { style: { color: (t == null ? void 0 : t.textSec) || "#757575", display: "flex", flexShrink: 0 } }, u.icon),
|
|
53
|
+
/* @__PURE__ */ p.createElement("span", { style: { flex: 1 } }, u.label),
|
|
54
|
+
d && /* @__PURE__ */ p.createElement("span", { style: { color: (t == null ? void 0 : t.textSec) || "#9ca3af", fontSize: "10px", marginLeft: "4px" } }, "▶")
|
|
55
|
+
);
|
|
56
|
+
})), U = (e) => ({
|
|
57
|
+
background: (e == null ? void 0 : e.surfaceBg) || (e == null ? void 0 : e.background) || "#fff",
|
|
58
|
+
border: `1px solid ${(e == null ? void 0 : e.border) || "#ccc"}`,
|
|
59
|
+
boxShadow: (e == null ? void 0 : e.shadowMd) || "0 4px 20px rgba(0,0,0,0.15)",
|
|
60
|
+
padding: "6px 0",
|
|
61
|
+
borderRadius: (e == null ? void 0 : e.radiusSm) || "8px",
|
|
62
|
+
fontSize: "13px",
|
|
63
|
+
minWidth: "190px",
|
|
64
|
+
maxWidth: "300px",
|
|
65
|
+
color: (e == null ? void 0 : e.text) || "#111"
|
|
66
|
+
}), V = ({ x: e, y: t, onClose: b, actions: f, theme: g }) => {
|
|
67
|
+
const [D, u] = T({ x: e, y: t }), [o, a] = T(null), [d, l] = T(null), W = R(null), H = R(null), k = R([]), A = R(null), E = v((n, r = 1) => {
|
|
68
|
+
const s = f.length;
|
|
69
|
+
for (let i = 0; i < s; i++) {
|
|
70
|
+
const y = (n + i * r + s * 2) % s, c = f[y];
|
|
71
|
+
if (c && c !== "separator" && !c.disabled && k.current[y]) {
|
|
72
|
+
k.current[y].focus();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, [f]);
|
|
77
|
+
B(() => {
|
|
78
|
+
E(0, 1);
|
|
79
|
+
}, [E]), B(() => () => clearTimeout(A.current), []);
|
|
80
|
+
const K = v(() => {
|
|
81
|
+
clearTimeout(A.current), A.current = setTimeout(() => {
|
|
82
|
+
a(null), l(null);
|
|
83
|
+
}, J);
|
|
84
|
+
}, []), L = v(() => {
|
|
85
|
+
clearTimeout(A.current);
|
|
86
|
+
}, []), C = v((n) => {
|
|
87
|
+
clearTimeout(A.current), A.current = setTimeout(() => {
|
|
88
|
+
a(n);
|
|
89
|
+
const r = k.current[n];
|
|
90
|
+
r && l(r.getBoundingClientRect());
|
|
91
|
+
}, o !== null ? 0 : G);
|
|
92
|
+
}, [o]), Y = v((n, r, s) => {
|
|
93
|
+
s || (r ? C(n) : (L(), a(null), l(null)));
|
|
94
|
+
}, [C, L]), I = v((n, r) => {
|
|
95
|
+
if (n.key === "Escape")
|
|
96
|
+
n.preventDefault(), b();
|
|
97
|
+
else if (n.key === "ArrowDown")
|
|
98
|
+
n.preventDefault(), E(r + 1, 1);
|
|
99
|
+
else if (n.key === "ArrowUp")
|
|
100
|
+
n.preventDefault(), E(r - 1, -1);
|
|
101
|
+
else if (n.key === "Home")
|
|
102
|
+
n.preventDefault(), E(0, 1);
|
|
103
|
+
else if (n.key === "End")
|
|
104
|
+
n.preventDefault(), E(f.length - 1, -1);
|
|
105
|
+
else if (n.key === "ArrowRight" && o === null && Number.isFinite(r) && r >= 0) {
|
|
106
|
+
const s = f[r];
|
|
107
|
+
s && s !== "separator" && Array.isArray(s.children) && (n.preventDefault(), C(r));
|
|
108
|
+
}
|
|
109
|
+
}, [b, E, f, o, C]);
|
|
110
|
+
O(() => {
|
|
111
|
+
const n = () => {
|
|
112
|
+
var F;
|
|
113
|
+
const r = window.innerWidth, s = window.innerHeight, i = (F = W.current) == null ? void 0 : F.getBoundingClientRect(), y = (i == null ? void 0 : i.width) || 200, c = (i == null ? void 0 : i.height) || f.length * 32 + 20, x = 8;
|
|
114
|
+
let M = Math.max(x, Math.min(e, r - y - x)), q = Math.max(x, Math.min(t, s - c - x));
|
|
115
|
+
u({ x: M, y: q });
|
|
116
|
+
};
|
|
117
|
+
return n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
|
|
118
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
119
|
+
};
|
|
120
|
+
}, [e, t, f.length]);
|
|
121
|
+
const [_, $] = T({ left: 0, top: 0 });
|
|
122
|
+
O(() => {
|
|
123
|
+
if (!d || o === null) return;
|
|
124
|
+
const n = H.current;
|
|
125
|
+
if (!n) return;
|
|
126
|
+
const r = window.innerWidth, s = window.innerHeight, i = n.offsetWidth || 200, y = n.offsetHeight || 200, c = 6;
|
|
127
|
+
let x = d.right + 2;
|
|
128
|
+
x + i > r - c && (x = d.left - i - 2);
|
|
129
|
+
let M = d.top - 6;
|
|
130
|
+
M + y > s - c && (M = s - y - c), $({ left: Math.max(c, x), top: Math.max(c, M) });
|
|
131
|
+
}, [d, o]);
|
|
132
|
+
const P = o !== null ? f[o] : null, w = P && Array.isArray(P.children) ? P.children : null, S = R([]), z = v((n, r = 1) => {
|
|
133
|
+
if (!w) return;
|
|
134
|
+
const s = w.length;
|
|
135
|
+
for (let i = 0; i < s; i++) {
|
|
136
|
+
const y = (n + i * r + s * 2) % s, c = w[y];
|
|
137
|
+
if (c && c !== "separator" && !c.disabled && S.current[y]) {
|
|
138
|
+
S.current[y].focus();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, [w]);
|
|
143
|
+
B(() => {
|
|
144
|
+
w && (S.current = S.current.slice(0, w.length));
|
|
145
|
+
}, [w]);
|
|
146
|
+
const j = v((n, r) => {
|
|
147
|
+
n.key === "Escape" || n.key === "ArrowLeft" ? (n.preventDefault(), n.stopPropagation(), a(null), l(null), o !== null && k.current[o] && k.current[o].focus()) : n.key === "ArrowDown" ? (n.preventDefault(), z(r + 1, 1)) : n.key === "ArrowUp" && (n.preventDefault(), z(r - 1, -1));
|
|
148
|
+
}, [z, o]);
|
|
149
|
+
return /* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
ref: W,
|
|
153
|
+
role: "menu",
|
|
154
|
+
style: { position: "fixed", top: D.y, left: D.x, zIndex: 10001, ...U(g) },
|
|
155
|
+
onMouseLeave: K,
|
|
156
|
+
onMouseEnter: L
|
|
157
|
+
},
|
|
158
|
+
/* @__PURE__ */ p.createElement(
|
|
159
|
+
N,
|
|
160
|
+
{
|
|
161
|
+
actions: f,
|
|
162
|
+
theme: g,
|
|
163
|
+
onClose: b,
|
|
164
|
+
itemRefs: k,
|
|
165
|
+
onItemMouseEnter: Y,
|
|
166
|
+
onKeyDown: I
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
), w && /* @__PURE__ */ p.createElement(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
ref: H,
|
|
173
|
+
role: "menu",
|
|
174
|
+
style: { position: "fixed", top: _.top, left: _.left, zIndex: 10002, ...U(g) },
|
|
175
|
+
onMouseEnter: L,
|
|
176
|
+
onMouseLeave: K
|
|
177
|
+
},
|
|
178
|
+
/* @__PURE__ */ p.createElement(
|
|
179
|
+
N,
|
|
180
|
+
{
|
|
181
|
+
actions: w,
|
|
182
|
+
theme: g,
|
|
183
|
+
onClose: b,
|
|
184
|
+
itemRefs: S,
|
|
185
|
+
onKeyDown: j
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
));
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
V as default
|
|
192
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import o from "react";
|
|
2
|
+
import { D as u } from "./DetailSurfaceContent-B3ZNKh7q.mjs";
|
|
3
|
+
function b({
|
|
4
|
+
detailState: e,
|
|
5
|
+
onClose: t,
|
|
6
|
+
onPageChange: a,
|
|
7
|
+
onSort: n,
|
|
8
|
+
onFilter: i,
|
|
9
|
+
theme: r,
|
|
10
|
+
height: l = 320
|
|
11
|
+
}) {
|
|
12
|
+
return e ? /* @__PURE__ */ o.createElement("div", { style: {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
left: 0,
|
|
15
|
+
right: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
height: `${Math.max(220, Number(l) || 320)}px`,
|
|
18
|
+
borderTop: `1px solid ${r.border}`,
|
|
19
|
+
background: r.surfaceBg || r.background,
|
|
20
|
+
zIndex: 85,
|
|
21
|
+
boxShadow: "0 -10px 24px rgba(15,23,42,0.12)",
|
|
22
|
+
overflow: "hidden"
|
|
23
|
+
} }, /* @__PURE__ */ o.createElement(
|
|
24
|
+
u,
|
|
25
|
+
{
|
|
26
|
+
detailState: e,
|
|
27
|
+
onClose: t,
|
|
28
|
+
onPageChange: a,
|
|
29
|
+
onSort: n,
|
|
30
|
+
onFilter: i,
|
|
31
|
+
theme: r
|
|
32
|
+
}
|
|
33
|
+
)) : null;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
b as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { D as d } from "./DetailSurfaceContent-B3ZNKh7q.mjs";
|
|
3
|
+
function m({
|
|
4
|
+
detailState: r,
|
|
5
|
+
onClose: i,
|
|
6
|
+
onPageChange: n,
|
|
7
|
+
onSort: o,
|
|
8
|
+
onFilter: l,
|
|
9
|
+
theme: e,
|
|
10
|
+
width: t = 480
|
|
11
|
+
}) {
|
|
12
|
+
return r ? /* @__PURE__ */ a.createElement("div", { style: {
|
|
13
|
+
width: `${Math.max(320, Number(t) || 480)}px`,
|
|
14
|
+
minWidth: `${Math.max(320, Number(t) || 480)}px`,
|
|
15
|
+
maxWidth: "52vw",
|
|
16
|
+
borderLeft: `1px solid ${e.border}`,
|
|
17
|
+
background: e.surfaceBg || e.background,
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "column",
|
|
20
|
+
minHeight: 0,
|
|
21
|
+
overflow: "hidden"
|
|
22
|
+
} }, /* @__PURE__ */ a.createElement(
|
|
23
|
+
d,
|
|
24
|
+
{
|
|
25
|
+
detailState: r,
|
|
26
|
+
onClose: i,
|
|
27
|
+
onPageChange: n,
|
|
28
|
+
onSort: o,
|
|
29
|
+
onFilter: l,
|
|
30
|
+
theme: e
|
|
31
|
+
}
|
|
32
|
+
)) : null;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
m as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import t, { useState as m, useEffect as D } from "react";
|
|
2
|
+
import { y as B } from "./react-CPZZxtSo.mjs";
|
|
3
|
+
function M({
|
|
4
|
+
detailState: o,
|
|
5
|
+
onClose: C,
|
|
6
|
+
onPageChange: a,
|
|
7
|
+
onSort: i,
|
|
8
|
+
onFilter: b,
|
|
9
|
+
theme: e,
|
|
10
|
+
compact: n = !1
|
|
11
|
+
}) {
|
|
12
|
+
const [y, E] = m("");
|
|
13
|
+
if (D(() => {
|
|
14
|
+
E(o && typeof o.filterText == "string" ? o.filterText : "");
|
|
15
|
+
}, [o && o.filterText]), !o) return null;
|
|
16
|
+
const {
|
|
17
|
+
loading: c,
|
|
18
|
+
rows: p = [],
|
|
19
|
+
columns: x = [],
|
|
20
|
+
page: l = 0,
|
|
21
|
+
pageSize: S = 100,
|
|
22
|
+
totalRows: k = 0,
|
|
23
|
+
sortCol: w = null,
|
|
24
|
+
sortDir: v = "asc",
|
|
25
|
+
title: $ = "Detail",
|
|
26
|
+
rowPath: u = ""
|
|
27
|
+
} = o, g = Array.isArray(x) && x.length > 0 ? x.map((r) => typeof r == "string" ? r : r.id).filter(Boolean) : p[0] ? Object.keys(p[0]).filter((r) => !r.startsWith("_")) : [], s = Math.max(1, Math.ceil((k || 0) / Math.max(1, S || 100))), z = (r) => {
|
|
28
|
+
if (i) {
|
|
29
|
+
if (w === r) {
|
|
30
|
+
i(r, v === "asc" ? "desc" : "asc");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
i(r, "asc");
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 } }, /* @__PURE__ */ t.createElement("div", { style: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
justifyContent: "space-between",
|
|
40
|
+
gap: "12px",
|
|
41
|
+
padding: n ? "10px 12px" : "14px 16px",
|
|
42
|
+
borderBottom: `1px solid ${e.border}`,
|
|
43
|
+
background: e.headerBg
|
|
44
|
+
} }, /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { fontSize: n ? "12px" : "13px", fontWeight: 700, color: e.text } }, $), u && /* @__PURE__ */ t.createElement("div", { style: {
|
|
45
|
+
fontSize: "11px",
|
|
46
|
+
color: e.textSec,
|
|
47
|
+
whiteSpace: "nowrap",
|
|
48
|
+
overflow: "hidden",
|
|
49
|
+
textOverflow: "ellipsis",
|
|
50
|
+
maxWidth: n ? "320px" : "460px"
|
|
51
|
+
} }, u)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 } }, /* @__PURE__ */ t.createElement("div", { style: {
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
gap: "6px",
|
|
55
|
+
padding: "0 10px",
|
|
56
|
+
border: `1px solid ${e.border}`,
|
|
57
|
+
borderRadius: "999px",
|
|
58
|
+
background: e.surfaceBg || e.background
|
|
59
|
+
} }, /* @__PURE__ */ t.createElement(B.Search, null), /* @__PURE__ */ t.createElement(
|
|
60
|
+
"input",
|
|
61
|
+
{
|
|
62
|
+
type: "text",
|
|
63
|
+
value: y,
|
|
64
|
+
placeholder: "Filter rows...",
|
|
65
|
+
onChange: (r) => E(r.target.value),
|
|
66
|
+
onKeyDown: (r) => {
|
|
67
|
+
r.key === "Enter" && b && b(y);
|
|
68
|
+
},
|
|
69
|
+
style: {
|
|
70
|
+
border: "none",
|
|
71
|
+
outline: "none",
|
|
72
|
+
background: "transparent",
|
|
73
|
+
color: e.text,
|
|
74
|
+
fontSize: "12px",
|
|
75
|
+
width: n ? "140px" : "180px",
|
|
76
|
+
padding: "8px 0"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
)), /* @__PURE__ */ t.createElement(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
onClick: C,
|
|
84
|
+
style: {
|
|
85
|
+
width: "28px",
|
|
86
|
+
height: "28px",
|
|
87
|
+
borderRadius: "999px",
|
|
88
|
+
border: `1px solid ${e.border}`,
|
|
89
|
+
background: e.surfaceBg || e.background,
|
|
90
|
+
color: e.textSec,
|
|
91
|
+
cursor: "pointer",
|
|
92
|
+
display: "inline-flex",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
justifyContent: "center"
|
|
95
|
+
},
|
|
96
|
+
title: "Close detail"
|
|
97
|
+
},
|
|
98
|
+
/* @__PURE__ */ t.createElement(B.Close, null)
|
|
99
|
+
))), /* @__PURE__ */ t.createElement("div", { style: { flex: 1, minHeight: 0, overflow: "auto", background: e.surfaceBg || e.background } }, c ? /* @__PURE__ */ t.createElement("div", { style: {
|
|
100
|
+
display: "flex",
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
height: "100%",
|
|
104
|
+
color: e.textSec,
|
|
105
|
+
fontSize: "13px"
|
|
106
|
+
} }, "Loading detail...") : /* @__PURE__ */ t.createElement("table", { style: { width: "100%", borderCollapse: "collapse", fontSize: "12px" } }, /* @__PURE__ */ t.createElement("thead", null, /* @__PURE__ */ t.createElement("tr", null, g.map((r) => /* @__PURE__ */ t.createElement(
|
|
107
|
+
"th",
|
|
108
|
+
{
|
|
109
|
+
key: r,
|
|
110
|
+
onClick: () => z(r),
|
|
111
|
+
style: {
|
|
112
|
+
position: "sticky",
|
|
113
|
+
top: 0,
|
|
114
|
+
zIndex: 1,
|
|
115
|
+
textAlign: "left",
|
|
116
|
+
padding: n ? "8px 10px" : "10px 12px",
|
|
117
|
+
background: e.headerBg,
|
|
118
|
+
color: e.text,
|
|
119
|
+
borderBottom: `1px solid ${e.border}`,
|
|
120
|
+
cursor: i ? "pointer" : "default",
|
|
121
|
+
whiteSpace: "nowrap"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
r,
|
|
125
|
+
w === r ? v === "asc" ? " ▲" : " ▼" : ""
|
|
126
|
+
)))), /* @__PURE__ */ t.createElement("tbody", null, p.length === 0 ? /* @__PURE__ */ t.createElement("tr", null, /* @__PURE__ */ t.createElement(
|
|
127
|
+
"td",
|
|
128
|
+
{
|
|
129
|
+
colSpan: Math.max(g.length, 1),
|
|
130
|
+
style: {
|
|
131
|
+
padding: "18px 12px",
|
|
132
|
+
textAlign: "center",
|
|
133
|
+
color: e.textSec,
|
|
134
|
+
borderBottom: `1px solid ${e.border}`
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"No detail rows"
|
|
138
|
+
)) : p.map((r, f) => /* @__PURE__ */ t.createElement("tr", { key: `${o.rowKey || u || "detail"}:${f}`, style: {
|
|
139
|
+
background: f % 2 === 0 ? e.surfaceBg || e.background : e.headerSubtleBg
|
|
140
|
+
} }, g.map((d) => /* @__PURE__ */ t.createElement(
|
|
141
|
+
"td",
|
|
142
|
+
{
|
|
143
|
+
key: `${d}:${f}`,
|
|
144
|
+
style: {
|
|
145
|
+
padding: n ? "7px 10px" : "9px 12px",
|
|
146
|
+
borderBottom: `1px solid ${e.border}`,
|
|
147
|
+
color: e.text,
|
|
148
|
+
whiteSpace: "nowrap"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
r[d] !== void 0 && r[d] !== null ? String(r[d]) : ""
|
|
152
|
+
))))))), /* @__PURE__ */ t.createElement("div", { style: {
|
|
153
|
+
display: "flex",
|
|
154
|
+
alignItems: "center",
|
|
155
|
+
justifyContent: "space-between",
|
|
156
|
+
gap: "12px",
|
|
157
|
+
padding: n ? "10px 12px" : "12px 16px",
|
|
158
|
+
borderTop: `1px solid ${e.border}`,
|
|
159
|
+
background: e.headerBg,
|
|
160
|
+
fontSize: "12px",
|
|
161
|
+
color: e.textSec
|
|
162
|
+
} }, /* @__PURE__ */ t.createElement("span", null, "Page ", l + 1, " of ", s, " ", "(", k || 0, " rows)"), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ t.createElement(
|
|
163
|
+
"button",
|
|
164
|
+
{
|
|
165
|
+
type: "button",
|
|
166
|
+
onClick: () => a && a(Math.max(l - 1, 0)),
|
|
167
|
+
disabled: c || l <= 0,
|
|
168
|
+
style: {
|
|
169
|
+
padding: "6px 10px",
|
|
170
|
+
borderRadius: "8px",
|
|
171
|
+
border: `1px solid ${e.border}`,
|
|
172
|
+
background: e.surfaceBg || e.background,
|
|
173
|
+
color: e.text,
|
|
174
|
+
cursor: l <= 0 ? "default" : "pointer",
|
|
175
|
+
opacity: l <= 0 ? 0.45 : 1
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"Previous"
|
|
179
|
+
), /* @__PURE__ */ t.createElement(
|
|
180
|
+
"button",
|
|
181
|
+
{
|
|
182
|
+
type: "button",
|
|
183
|
+
onClick: () => a && a(l + 1),
|
|
184
|
+
disabled: c || l >= s - 1,
|
|
185
|
+
style: {
|
|
186
|
+
padding: "6px 10px",
|
|
187
|
+
borderRadius: "8px",
|
|
188
|
+
border: `1px solid ${e.border}`,
|
|
189
|
+
background: e.surfaceBg || e.background,
|
|
190
|
+
color: e.text,
|
|
191
|
+
cursor: l >= s - 1 ? "default" : "pointer",
|
|
192
|
+
opacity: l >= s - 1 ? 0.45 : 1
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"Next"
|
|
196
|
+
))));
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
M as D
|
|
200
|
+
};
|