jcicl 1.0.56 → 1.0.57
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/Table/Table.d.ts +23 -0
- package/Table/Table.js +4287 -4279
- package/package.json +1 -1
package/Table/Table.d.ts
CHANGED
|
@@ -5,6 +5,29 @@ import { default as React } from 'react';
|
|
|
5
5
|
export interface TableValueHandle {
|
|
6
6
|
getTableValue: () => string | number;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* A cell value that displays one thing but sorts by a numeric priority.
|
|
10
|
+
*
|
|
11
|
+
* Use this when a column's display text doesn't sort in the desired order.
|
|
12
|
+
* The Table renders `value` in the cell, searches by `value`, and exports `value` to CSV,
|
|
13
|
+
* but sorts by `sortPriority` when the column header is clicked.
|
|
14
|
+
*
|
|
15
|
+
* Plain values still work as before — SortableCell is opt-in per cell.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Priority column: displays "Critical" but sorts numerically (0 first)
|
|
19
|
+
* const data = [
|
|
20
|
+
* { name: 'Task A', priority: { value: 'Critical', sortPriority: 0 } },
|
|
21
|
+
* { name: 'Task B', priority: { value: 'Low', sortPriority: 3 } },
|
|
22
|
+
* { name: 'Task C', priority: { value: 'High', sortPriority: 1 } },
|
|
23
|
+
* ];
|
|
24
|
+
*/
|
|
25
|
+
export interface SortableCell {
|
|
26
|
+
/** The value displayed in the cell, used for search and CSV export. */
|
|
27
|
+
value: string | number | React.ReactNode;
|
|
28
|
+
/** The numeric value used for sorting when the column header is clicked. Lower numbers sort first in ascending order. */
|
|
29
|
+
sortPriority: number;
|
|
30
|
+
}
|
|
8
31
|
export interface TableProps {
|
|
9
32
|
data: Record<string, any>[];
|
|
10
33
|
columnTitles?: Record<string, string>;
|