@siyahi/ui 0.0.0-stage → 0.1.0-next.3

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 (192) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -2
  3. package/THIRD_PARTY_NOTICES.md +51 -0
  4. package/dist/components/registry/dashboard-01/section-cards.d.ts +17 -0
  5. package/dist/components/registry/dashboard-01/section-cards.js +39 -0
  6. package/dist/components/registry/dashboardcn/bar-list.d.ts +24 -0
  7. package/dist/components/registry/dashboardcn/bar-list.js +71 -0
  8. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +134 -0
  9. package/dist/components/registry/heatmap/calendar-heatmap.js +497 -0
  10. package/dist/components/registry/heatmap/status-heatmap.d.ts +120 -0
  11. package/dist/components/registry/heatmap/status-heatmap.js +330 -0
  12. package/dist/components/registry/heatmap/weekday-heatmap.d.ts +145 -0
  13. package/dist/components/registry/heatmap/weekday-heatmap.js +489 -0
  14. package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +26 -0
  15. package/dist/components/registry/niko-table/components/data-table-column-actions.js +32 -0
  16. package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +13 -0
  17. package/dist/components/registry/niko-table/components/data-table-column-filter.js +17 -0
  18. package/dist/components/registry/niko-table/components/data-table-column-header.d.ts +30 -0
  19. package/dist/components/registry/niko-table/components/data-table-column-header.js +35 -0
  20. package/dist/components/registry/niko-table/components/data-table-column-sort.d.ts +21 -0
  21. package/dist/components/registry/niko-table/components/data-table-column-sort.js +36 -0
  22. package/dist/components/registry/niko-table/components/data-table-column-title.d.ts +12 -0
  23. package/dist/components/registry/niko-table/components/data-table-column-title.js +18 -0
  24. package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +108 -0
  25. package/dist/components/registry/niko-table/components/data-table-empty-state.js +148 -0
  26. package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +46 -0
  27. package/dist/components/registry/niko-table/components/data-table-faceted-filter.js +133 -0
  28. package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +111 -0
  29. package/dist/components/registry/niko-table/components/data-table-grouped-rows.js +77 -0
  30. package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +65 -0
  31. package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.js +65 -0
  32. package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +50 -0
  33. package/dist/components/registry/niko-table/components/data-table-row-context-menu.js +42 -0
  34. package/dist/components/registry/niko-table/components/data-table-row-menu.d.ts +51 -0
  35. package/dist/components/registry/niko-table/components/data-table-row-menu.js +65 -0
  36. package/dist/components/registry/niko-table/components/data-table-toolbar-section.d.ts +7 -0
  37. package/dist/components/registry/niko-table/components/data-table-toolbar-section.js +63 -0
  38. package/dist/components/registry/niko-table/config/data-table.d.ts +156 -0
  39. package/dist/components/registry/niko-table/config/data-table.js +279 -0
  40. package/dist/components/registry/niko-table/config/feature-detection.d.ts +39 -0
  41. package/dist/components/registry/niko-table/config/feature-detection.js +174 -0
  42. package/dist/components/registry/niko-table/core/data-table-context.d.ts +157 -0
  43. package/dist/components/registry/niko-table/core/data-table-context.js +326 -0
  44. package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +85 -0
  45. package/dist/components/registry/niko-table/core/data-table-error-boundary.js +116 -0
  46. package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +49 -0
  47. package/dist/components/registry/niko-table/core/data-table-grouped-row.js +112 -0
  48. package/dist/components/registry/niko-table/core/data-table-root.d.ts +62 -0
  49. package/dist/components/registry/niko-table/core/data-table-root.js +406 -0
  50. package/dist/components/registry/niko-table/core/data-table-structure.d.ts +153 -0
  51. package/dist/components/registry/niko-table/core/data-table-structure.js +370 -0
  52. package/dist/components/registry/niko-table/core/data-table.d.ts +30 -0
  53. package/dist/components/registry/niko-table/core/data-table.js +126 -0
  54. package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +49 -0
  55. package/dist/components/registry/niko-table/filters/table-column-actions.js +48 -0
  56. package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +51 -0
  57. package/dist/components/registry/niko-table/filters/table-column-sort.js +184 -0
  58. package/dist/components/registry/niko-table/filters/table-column-title.d.ts +17 -0
  59. package/dist/components/registry/niko-table/filters/table-column-title.js +20 -0
  60. package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +40 -0
  61. package/dist/components/registry/niko-table/filters/table-faceted-filter.js +210 -0
  62. package/dist/components/registry/niko-table/hooks/use-derived-column-title.d.ts +29 -0
  63. package/dist/components/registry/niko-table/hooks/use-derived-column-title.js +40 -0
  64. package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +49 -0
  65. package/dist/components/registry/niko-table/hooks/use-generated-options.js +144 -0
  66. package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +59 -0
  67. package/dist/components/registry/niko-table/lib/build-faceted-options.js +82 -0
  68. package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +33 -0
  69. package/dist/components/registry/niko-table/lib/column-resize-handle.js +175 -0
  70. package/dist/components/registry/niko-table/lib/constants.d.ts +128 -0
  71. package/dist/components/registry/niko-table/lib/constants.js +123 -0
  72. package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +35 -0
  73. package/dist/components/registry/niko-table/lib/create-scroll-handler.js +63 -0
  74. package/dist/components/registry/niko-table/lib/data-table-features.d.ts +218 -0
  75. package/dist/components/registry/niko-table/lib/data-table-features.js +127 -0
  76. package/dist/components/registry/niko-table/lib/filter-functions.d.ts +47 -0
  77. package/dist/components/registry/niko-table/lib/filter-functions.js +309 -0
  78. package/dist/components/registry/niko-table/lib/filter-rows.d.ts +14 -0
  79. package/dist/components/registry/niko-table/lib/filter-rows.js +28 -0
  80. package/dist/components/registry/niko-table/lib/flex-columns.d.ts +48 -0
  81. package/dist/components/registry/niko-table/lib/flex-columns.js +65 -0
  82. package/dist/components/registry/niko-table/lib/format.d.ts +33 -0
  83. package/dist/components/registry/niko-table/lib/format.js +99 -0
  84. package/dist/components/registry/niko-table/lib/render-cell-content.d.ts +17 -0
  85. package/dist/components/registry/niko-table/lib/render-cell-content.js +65 -0
  86. package/dist/components/registry/niko-table/lib/row-click.d.ts +67 -0
  87. package/dist/components/registry/niko-table/lib/row-click.js +28 -0
  88. package/dist/components/registry/niko-table/lib/styles.d.ts +6 -0
  89. package/dist/components/registry/niko-table/lib/styles.js +24 -0
  90. package/dist/components/registry/niko-table/lib/use-header-min-widths.d.ts +17 -0
  91. package/dist/components/registry/niko-table/lib/use-header-min-widths.js +82 -0
  92. package/dist/components/registry/niko-table/types/index.d.ts +141 -0
  93. package/dist/components/registry/niko-table/types/index.js +2 -0
  94. package/dist/components/registry/niko-table/ui/table.d.ts +13 -0
  95. package/dist/components/registry/niko-table/ui/table.js +74 -0
  96. package/dist/components/registry/sidebar-07/app-sidebar.d.ts +18 -0
  97. package/dist/components/registry/sidebar-07/app-sidebar.js +26 -0
  98. package/dist/components/registry/sidebar-07/nav-main.d.ts +15 -0
  99. package/dist/components/registry/sidebar-07/nav-main.js +25 -0
  100. package/dist/components/registry/sidebar-07/nav-projects.d.ts +9 -0
  101. package/dist/components/registry/sidebar-07/nav-projects.js +43 -0
  102. package/dist/components/registry/sidebar-07/nav-user.d.ts +9 -0
  103. package/dist/components/registry/sidebar-07/nav-user.js +70 -0
  104. package/dist/components/registry/sidebar-07/team-switcher.d.ts +10 -0
  105. package/dist/components/registry/sidebar-07/team-switcher.js +70 -0
  106. package/dist/components/siyahi/delta.d.ts +10 -0
  107. package/dist/components/siyahi/delta.js +27 -0
  108. package/dist/components/siyahi/local-time.d.ts +7 -0
  109. package/dist/components/siyahi/local-time.js +22 -0
  110. package/dist/components/siyahi/price-chart.d.ts +12 -0
  111. package/dist/components/siyahi/price-chart.js +80 -0
  112. package/dist/components/siyahi/siyahi-provider.d.ts +12 -0
  113. package/dist/components/siyahi/siyahi-provider.js +31 -0
  114. package/dist/components/siyahi/treemap.d.ts +14 -0
  115. package/dist/components/siyahi/treemap.js +58 -0
  116. package/dist/components/ui/alert.d.ts +12 -0
  117. package/dist/components/ui/alert.js +43 -0
  118. package/dist/components/ui/avatar.d.ts +13 -0
  119. package/dist/components/ui/avatar.js +50 -0
  120. package/dist/components/ui/badge.d.ts +9 -0
  121. package/dist/components/ui/badge.js +29 -0
  122. package/dist/components/ui/breadcrumb.d.ts +12 -0
  123. package/dist/components/ui/breadcrumb.js +72 -0
  124. package/dist/components/ui/button.d.ts +10 -0
  125. package/dist/components/ui/button.js +44 -0
  126. package/dist/components/ui/calendar.d.ts +12 -0
  127. package/dist/components/ui/calendar.js +107 -0
  128. package/dist/components/ui/card.d.ts +13 -0
  129. package/dist/components/ui/card.js +56 -0
  130. package/dist/components/ui/chart.d.ts +46 -0
  131. package/dist/components/ui/chart.js +149 -0
  132. package/dist/components/ui/collapsible.d.ts +7 -0
  133. package/dist/components/ui/collapsible.js +24 -0
  134. package/dist/components/ui/command.d.ts +21 -0
  135. package/dist/components/ui/command.js +88 -0
  136. package/dist/components/ui/context-menu.d.ts +31 -0
  137. package/dist/components/ui/context-menu.js +132 -0
  138. package/dist/components/ui/dialog.d.ts +19 -0
  139. package/dist/components/ui/dialog.js +91 -0
  140. package/dist/components/ui/dropdown-menu.d.ts +31 -0
  141. package/dist/components/ui/dropdown-menu.js +136 -0
  142. package/dist/components/ui/input-group.d.ts +20 -0
  143. package/dist/components/ui/input-group.js +79 -0
  144. package/dist/components/ui/input.d.ts +5 -0
  145. package/dist/components/ui/input.js +15 -0
  146. package/dist/components/ui/popover.d.ts +11 -0
  147. package/dist/components/ui/popover.js +55 -0
  148. package/dist/components/ui/progress.d.ts +9 -0
  149. package/dist/components/ui/progress.js +43 -0
  150. package/dist/components/ui/scroll-area.d.ts +7 -0
  151. package/dist/components/ui/scroll-area.js +36 -0
  152. package/dist/components/ui/select.d.ts +17 -0
  153. package/dist/components/ui/select.js +97 -0
  154. package/dist/components/ui/separator.d.ts +5 -0
  155. package/dist/components/ui/separator.js +15 -0
  156. package/dist/components/ui/sheet.d.ts +16 -0
  157. package/dist/components/ui/sheet.js +89 -0
  158. package/dist/components/ui/sidebar.d.ts +65 -0
  159. package/dist/components/ui/sidebar.js +385 -0
  160. package/dist/components/ui/skeleton.d.ts +4 -0
  161. package/dist/components/ui/skeleton.js +12 -0
  162. package/dist/components/ui/slider.d.ts +5 -0
  163. package/dist/components/ui/slider.js +33 -0
  164. package/dist/components/ui/table.d.ts +12 -0
  165. package/dist/components/ui/table.js +66 -0
  166. package/dist/components/ui/tabs.d.ts +12 -0
  167. package/dist/components/ui/tabs.js +45 -0
  168. package/dist/components/ui/textarea.d.ts +5 -0
  169. package/dist/components/ui/textarea.js +13 -0
  170. package/dist/components/ui/toggle-group.d.ts +13 -0
  171. package/dist/components/ui/toggle-group.js +52 -0
  172. package/dist/components/ui/toggle.d.ts +10 -0
  173. package/dist/components/ui/toggle.js +36 -0
  174. package/dist/components/ui/tooltip.d.ts +8 -0
  175. package/dist/components/ui/tooltip.js +41 -0
  176. package/dist/hooks/use-mobile.d.ts +3 -0
  177. package/dist/hooks/use-mobile.js +18 -0
  178. package/dist/index.d.ts +73 -0
  179. package/dist/index.js +71 -0
  180. package/dist/lib/format.d.ts +24 -0
  181. package/dist/lib/format.js +58 -0
  182. package/dist/lib/locale.d.ts +12 -0
  183. package/dist/lib/locale.js +8 -0
  184. package/dist/lib/recharts.d.ts +2 -0
  185. package/dist/lib/recharts.js +1 -0
  186. package/dist/lib/utils.d.ts +2 -0
  187. package/dist/lib/utils.js +1 -0
  188. package/package.json +78 -3
  189. package/registry.lock.json +413 -0
  190. package/report.css +129 -0
  191. package/styles/shadcn.css +643 -0
  192. package/styles/siyahi.css +189 -0
