katucharts.js 0.2.1

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 (200) hide show
  1. package/LICENSE +106 -0
  2. package/README.md +1100 -0
  3. package/dist/__vite-optional-peer-dep_jspdf_katucharts-BDMct_Gn.js +4 -0
  4. package/dist/accessibility/A11yModule.d.ts +26 -0
  5. package/dist/axis/Axis.d.ts +140 -0
  6. package/dist/axis/AxisCoordinator.d.ts +38 -0
  7. package/dist/bio.d.ts +22 -0
  8. package/dist/components/Credits.d.ts +38 -0
  9. package/dist/components/Crosshair.d.ts +15 -0
  10. package/dist/components/DataLabels.d.ts +7 -0
  11. package/dist/components/ExportButton.d.ts +27 -0
  12. package/dist/components/Legend.d.ts +53 -0
  13. package/dist/components/TitleRenderer.d.ts +19 -0
  14. package/dist/components/Tooltip.d.ts +61 -0
  15. package/dist/core/Chart.d.ts +156 -0
  16. package/dist/core/EventBus.d.ts +14 -0
  17. package/dist/core/InteractionController.d.ts +62 -0
  18. package/dist/core/OptionsParser.d.ts +61 -0
  19. package/dist/core/Registry.d.ts +27 -0
  20. package/dist/core/SVGRenderer.d.ts +48 -0
  21. package/dist/core/ScrollablePlotOverlay.d.ts +31 -0
  22. package/dist/core/StackComputer.d.ts +25 -0
  23. package/dist/core/StateManager.d.ts +21 -0
  24. package/dist/core/UpdateScheduler.d.ts +28 -0
  25. package/dist/core/animationConstants.d.ts +20 -0
  26. package/dist/core/chartTypes.d.ts +46 -0
  27. package/dist/core/registerAll.d.ts +4 -0
  28. package/dist/core/registerBio.d.ts +4 -0
  29. package/dist/core/registerCore.d.ts +4 -0
  30. package/dist/core/registerFinance.d.ts +4 -0
  31. package/dist/core/registerFinancial.d.ts +4 -0
  32. package/dist/core/registerFlow.d.ts +4 -0
  33. package/dist/core/registerGeneral.d.ts +4 -0
  34. package/dist/datatable/DataTable.d.ts +162 -0
  35. package/dist/datatable/DataTableDefaults.d.ts +7 -0
  36. package/dist/datatable/api/TableApi.d.ts +35 -0
  37. package/dist/datatable/columns/ColumnDef.d.ts +16 -0
  38. package/dist/datatable/columns/ColumnManager.d.ts +31 -0
  39. package/dist/datatable/data/DataProcessor.d.ts +46 -0
  40. package/dist/datatable/data/DataSource.d.ts +26 -0
  41. package/dist/datatable/editing/CellEditor.d.ts +29 -0
  42. package/dist/datatable/export/TableExport.d.ts +23 -0
  43. package/dist/datatable/locales/en.d.ts +9 -0
  44. package/dist/datatable/locales/es.d.ts +6 -0
  45. package/dist/datatable/locales/index.d.ts +22 -0
  46. package/dist/datatable/locales/pt-BR.d.ts +6 -0
  47. package/dist/datatable/locales/resolveLocale.d.ts +16 -0
  48. package/dist/datatable/locales/zh.d.ts +6 -0
  49. package/dist/datatable/render/CellRenderer.d.ts +24 -0
  50. package/dist/datatable/render/HeaderRenderer.d.ts +51 -0
  51. package/dist/datatable/render/PaginationRenderer.d.ts +26 -0
  52. package/dist/datatable/render/SearchRenderer.d.ts +21 -0
  53. package/dist/datatable/render/TableRenderer.d.ts +81 -0
  54. package/dist/datatable/render/ToolbarRenderer.d.ts +34 -0
  55. package/dist/datatable/render/icons.d.ts +24 -0
  56. package/dist/datatable/render/popover.d.ts +15 -0
  57. package/dist/datatable/selection/SelectionManager.d.ts +29 -0
  58. package/dist/datatable/themes/TableTheme.d.ts +36 -0
  59. package/dist/datatable/themes/styleSheet.d.ts +16 -0
  60. package/dist/datatable.d.ts +19 -0
  61. package/dist/export/ChartExporter.d.ts +50 -0
  62. package/dist/export/Export.d.ts +76 -0
  63. package/dist/finance.d.ts +49 -0
  64. package/dist/index.d.ts +67 -0
  65. package/dist/indicators/Indicator.d.ts +23 -0
  66. package/dist/indicators/expandIndicators.d.ts +18 -0
  67. package/dist/indicators/moving-averages/DEMA.d.ts +10 -0
  68. package/dist/indicators/moving-averages/EMA.d.ts +12 -0
  69. package/dist/indicators/moving-averages/SMA.d.ts +11 -0
  70. package/dist/indicators/moving-averages/TEMA.d.ts +10 -0
  71. package/dist/indicators/moving-averages/WMA.d.ts +12 -0
  72. package/dist/indicators/oscillators/CCI.d.ts +11 -0
  73. package/dist/indicators/oscillators/MACD.d.ts +20 -0
  74. package/dist/indicators/oscillators/Momentum.d.ts +10 -0
  75. package/dist/indicators/oscillators/ROC.d.ts +10 -0
  76. package/dist/indicators/oscillators/RSI.d.ts +11 -0
  77. package/dist/indicators/oscillators/Stochastic.d.ts +20 -0
  78. package/dist/indicators/registry.d.ts +9 -0
  79. package/dist/indicators/trend/ADX.d.ts +11 -0
  80. package/dist/indicators/trend/IchimokuCloud.d.ts +14 -0
  81. package/dist/indicators/trend/PSAR.d.ts +11 -0
  82. package/dist/indicators/util.d.ts +8 -0
  83. package/dist/indicators/volatility/ATR.d.ts +11 -0
  84. package/dist/indicators/volatility/BollingerBands.d.ts +11 -0
  85. package/dist/indicators/volume/OBV.d.ts +11 -0
  86. package/dist/indicators/volume/VBP.d.ts +12 -0
  87. package/dist/indicators/volume/VWAP.d.ts +12 -0
  88. package/dist/interaction/Drilldown.d.ts +29 -0
  89. package/dist/interaction/HoverManager.d.ts +47 -0
  90. package/dist/interaction/Zoom.d.ts +68 -0
  91. package/dist/katucharts-bio.es.js +5861 -0
  92. package/dist/katucharts-bio.umd.js +1 -0
  93. package/dist/katucharts-datatable.es.js +3363 -0
  94. package/dist/katucharts-datatable.umd.js +296 -0
  95. package/dist/katucharts-finance.es.js +4364 -0
  96. package/dist/katucharts-finance.umd.js +1 -0
  97. package/dist/katucharts-react.es.js +35 -0
  98. package/dist/katucharts-react.umd.js +1 -0
  99. package/dist/katucharts.es.js +20531 -0
  100. package/dist/katucharts.umd.js +9 -0
  101. package/dist/layout/LayoutEngine.d.ts +44 -0
  102. package/dist/license/LicenseManager.d.ts +63 -0
  103. package/dist/options/defaults.d.ts +5 -0
  104. package/dist/react/KatuChartsReact.d.ts +16 -0
  105. package/dist/react.d.ts +2 -0
  106. package/dist/responsive/ResponsiveEngine.d.ts +15 -0
  107. package/dist/series/BaseSeries.d.ts +186 -0
  108. package/dist/series/bioinformatics/CircosChart.d.ts +4 -0
  109. package/dist/series/bioinformatics/ClusteredHeatmapChart.d.ts +22 -0
  110. package/dist/series/bioinformatics/ForestPlotChart.d.ts +21 -0
  111. package/dist/series/bioinformatics/KaplanMeierChart.d.ts +22 -0
  112. package/dist/series/bioinformatics/ManhattanChart.d.ts +34 -0
  113. package/dist/series/bioinformatics/PCoAChart.d.ts +22 -0
  114. package/dist/series/bioinformatics/PhyloTreeChart.d.ts +27 -0
  115. package/dist/series/bioinformatics/SequenceLogoChart.d.ts +21 -0
  116. package/dist/series/bioinformatics/ViolinChart.d.ts +23 -0
  117. package/dist/series/bioinformatics/VolcanoChart.d.ts +28 -0
  118. package/dist/series/bioinformatics/circos/CircosChart.d.ts +20 -0
  119. package/dist/series/bioinformatics/circos/CircosColorScales.d.ts +6 -0
  120. package/dist/series/bioinformatics/circos/CircosComparativeChart.d.ts +41 -0
  121. package/dist/series/bioinformatics/circos/CircosHeatmapChart.d.ts +31 -0
  122. package/dist/series/bioinformatics/circos/CircosLayoutEngine.d.ts +37 -0
  123. package/dist/series/bioinformatics/circos/CircosRules.d.ts +6 -0
  124. package/dist/series/bioinformatics/circos/CircosSpiralChart.d.ts +39 -0
  125. package/dist/series/bioinformatics/circos/CircosTypes.d.ts +131 -0
  126. package/dist/series/bioinformatics/circos/tracks/AreaTrackRenderer.d.ts +7 -0
  127. package/dist/series/bioinformatics/circos/tracks/ConnectorTrackRenderer.d.ts +7 -0
  128. package/dist/series/bioinformatics/circos/tracks/GlyphTrackRenderer.d.ts +7 -0
  129. package/dist/series/bioinformatics/circos/tracks/HeatmapTrackRenderer.d.ts +7 -0
  130. package/dist/series/bioinformatics/circos/tracks/HighlightTrackRenderer.d.ts +6 -0
  131. package/dist/series/bioinformatics/circos/tracks/HistogramTrackRenderer.d.ts +7 -0
  132. package/dist/series/bioinformatics/circos/tracks/LineTrackRenderer.d.ts +7 -0
  133. package/dist/series/bioinformatics/circos/tracks/LinkTrackRenderer.d.ts +8 -0
  134. package/dist/series/bioinformatics/circos/tracks/LollipopTrackRenderer.d.ts +9 -0
  135. package/dist/series/bioinformatics/circos/tracks/RibbonTrackRenderer.d.ts +9 -0
  136. package/dist/series/bioinformatics/circos/tracks/ScatterTrackRenderer.d.ts +7 -0
  137. package/dist/series/bioinformatics/circos/tracks/StackTrackRenderer.d.ts +7 -0
  138. package/dist/series/bioinformatics/circos/tracks/TextTrackRenderer.d.ts +8 -0
  139. package/dist/series/bioinformatics/circos/tracks/TileTrackRenderer.d.ts +7 -0
  140. package/dist/series/bioinformatics/circos/tracks/TrackAxesRenderer.d.ts +6 -0
  141. package/dist/series/bioinformatics/circos/tracks/TrackBackgroundRenderer.d.ts +5 -0
  142. package/dist/series/cartesian/AreaChart.d.ts +33 -0
  143. package/dist/series/cartesian/BoxPlotChart.d.ts +24 -0
  144. package/dist/series/cartesian/BubbleChart.d.ts +34 -0
  145. package/dist/series/cartesian/ColumnChart.d.ts +37 -0
  146. package/dist/series/cartesian/LineChart.d.ts +28 -0
  147. package/dist/series/cartesian/ScatterChart.d.ts +20 -0
  148. package/dist/series/cartesian/SplineChart.d.ts +9 -0
  149. package/dist/series/cartesian/WaterfallChart.d.ts +25 -0
  150. package/dist/series/financial/AreaRangeChart.d.ts +24 -0
  151. package/dist/series/financial/BaselineChart.d.ts +20 -0
  152. package/dist/series/financial/CandlestickChart.d.ts +55 -0
  153. package/dist/series/financial/ColumnRangeChart.d.ts +16 -0
  154. package/dist/series/financial/FlagsChart.d.ts +34 -0
  155. package/dist/series/financial/HeikinAshiChart.d.ts +11 -0
  156. package/dist/series/financial/HollowCandlestickChart.d.ts +17 -0
  157. package/dist/series/financial/KagiChart.d.ts +23 -0
  158. package/dist/series/financial/LineBreakChart.d.ts +23 -0
  159. package/dist/series/financial/PointAndFigureChart.d.ts +24 -0
  160. package/dist/series/financial/RenkoChart.d.ts +22 -0
  161. package/dist/series/financial/VBPChart.d.ts +18 -0
  162. package/dist/series/financial/VolumeChart.d.ts +15 -0
  163. package/dist/series/flow/DependencyWheelChart.d.ts +23 -0
  164. package/dist/series/flow/NetworkGraphChart.d.ts +18 -0
  165. package/dist/series/flow/SankeyChart.d.ts +24 -0
  166. package/dist/series/gauge/GaugeChart.d.ts +40 -0
  167. package/dist/series/heatmap/HeatmapChart.d.ts +18 -0
  168. package/dist/series/hierarchical/SunburstChart.d.ts +44 -0
  169. package/dist/series/hierarchical/TreegraphChart.d.ts +19 -0
  170. package/dist/series/hierarchical/TreemapChart.d.ts +20 -0
  171. package/dist/series/hierarchical/WordcloudChart.d.ts +19 -0
  172. package/dist/series/index.d.ts +45 -0
  173. package/dist/series/map/FlowmapChart.d.ts +33 -0
  174. package/dist/series/map/MapChart.d.ts +53 -0
  175. package/dist/series/map/MapPointChart.d.ts +26 -0
  176. package/dist/series/map/mapProjection.d.ts +46 -0
  177. package/dist/series/pie/PieChart.d.ts +53 -0
  178. package/dist/series/polar/PolarChart.d.ts +18 -0
  179. package/dist/series/race/BarRaceChart.d.ts +44 -0
  180. package/dist/series/timeline/TimelineChart.d.ts +23 -0
  181. package/dist/series/venn/VennChart.d.ts +28 -0
  182. package/dist/stock/DataGrouping.d.ts +21 -0
  183. package/dist/stock/Navigator.d.ts +25 -0
  184. package/dist/stock/RangeSelector.d.ts +9 -0
  185. package/dist/stock/StockController.d.ts +47 -0
  186. package/dist/stockcharts.d.ts +8 -0
  187. package/dist/streaming/StreamAdapter.d.ts +36 -0
  188. package/dist/types/datatable-options.d.ts +633 -0
  189. package/dist/types/options.d.ts +1333 -0
  190. package/dist/utils/CircularBuffer.d.ts +24 -0
  191. package/dist/utils/chartText.d.ts +18 -0
  192. package/dist/utils/color.d.ts +23 -0
  193. package/dist/utils/decimation.d.ts +19 -0
  194. package/dist/utils/deepMerge.d.ts +5 -0
  195. package/dist/utils/dom.d.ts +10 -0
  196. package/dist/utils/format.d.ts +42 -0
  197. package/dist/utils/index.d.ts +7 -0
  198. package/dist/utils/math.d.ts +6 -0
  199. package/dist/utils/throttle.d.ts +2 -0
  200. package/package.json +95 -0
