pixel-react 1.21.31 → 1.21.33
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/lib/components/Icon/iconList.js +4 -0
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.js +2 -2
- package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.js.map +1 -1
- package/lib/components/Weightagetable/Weightagetable.js +101 -14
- package/lib/components/Weightagetable/Weightagetable.js.map +1 -1
- package/lib/components/Weightagetable/types.d.ts +56 -7
- package/lib/index.js +7 -7
- package/lib/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type WeightageColumnLabels = {
|
|
3
|
+
principle: React.ReactNode;
|
|
4
|
+
guidelines: React.ReactNode;
|
|
5
|
+
weightage: React.ReactNode;
|
|
6
|
+
};
|
|
2
7
|
export interface WeightageRow {
|
|
3
8
|
/**
|
|
4
9
|
* Label for the guideline row, e.g. "1.1 - Text alternative"
|
|
@@ -21,7 +26,7 @@ export interface WeightageRow {
|
|
|
21
26
|
*/
|
|
22
27
|
minValue?: number;
|
|
23
28
|
/**
|
|
24
|
-
* Maximum allowed value for this row's input (
|
|
29
|
+
* Maximum allowed value for this row's input (capped at 100)
|
|
25
30
|
*/
|
|
26
31
|
maxValue?: number;
|
|
27
32
|
/**
|
|
@@ -47,32 +52,58 @@ export interface WeightageGroup {
|
|
|
47
52
|
*/
|
|
48
53
|
guidelines: WeightageRow[];
|
|
49
54
|
}
|
|
55
|
+
export interface WeightageCellRenderProps {
|
|
56
|
+
group: WeightageGroup;
|
|
57
|
+
row: WeightageRow;
|
|
58
|
+
groupIndex: number;
|
|
59
|
+
rowIndex: number;
|
|
60
|
+
rowKey: string;
|
|
61
|
+
minValue: number;
|
|
62
|
+
maxValue: number;
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
inputWidth?: React.CSSProperties['width'];
|
|
65
|
+
inputProps: {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
'aria-label': string;
|
|
69
|
+
'aria-describedby'?: string;
|
|
70
|
+
'aria-errormessage'?: string;
|
|
71
|
+
'aria-invalid'?: boolean;
|
|
72
|
+
};
|
|
73
|
+
onChange: (updatedRow: WeightageRow) => void;
|
|
74
|
+
}
|
|
50
75
|
export interface WeightageTableProps {
|
|
51
76
|
/**
|
|
52
77
|
* Title shown on the left side of the header bar
|
|
53
78
|
*/
|
|
54
|
-
title?:
|
|
79
|
+
title?: React.ReactNode;
|
|
55
80
|
/**
|
|
56
81
|
* Total weightage value shown on the right side of the header bar, e.g. 100.
|
|
57
82
|
* If not passed, it is auto-computed as the sum of all row values.
|
|
58
83
|
*/
|
|
59
84
|
totalWeightage?: number;
|
|
60
85
|
/**
|
|
61
|
-
* Max possible weightage
|
|
86
|
+
* Max possible weightage retained for backward compatibility.
|
|
87
|
+
* Use minValue/maxValue for default input validation.
|
|
62
88
|
*/
|
|
63
89
|
maxWeightage?: number;
|
|
64
90
|
/**
|
|
65
91
|
* Column heading for the principle column
|
|
66
92
|
*/
|
|
67
|
-
principleColumnLabel?:
|
|
93
|
+
principleColumnLabel?: React.ReactNode;
|
|
68
94
|
/**
|
|
69
95
|
* Column heading for the guidelines column
|
|
70
96
|
*/
|
|
71
|
-
guidelinesColumnLabel?:
|
|
97
|
+
guidelinesColumnLabel?: React.ReactNode;
|
|
72
98
|
/**
|
|
73
99
|
* Column heading for the weightage column
|
|
74
100
|
*/
|
|
75
|
-
weightageColumnLabel?:
|
|
101
|
+
weightageColumnLabel?: React.ReactNode;
|
|
102
|
+
/**
|
|
103
|
+
* Preferred API for overriding column labels in one place.
|
|
104
|
+
* Individual label props are still supported for backward compatibility.
|
|
105
|
+
*/
|
|
106
|
+
columnLabels?: Partial<WeightageColumnLabels>;
|
|
76
107
|
/**
|
|
77
108
|
* Data for the table body, grouped by principle. This component is controlled —
|
|
78
109
|
* the parent owns this array and updates it inside onWeightageChange.
|
|
@@ -83,6 +114,15 @@ export interface WeightageTableProps {
|
|
|
83
114
|
* use groupIndex/rowIndex to update just that one row in your state.
|
|
84
115
|
*/
|
|
85
116
|
onWeightageChange?: (groupIndex: number, rowIndex: number, updatedRow: WeightageRow) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Optional custom renderer for the weightage cell.
|
|
119
|
+
* If omitted, the component renders its default number Input.
|
|
120
|
+
*/
|
|
121
|
+
renderWeightageCell?: (props: WeightageCellRenderProps) => React.ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Width of the default weightage Input, e.g. "70px", "12%", or 70.
|
|
124
|
+
*/
|
|
125
|
+
weightageInputWidth?: React.CSSProperties['width'];
|
|
86
126
|
/**
|
|
87
127
|
* Called when the refresh/reset icon in the header is clicked
|
|
88
128
|
*/
|
|
@@ -100,9 +140,18 @@ export interface WeightageTableProps {
|
|
|
100
140
|
*/
|
|
101
141
|
minValue?: number;
|
|
102
142
|
/**
|
|
103
|
-
* Default maxValue applied to every row's Input unless the row overrides it
|
|
143
|
+
* Default maxValue applied to every row's Input unless the row overrides it.
|
|
144
|
+
* Values above 100 are capped at 100.
|
|
104
145
|
*/
|
|
105
146
|
maxValue?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Enables expand/collapse behavior for the table content.
|
|
149
|
+
*/
|
|
150
|
+
isAccordion?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Initial expanded state when accordion behavior is enabled.
|
|
153
|
+
*/
|
|
154
|
+
defaultExpanded?: boolean;
|
|
106
155
|
/**
|
|
107
156
|
* To add styles in WeightageTable
|
|
108
157
|
*/
|