pace-table-lib 1.0.45 → 1.0.46
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/dist/components/PivotTable/PivotTable.d.ts +5 -0
- package/dist/components/PivotTable/PivotTable.types.d.ts +283 -0
- package/dist/components/PivotTable/PivotTable.utils.d.ts +31 -0
- package/dist/components/StaticTable/StaticTableTypeDec.types.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/pace-table-lib.es.js +1379 -5
- package/dist/pace-table-lib.es.js.map +1 -1
- package/dist/pace-table-lib.umd.js +1378 -4
- package/dist/pace-table-lib.umd.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
export interface ColumnDefinition {
|
|
2
|
+
Count: number;
|
|
3
|
+
headerIndex: number;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
isLegendCell: boolean;
|
|
6
|
+
isRollup: boolean;
|
|
7
|
+
rowSpan: number;
|
|
8
|
+
visibility: boolean;
|
|
9
|
+
isParentCell: boolean;
|
|
10
|
+
priorityOrder: number;
|
|
11
|
+
gridVisibility: boolean;
|
|
12
|
+
columnGridVisibility: boolean;
|
|
13
|
+
rowGridVisibility: boolean;
|
|
14
|
+
fontWeight: boolean;
|
|
15
|
+
Name: string;
|
|
16
|
+
totalPath?: string;
|
|
17
|
+
columnHeader: boolean;
|
|
18
|
+
width: number;
|
|
19
|
+
ribbon: "even" | "odd";
|
|
20
|
+
}
|
|
21
|
+
export interface RowDefinition {
|
|
22
|
+
Count: number;
|
|
23
|
+
headerIndex: number;
|
|
24
|
+
isExpanded: boolean;
|
|
25
|
+
isLegendCell: boolean;
|
|
26
|
+
isRollup: boolean;
|
|
27
|
+
rowSpan: number;
|
|
28
|
+
visibility: boolean;
|
|
29
|
+
isParentCell: boolean;
|
|
30
|
+
priorityOrder: number;
|
|
31
|
+
gridVisibility: boolean;
|
|
32
|
+
columnGridVisibility: boolean;
|
|
33
|
+
rowGridVisibility: boolean;
|
|
34
|
+
fontWeight: boolean;
|
|
35
|
+
Name: string;
|
|
36
|
+
totalPath: string;
|
|
37
|
+
columnPath?: string;
|
|
38
|
+
Dimension?: string[];
|
|
39
|
+
width?: number;
|
|
40
|
+
maxValueInColumn?: number;
|
|
41
|
+
minValueInColumn?: number;
|
|
42
|
+
maxValueInRow?: number;
|
|
43
|
+
minValueInRow?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface BaseTableData {
|
|
46
|
+
columnList?: ColumnDefinition[];
|
|
47
|
+
rowList?: RowDefinition[];
|
|
48
|
+
noOfColumns?: number;
|
|
49
|
+
multilpleCol?: boolean;
|
|
50
|
+
minMaxValuesInAllData?: {
|
|
51
|
+
minValueInAllData: number;
|
|
52
|
+
maxValueInAllData: number;
|
|
53
|
+
};
|
|
54
|
+
columnDateFormatObj?: Record<string, any>;
|
|
55
|
+
}
|
|
56
|
+
export interface TableData {
|
|
57
|
+
columnList: ColumnDefinition[];
|
|
58
|
+
rowList: RowDefinition[];
|
|
59
|
+
noOfColumns: number;
|
|
60
|
+
multilpleCol: boolean;
|
|
61
|
+
minMaxValuesInAllData?: {
|
|
62
|
+
minValueInAllData: number;
|
|
63
|
+
maxValueInAllData: number;
|
|
64
|
+
};
|
|
65
|
+
columnDateFormatObj?: Record<string, any>;
|
|
66
|
+
}
|
|
67
|
+
export interface MeasureFormatConfig {
|
|
68
|
+
measureIndex: number;
|
|
69
|
+
measureName: string;
|
|
70
|
+
numberFormat: string;
|
|
71
|
+
displayUnits: string;
|
|
72
|
+
decimalPrecision: number;
|
|
73
|
+
}
|
|
74
|
+
export interface TableStyleProps {
|
|
75
|
+
TableTitle: {
|
|
76
|
+
TableTitleVisibility: boolean;
|
|
77
|
+
TableTitleFontSize: number;
|
|
78
|
+
TableTitleFontFamily: string;
|
|
79
|
+
TableTitleColor: string;
|
|
80
|
+
TableTitleText: string;
|
|
81
|
+
Textalign: string;
|
|
82
|
+
};
|
|
83
|
+
Border: {
|
|
84
|
+
BorderButtonVisibility: boolean;
|
|
85
|
+
LineStyle: string;
|
|
86
|
+
LineColor: string;
|
|
87
|
+
LineWidth: number;
|
|
88
|
+
VerticalBorderLineButton: boolean;
|
|
89
|
+
VerticalBorderLineStyle: string;
|
|
90
|
+
VerticalBorderLineColor: string;
|
|
91
|
+
VerticalBorderLineWidth: number;
|
|
92
|
+
HorizontalBorderLineButton: boolean;
|
|
93
|
+
HorizontalBorderLineStyle: string;
|
|
94
|
+
HorizontalBorderLineColor: string;
|
|
95
|
+
HorizontalBorderLineWidth: number;
|
|
96
|
+
};
|
|
97
|
+
RowHeader: {
|
|
98
|
+
RowHeaderFontSize: number;
|
|
99
|
+
RowHeaderFontFamily: string;
|
|
100
|
+
RowHeaderFontStyle: string[];
|
|
101
|
+
RowHeaderFontWeight: string;
|
|
102
|
+
RowHeaderColor: string;
|
|
103
|
+
RowHeaderBackgroundcolor: string;
|
|
104
|
+
CustomRowHeaderBackgroundcolor: string;
|
|
105
|
+
EvenRowHeadercolor: string;
|
|
106
|
+
OddRowHeadercolor: string;
|
|
107
|
+
Textalign: string;
|
|
108
|
+
HideRowHeader: boolean;
|
|
109
|
+
};
|
|
110
|
+
ColumnHeader: {
|
|
111
|
+
ColumnHeaderFontSize: number;
|
|
112
|
+
ColumnHeaderFontFamily: string;
|
|
113
|
+
ColumnHeaderFontStyle: string[];
|
|
114
|
+
ColumnHeaderFontWeight: string;
|
|
115
|
+
ColumnHeaderColor: string;
|
|
116
|
+
ColumnHeaderBackgroundcolor: string;
|
|
117
|
+
CustomColumnHeaderBackgroundcolor: string;
|
|
118
|
+
EvenColumnHeadercolor: string;
|
|
119
|
+
OddColumnHeadercolor: string;
|
|
120
|
+
Textalign: string;
|
|
121
|
+
HideColumnHeader: boolean;
|
|
122
|
+
};
|
|
123
|
+
DataField: {
|
|
124
|
+
DataFieldFontSize: number;
|
|
125
|
+
DataFieldFontFamily: string;
|
|
126
|
+
DataFieldFontStyle: string[];
|
|
127
|
+
DataFieldFontWeight: string;
|
|
128
|
+
DataFieldColor: string;
|
|
129
|
+
DataFieldBackgroundcolor: string;
|
|
130
|
+
CustomDataFieldBackgroundcolor: string;
|
|
131
|
+
EvenDataFieldcolor: string;
|
|
132
|
+
OddDataFieldcolor: string;
|
|
133
|
+
RowTotal: boolean;
|
|
134
|
+
ColumnTotal: boolean;
|
|
135
|
+
NumberFormat: string;
|
|
136
|
+
DataFieldDecimalPrecision: number;
|
|
137
|
+
DisplayUnits: string;
|
|
138
|
+
Textalign: string;
|
|
139
|
+
};
|
|
140
|
+
ToolTip: {
|
|
141
|
+
ToolTipVisibility: boolean;
|
|
142
|
+
ToolTipNumberFormat: string;
|
|
143
|
+
ToolTipDecimalPrecision: number;
|
|
144
|
+
};
|
|
145
|
+
Table: {
|
|
146
|
+
FitTable: boolean;
|
|
147
|
+
TableWidth: number;
|
|
148
|
+
RowHeight: number;
|
|
149
|
+
Conditionalformatting: any[];
|
|
150
|
+
ConditionalformattingOnOff: boolean;
|
|
151
|
+
FixHeaderWidth: number;
|
|
152
|
+
ColumnWrapText: boolean;
|
|
153
|
+
RowWrapText: boolean;
|
|
154
|
+
};
|
|
155
|
+
KPI: {
|
|
156
|
+
KPIVisibility: boolean;
|
|
157
|
+
showContributionToToolTip: boolean;
|
|
158
|
+
KPIBaseFormat: string;
|
|
159
|
+
KPIMinColor: string;
|
|
160
|
+
KPIMaxColor: string;
|
|
161
|
+
};
|
|
162
|
+
HeatMap: {
|
|
163
|
+
ShowHeatMap: boolean;
|
|
164
|
+
HeatMapView: string;
|
|
165
|
+
HeatMapMinColor: string;
|
|
166
|
+
HeatMapMaxColor: string;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export interface PivotTableProps<T extends BaseTableData = BaseTableData> {
|
|
170
|
+
tableData: T;
|
|
171
|
+
leftFixedCellNameList?: string[];
|
|
172
|
+
tableStyleProps?: any;
|
|
173
|
+
tableWidth?: number;
|
|
174
|
+
tableHeight?: number;
|
|
175
|
+
measureFormatConfigs?: any;
|
|
176
|
+
}
|
|
177
|
+
export interface ColumnNode {
|
|
178
|
+
column: ColumnDefinition;
|
|
179
|
+
children: ColumnNode[];
|
|
180
|
+
parent: ColumnNode | null;
|
|
181
|
+
level: number;
|
|
182
|
+
}
|
|
183
|
+
export interface ExpandedState {
|
|
184
|
+
[totalPath: string]: boolean;
|
|
185
|
+
}
|
|
186
|
+
export interface MeasureDefinition {
|
|
187
|
+
Name: {
|
|
188
|
+
DatasourceId: string;
|
|
189
|
+
Value: string;
|
|
190
|
+
Type: string;
|
|
191
|
+
};
|
|
192
|
+
MeasureName: string;
|
|
193
|
+
Aggregation: string;
|
|
194
|
+
MeasureUniqueId: string;
|
|
195
|
+
}
|
|
196
|
+
export interface MeasureSet {
|
|
197
|
+
Columns: [];
|
|
198
|
+
DatasourceMetaId: string[];
|
|
199
|
+
Id: string;
|
|
200
|
+
Measure: MeasureDefinition;
|
|
201
|
+
PrimaryDatasourceID: string;
|
|
202
|
+
Rows: RowDefinition;
|
|
203
|
+
Slices: [];
|
|
204
|
+
Type: string;
|
|
205
|
+
}
|
|
206
|
+
export interface RequestJson {
|
|
207
|
+
Formula: [];
|
|
208
|
+
GroupDimensions: Record<string, unknown>;
|
|
209
|
+
MeasureSet: MeasureSet[];
|
|
210
|
+
RequestId: string;
|
|
211
|
+
RequestType: number;
|
|
212
|
+
currentPageNumber: number;
|
|
213
|
+
pageSize: number;
|
|
214
|
+
sortingData: Record<string, unknown>;
|
|
215
|
+
}
|
|
216
|
+
export interface FinalRequestJson {
|
|
217
|
+
RequestJson: RequestJson;
|
|
218
|
+
SourceData: SourceData;
|
|
219
|
+
chartSheetMetaData: ChartSheetMetaData;
|
|
220
|
+
isReqFormAnalyzer: boolean;
|
|
221
|
+
}
|
|
222
|
+
interface Style {
|
|
223
|
+
Style: TableStyleProps;
|
|
224
|
+
}
|
|
225
|
+
export interface SourceData {
|
|
226
|
+
TableStyle: Style;
|
|
227
|
+
Yaxis: YAxisField[];
|
|
228
|
+
}
|
|
229
|
+
export interface YAxisField {
|
|
230
|
+
Id: string;
|
|
231
|
+
Name: string;
|
|
232
|
+
ActualName: string;
|
|
233
|
+
Alias: string;
|
|
234
|
+
DatasourceId: string;
|
|
235
|
+
DatasourceName: string;
|
|
236
|
+
Aggregation: string;
|
|
237
|
+
MeasureUniqueId: string;
|
|
238
|
+
Type: "Measure";
|
|
239
|
+
IsVisible: boolean;
|
|
240
|
+
IsActive: boolean;
|
|
241
|
+
FilterList: unknown[];
|
|
242
|
+
LegendList: [];
|
|
243
|
+
}
|
|
244
|
+
export interface ChartSheetMetaData {
|
|
245
|
+
tableId: string;
|
|
246
|
+
}
|
|
247
|
+
export interface FlatRow {
|
|
248
|
+
rowPath: string;
|
|
249
|
+
segments: string[];
|
|
250
|
+
depth: number;
|
|
251
|
+
name: string;
|
|
252
|
+
measureIndex: number;
|
|
253
|
+
measureName: string;
|
|
254
|
+
isSubtotal: boolean;
|
|
255
|
+
rowIndex: number;
|
|
256
|
+
}
|
|
257
|
+
export interface ParsedColumn {
|
|
258
|
+
path: string;
|
|
259
|
+
year: string;
|
|
260
|
+
isSubtotal: boolean;
|
|
261
|
+
measureDisplay: string;
|
|
262
|
+
colIndex: number;
|
|
263
|
+
}
|
|
264
|
+
export interface BgColorPair {
|
|
265
|
+
odd: string;
|
|
266
|
+
even: string;
|
|
267
|
+
}
|
|
268
|
+
export interface BorderStyles {
|
|
269
|
+
outsideBorder: string | null;
|
|
270
|
+
insideVBorder: string | null;
|
|
271
|
+
insideHBorder: string | null;
|
|
272
|
+
}
|
|
273
|
+
export interface CellSizes {
|
|
274
|
+
colCellHeight: number;
|
|
275
|
+
rowCellHeight: number;
|
|
276
|
+
colCellWidth: number;
|
|
277
|
+
fixedColWidth: number;
|
|
278
|
+
}
|
|
279
|
+
export interface ParsedMeasureInfo {
|
|
280
|
+
measureIndex: number;
|
|
281
|
+
measureName: string;
|
|
282
|
+
}
|
|
283
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MeasureFormatObj, TableStyleConfig } from "../StaticTable/StaticTableTypeDec.types";
|
|
2
|
+
import { BgColorPair, ParsedMeasureInfo } from "./PivotTable.types";
|
|
3
|
+
/** Linearly interpolates between two hex colors by factor [0,1] */
|
|
4
|
+
export declare const interpolateColor: (minColor: string, maxColor: string, factor: number) => string;
|
|
5
|
+
/** Maps a value in [minValue, maxValue] to an interpolated RGB color string */
|
|
6
|
+
export declare function getHeatmapColor(value: number, minValue: number, maxValue: number, minColor: string, maxColor: string): string;
|
|
7
|
+
/** Splits a backtick-delimited row path into segments */
|
|
8
|
+
export declare function parseRowPath(rowPath: string): string[];
|
|
9
|
+
/** Returns the last non-subtotal segment as the display label */
|
|
10
|
+
export declare function getDisplayName(segments: string[]): string;
|
|
11
|
+
export declare function getRowDisplayName(segments: string[]): string;
|
|
12
|
+
/** Formats a raw numeric value according to MeasureFormatObj config */
|
|
13
|
+
export declare function formatCellValue(value: string | number, formatConfig?: MeasureFormatObj): string;
|
|
14
|
+
/** Resolves the background color for a data cell or row header based on style config */
|
|
15
|
+
export declare function getCellBackgroundColor(isEven: boolean, _ribbon: "even" | "odd" | undefined, styleProps: TableStyleConfig, isRowHeader?: boolean): string;
|
|
16
|
+
/** Resolves odd/even background colors for a given cell region from style config */
|
|
17
|
+
export declare const resolveBgColors: (obj: any, type: "row" | "dataField" | "column") => BgColorPair;
|
|
18
|
+
/** Extracts font style tokens from an array or string into CSS properties */
|
|
19
|
+
export declare const parseFontStyle: (stylePayload: any) => React.CSSProperties;
|
|
20
|
+
/** Safely coerces a font-size value to a finite number (defaults to 10) */
|
|
21
|
+
export declare const normalizeFontSize: (v?: number | string) => number;
|
|
22
|
+
/** Builds a CSS border shorthand string */
|
|
23
|
+
export declare const makeBorder: (w: number, s: string, c: string) => string;
|
|
24
|
+
export declare function getMeasureNameFromCol(col: {
|
|
25
|
+
path: string;
|
|
26
|
+
isSubtotal: boolean;
|
|
27
|
+
year: string;
|
|
28
|
+
measureDisplay: string;
|
|
29
|
+
}): ParsedMeasureInfo;
|
|
30
|
+
/** Apply date format on column and row header */
|
|
31
|
+
export declare function applyDateFormat(value: string, format: string): string;
|
|
@@ -13,7 +13,7 @@ export type StaticTableProps = {
|
|
|
13
13
|
measureFormatConfigs?: MeasureFormatObj[];
|
|
14
14
|
};
|
|
15
15
|
export type DisplayUnitsType = typeof DISPLAY_UNITS_OBJ[keyof typeof DISPLAY_UNITS_OBJ];
|
|
16
|
-
type MeasureFormatObj = {
|
|
16
|
+
export type MeasureFormatObj = {
|
|
17
17
|
measureName?: string;
|
|
18
18
|
numberFormat: string;
|
|
19
19
|
decimalPrecision: number;
|
|
@@ -56,7 +56,7 @@ type TableDataTypes = {
|
|
|
56
56
|
}[];
|
|
57
57
|
totalNumberOfRows: number;
|
|
58
58
|
};
|
|
59
|
-
type TableStyleConfig = {
|
|
59
|
+
export type TableStyleConfig = {
|
|
60
60
|
ToolTip: {
|
|
61
61
|
ToolTipNumberFormat: "Comma Separated" | string;
|
|
62
62
|
ToolTipVisibility: boolean;
|
package/dist/index.d.ts
CHANGED