@@ -0,0 +1,633 @@
1
+ /**
2
+ * TypeScript interfaces for the KatuCharts DataTable module.
3
+ */
4
+ import type { CSSObject, AlignType } from './options';
5
+ export type { CSSObject, AlignType } from './options';
6
+ export type ColumnType = 'string' | 'number' | 'date' | 'boolean' | 'html';
7
+ export type SortDirection = 'asc' | 'desc' | null;
8
+ export type FilterType = 'text' | 'number' | 'select' | 'multiselect' | 'faceted' | 'boolean' | 'date' | 'daterange' | 'numberrange';
9
+ export type SelectionMode = 'none' | 'single' | 'multi';
10
+ export type PinDirection = 'left' | 'right' | null;
11
+ export type DensityMode = 'compact' | 'normal' | 'comfortable';
12
+ export type LayoutStyle = 'default' | 'bordered' | 'minimal' | 'striped-dark';
13
+ export interface FormatterContext {
14
+ value: any;
15
+ row: any;
16
+ column: ColumnDefinition;
17
+ rowIndex: number;
18
+ }
19
+ export interface CellStyleContext {
20
+ value: any;
21
+ row: any;
22
+ column: ColumnDefinition;
23
+ rowIndex: number;
24
+ }
25
+ export interface RowStyleContext {
26
+ row: any;
27
+ rowIndex: number;
28
+ }
29
+ export interface CustomEditorResult {
30
+ getValue: () => any;
31
+ destroy: () => void;
32
+ }
33
+ export type CustomEditorFn = (cell: HTMLElement, value: any, row: any, column: ColumnDefinition) => CustomEditorResult;
34
+ /** TanStack-compatible column facade passed to header/cell callbacks. */
35
+ export interface ColumnApi {
36
+ id: string;
37
+ columnDef: ColumnDefinition;
38
+ getCanSort(): boolean;
39
+ getCanHide(): boolean;
40
+ getIsSorted(): 'asc' | 'desc' | false;
41
+ toggleSorting(desc?: boolean): void;
42
+ clearSorting(): void;
43
+ getIsVisible(): boolean;
44
+ toggleVisibility(visible?: boolean): void;
45
+ getFilterValue(): any;
46
+ setFilterValue(value: any): void;
47
+ }
48
+ /** TanStack-compatible row facade passed to cell callbacks. */
49
+ export interface RowApi {
50
+ id: string;
51
+ index: number;
52
+ original: any;
53
+ getValue(columnId: string): any;
54
+ renderValue(columnId: string): any;
55
+ getIsSelected(): boolean;
56
+ toggleSelected(selected?: boolean): void;
57
+ }
58
+ /** TanStack-compatible table facade passed to header/cell callbacks. */
59
+ export interface TableApi {
60
+ getColumn(id: string): ColumnApi | undefined;
61
+ getAllColumns(): ColumnApi[];
62
+ getAllLeafColumns(): ColumnApi[];
63
+ getIsAllPageRowsSelected(): boolean;
64
+ getIsSomePageRowsSelected(): boolean;
65
+ toggleAllPageRowsSelected(selected?: boolean): void;
66
+ getState(): {
67
+ pagination: {
68
+ pageIndex: number;
69
+ pageSize: number;
70
+ };
71
+ };
72
+ nextPage(): void;
73
+ previousPage(): void;
74
+ setPageIndex(index: number): void;
75
+ setPageSize(size: number): void;
76
+ getCanNextPage(): boolean;
77
+ getCanPreviousPage(): boolean;
78
+ getPageCount(): number;
79
+ }
80
+ export interface HeaderContext {
81
+ column: ColumnApi;
82
+ table: TableApi;
83
+ }
84
+ export interface CellContext {
85
+ row: RowApi;
86
+ column: ColumnApi;
87
+ table: TableApi;
88
+ getValue(): any;
89
+ renderValue(): any;
90
+ }
91
+ export type HeaderRenderFn = (ctx: HeaderContext) => string | Node;
92
+ export type CellRenderFn = (ctx: CellContext) => string | Node;
93
+ export type ColumnFilterFn = (row: any, columnId: string, filterValue: any) => boolean;
94
+ export interface ColumnDefinition {
95
+ field: string;
96
+ title?: string;
97
+ type?: ColumnType;
98
+ width?: number | string;
99
+ minWidth?: number;
100
+ maxWidth?: number;
101
+ align?: AlignType;
102
+ headerAlign?: AlignType;
103
+ visible?: boolean;
104
+ sortable?: boolean;
105
+ filterable?: boolean;
106
+ resizable?: boolean;
107
+ reorderable?: boolean;
108
+ pinned?: PinDirection;
109
+ formatter?: (this: FormatterContext) => string;
110
+ headerFormatter?: (this: {
111
+ column: ColumnDefinition;
112
+ }) => string;
113
+ comparator?: (a: any, b: any) => number;
114
+ filterType?: FilterType;
115
+ filterOptions?: any[];
116
+ cellStyle?: CSSObject | ((this: CellStyleContext) => CSSObject);
117
+ cellClass?: string | ((this: {
118
+ value: any;
119
+ row: any;
120
+ }) => string);
121
+ headerStyle?: CSSObject;
122
+ editable?: boolean;
123
+ editor?: 'text' | 'number' | 'select' | 'date' | 'checkbox' | CustomEditorFn;
124
+ editorOptions?: any[];
125
+ validator?: (value: any, row: any) => boolean | string;
126
+ aggregate?: 'sum' | 'avg' | 'count' | 'min' | 'max' | ((values: any[]) => any);
127
+ groupFormatter?: (this: {
128
+ value: any;
129
+ count: number;
130
+ rows: any[];
131
+ }) => string;
132
+ priority?: number;
133
+ headerTooltip?: string;
134
+ cellTooltip?: boolean | ((this: {
135
+ value: any;
136
+ row: any;
137
+ }) => string);
138
+ /**
139
+ * TanStack-compatible aliases. These let you paste familiar column
140
+ * definitions, e.g.:
141
+ * { accessorKey: 'amount', header: ({ column }) => ..., cell: ({ row }) => ... }
142
+ */
143
+ accessorKey?: string;
144
+ accessorFn?: (row: any) => any;
145
+ id?: string;
146
+ header?: string | HeaderRenderFn;
147
+ cell?: CellRenderFn;
148
+ enableSorting?: boolean;
149
+ enableHiding?: boolean;
150
+ enableColumnFilter?: boolean;
151
+ filterFn?: ColumnFilterFn;
152
+ meta?: Record<string, any>;
153
+ size?: number;
154
+ minSize?: number;
155
+ maxSize?: number;
156
+ }
157
+ export interface DataTableEventsOptions {
158
+ load?: (this: any, event: Event) => void;
159
+ dataLoad?: (this: any, event: {
160
+ data: any[];
161
+ }) => void;
162
+ rowClick?: (this: any, event: {
163
+ row: any;
164
+ rowIndex: number;
165
+ originalEvent: MouseEvent;
166
+ }) => void;
167
+ cellClick?: (this: any, event: {
168
+ value: any;
169
+ row: any;
170
+ column: ColumnDefinition;
171
+ rowIndex: number;
172
+ colIndex: number;
173
+ originalEvent: MouseEvent;
174
+ }) => void;
175
+ rowDblClick?: (this: any, event: {
176
+ row: any;
177
+ rowIndex: number;
178
+ originalEvent: MouseEvent;
179
+ }) => void;
180
+ selectionChange?: (this: any, event: {
181
+ selected: any[];
182
+ added: any[];
183
+ removed: any[];
184
+ }) => void;
185
+ sortChange?: (this: any, event: {
186
+ column: string;
187
+ direction: SortDirection;
188
+ multiSort: Array<{
189
+ column: string;
190
+ direction: SortDirection;
191
+ }>;
192
+ }) => void;
193
+ filterChange?: (this: any, event: {
194
+ column: string;
195
+ value: any;
196
+ allFilters: Record<string, any>;
197
+ }) => void;
198
+ pageChange?: (this: any, event: {
199
+ page: number;
200
+ pageSize: number;
201
+ totalPages: number;
202
+ }) => void;
203
+ columnResize?: (this: any, event: {
204
+ column: string;
205
+ width: number;
206
+ }) => void;
207
+ columnReorder?: (this: any, event: {
208
+ column: string;
209
+ fromIndex: number;
210
+ toIndex: number;
211
+ }) => void;
212
+ cellEdit?: (this: any, event: {
213
+ row: any;
214
+ column: string;
215
+ oldValue: any;
216
+ newValue: any;
217
+ }) => void;
218
+ cellEditCancel?: (this: any, event: {
219
+ row: any;
220
+ column: string;
221
+ value: any;
222
+ }) => void;
223
+ groupToggle?: (this: any, event: {
224
+ groupValue: any;
225
+ expanded: boolean;
226
+ }) => void;
227
+ searchChange?: (this: any, event: {
228
+ query: string;
229
+ }) => void;
230
+ scroll?: (this: any, event: {
231
+ scrollTop: number;
232
+ scrollLeft: number;
233
+ }) => void;
234
+ destroy?: (this: any, event: Event) => void;
235
+ }
236
+ export interface PaginationOptions {
237
+ enabled?: boolean;
238
+ pageSize?: number;
239
+ pageSizes?: number[];
240
+ position?: 'top' | 'bottom' | 'both';
241
+ showPageSizeSelector?: boolean;
242
+ showPageInfo?: boolean;
243
+ showFirstLast?: boolean;
244
+ style?: CSSObject;
245
+ buttonStyle?: CSSObject;
246
+ activeButtonStyle?: CSSObject;
247
+ }
248
+ export interface SearchOptions {
249
+ enabled?: boolean;
250
+ placeholder?: string;
251
+ debounceMs?: number;
252
+ caseSensitive?: boolean;
253
+ columns?: string[];
254
+ position?: 'toolbar' | 'above';
255
+ style?: CSSObject;
256
+ inputStyle?: CSSObject;
257
+ }
258
+ export interface ToolbarOptions {
259
+ enabled?: boolean;
260
+ position?: 'top' | 'bottom' | 'both';
261
+ items?: ('search' | 'columnToggle' | 'export' | 'fullscreen' | 'density')[];
262
+ style?: CSSObject;
263
+ customItems?: Array<{
264
+ content: string;
265
+ onClick?: () => void;
266
+ position?: 'left' | 'right';
267
+ style?: CSSObject;
268
+ }>;
269
+ }
270
+ export interface ExportTableOptions {
271
+ enabled?: boolean;
272
+ formats?: ('csv' | 'json' | 'clipboard' | 'html')[];
273
+ filename?: string;
274
+ csv?: {
275
+ delimiter?: string;
276
+ lineDelimiter?: string;
277
+ decimalPoint?: string;
278
+ includeHeaders?: boolean;
279
+ onlyVisible?: boolean;
280
+ };
281
+ json?: {
282
+ indent?: number;
283
+ onlyVisible?: boolean;
284
+ };
285
+ }
286
+ export interface ServerSideOptions {
287
+ enabled?: boolean;
288
+ url?: string;
289
+ method?: 'GET' | 'POST';
290
+ headers?: Record<string, string>;
291
+ requestMapper?: (params: ServerSideRequestParams) => any;
292
+ responseMapper?: (response: any) => {
293
+ data: any[];
294
+ total: number;
295
+ };
296
+ debounceMs?: number;
297
+ loadingText?: string;
298
+ }
299
+ export interface ServerSideRequestParams {
300
+ page: number;
301
+ pageSize: number;
302
+ sort: Array<{
303
+ column: string;
304
+ direction: SortDirection;
305
+ }>;
306
+ filters: Record<string, any>;
307
+ search: string;
308
+ }
309
+ export interface VirtualScrollOptions {
310
+ enabled?: boolean;
311
+ rowHeight?: number;
312
+ overscan?: number;
313
+ threshold?: number;
314
+ }
315
+ export interface GroupingOptions {
316
+ enabled?: boolean;
317
+ columns?: string[];
318
+ expanded?: boolean;
319
+ showCount?: boolean;
320
+ aggregations?: Record<string, 'sum' | 'avg' | 'count' | 'min' | 'max' | ((values: any[]) => any)>;
321
+ headerStyle?: CSSObject;
322
+ headerFormatter?: (this: {
323
+ value: any;
324
+ column: string;
325
+ count: number;
326
+ }) => string;
327
+ }
328
+ export interface MasterDetailOptions {
329
+ enabled?: boolean;
330
+ renderer?: (row: any, container: HTMLElement) => void | HTMLElement;
331
+ height?: number | 'auto';
332
+ expandOnRowClick?: boolean;
333
+ expandIcon?: string;
334
+ collapseIcon?: string;
335
+ singleExpand?: boolean;
336
+ }
337
+ export interface TreeDataOptions {
338
+ enabled?: boolean;
339
+ childrenField?: string;
340
+ expandAll?: boolean;
341
+ indent?: number;
342
+ }
343
+ export interface ContextMenuItem {
344
+ label: string;
345
+ icon?: string;
346
+ action: (row: any, column: ColumnDefinition, event: MouseEvent) => void;
347
+ visible?: (row: any, column: ColumnDefinition) => boolean;
348
+ disabled?: (row: any, column: ColumnDefinition) => boolean;
349
+ separator?: boolean;
350
+ }
351
+ export interface ContextMenuOptions {
352
+ enabled?: boolean;
353
+ items?: ContextMenuItem[];
354
+ }
355
+ export interface HeaderGroupDefinition {
356
+ title: string;
357
+ columns: string[];
358
+ style?: CSSObject;
359
+ }
360
+ export interface DataTableStyleOptions {
361
+ containerStyle?: CSSObject;
362
+ tableStyle?: CSSObject;
363
+ headerStyle?: CSSObject;
364
+ headerCellStyle?: CSSObject;
365
+ bodyStyle?: CSSObject;
366
+ rowStyle?: CSSObject | ((this: RowStyleContext) => CSSObject);
367
+ cellStyle?: CSSObject;
368
+ alternateRowColor?: string | false;
369
+ hoverRowColor?: string | false;
370
+ selectedRowColor?: string | false;
371
+ borderColor?: string;
372
+ fontSize?: string;
373
+ fontFamily?: string;
374
+ headerFontSize?: string;
375
+ headerFontWeight?: string;
376
+ rowHeight?: number;
377
+ headerHeight?: number;
378
+ density?: DensityMode;
379
+ layout?: LayoutStyle;
380
+ stripedRows?: boolean;
381
+ showBorders?: boolean | 'horizontal' | 'vertical' | 'both' | 'none';
382
+ /** Light or dark palette. Maps to the `data-theme` attribute. */
383
+ theme?: 'light' | 'dark';
384
+ /** Page/cell background color. */
385
+ background?: string;
386
+ /** Default text color. */
387
+ foreground?: string;
388
+ /** Subtle surface color (headers, group rows, badges). */
389
+ mutedColor?: string;
390
+ /** Secondary/placeholder text color. */
391
+ mutedForeground?: string;
392
+ /** Hover/active surface color for rows, buttons and menu items. */
393
+ accentColor?: string;
394
+ /** Primary accent (selected checkbox, active pagination button). */
395
+ primaryColor?: string;
396
+ /** Corner radius for the container, inputs, buttons and menus. */
397
+ radius?: number | string;
398
+ /** Escape hatch: any extra `--kdt-*` custom properties to set on the root. */
399
+ cssVars?: Record<string, string>;
400
+ }
401
+ /**
402
+ * Per-part class hooks. Strings are appended to the element's class list,
403
+ * letting consumers attach their own CSS (e.g. Tailwind utilities) to any
404
+ * structural piece of the table — the `className` convention.
405
+ */
406
+ export interface DataTableClassNames {
407
+ root?: string;
408
+ toolbar?: string;
409
+ title?: string;
410
+ search?: string;
411
+ table?: string;
412
+ header?: string;
413
+ headerRow?: string;
414
+ headerCell?: string;
415
+ filterRow?: string;
416
+ body?: string;
417
+ row?: string;
418
+ cell?: string;
419
+ footer?: string;
420
+ pagination?: string;
421
+ }
422
+ export interface DataTableLangOptions {
423
+ search?: string;
424
+ noData?: string;
425
+ loading?: string;
426
+ pageInfo?: string;
427
+ pageSizeLabel?: string;
428
+ firstPage?: string;
429
+ lastPage?: string;
430
+ previousPage?: string;
431
+ nextPage?: string;
432
+ selectAll?: string;
433
+ columns?: string;
434
+ exportCSV?: string;
435
+ exportJSON?: string;
436
+ copyClipboard?: string;
437
+ resetFilters?: string;
438
+ of?: string;
439
+ rows?: string;
440
+ showing?: string;
441
+ /** Placeholder for the per-column text filter input. */
442
+ filterPlaceholder?: string;
443
+ /** "All" option shown in select and boolean column filters. */
444
+ filterAll?: string;
445
+ /** "True" option in boolean column filters. */
446
+ filterTrue?: string;
447
+ /** "False" option in boolean column filters. */
448
+ filterFalse?: string;
449
+ /** Placeholder for the lower bound of a numeric range filter. */
450
+ rangeMin?: string;
451
+ /** Placeholder for the upper bound of a numeric range filter. */
452
+ rangeMax?: string;
453
+ /** Accessible label for the header "select all rows" checkbox. */
454
+ selectAllRows?: string;
455
+ /** Accessible label for a per-row selection checkbox. */
456
+ selectRow?: string;
457
+ /** Heading of the column visibility menu. */
458
+ toggleColumns?: string;
459
+ /** Label of the export menu button. */
460
+ exportButton?: string;
461
+ /** "Export HTML" item in the export menu. */
462
+ exportHTML?: string;
463
+ /** Label of the row-density menu button. */
464
+ density?: string;
465
+ /** "Compact" density option. */
466
+ densityCompact?: string;
467
+ /** "Normal" density option. */
468
+ densityNormal?: string;
469
+ /** "Comfortable" density option. */
470
+ densityComfortable?: string;
471
+ }
472
+ export interface SortingOptions {
473
+ enabled?: boolean;
474
+ multiSort?: boolean;
475
+ defaultSort?: Array<{
476
+ column: string;
477
+ direction: SortDirection;
478
+ }>;
479
+ }
480
+ export interface FilteringOptions {
481
+ /** Master switch for all per-column filtering. */
482
+ enabled?: boolean;
483
+ /** Where the per-column filter inputs live. */
484
+ position?: 'header' | 'toolbar';
485
+ /** Render the inline filter row under the header (defaults to true when enabled). */
486
+ showFilterRow?: boolean;
487
+ /** Case sensitivity for text filters. */
488
+ caseSensitive?: boolean;
489
+ /** Show a "reset filters" control in the toolbar when any filter is active. */
490
+ showReset?: boolean;
491
+ }
492
+ export interface SelectionOptions {
493
+ mode?: SelectionMode;
494
+ checkbox?: boolean;
495
+ selectAll?: boolean;
496
+ preserveOnFilter?: boolean;
497
+ }
498
+ export interface EditingOptions {
499
+ enabled?: boolean;
500
+ mode?: 'cell' | 'row';
501
+ saveOnBlur?: boolean;
502
+ }
503
+ export interface DataTableOptions {
504
+ data?: any[];
505
+ columns?: ColumnDefinition[];
506
+ rowKey?: string;
507
+ title?: {
508
+ text?: string;
509
+ style?: CSSObject;
510
+ };
511
+ style?: DataTableStyleOptions;
512
+ height?: number | string;
513
+ width?: number | string;
514
+ responsive?: boolean;
515
+ sorting?: SortingOptions;
516
+ filtering?: FilteringOptions;
517
+ search?: SearchOptions;
518
+ pagination?: PaginationOptions;
519
+ selection?: SelectionOptions;
520
+ editing?: EditingOptions;
521
+ columnPinning?: {
522
+ enabled?: boolean;
523
+ };
524
+ columnResizing?: {
525
+ enabled?: boolean;
526
+ };
527
+ columnReordering?: {
528
+ enabled?: boolean;
529
+ };
530
+ columnVisibility?: {
531
+ enabled?: boolean;
532
+ };
533
+ grouping?: GroupingOptions;
534
+ virtualScroll?: VirtualScrollOptions;
535
+ masterDetail?: MasterDetailOptions;
536
+ treeData?: TreeDataOptions;
537
+ contextMenu?: ContextMenuOptions;
538
+ toolbar?: ToolbarOptions;
539
+ exporting?: ExportTableOptions;
540
+ serverSide?: ServerSideOptions;
541
+ headerGroups?: HeaderGroupDefinition[];
542
+ formatters?: {
543
+ number?: (value: number) => string;
544
+ date?: (value: Date | string | number) => string;
545
+ currency?: (value: number) => string;
546
+ percentage?: (value: number) => string;
547
+ boolean?: (value: boolean) => string;
548
+ };
549
+ events?: DataTableEventsOptions;
550
+ /**
551
+ * Locale code for the built-in UI strings (e.g. `'pt-BR'`, `'es'`, `'zh'`).
552
+ * Omitted or `'auto'` auto-detects from the browser language and falls back to
553
+ * English; any other value pins that locale. Per-key `lang` overrides always win.
554
+ */
555
+ locale?: string;
556
+ lang?: DataTableLangOptions;
557
+ chart?: any;
558
+ /** Per-part class hooks (`className` convention). */
559
+ classNames?: DataTableClassNames;
560
+ /**
561
+ * TanStack-style initial state. A convenient way to set the starting page
562
+ * size, sort, hidden columns and active filters in one place.
563
+ */
564
+ initialState?: {
565
+ pagination?: {
566
+ pageSize?: number;
567
+ pageIndex?: number;
568
+ };
569
+ sorting?: Array<{
570
+ column?: string;
571
+ id?: string;
572
+ direction?: SortDirection;
573
+ desc?: boolean;
574
+ }>;
575
+ columnVisibility?: Record<string, boolean>;
576
+ columnFilters?: Array<{
577
+ id: string;
578
+ value: any;
579
+ }> | Record<string, any>;
580
+ };
581
+ }
582
+ export interface InternalColumnDef extends ColumnDefinition {
583
+ _index: number;
584
+ _computedWidth: number;
585
+ _explicitWidth?: boolean;
586
+ _visible: boolean;
587
+ _sortDirection: SortDirection;
588
+ _sortPriority: number;
589
+ _filterValue: any;
590
+ _pinnedOffset: number;
591
+ }
592
+ export interface ProcessedRow {
593
+ _type: 'data' | 'group-header' | 'group-footer' | 'detail';
594
+ _index: number;
595
+ _originalIndex: number;
596
+ _data: any;
597
+ _depth: number;
598
+ _groupValue?: any;
599
+ _groupColumn?: string;
600
+ _groupCount?: number;
601
+ _expanded?: boolean;
602
+ _selected?: boolean;
603
+ _children?: ProcessedRow[];
604
+ _parentKey?: string;
605
+ _visible: boolean;
606
+ }
607
+ export interface ProcessedResult {
608
+ rows: ProcessedRow[];
609
+ totalFiltered: number;
610
+ totalAll: number;
611
+ aggregates: Record<string, Record<string, any>>;
612
+ groups?: GroupInfo[];
613
+ }
614
+ export interface GroupInfo {
615
+ column: string;
616
+ value: any;
617
+ count: number;
618
+ expanded: boolean;
619
+ rows: any[];
620
+ aggregates: Record<string, any>;
621
+ }
622
+ export interface PageInfo {
623
+ page: number;
624
+ pageSize: number;
625
+ totalPages: number;
626
+ totalRows: number;
627
+ from: number;
628
+ to: number;
629
+ }
630
+ export interface SortState {
631
+ column: string;
632
+ direction: SortDirection;
633
+ }