@@ -0,0 +1,123 @@
1
+ //#region src/components/registry/niko-table/lib/constants.ts
2
+ const JOIN_OPERATORS = {
3
+ /** Logical AND (all filters must match) */
4
+ AND: "and",
5
+ /** Logical OR (any filter can match) */
6
+ OR: "or",
7
+ /** Mixed logic (combination of AND/OR) */
8
+ MIXED: "mixed"
9
+ };
10
+ /**
11
+ * Filter operator constants defining the comparison logic.
12
+ * Naming follows SQL/PostgREST standards (ilike, eq, ne, etc.).
13
+ */
14
+ const FILTER_OPERATORS = {
15
+ /** SQL ILIKE (Case-insensitive search) */
16
+ ILIKE: "ilike",
17
+ /** SQL NOT ILIKE */
18
+ NOT_ILIKE: "not.ilike",
19
+ /** SQL EQUAL (=) */
20
+ EQ: "eq",
21
+ /** SQL NOT EQUAL (!=) */
22
+ NEQ: "neq",
23
+ /** SQL IN (one of) */
24
+ IN: "in",
25
+ /** SQL NOT IN (none of) */
26
+ NOT_IN: "not.in",
27
+ /** Value is null or empty string */
28
+ EMPTY: "empty",
29
+ /** Value is not null and not empty string */
30
+ NOT_EMPTY: "not.empty",
31
+ /** SQL LESS THAN (<) */
32
+ LT: "lt",
33
+ /** SQL LESS THAN OR EQUAL (<=) */
34
+ LTE: "lte",
35
+ /** SQL GREATER THAN (>) */
36
+ GT: "gt",
37
+ /** SQL GREATER THAN OR EQUAL (>=) */
38
+ GTE: "gte",
39
+ /** SQL BETWEEN (range) */
40
+ BETWEEN: "between",
41
+ /** Relative date calculation (e.g., "today", "last-7-days") */
42
+ RELATIVE: "relative"
43
+ };
44
+ /**
45
+ * Filter variant constants defining the UI control type.
46
+ */
47
+ const FILTER_VARIANTS = {
48
+ /** Standard text input */
49
+ TEXT: "text",
50
+ /** Numeric input */
51
+ NUMBER: "number",
52
+ /** Two-value range input */
53
+ RANGE: "range",
54
+ /** Single date picker */
55
+ DATE: "date",
56
+ /** Date range picker */
57
+ DATE_RANGE: "dateRange",
58
+ /** Single select dropdown */
59
+ SELECT: "select",
60
+ /** Multi-select dropdown */
61
+ MULTI_SELECT: "multiSelect",
62
+ /** Checkbox or toggle */
63
+ BOOLEAN: "boolean"
64
+ };
65
+ /** Global default values */
66
+ const DEFAULT_VALUES = {
67
+ JOIN_OPERATOR: JOIN_OPERATORS.AND,
68
+ PAGE_SIZE: 10,
69
+ PAGE_INDEX: 0
70
+ };
71
+ /** System column IDs - used for smart pinning and feature detection */
72
+ const SYSTEM_COLUMN_IDS = {
73
+ /** Row selection checkbox column */
74
+ SELECT: "select",
75
+ /** Row expand/collapse column */
76
+ EXPAND: "expand",
77
+ /** Row actions column (edit, delete, etc.) */
78
+ ACTIONS: "actions"
79
+ };
80
+ /** Array of all system column IDs for filtering */
81
+ const SYSTEM_COLUMN_ID_LIST = [SYSTEM_COLUMN_IDS.SELECT, SYSTEM_COLUMN_IDS.EXPAND];
82
+ /** UI-related constraints and settings */
83
+ const UI_CONSTANTS = {
84
+ /** Max characters allowed for a filter ID */
85
+ FILTER_ID_MAX_LENGTH: 100,
86
+ /** Default max height for scrollable filter popovers */
87
+ MAX_FILTER_DISPLAY_HEIGHT: 300,
88
+ /** Default debounce delay in milliseconds for search inputs */
89
+ DEBOUNCE_DELAY: 300
90
+ };
91
+ /** Default keyboard shortcut key mappings */
92
+ const KEYBOARD_SHORTCUTS = {
93
+ /** Open/Toggle filter menu */
94
+ FILTER_TOGGLE: "f",
95
+ /** Remove active filter (usually combined with Shift) */
96
+ FILTER_REMOVE: "f",
97
+ /** Close active UI elements */
98
+ ESCAPE: "escape",
99
+ /** Confirm or submit active action */
100
+ ENTER: "enter",
101
+ /** Remove character or navigate back */
102
+ BACKSPACE: "backspace",
103
+ /** Item deletion */
104
+ DELETE: "delete"
105
+ };
106
+ /**
107
+ * Default column width bounds when a column omits `minSize` / `maxSize`.
108
+ * Shared by `DataTableRoot` (defaultColumn) and the resize handle clamp —
109
+ * keep these in constants so root does not import the resize-handle module.
110
+ */
111
+ const DEFAULT_MIN_COLUMN_SIZE = 40;
112
+ const DEFAULT_MAX_COLUMN_SIZE = 1e3;
113
+ /** Standard internalized error messages */
114
+ const ERROR_MESSAGES = {
115
+ /** Thrown when using the old global operator pattern */
116
+ DEPRECATED_GLOBAL_JOIN_OPERATOR: "Global join operator is deprecated. Use individual filter join operators.",
117
+ /** General configuration error */
118
+ INVALID_FILTER_CONFIGURATION: "Invalid filter configuration provided.",
119
+ /** Thrown when mandatory metadata is missing from columns */
120
+ MISSING_COLUMN_META: "Column metadata is required for filtering."
121
+ };
122
+ //#endregion
123
+ export { DEFAULT_MAX_COLUMN_SIZE, DEFAULT_MIN_COLUMN_SIZE, DEFAULT_VALUES, ERROR_MESSAGES, FILTER_OPERATORS, FILTER_VARIANTS, JOIN_OPERATORS, KEYBOARD_SHORTCUTS, SYSTEM_COLUMN_IDS, SYSTEM_COLUMN_ID_LIST, UI_CONSTANTS };
@@ -0,0 +1,35 @@
1
+ //#region src/components/registry/niko-table/lib/create-scroll-handler.d.ts
2
+ export interface ScrollEvent {
3
+ scrollTop: number;
4
+ scrollHeight: number;
5
+ clientHeight: number;
6
+ isTop: boolean;
7
+ isBottom: boolean;
8
+ percentage: number;
9
+ }
10
+ /**
11
+ * Builds the body-scroll listener used by every data-table body
12
+ * (regular, virtualized, virtualized-DnD ×2). Reads the scroll
13
+ * container's metrics on each event and dispatches:
14
+ *
15
+ * - `onScroll` with a `ScrollEvent` snapshot
16
+ * - `onScrolledTop` when at the top
17
+ * - `onScrolledBottom` when within `scrollThreshold` of the bottom
18
+ *
19
+ * The body shipped four byte-for-byte copies of this — extracted so
20
+ * scroll-math changes propagate to all four bodies and so consumers
21
+ * get one canonical attach point. The returned listener is intended
22
+ * to be passed to `addEventListener("scroll", handler, { passive: true })`.
23
+ *
24
+ * Why a factory instead of `useCallback` per body: the closure deps
25
+ * are stable across renders (the consumer-supplied callbacks +
26
+ * threshold are passed as args once), and bodies that wrap this in
27
+ * a `useEffect` already key on those callbacks via their own deps.
28
+ */
29
+ export declare function createScrollHandler({ onScroll, onScrolledTop, onScrolledBottom, scrollThreshold }: {
30
+ onScroll?: (event: ScrollEvent) => void;
31
+ onScrolledTop?: () => void;
32
+ onScrolledBottom?: () => void;
33
+ scrollThreshold?: number;
34
+ }): (event: Event) => void;
35
+ //#endregion
@@ -0,0 +1,63 @@
1
+ //#region src/components/registry/niko-table/lib/create-scroll-handler.ts
2
+ /**
3
+ * Builds the body-scroll listener used by every data-table body
4
+ * (regular, virtualized, virtualized-DnD ×2). Reads the scroll
5
+ * container's metrics on each event and dispatches:
6
+ *
7
+ * - `onScroll` with a `ScrollEvent` snapshot
8
+ * - `onScrolledTop` when at the top
9
+ * - `onScrolledBottom` when within `scrollThreshold` of the bottom
10
+ *
11
+ * The body shipped four byte-for-byte copies of this — extracted so
12
+ * scroll-math changes propagate to all four bodies and so consumers
13
+ * get one canonical attach point. The returned listener is intended
14
+ * to be passed to `addEventListener("scroll", handler, { passive: true })`.
15
+ *
16
+ * Why a factory instead of `useCallback` per body: the closure deps
17
+ * are stable across renders (the consumer-supplied callbacks +
18
+ * threshold are passed as args once), and bodies that wrap this in
19
+ * a `useEffect` already key on those callbacks via their own deps.
20
+ */
21
+ function createScrollHandler({ onScroll, onScrolledTop, onScrolledBottom, scrollThreshold = 50 }) {
22
+ /**
23
+ * Edge-transition gating only — no rAF coalescing.
24
+ *
25
+ * Edge gating: `onScrolledTop` / `onScrolledBottom` previously fired on
26
+ * EVERY scroll event while sitting at the edge — pinning at the bottom
27
+ * while data streamed in re-fired `onScrolledBottom` dozens of times per
28
+ * second. Tracking previous edge state limits firing to the leading edge
29
+ * (false→true) and is the actual source of the perf win.
30
+ *
31
+ * No rAF: iOS Safari pauses `requestAnimationFrame` during momentum
32
+ * scroll, which delayed edge callbacks until the finger lifted and
33
+ * momentum settled — broke infinite-scroll triggering on touch.
34
+ * Dispatch synchronously instead; the scroll math is cheap and edge
35
+ * gating already prevents redundant consumer renders. rAF is better
36
+ * reserved for DOM writes (row virtualization translateY), not
37
+ * consumer callbacks.
38
+ */
39
+ let prevAtTop = false;
40
+ let prevAtBottom = false;
41
+ return (event) => {
42
+ const element = event.currentTarget;
43
+ if (!element) return;
44
+ const { scrollHeight, scrollTop, clientHeight } = element;
45
+ const isTop = scrollTop === 0;
46
+ const isBottom = scrollHeight - scrollTop - clientHeight < scrollThreshold;
47
+ const percentage = scrollHeight - clientHeight > 0 ? scrollTop / (scrollHeight - clientHeight) * 100 : 0;
48
+ onScroll?.({
49
+ scrollTop,
50
+ scrollHeight,
51
+ clientHeight,
52
+ isTop,
53
+ isBottom,
54
+ percentage
55
+ });
56
+ if (isTop && !prevAtTop) onScrolledTop?.();
57
+ if (isBottom && !prevAtBottom) onScrolledBottom?.();
58
+ prevAtTop = isTop;
59
+ prevAtBottom = isBottom;
60
+ };
61
+ }
62
+ //#endregion
63
+ export { createScrollHandler };
@@ -0,0 +1,218 @@
1
+ import { RowData } from "@tanstack/react-table";
2
+ //#region src/components/registry/niko-table/lib/data-table-features.d.ts
3
+ /**
4
+ * Feature groups — the composable unit of the engine layer.
5
+ *
6
+ * Each group is a plain object holding the features, row models and named
7
+ * functions one capability needs. Spread the ones your tables use into
8
+ * `tableFeatures({ … })` and the rest never enters the bundle. That is the
9
+ * engine-side mirror of installing only the `DataTable*` pieces you need —
10
+ * you compose by listing what you want, not by toggling flags.
11
+ *
12
+ * @example
13
+ * // A read-only table: columns, sorting, nothing else.
14
+ * export const features = tableFeatures({
15
+ * ...coreFeatures,
16
+ * ...sortingFeatures,
17
+ * })
18
+ */
19
+ /** Column visibility, ordering, pinning, sizing and resizing. Always useful. */
20
+ export declare const coreFeatures: {
21
+ readonly columnOrderingFeature: import("@tanstack/react-table").TableFeature;
22
+ readonly columnPinningFeature: import("@tanstack/react-table").TableFeature;
23
+ readonly columnResizingFeature: import("@tanstack/react-table").TableFeature;
24
+ readonly columnSizingFeature: import("@tanstack/react-table").TableFeature;
25
+ readonly columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
26
+ };
27
+ /** Column + global filtering, faceting, and the row models they need. */
28
+ export declare const filteringFeatures: {
29
+ readonly columnFacetingFeature: import("@tanstack/react-table").TableFeature;
30
+ readonly columnFilteringFeature: import("@tanstack/react-table").TableFeature;
31
+ readonly globalFilteringFeature: import("@tanstack/react-table").TableFeature;
32
+ readonly facetedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
33
+ readonly facetedUniqueValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => Map<any, number>;
34
+ readonly facetedMinMaxValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => undefined | [number, number];
35
+ readonly filteredRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
36
+ readonly filterFns: {
37
+ readonly extended: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
38
+ readonly numberRange: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
39
+ readonly dateRange: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
40
+ };
41
+ };
42
+ /**
43
+ * Sorting, plus the sort functions a column may name in `sortFn`.
44
+ *
45
+ * `'auto'` resolves only what is registered here, so drop any your tables
46
+ * never reference.
47
+ */
48
+ export declare const sortingFeatures: {
49
+ readonly rowSortingFeature: import("@tanstack/react-table").TableFeature;
50
+ readonly sortedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, RowData>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, RowData>;
51
+ readonly sortFns: {
52
+ readonly alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
53
+ readonly alphanumericCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
54
+ readonly basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
55
+ readonly datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
56
+ readonly text: import("@tanstack/react-table").CreatedSortFn<any, any>;
57
+ readonly textCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
58
+ };
59
+ };
60
+ /** Row expansion — sub-rows and expanded content. Grouping requires it. */
61
+ export declare const expandingFeatures: {
62
+ readonly rowExpandingFeature: import("@tanstack/react-table").TableFeature;
63
+ readonly expandedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
64
+ };
65
+ /**
66
+ * Grouping and aggregation, plus the aggregation functions a column may name
67
+ * in `aggregationFn`. Includes `expandingFeatures`, because a group that
68
+ * cannot collapse is not a group.
69
+ *
70
+ * Pairs with `<DataTableGroupedRows>` on the UI side — compose both, or
71
+ * neither.
72
+ */
73
+ export declare const groupingFeatures: {
74
+ readonly rowExpandingFeature: import("@tanstack/react-table").TableFeature;
75
+ readonly expandedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
76
+ readonly columnGroupingFeature: import("@tanstack/react-table").TableFeature;
77
+ readonly rowAggregationFeature: import("@tanstack/react-table").TableFeature;
78
+ readonly groupedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
79
+ readonly aggregationFns: {
80
+ readonly count: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
81
+ readonly extent: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
82
+ readonly first: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
83
+ readonly last: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
84
+ readonly max: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
85
+ readonly mean: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
86
+ readonly median: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
87
+ readonly min: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
88
+ readonly sum: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
89
+ readonly unique: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown[]>;
90
+ readonly uniqueCount: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
91
+ };
92
+ };
93
+ /** Client-side pagination. Omit it for server-driven or infinite tables. */
94
+ export declare const paginationFeatures: {
95
+ readonly rowPaginationFeature: import("@tanstack/react-table").TableFeature;
96
+ readonly paginatedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
97
+ };
98
+ /** Row selection — checkboxes, the selection bar, bulk actions. */
99
+ export declare const selectionFeatures: {
100
+ readonly rowSelectionFeature: import("@tanstack/react-table").TableFeature;
101
+ };
102
+ /**
103
+ * Batteries-included default: every group above.
104
+ *
105
+ * It exists so a fresh install and every copy-paste example work with no
106
+ * setup. It is a starting point, not a recommendation — replace it with the
107
+ * groups your tables actually use and the rest drops out of the bundle.
108
+ */
109
+ export declare const features: {
110
+ columnOrderingFeature: import("@tanstack/react-table").TableFeature;
111
+ columnPinningFeature: import("@tanstack/react-table").TableFeature;
112
+ columnResizingFeature: import("@tanstack/react-table").TableFeature;
113
+ columnSizingFeature: import("@tanstack/react-table").TableFeature;
114
+ columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
115
+ columnFacetingFeature: import("@tanstack/react-table").TableFeature;
116
+ columnFilteringFeature: import("@tanstack/react-table").TableFeature;
117
+ globalFilteringFeature: import("@tanstack/react-table").TableFeature;
118
+ facetedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
119
+ facetedUniqueValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => Map<any, number>;
120
+ facetedMinMaxValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => undefined | [number, number];
121
+ filteredRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
122
+ filterFns: {
123
+ readonly extended: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
124
+ readonly numberRange: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
125
+ readonly dateRange: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
126
+ };
127
+ rowSortingFeature: import("@tanstack/react-table").TableFeature;
128
+ sortedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, RowData>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, RowData>;
129
+ sortFns: {
130
+ readonly alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
131
+ readonly alphanumericCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
132
+ readonly basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
133
+ readonly datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
134
+ readonly text: import("@tanstack/react-table").CreatedSortFn<any, any>;
135
+ readonly textCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
136
+ };
137
+ rowExpandingFeature: import("@tanstack/react-table").TableFeature;
138
+ expandedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
139
+ columnGroupingFeature: import("@tanstack/react-table").TableFeature;
140
+ rowAggregationFeature: import("@tanstack/react-table").TableFeature;
141
+ groupedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
142
+ aggregationFns: {
143
+ readonly count: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
144
+ readonly extent: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
145
+ readonly first: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
146
+ readonly last: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
147
+ readonly max: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
148
+ readonly mean: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
149
+ readonly median: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
150
+ readonly min: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
151
+ readonly sum: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
152
+ readonly unique: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown[]>;
153
+ readonly uniqueCount: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
154
+ };
155
+ rowPaginationFeature: import("@tanstack/react-table").TableFeature;
156
+ paginatedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
157
+ rowSelectionFeature: import("@tanstack/react-table").TableFeature;
158
+ };
159
+ export type DataTableFeatures = typeof features;
160
+ /**
161
+ * Pre-bound column helper for DataTable. TanStack v9's `createColumnHelper`
162
+ * needs the features generic first (`createColumnHelper<DataTableFeatures, TData>()`);
163
+ * this wraps that the same way `DataTableColumnDef<TData>` pre-binds features.
164
+ *
165
+ * Prefer the helper when you want typed `getValue()` in cells. Prefer a plain
166
+ * `DataTableColumnDef<TData>[]` array for dynamic columns and copy-paste examples.
167
+ */
168
+ export declare function createDataTableColumnHelper<TData extends RowData>(): import("@tanstack/react-table").ColumnHelper<{
169
+ columnOrderingFeature: import("@tanstack/react-table").TableFeature;
170
+ columnPinningFeature: import("@tanstack/react-table").TableFeature;
171
+ columnResizingFeature: import("@tanstack/react-table").TableFeature;
172
+ columnSizingFeature: import("@tanstack/react-table").TableFeature;
173
+ columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
174
+ columnFacetingFeature: import("@tanstack/react-table").TableFeature;
175
+ columnFilteringFeature: import("@tanstack/react-table").TableFeature;
176
+ globalFilteringFeature: import("@tanstack/react-table").TableFeature;
177
+ facetedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
178
+ facetedUniqueValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => Map<any, number>;
179
+ facetedMinMaxValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => undefined | [number, number];
180
+ filteredRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
181
+ filterFns: {
182
+ readonly extended: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
183
+ readonly numberRange: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
184
+ readonly dateRange: import("@tanstack/react-table").FilterFn<import("@tanstack/react-table").TableFeatures, RowData>;
185
+ };
186
+ rowSortingFeature: import("@tanstack/react-table").TableFeature;
187
+ sortedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, RowData>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, RowData>;
188
+ sortFns: {
189
+ readonly alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
190
+ readonly alphanumericCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
191
+ readonly basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
192
+ readonly datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
193
+ readonly text: import("@tanstack/react-table").CreatedSortFn<any, any>;
194
+ readonly textCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
195
+ };
196
+ rowExpandingFeature: import("@tanstack/react-table").TableFeature;
197
+ expandedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
198
+ columnGroupingFeature: import("@tanstack/react-table").TableFeature;
199
+ rowAggregationFeature: import("@tanstack/react-table").TableFeature;
200
+ groupedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
201
+ aggregationFns: {
202
+ readonly count: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
203
+ readonly extent: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
204
+ readonly first: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
205
+ readonly last: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
206
+ readonly max: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
207
+ readonly mean: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
208
+ readonly median: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
209
+ readonly min: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
210
+ readonly sum: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
211
+ readonly unique: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown[]>;
212
+ readonly uniqueCount: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
213
+ };
214
+ rowPaginationFeature: import("@tanstack/react-table").TableFeature;
215
+ paginatedRowModel: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>) => () => import("@tanstack/react-table").RowModel<import("@tanstack/react-table").TableFeatures, any>;
216
+ rowSelectionFeature: import("@tanstack/react-table").TableFeature;
217
+ }, TData>;
218
+ //#endregion
@@ -0,0 +1,127 @@
1
+ import { dateRangeFilter, extendedFilter, numberRangeFilter } from "./filter-functions.js";
2
+ import { aggregationFn_count, aggregationFn_extent, aggregationFn_first, aggregationFn_last, aggregationFn_max, aggregationFn_mean, aggregationFn_median, aggregationFn_min, aggregationFn_sum, aggregationFn_unique, aggregationFn_uniqueCount, columnFacetingFeature, columnFilteringFeature, columnGroupingFeature, columnOrderingFeature, columnPinningFeature, columnResizingFeature, columnSizingFeature, columnVisibilityFeature, createColumnHelper, createExpandedRowModel, createFacetedMinMaxValues, createFacetedRowModel, createFacetedUniqueValues, createFilteredRowModel, createGroupedRowModel, createPaginatedRowModel, createSortedRowModel, globalFilteringFeature, rowAggregationFeature, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures } from "@tanstack/react-table";
3
+ //#region src/components/registry/niko-table/lib/data-table-features.ts
4
+ /**
5
+ * Feature groups — the composable unit of the engine layer.
6
+ *
7
+ * Each group is a plain object holding the features, row models and named
8
+ * functions one capability needs. Spread the ones your tables use into
9
+ * `tableFeatures({ … })` and the rest never enters the bundle. That is the
10
+ * engine-side mirror of installing only the `DataTable*` pieces you need —
11
+ * you compose by listing what you want, not by toggling flags.
12
+ *
13
+ * @example
14
+ * // A read-only table: columns, sorting, nothing else.
15
+ * export const features = tableFeatures({
16
+ * ...coreFeatures,
17
+ * ...sortingFeatures,
18
+ * })
19
+ */
20
+ /** Column visibility, ordering, pinning, sizing and resizing. Always useful. */
21
+ const coreFeatures = {
22
+ columnOrderingFeature,
23
+ columnPinningFeature,
24
+ columnResizingFeature,
25
+ columnSizingFeature,
26
+ columnVisibilityFeature
27
+ };
28
+ /** Column + global filtering, faceting, and the row models they need. */
29
+ const filteringFeatures = {
30
+ columnFacetingFeature,
31
+ columnFilteringFeature,
32
+ globalFilteringFeature,
33
+ facetedRowModel: createFacetedRowModel(),
34
+ facetedUniqueValues: createFacetedUniqueValues(),
35
+ facetedMinMaxValues: createFacetedMinMaxValues(),
36
+ filteredRowModel: createFilteredRowModel(),
37
+ filterFns: {
38
+ extended: extendedFilter,
39
+ numberRange: numberRangeFilter,
40
+ dateRange: dateRangeFilter
41
+ }
42
+ };
43
+ /**
44
+ * Sorting, plus the sort functions a column may name in `sortFn`.
45
+ *
46
+ * `'auto'` resolves only what is registered here, so drop any your tables
47
+ * never reference.
48
+ */
49
+ const sortingFeatures = {
50
+ rowSortingFeature,
51
+ sortedRowModel: createSortedRowModel(),
52
+ sortFns: {
53
+ alphanumeric: sortFn_alphanumeric,
54
+ alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,
55
+ basic: sortFn_basic,
56
+ datetime: sortFn_datetime,
57
+ text: sortFn_text,
58
+ textCaseSensitive: sortFn_textCaseSensitive
59
+ }
60
+ };
61
+ /** Row expansion — sub-rows and expanded content. Grouping requires it. */
62
+ const expandingFeatures = {
63
+ rowExpandingFeature,
64
+ expandedRowModel: createExpandedRowModel()
65
+ };
66
+ /**
67
+ * Grouping and aggregation, plus the aggregation functions a column may name
68
+ * in `aggregationFn`. Includes `expandingFeatures`, because a group that
69
+ * cannot collapse is not a group.
70
+ *
71
+ * Pairs with `<DataTableGroupedRows>` on the UI side — compose both, or
72
+ * neither.
73
+ */
74
+ const groupingFeatures = {
75
+ ...expandingFeatures,
76
+ columnGroupingFeature,
77
+ rowAggregationFeature,
78
+ groupedRowModel: createGroupedRowModel(),
79
+ aggregationFns: {
80
+ count: aggregationFn_count,
81
+ extent: aggregationFn_extent,
82
+ first: aggregationFn_first,
83
+ last: aggregationFn_last,
84
+ max: aggregationFn_max,
85
+ mean: aggregationFn_mean,
86
+ median: aggregationFn_median,
87
+ min: aggregationFn_min,
88
+ sum: aggregationFn_sum,
89
+ unique: aggregationFn_unique,
90
+ uniqueCount: aggregationFn_uniqueCount
91
+ }
92
+ };
93
+ /** Client-side pagination. Omit it for server-driven or infinite tables. */
94
+ const paginationFeatures = {
95
+ rowPaginationFeature,
96
+ paginatedRowModel: createPaginatedRowModel()
97
+ };
98
+ /** Row selection — checkboxes, the selection bar, bulk actions. */
99
+ const selectionFeatures = { rowSelectionFeature };
100
+ /**
101
+ * Batteries-included default: every group above.
102
+ *
103
+ * It exists so a fresh install and every copy-paste example work with no
104
+ * setup. It is a starting point, not a recommendation — replace it with the
105
+ * groups your tables actually use and the rest drops out of the bundle.
106
+ */
107
+ const features = tableFeatures({
108
+ ...coreFeatures,
109
+ ...filteringFeatures,
110
+ ...sortingFeatures,
111
+ ...groupingFeatures,
112
+ ...paginationFeatures,
113
+ ...selectionFeatures
114
+ });
115
+ /**
116
+ * Pre-bound column helper for DataTable. TanStack v9's `createColumnHelper`
117
+ * needs the features generic first (`createColumnHelper<DataTableFeatures, TData>()`);
118
+ * this wraps that the same way `DataTableColumnDef<TData>` pre-binds features.
119
+ *
120
+ * Prefer the helper when you want typed `getValue()` in cells. Prefer a plain
121
+ * `DataTableColumnDef<TData>[]` array for dynamic columns and copy-paste examples.
122
+ */
123
+ function createDataTableColumnHelper() {
124
+ return createColumnHelper();
125
+ }
126
+ //#endregion
127
+ export { coreFeatures, createDataTableColumnHelper, expandingFeatures, features, filteringFeatures, groupingFeatures, paginationFeatures, selectionFeatures, sortingFeatures };
@@ -0,0 +1,47 @@
1
+ import { ExtendedColumnFilter, FilterOperator } from "../types/index.js";
2
+ import { FilterFn, RowData, TableFeatures } from "@tanstack/react-table";
3
+ //#region src/components/registry/niko-table/lib/filter-functions.d.ts
4
+ /**
5
+ * Feature-agnostic filter fn typing for shared Niko filter helpers: these only
6
+ * read the row, so they stay assignable whatever feature set a table registers.
7
+ */
8
+ type AnyFilterFn<TData extends RowData = RowData> = FilterFn<TableFeatures, TData>;
9
+ /**
10
+ * Custom filter function that handles our extended filter operators
11
+ */
12
+ export declare const extendedFilter: AnyFilterFn;
13
+ /**
14
+ * Global filter with operator precedence. Supports plain string search,
15
+ * pure OR, and mixed AND/OR (AND has higher precedence than OR — splits
16
+ * filters into OR-separated AND-groups).
17
+ */
18
+ /**
19
+ * Whether a `globalFilter` value represents a search the reader actually made.
20
+ *
21
+ * A whitespace-only string does not: it is invisible in the search input, so
22
+ * treating it as active makes the UI insist something is filtered while showing
23
+ * nothing that could be. The advanced filter payload is an object and always
24
+ * counts.
25
+ */
26
+ export declare function isGlobalFilterActive(value: unknown): boolean;
27
+ export declare const globalFilter: AnyFilterFn;
28
+ /**
29
+ * Filter function for number range (slider) filters
30
+ * Handles array values [min, max] for range filtering
31
+ */
32
+ export declare const numberRangeFilter: AnyFilterFn;
33
+ /**
34
+ * Filter function for date range filters
35
+ * Handles both single date (timestamp) and date range [from, to] (timestamps)
36
+ */
37
+ export declare const dateRangeFilter: AnyFilterFn;
38
+ /**
39
+ * Helper function to create filter value with operator
40
+ *
41
+ * @param operator - The filter operator to apply
42
+ * @param value - The value to filter by
43
+ * @returns ExtendedColumnFilter object with default properties
44
+ */
45
+ export declare const createFilterValue: <TData = RowData>(operator: FilterOperator, value: string | number | boolean | null | undefined | string[]) => ExtendedColumnFilter<TData>;
46
+ //#endregion
47
+ export {};