@agilant/toga-blox 1.0.96 → 1.0.97
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.
|
@@ -40,6 +40,12 @@ export interface Renderers {
|
|
|
40
40
|
* A generic table formatter you can reuse in both apps.
|
|
41
41
|
* This version delegates certain rendering details to the `renderers`.
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
declare function formatTableData(columnTitles: string[], accessors: string[], columnConfigs: SharedColumnConfig[], renderers?: Renderers): TableColumn[];
|
|
44
44
|
/** Simple helper to generate the default "col1", "col2", ... accessors */
|
|
45
|
-
|
|
45
|
+
declare function generateAccessors(columnTitles: string[]): string[];
|
|
46
|
+
export { formatTableData, generateAccessors };
|
|
47
|
+
declare const _default: {
|
|
48
|
+
formatTableData: typeof formatTableData;
|
|
49
|
+
generateAccessors: typeof generateAccessors;
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
* A generic table formatter you can reuse in both apps.
|
|
4
4
|
* This version delegates certain rendering details to the `renderers`.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
function formatTableData(columnTitles, accessors, columnConfigs, renderers = {}) {
|
|
7
7
|
function renderCellContent(config) {
|
|
8
8
|
return ({ value }) => {
|
|
9
9
|
// 1. Check leftIcon, rightIcon, leftImage, rightImage, etc.
|
|
@@ -75,6 +75,11 @@ export function formatTableData(columnTitles, accessors, columnConfigs, renderer
|
|
|
75
75
|
return columns;
|
|
76
76
|
}
|
|
77
77
|
/** Simple helper to generate the default "col1", "col2", ... accessors */
|
|
78
|
-
|
|
78
|
+
function generateAccessors(columnTitles) {
|
|
79
79
|
return columnTitles.map((_, index) => `col${index + 1}`);
|
|
80
80
|
}
|
|
81
|
+
export { formatTableData, generateAccessors };
|
|
82
|
+
export default {
|
|
83
|
+
formatTableData,
|
|
84
|
+
generateAccessors,
|
|
85
|
+
};
|