@kong-ui-public/table-data-grid 0.7.3 → 0.7.4-pr.3892.c83ecea95.0
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/package.json +1 -1
- package/dist/style.css +0 -1
- package/dist/table-data-grid.es.js +0 -719
- package/dist/table-data-grid.umd.js +0 -1
- package/dist/types/components/TableDataGrid.vue.d.ts +0 -40
- package/dist/types/components/TableDataGrid.vue.d.ts.map +0 -1
- package/dist/types/components/TableDataGridCellRenderer.vue.d.ts +0 -25
- package/dist/types/components/TableDataGridCellRenderer.vue.d.ts.map +0 -1
- package/dist/types/composables/useEmitState.d.ts +0 -11
- package/dist/types/composables/useEmitState.d.ts.map +0 -1
- package/dist/types/composables/useFetchInfinite.d.ts +0 -53
- package/dist/types/composables/useFetchInfinite.d.ts.map +0 -1
- package/dist/types/composables/useFetchState.d.ts +0 -30
- package/dist/types/composables/useFetchState.d.ts.map +0 -1
- package/dist/types/composables/useI18n.d.ts +0 -9
- package/dist/types/composables/useI18n.d.ts.map +0 -1
- package/dist/types/composables/useTableDataGridColumnDefs.d.ts +0 -31
- package/dist/types/composables/useTableDataGridColumnDefs.d.ts.map +0 -1
- package/dist/types/composables/useTableDataGridConfig.d.ts +0 -38
- package/dist/types/composables/useTableDataGridConfig.d.ts.map +0 -1
- package/dist/types/composables/useTableDataGridInteractions.d.ts +0 -17
- package/dist/types/composables/useTableDataGridInteractions.d.ts.map +0 -1
- package/dist/types/composables/useTableDataGridSort.d.ts +0 -18
- package/dist/types/composables/useTableDataGridSort.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -105
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/fetchers.d.ts +0 -42
- package/dist/types/utils/fetchers.d.ts.map +0 -1
- package/dist/types/utils/tableConfig.d.ts +0 -25
- package/dist/types/utils/tableConfig.d.ts.map +0 -1
- package/dist/types/utils/tableDataGridPresentation.d.ts +0 -87
- package/dist/types/utils/tableDataGridPresentation.d.ts.map +0 -1
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { TableDataGridHeader, TableDataGridThreshold } from '../types';
|
|
2
|
-
export type TableDataGridColumnStats = {
|
|
3
|
-
sum: number;
|
|
4
|
-
max: number;
|
|
5
|
-
};
|
|
6
|
-
/** Longest value and percentage text in a bar column, used to size a shared label track. */
|
|
7
|
-
export type TableDataGridLabelSizer = {
|
|
8
|
-
value: string;
|
|
9
|
-
relative?: string;
|
|
10
|
-
};
|
|
11
|
-
/** Stats and label sizers are only present for unpaginated columns with percentage or bar presentation. */
|
|
12
|
-
export type TableDataGridPresentationContext = {
|
|
13
|
-
stats: Record<string, TableDataGridColumnStats>;
|
|
14
|
-
labelSizers: Record<string, TableDataGridLabelSizer>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Return the text a cell displays: the header's `valueFormatter` output, or the raw value as a string.
|
|
18
|
-
* Shared by the AG Grid column formatter and the label sizer so both measure the same text.
|
|
19
|
-
*
|
|
20
|
-
* @param header - Column whose optional value formatter applies.
|
|
21
|
-
* @param row - Row that owns the value.
|
|
22
|
-
* @returns Display text for the cell.
|
|
23
|
-
*/
|
|
24
|
-
export declare const formatCellValue: <Row extends object>(header: Pick<TableDataGridHeader<Row>, "key" | "valueFormatter">, row: Row) => string;
|
|
25
|
-
/**
|
|
26
|
-
* Accept numeric values only; generic grid cells must not coerce strings or booleans.
|
|
27
|
-
*
|
|
28
|
-
* @param value - Raw cell value.
|
|
29
|
-
* @returns The finite number unchanged, or null without coercion.
|
|
30
|
-
*/
|
|
31
|
-
export declare const toFiniteNumber: (value: unknown) => number | null;
|
|
32
|
-
/**
|
|
33
|
-
* Calculate sum and maximum from the complete returned result, ignoring missing or invalid values.
|
|
34
|
-
*
|
|
35
|
-
* @param rows - Complete result for the current query.
|
|
36
|
-
* @param header - Column key to aggregate.
|
|
37
|
-
* @returns Column sum and maximum, with the maximum floored at zero.
|
|
38
|
-
*/
|
|
39
|
-
export declare const getColumnStats: (rows: readonly object[], header: Pick<TableDataGridHeader, "key">) => TableDataGridColumnStats;
|
|
40
|
-
/**
|
|
41
|
-
* Preserve TopN threshold precedence: highest crossed value wins, with error winning ties.
|
|
42
|
-
*
|
|
43
|
-
* @param value - Numeric cell value.
|
|
44
|
-
* @param thresholds - Optional warning and error thresholds.
|
|
45
|
-
* @returns The highest crossed threshold type, or undefined.
|
|
46
|
-
*/
|
|
47
|
-
export declare const getThresholdType: (value: number, thresholds: readonly TableDataGridThreshold[] | undefined) => TableDataGridThreshold["type"] | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Return a clamped 0–1 ratio: relative uses the column sum; absolute uses its maximum.
|
|
50
|
-
*
|
|
51
|
-
* @param value - Numeric cell value, or null when missing.
|
|
52
|
-
* @param stats - Sum and maximum of the complete column.
|
|
53
|
-
* @param mode - Relative (sum) or absolute (maximum) scaling.
|
|
54
|
-
* @returns A ratio between zero and one; zero for missing values or nonpositive denominators.
|
|
55
|
-
*/
|
|
56
|
-
export declare const getBarRatio: (value: number | null, stats: TableDataGridColumnStats, mode: TableDataGridHeader["bar"]) => number;
|
|
57
|
-
/**
|
|
58
|
-
* Format a value as its share of the column total.
|
|
59
|
-
*
|
|
60
|
-
* @param value - Numeric cell value, or null when missing.
|
|
61
|
-
* @param stats - Sum and maximum of the complete column.
|
|
62
|
-
* @param header - Column whose optional percentage formatter applies.
|
|
63
|
-
* @returns Percentage text, or undefined when the share is undefined.
|
|
64
|
-
*/
|
|
65
|
-
export declare const formatRelativeValue: ({ value, stats, header, }: {
|
|
66
|
-
value: number | null;
|
|
67
|
-
stats: TableDataGridColumnStats;
|
|
68
|
-
header: Pick<TableDataGridHeader, "percentageFormatter">;
|
|
69
|
-
}) => string | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* Find the longest value and percentage text in the complete result.
|
|
72
|
-
*
|
|
73
|
-
* Every bar cell reserves this text's width, so bars start at the same offset across rows.
|
|
74
|
-
* Length approximates rendered width, which holds for numeric text. Host slot content and
|
|
75
|
-
* cell icons are not measured.
|
|
76
|
-
*
|
|
77
|
-
* @param rows - Complete result for the current query.
|
|
78
|
-
* @param header - Bar column to measure.
|
|
79
|
-
* @param stats - Sum and maximum of the complete column.
|
|
80
|
-
* @returns The longest value text and, when percentages show, the longest percentage text.
|
|
81
|
-
*/
|
|
82
|
-
export declare const getLabelSizer: <Row extends object>({ rows, header, stats, }: {
|
|
83
|
-
rows: readonly Row[];
|
|
84
|
-
header: TableDataGridHeader<Row>;
|
|
85
|
-
stats: TableDataGridColumnStats;
|
|
86
|
-
}) => TableDataGridLabelSizer;
|
|
87
|
-
//# sourceMappingURL=tableDataGridPresentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tableDataGridPresentation.d.ts","sourceRoot":"","sources":["../../../src/utils/tableDataGridPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,UAAU,CAAA;AAKjB,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,4FAA4F;AAC5F,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,2GAA2G;AAC3G,MAAM,MAAM,gCAAgC,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAA;IAC/C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;CACrD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,SAAS,MAAM,EAChD,QAAQ,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,gBAAgB,CAAC,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