pace-table-lib 0.0.2 → 1.0.1
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/README.md +12 -12
- package/dist/components/StaticTable/HelperFunctions.d.ts +11 -0
- package/dist/components/StaticTable/StaticTable.d.ts +4 -0
- package/dist/components/StaticTable/StaticTableConst.d.ts +64 -0
- package/dist/components/StaticTable/StaticTableTypeDec.types.d.ts +233 -0
- package/dist/index.d.ts +2 -1
- package/dist/pace-table-lib.es.js +6596 -0
- package/dist/pace-table-lib.umd.js +53 -0
- package/dist/stats.html +4687 -0
- package/dist/vite.svg +1 -0
- package/package.json +51 -29
- package/dist/components/charts/barchart/BarChart.d.ts +0 -12
- package/dist/components/charts/barchart/BarChart.js +0 -9
- package/dist/components/charts/linechart/LineChart.d.ts +0 -12
- package/dist/components/charts/linechart/LineChart.js +0 -5
- package/dist/components/tables/Table.d.ts +0 -11
- package/dist/components/tables/Table.js +0 -8
- package/dist/index.js +0 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# 📋 pace-table-lib
|
|
2
|
-
|
|
3
|
-
A lightweight, reusable, and customizable React Table component built with TypeScript. Ideal for rendering tabular data with dynamic columns and content.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 📦 Installation
|
|
8
|
-
|
|
9
|
-
Install the library in your project:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install pace-table-lib
|
|
1
|
+
# 📋 pace-table-lib
|
|
2
|
+
|
|
3
|
+
A lightweight, reusable, and customizable React Table component built with TypeScript. Ideal for rendering tabular data with dynamic columns and content.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📦 Installation
|
|
8
|
+
|
|
9
|
+
Install the library in your project:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install pace-table-lib
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { BgColorObj, DisplayUnitsType } from "./StaticTableTypeDec.types";
|
|
3
|
+
export declare function getSpan(arr: string[][], index: number, level: number): number;
|
|
4
|
+
export declare function getCleanString(dimensionMark: string): string;
|
|
5
|
+
export declare function isFirstOccurrence(arr: string[][], index: number, level: number): boolean;
|
|
6
|
+
export declare function getBgColorForCell(dataIndex: number, colorObj: BgColorObj): string;
|
|
7
|
+
export declare function getBgColor(obj: any, type: "row" | "dataField" | "column"): BgColorObj;
|
|
8
|
+
export declare function formatValue(value: any, format: string, decimalValues?: number, displayUnit?: DisplayUnitsType): any;
|
|
9
|
+
export declare function getFontStyleObj(stylePayload: any): CSSProperties;
|
|
10
|
+
export declare function interpolateColor(minColor: string, maxColor: string, ratio: number): string;
|
|
11
|
+
export declare function computeMatrix<T>(rawDataMatrix: number[][], mode: "All" | "Column-wise" | "Row-wise", transformFn: (v: number, min: number, max: number) => T): T[][];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "react-virtualized/styles.css";
|
|
2
|
+
import "./StaticTable.scss";
|
|
3
|
+
import { StaticTableProps } from "./StaticTableTypeDec.types";
|
|
4
|
+
export default function StaticTable({ tableData, leftFixedCellNameList, tableStyleProps, tableWidth, tableHeight, measureFormatConfigs }: StaticTableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const TOTAL = "Total";
|
|
2
|
+
export declare const BORDER_STYLE = "1px solid #ccc";
|
|
3
|
+
export declare const MONTHS_SHORT: string[];
|
|
4
|
+
export declare const MONTHS_FULL: string[];
|
|
5
|
+
export declare const DATE_FORMATS: string[];
|
|
6
|
+
export declare const EXCEL_EPOCH_OFFSET = 25569;
|
|
7
|
+
export declare const DATE_FORMAT_OBJ: {
|
|
8
|
+
readonly DD_MM_YYYY: "DD-MM-YYYY";
|
|
9
|
+
readonly MM_DD_YYYY: "MM-DD-YYYY";
|
|
10
|
+
readonly YYYY_MM_DD: "YYYY-MM-DD";
|
|
11
|
+
readonly YYYY: "YYYY";
|
|
12
|
+
readonly DD_MM: "DD-MM";
|
|
13
|
+
readonly MMM_YY: "MMM-YY";
|
|
14
|
+
readonly YY_MMM: "YY-MMM";
|
|
15
|
+
readonly MM_YYYY: "MM-YYYY";
|
|
16
|
+
readonly YYYY_MM: "YYYY-MM";
|
|
17
|
+
readonly MMMM_YYYY: "MMMM-YYYY";
|
|
18
|
+
readonly MMMM_YY: "MMMM-YY";
|
|
19
|
+
readonly DD_MMM: "DD-MMM";
|
|
20
|
+
readonly DD_MMM_YY: "DD-MMM-YY";
|
|
21
|
+
readonly DD_MMM_YYYY: "DD-MMM-YYYY";
|
|
22
|
+
};
|
|
23
|
+
export declare const COLOR_BAND_TYPE: {
|
|
24
|
+
NO_FILL: string;
|
|
25
|
+
SINGLE: string;
|
|
26
|
+
ROW_BAND: string;
|
|
27
|
+
COLUMN_BAND: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const BACKGROUND_COLOR_KEY_MAP: Record<"row" | "dataField" | "column", {
|
|
30
|
+
backgroundKey: string;
|
|
31
|
+
customKey: string;
|
|
32
|
+
oddKey: string;
|
|
33
|
+
evenKey: string;
|
|
34
|
+
bandType: string;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const DEFAULT_BG_COLOR = "#ffffff";
|
|
37
|
+
export declare const DISPLAY_UNITS_OBJ: {
|
|
38
|
+
readonly NONE: "None";
|
|
39
|
+
readonly THOUSANDS: "Thousands";
|
|
40
|
+
readonly MILLIONS: "Millions";
|
|
41
|
+
readonly BILLIONS: "Billions";
|
|
42
|
+
};
|
|
43
|
+
export declare const VALUE_FORMAT_OBJ: {
|
|
44
|
+
readonly PERCENT_SHORT: ",.0%";
|
|
45
|
+
readonly PERCENT: "Percentage";
|
|
46
|
+
readonly GENERAL_EMPTY: "";
|
|
47
|
+
readonly GENERAL: "General";
|
|
48
|
+
readonly SCIENTIFIC_SHORT: ".2n";
|
|
49
|
+
readonly SCIENTIFIC: "Scientific";
|
|
50
|
+
readonly CURRENCY_USD_SHORT: ".2$";
|
|
51
|
+
readonly CURRENCY_USD: "Currency-USD";
|
|
52
|
+
readonly CURRENCY_CAD_SHORT: ".2c";
|
|
53
|
+
readonly CURRENCY_CAD: "Currency-CAD";
|
|
54
|
+
readonly CURRENCY_EUR_SHORT: ".2ē";
|
|
55
|
+
readonly CURRENCY_EUR: "Currency-EUR";
|
|
56
|
+
readonly CURRENCY_CHF_SHORT: ".2ch";
|
|
57
|
+
readonly CURRENCY_CHF: "Currency-CHF";
|
|
58
|
+
readonly CURRENCY_GBP_SHORT: ".2£";
|
|
59
|
+
readonly CURRENCY_GBP: "Currency-UK";
|
|
60
|
+
readonly CURRENCY_INR_SHORT: ".2₹";
|
|
61
|
+
readonly CURRENCY_INR: "Currency-INR";
|
|
62
|
+
readonly COMMA_SHORT: ",";
|
|
63
|
+
readonly COMMA: "Comma Separated";
|
|
64
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { DISPLAY_UNITS_OBJ } from "./StaticTableConst";
|
|
3
|
+
export declare enum TotalHeaderPos {
|
|
4
|
+
Start = "Start",
|
|
5
|
+
End = "End"
|
|
6
|
+
}
|
|
7
|
+
export type StaticTableProps = {
|
|
8
|
+
tableData: TableDataTypes;
|
|
9
|
+
leftFixedCellNameList: string[];
|
|
10
|
+
tableStyleProps: TableStyleConfig;
|
|
11
|
+
tableWidth: number;
|
|
12
|
+
tableHeight: number;
|
|
13
|
+
measureFormatConfigs?: MeasureFormatObj[];
|
|
14
|
+
};
|
|
15
|
+
export type DisplayUnitsType = typeof DISPLAY_UNITS_OBJ[keyof typeof DISPLAY_UNITS_OBJ];
|
|
16
|
+
type MeasureFormatObj = {
|
|
17
|
+
measureName?: string;
|
|
18
|
+
numberFormat: string;
|
|
19
|
+
decimalPrecision: number;
|
|
20
|
+
displayUnits: DisplayUnitsType;
|
|
21
|
+
};
|
|
22
|
+
export type CellRendererProps = {
|
|
23
|
+
columnIndex: number;
|
|
24
|
+
rowIndex: number;
|
|
25
|
+
key: string;
|
|
26
|
+
style: CSSProperties;
|
|
27
|
+
};
|
|
28
|
+
export type BgColorObj = {
|
|
29
|
+
oddColor: string;
|
|
30
|
+
evenColor: string;
|
|
31
|
+
};
|
|
32
|
+
type TableDataTypes = {
|
|
33
|
+
customSortRowwise: string[];
|
|
34
|
+
uniqueTitleMembers: string[];
|
|
35
|
+
maximumValueInTable: number;
|
|
36
|
+
minimumValueInTable: number;
|
|
37
|
+
maxValueInRowTotalColumn: number;
|
|
38
|
+
minValueInRowTotalColumn: number;
|
|
39
|
+
maxValueInColumnTotalRow: number;
|
|
40
|
+
minValueInColumnTotalRow: number;
|
|
41
|
+
columnTotalRow: {
|
|
42
|
+
columnTotal: number;
|
|
43
|
+
maxValueInColumn: number;
|
|
44
|
+
minValueInColumn: number;
|
|
45
|
+
}[];
|
|
46
|
+
dimensionMarks: string[][];
|
|
47
|
+
grandTotal: number;
|
|
48
|
+
measuresBySlice: {
|
|
49
|
+
sliceMark: string[];
|
|
50
|
+
measures: number[];
|
|
51
|
+
measureNames: string[];
|
|
52
|
+
rowTotal: number;
|
|
53
|
+
maxValueInRow: number;
|
|
54
|
+
minValueInRow: number;
|
|
55
|
+
}[];
|
|
56
|
+
totalNumberOfRows: number;
|
|
57
|
+
};
|
|
58
|
+
type TableStyleConfig = {
|
|
59
|
+
ToolTip: {
|
|
60
|
+
ToolTipNumberFormat: "Comma Separated" | string;
|
|
61
|
+
ToolTipVisibility: boolean;
|
|
62
|
+
ToolTipDecimalPrecision: number;
|
|
63
|
+
};
|
|
64
|
+
SparkLine: {
|
|
65
|
+
SparkLineButton: boolean;
|
|
66
|
+
SparkLineMarkerColor: string;
|
|
67
|
+
MinMaxLineColor: string;
|
|
68
|
+
Position: "Start" | "End" | string;
|
|
69
|
+
HideMarkerButton: boolean;
|
|
70
|
+
BoxBorderColor: string;
|
|
71
|
+
BoxFillColor: string;
|
|
72
|
+
SparkLineAlias: string;
|
|
73
|
+
PositiveBarChartColor: string;
|
|
74
|
+
ThresholdValue: number;
|
|
75
|
+
SparkLineWidth: number;
|
|
76
|
+
SparkLineType: "Line" | "Bar" | string;
|
|
77
|
+
MedianColor: string;
|
|
78
|
+
ThresholdColor: string;
|
|
79
|
+
ZeroBarChartColor: string;
|
|
80
|
+
NegativeBarChartColor: string;
|
|
81
|
+
BarSpacing: number;
|
|
82
|
+
SparkLineColor: string;
|
|
83
|
+
BarWidth: number;
|
|
84
|
+
};
|
|
85
|
+
ColumnHeader: {
|
|
86
|
+
OddColumnHeadercolor: string;
|
|
87
|
+
ColumnSortButton: boolean;
|
|
88
|
+
ColumnVerticalLineWidth: number;
|
|
89
|
+
ColumnDisplayUnits: "None" | string;
|
|
90
|
+
ColumnHeaderFontStyle: string[];
|
|
91
|
+
ColumnVerticalLineColor: string;
|
|
92
|
+
ColumnHorizontalLineButton: boolean;
|
|
93
|
+
ColumnHorizontalLineStyle: "solid" | string;
|
|
94
|
+
ColumnDecimalPrecision: number;
|
|
95
|
+
EvenColumnHeadercolor: string;
|
|
96
|
+
ColumnHorizontalLineColor: string;
|
|
97
|
+
ColumnHeaderBackgroundcolor: "Single" | string;
|
|
98
|
+
ColumnHorizontalLineWidth: number;
|
|
99
|
+
ColumnVerticalLineButton: boolean;
|
|
100
|
+
ColumnVerticalLineStyle: "solid" | string;
|
|
101
|
+
CustomColumnHeaderBackgroundcolor: string;
|
|
102
|
+
ColumnSort: string[];
|
|
103
|
+
Textalign: "Center" | "Left" | "Right" | string;
|
|
104
|
+
ColumnHeaderWidth: number;
|
|
105
|
+
ColumnDisplayUnitsLabel: boolean;
|
|
106
|
+
ColumnHeaderFontSize: number;
|
|
107
|
+
HideColumnHeader: boolean;
|
|
108
|
+
ColumnHeaderFontWeight: "Normal" | "Bold" | string;
|
|
109
|
+
ColumnHeaderColor: string;
|
|
110
|
+
ColumnHeaderFontFamily: string;
|
|
111
|
+
};
|
|
112
|
+
Table: {
|
|
113
|
+
RowHeight: number;
|
|
114
|
+
FixHeaderWidth: number;
|
|
115
|
+
TableWidth: number;
|
|
116
|
+
ColumnWrapText: boolean;
|
|
117
|
+
Conditionalformatting: unknown | null;
|
|
118
|
+
RowWrapText: boolean;
|
|
119
|
+
EnablePagination: boolean;
|
|
120
|
+
FitTable: boolean;
|
|
121
|
+
ShowZeroRows: boolean;
|
|
122
|
+
colOrRowHeaderName: string;
|
|
123
|
+
ConditionalformattingOnOff: boolean;
|
|
124
|
+
};
|
|
125
|
+
DataField: {
|
|
126
|
+
DataFieldFontSize: number;
|
|
127
|
+
DataFieldVerticalLineColor: string;
|
|
128
|
+
SubtotalAggregationBy: "Sum" | "Average" | string;
|
|
129
|
+
measureDataFieldDecimalPrecision: number;
|
|
130
|
+
DataFieldVerticalLineButton: boolean;
|
|
131
|
+
DataFieldFontFamily: string;
|
|
132
|
+
DataFieldFontStyle: string[];
|
|
133
|
+
DataFieldVerticalLineWidth: number;
|
|
134
|
+
DataFieldHorizontalLineButton: boolean;
|
|
135
|
+
selectMeasure: string;
|
|
136
|
+
CustomDataFieldBackgroundcolor: string;
|
|
137
|
+
TotalHeaderPosition: "Start" | "End" | string;
|
|
138
|
+
DataFieldFontWeight: "Normal" | "Bold" | string;
|
|
139
|
+
OddDataFieldcolor: string;
|
|
140
|
+
EvenDataFieldcolor: string;
|
|
141
|
+
DataFieldBackgroundcolor: "Row Band" | "Single" | string;
|
|
142
|
+
measureNumberFormat: string;
|
|
143
|
+
ColumnTotal: boolean;
|
|
144
|
+
DataFieldHorizontalLineColor: string;
|
|
145
|
+
Textalign: "Left" | "Right" | "Center" | string;
|
|
146
|
+
DataFieldDisplayUnitsLabel: boolean;
|
|
147
|
+
DataFieldColor: string;
|
|
148
|
+
DisplayUnits: DisplayUnitsType;
|
|
149
|
+
RowTotal: boolean;
|
|
150
|
+
DataFieldDisplayUnits: "None" | string;
|
|
151
|
+
DataFieldDecimalPrecision: number;
|
|
152
|
+
measureDisplayUnits: "None" | string;
|
|
153
|
+
DataFieldHorizontalLineWidth: number;
|
|
154
|
+
GrandTotal: boolean;
|
|
155
|
+
DataFieldVerticalLineStyle: "solid" | string;
|
|
156
|
+
DataFieldHorizontalLineStyle: "solid" | string;
|
|
157
|
+
NumberFormat: "Comma Separated" | string;
|
|
158
|
+
};
|
|
159
|
+
KPI: {
|
|
160
|
+
KPIBaseFormat: "All" | "Column-wise" | "Row-wise";
|
|
161
|
+
KPIVisibility: boolean;
|
|
162
|
+
KPIMaxColor: string;
|
|
163
|
+
showContributionToToolTip: boolean;
|
|
164
|
+
KPIMinColor: string;
|
|
165
|
+
};
|
|
166
|
+
RowHeader: {
|
|
167
|
+
RowHeaderFontFamily: string;
|
|
168
|
+
RowHeaderFontSize: number;
|
|
169
|
+
CustomRowHeaderBackgroundcolor: string;
|
|
170
|
+
RowHeaderColor: string;
|
|
171
|
+
EvenRowHeadercolor: string;
|
|
172
|
+
RowSortButton: boolean;
|
|
173
|
+
RowHeaderFontStyle: string[];
|
|
174
|
+
VerticalLineColor: string;
|
|
175
|
+
RowSort: string[];
|
|
176
|
+
VerticalLineStyle: "solid" | string;
|
|
177
|
+
VerticalLineWidth: number;
|
|
178
|
+
RowDecimalPrecision: number;
|
|
179
|
+
Textalign: "Center" | "Left" | "Right" | string;
|
|
180
|
+
HorizontalLineButton: boolean;
|
|
181
|
+
HorizontalLineColor: string;
|
|
182
|
+
VerticalLineButton: boolean;
|
|
183
|
+
HorizontalLineWidth: number;
|
|
184
|
+
HorizontalLineStyle: "solid" | string;
|
|
185
|
+
RowHeaderBackgroundcolor: "Single" | "Row Band" | string;
|
|
186
|
+
OddRowHeadercolor: string;
|
|
187
|
+
HideRowHeader: boolean;
|
|
188
|
+
RowDisplayUnitsLabel: boolean;
|
|
189
|
+
RowDisplayUnits: "None" | string;
|
|
190
|
+
RowHeaderFontWeight: "Normal" | "Bold" | string;
|
|
191
|
+
};
|
|
192
|
+
HeatMap: {
|
|
193
|
+
HeatMapMaxColor: string;
|
|
194
|
+
ShowHeatMap: boolean;
|
|
195
|
+
HeatMapMinColor: string;
|
|
196
|
+
HeatMapView: "All" | "Column-wise" | "Row-wise";
|
|
197
|
+
};
|
|
198
|
+
TableTitle: {
|
|
199
|
+
TableTitleFontStyle: string[];
|
|
200
|
+
TableTitleText: string;
|
|
201
|
+
TableTitleFontFamily: string;
|
|
202
|
+
FormulaID: string;
|
|
203
|
+
TableTitleFontWeight: "Normal" | "Bold" | string;
|
|
204
|
+
DynamicTitleText: string;
|
|
205
|
+
TableTitleHTML: string;
|
|
206
|
+
TableTitleColor: string;
|
|
207
|
+
TableTitleFontSize: number;
|
|
208
|
+
Textalign: "Left" | "Right" | "Center" | string;
|
|
209
|
+
TableTitleVisibility: boolean;
|
|
210
|
+
};
|
|
211
|
+
undoRedo: {
|
|
212
|
+
isFromUndo: boolean;
|
|
213
|
+
isFromOnChange: boolean;
|
|
214
|
+
};
|
|
215
|
+
Border: {
|
|
216
|
+
HorizontalBorderLineStyle: "solid" | string;
|
|
217
|
+
HorizontalBorderLineWidth: number;
|
|
218
|
+
BorderButtonVisibility: boolean;
|
|
219
|
+
HorizontalBorderLineColor: string;
|
|
220
|
+
LineStyle: "solid" | string;
|
|
221
|
+
HorizontalBorderLineButton: boolean;
|
|
222
|
+
LineColor: string;
|
|
223
|
+
VerticalBorderLineWidth: number;
|
|
224
|
+
LineWidth: number;
|
|
225
|
+
VerticalBorderLineButton: boolean;
|
|
226
|
+
VerticalBorderLineColor: string;
|
|
227
|
+
VerticalBorderLineStyle: "solid" | string;
|
|
228
|
+
};
|
|
229
|
+
Styles: {
|
|
230
|
+
idOfAppliedStyle: string;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import "./styles/fonts.css";
|
|
2
|
+
export { default as StaticTable } from "./components/StaticTable/StaticTable";
|