sccoreui 6.2.11 → 6.2.12
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/assets/svg/svg.js +163 -38
- package/dist/components/ag-grid/AgGrid.js +1 -1
- package/dist/components/ag-grid/advancedFeature/column-group.js +100 -45
- package/dist/components/ag-grid/advancedFeature/hide-column.js +2 -2
- package/dist/components/ag-grid/context-provider.js +6 -3
- package/dist/components/ag-grid/helper.js +145 -68
- package/dist/components/ag-grid/parent-for-grid.js +49 -17
- package/dist/components/ag-grid/utilComponents.js +7 -1
- package/dist/components/formula-template/FormulaCoponent.js +2 -2
- package/dist/components/multi-select-dropdown/multi-select-dropdown.js +4 -2
- package/dist/types/components/ag-grid/Types.d.ts +1 -0
- package/dist/types/components/ag-grid/context-provider.d.ts +2 -0
- package/dist/types/components/ag-grid/helper.d.ts +3 -2
- package/dist/types/components/ag-grid/utilComponents.d.ts +1 -0
- package/package.json +1 -1
package/dist/assets/svg/svg.js
CHANGED
|
@@ -1,51 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export const InfoLogo = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
width="16"
|
|
5
|
+
height="16"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="M6.05992 5.99998C6.21665 5.55442 6.52602 5.17872 6.93322 4.9394C7.34042 4.70009 7.81918 4.61261 8.2847 4.69245C8.75022 4.7723 9.17246 5.01433 9.47664 5.37567C9.78081 5.737 9.94729 6.19433 9.94659 6.66665C9.94659 7.99998 7.94659 8.66665 7.94659 8.66665M7.99992 11.3333H8.00659M14.6666 7.99998C14.6666 11.6819 11.6818 14.6666 7.99992 14.6666C4.31802 14.6666 1.33325 11.6819 1.33325 7.99998C1.33325 4.31808 4.31802 1.33331 7.99992 1.33331C11.6818 1.33331 14.6666 4.31808 14.6666 7.99998Z"
|
|
12
|
+
stroke="#98A2B3"
|
|
13
|
+
strokeWidth="1.33333"
|
|
14
|
+
strokeLinecap="round"
|
|
15
|
+
strokeLinejoin="round"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
7
19
|
};
|
|
8
|
-
|
|
9
|
-
const Card = () => {
|
|
10
|
-
|
|
20
|
+
|
|
21
|
+
export const Card = () => {
|
|
22
|
+
return (
|
|
23
|
+
<svg
|
|
24
|
+
width="34"
|
|
25
|
+
height="24"
|
|
26
|
+
viewBox="0 0 34 24"
|
|
27
|
+
fill="none"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
>
|
|
30
|
+
<rect x="0.5" y="0.5" width="33" height="23" rx="3.5" fill="white" />
|
|
31
|
+
<path
|
|
32
|
+
fillRule="evenodd"
|
|
33
|
+
clipRule="evenodd"
|
|
34
|
+
d="M17.179 16.8295C15.9949 17.8275 14.459 18.43 12.7807 18.43C9.03582 18.43 6 15.4303 6 11.73C6 8.02972 9.03582 5.03003 12.7807 5.03003C14.459 5.03003 15.9949 5.63253 17.179 6.63057C18.363 5.63253 19.8989 5.03003 21.5773 5.03003C25.3221 5.03003 28.358 8.02972 28.358 11.73C28.358 15.4303 25.3221 18.43 21.5773 18.43C19.8989 18.43 18.363 17.8275 17.179 16.8295Z"
|
|
35
|
+
fill="#ED0006"
|
|
36
|
+
/>
|
|
37
|
+
<path
|
|
38
|
+
fillRule="evenodd"
|
|
39
|
+
clipRule="evenodd"
|
|
40
|
+
d="M17.1792 16.8295C18.6371 15.6006 19.5616 13.772 19.5616 11.73C19.5616 9.68807 18.6371 7.85947 17.1792 6.63057C18.3632 5.63253 19.8992 5.03003 21.5775 5.03003C25.3224 5.03003 28.3582 8.02972 28.3582 11.73C28.3582 15.4303 25.3224 18.43 21.5775 18.43C19.8992 18.43 18.3632 17.8275 17.1792 16.8295Z"
|
|
41
|
+
fill="#F9A000"
|
|
42
|
+
/>
|
|
43
|
+
<path
|
|
44
|
+
fillRule="evenodd"
|
|
45
|
+
clipRule="evenodd"
|
|
46
|
+
d="M17.1788 16.8295C18.6367 15.6006 19.5611 13.772 19.5611 11.7301C19.5611 9.68811 18.6367 7.85952 17.1788 6.63062C15.7208 7.85952 14.7964 9.68811 14.7964 11.7301C14.7964 13.772 15.7208 15.6006 17.1788 16.8295Z"
|
|
47
|
+
fill="#FF5E00"
|
|
48
|
+
/>
|
|
49
|
+
<rect x="0.5" y="0.5" width="33" height="23" rx="3.5" stroke="#F2F4F7" />
|
|
50
|
+
</svg>
|
|
51
|
+
);
|
|
11
52
|
};
|
|
12
|
-
|
|
13
|
-
const Error = () => {
|
|
14
|
-
|
|
53
|
+
|
|
54
|
+
export const Error = () => {
|
|
55
|
+
return (
|
|
56
|
+
<svg
|
|
57
|
+
width="16"
|
|
58
|
+
height="16"
|
|
59
|
+
viewBox="0 0 16 16"
|
|
60
|
+
fill="none"
|
|
61
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
62
|
+
>
|
|
63
|
+
<path
|
|
64
|
+
d="M7.99992 5.33337V8.00004M7.99992 10.6667H8.00659M14.6666 8.00004C14.6666 11.6819 11.6818 14.6667 7.99992 14.6667C4.31802 14.6667 1.33325 11.6819 1.33325 8.00004C1.33325 4.31814 4.31802 1.33337 7.99992 1.33337C11.6818 1.33337 14.6666 4.31814 14.6666 8.00004Z"
|
|
65
|
+
stroke="var(--red-500)"
|
|
66
|
+
strokeWidth="1.33333"
|
|
67
|
+
strokeLinecap="round"
|
|
68
|
+
strokeLinejoin="round"
|
|
69
|
+
/>
|
|
70
|
+
</svg>
|
|
71
|
+
);
|
|
15
72
|
};
|
|
16
|
-
|
|
17
|
-
const Message = () => {
|
|
18
|
-
|
|
73
|
+
|
|
74
|
+
export const Message = () => {
|
|
75
|
+
return (
|
|
76
|
+
<svg
|
|
77
|
+
width="20"
|
|
78
|
+
height="16"
|
|
79
|
+
viewBox="0 0 20 16"
|
|
80
|
+
fill="none"
|
|
81
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
82
|
+
>
|
|
83
|
+
<path
|
|
84
|
+
d="M1.66675 3.83331L8.47085 8.59618C9.02182 8.98187 9.29731 9.17471 9.59697 9.2494C9.86166 9.31538 10.1385 9.31538 10.4032 9.2494C10.7029 9.17471 10.9783 8.98187 11.5293 8.59618L18.3334 3.83331M5.66675 14.6666H14.3334C15.7335 14.6666 16.4336 14.6666 16.9684 14.3942C17.4388 14.1545 17.8212 13.772 18.0609 13.3016C18.3334 12.7668 18.3334 12.0668 18.3334 10.6666V5.33331C18.3334 3.93318 18.3334 3.23312 18.0609 2.69834C17.8212 2.22793 17.4388 1.84548 16.9684 1.6058C16.4336 1.33331 15.7335 1.33331 14.3334 1.33331H5.66675C4.26662 1.33331 3.56655 1.33331 3.03177 1.6058C2.56137 1.84548 2.17892 2.22793 1.93923 2.69834C1.66675 3.23312 1.66675 3.93318 1.66675 5.33331V10.6666C1.66675 12.0668 1.66675 12.7668 1.93923 13.3016C2.17892 13.772 2.56137 14.1545 3.03177 14.3942C3.56655 14.6666 4.26662 14.6666 5.66675 14.6666Z"
|
|
85
|
+
stroke="#667085"
|
|
86
|
+
strokeWidth="1.66667"
|
|
87
|
+
strokeLinecap="round"
|
|
88
|
+
strokeLinejoin="round"
|
|
89
|
+
/>
|
|
90
|
+
</svg>
|
|
91
|
+
);
|
|
19
92
|
};
|
|
20
|
-
|
|
21
|
-
const Dollar = () => {
|
|
22
|
-
|
|
93
|
+
|
|
94
|
+
export const Dollar = () => {
|
|
95
|
+
return (
|
|
96
|
+
<svg
|
|
97
|
+
width="16"
|
|
98
|
+
height="16"
|
|
99
|
+
viewBox="0 0 9 16"
|
|
100
|
+
fill="none"
|
|
101
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
102
|
+
>
|
|
103
|
+
<path
|
|
104
|
+
d="M4.904 12.904C5.256 12.872 5.56533 12.7973 5.832 12.68C6.09867 12.5573 6.32267 12.4027 6.504 12.216C6.69067 12.0293 6.82933 11.8133 6.92 11.568C7.016 11.3173 7.064 11.0427 7.064 10.744C7.064 10.4773 7.01333 10.248 6.912 10.056C6.816 9.864 6.68267 9.69867 6.512 9.56C6.34133 9.416 6.14133 9.296 5.912 9.2C5.68267 9.09867 5.43733 9.00533 5.176 8.92L4.904 12.904ZM4.64 3.656C4.29333 3.688 3.992 3.75733 3.736 3.864C3.48533 3.97067 3.27733 4.104 3.112 4.264C2.94667 4.424 2.824 4.60533 2.744 4.808C2.664 5.00533 2.624 5.21333 2.624 5.432C2.624 5.688 2.66933 5.912 2.76 6.104C2.85067 6.29067 2.976 6.456 3.136 6.6C3.296 6.744 3.48267 6.86933 3.696 6.976C3.90933 7.08267 4.14133 7.17867 4.392 7.264L4.64 3.656ZM5.272 7.544C5.656 7.66667 6.03467 7.79733 6.408 7.936C6.78133 8.07467 7.11733 8.25333 7.416 8.472C7.71467 8.69067 7.95467 8.96533 8.136 9.296C8.32267 9.62133 8.416 10.0293 8.416 10.52C8.416 11 8.336 11.4507 8.176 11.872C8.016 12.2933 7.78133 12.664 7.472 12.984C7.168 13.304 6.792 13.5653 6.344 13.768C5.90133 13.9653 5.39467 14.0827 4.824 14.12L4.728 15.52C4.72267 15.6213 4.68267 15.7093 4.608 15.784C4.53333 15.864 4.44 15.904 4.328 15.904H3.8L3.92 14.104C3.27467 14.04 2.68533 13.88 2.152 13.624C1.624 13.3627 1.168 13.032 0.784 12.632L1.216 11.976C1.25867 11.9173 1.312 11.8693 1.376 11.832C1.44 11.7947 1.50933 11.776 1.584 11.776C1.68533 11.776 1.8 11.8267 1.928 11.928C2.056 12.0293 2.21333 12.144 2.4 12.272C2.592 12.4 2.816 12.5253 3.072 12.648C3.33333 12.7707 3.64533 12.8533 4.008 12.896L4.296 8.648C3.92267 8.536 3.55467 8.41067 3.192 8.272C2.83467 8.13333 2.512 7.94933 2.224 7.72C1.94133 7.49067 1.712 7.20533 1.536 6.864C1.36533 6.52267 1.28 6.09333 1.28 5.576C1.28 5.18667 1.35467 4.808 1.504 4.44C1.65867 4.06667 1.88267 3.736 2.176 3.448C2.46933 3.16 2.82933 2.92533 3.256 2.744C3.68267 2.55733 4.17067 2.45333 4.72 2.432L4.8 1.28C4.80533 1.17867 4.84267 1.088 4.912 1.008C4.98667 0.927999 5.08267 0.888 5.2 0.888H5.728L5.624 2.464C6.17867 2.53333 6.65867 2.67733 7.064 2.896C7.47467 3.11467 7.83733 3.38133 8.152 3.696L7.808 4.224C7.70133 4.384 7.57867 4.464 7.44 4.464C7.36533 4.464 7.272 4.432 7.16 4.368C7.05333 4.29867 6.92267 4.21867 6.768 4.128C6.61867 4.03733 6.44 3.94933 6.232 3.864C6.02933 3.77867 5.79733 3.71467 5.536 3.672L5.272 7.544Z"
|
|
105
|
+
fill="#475467"
|
|
106
|
+
/>
|
|
107
|
+
</svg>
|
|
108
|
+
);
|
|
23
109
|
};
|
|
24
|
-
|
|
25
|
-
const Copy = () => {
|
|
26
|
-
|
|
110
|
+
|
|
111
|
+
export const Copy = () => {
|
|
112
|
+
return (
|
|
113
|
+
<svg
|
|
114
|
+
width="20"
|
|
115
|
+
height="20"
|
|
116
|
+
viewBox="0 0 20 20"
|
|
117
|
+
fill="none"
|
|
118
|
+
stroke="var(--gray-700)"
|
|
119
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
120
|
+
>
|
|
121
|
+
<path
|
|
122
|
+
d="M4.1665 12.5C3.38993 12.5 3.00165 12.5 2.69536 12.3732C2.28698 12.204 1.96253 11.8795 1.79337 11.4712C1.6665 11.1649 1.6665 10.7766 1.6665 10V4.33335C1.6665 3.39993 1.6665 2.93322 1.84816 2.5767C2.00795 2.2631 2.26292 2.00813 2.57652 1.84834C2.93304 1.66669 3.39975 1.66669 4.33317 1.66669H9.99984C10.7764 1.66669 11.1647 1.66669 11.471 1.79355C11.8794 1.96271 12.2038 2.28717 12.373 2.69555C12.4998 3.00183 12.4998 3.39012 12.4998 4.16669M10.1665 18.3334H15.6665C16.5999 18.3334 17.0666 18.3334 17.4232 18.1517C17.7368 17.9919 17.9917 17.7369 18.1515 17.4233C18.3332 17.0668 18.3332 16.6001 18.3332 15.6667V10.1667C18.3332 9.23327 18.3332 8.76656 18.1515 8.41004C17.9917 8.09643 17.7368 7.84147 17.4232 7.68168C17.0666 7.50002 16.5999 7.50002 15.6665 7.50002H10.1665C9.23308 7.50002 8.76637 7.50002 8.40985 7.68168C8.09625 7.84147 7.84128 8.09643 7.68149 8.41004C7.49984 8.76656 7.49984 9.23327 7.49984 10.1667V15.6667C7.49984 16.6001 7.49984 17.0668 7.68149 17.4233C7.84128 17.7369 8.09625 17.9919 8.40985 18.1517C8.76637 18.3334 9.23308 18.3334 10.1665 18.3334Z"
|
|
123
|
+
stroke="#344054"
|
|
124
|
+
strokeWidth="1.66667"
|
|
125
|
+
strokeLinecap="round"
|
|
126
|
+
strokeLinejoin="round"
|
|
127
|
+
/>
|
|
128
|
+
</svg>
|
|
129
|
+
);
|
|
27
130
|
};
|
|
28
|
-
|
|
29
|
-
const Times = () => {
|
|
30
|
-
|
|
131
|
+
|
|
132
|
+
export const Times = () => {
|
|
133
|
+
return (
|
|
134
|
+
<svg
|
|
135
|
+
width="8"
|
|
136
|
+
height="8"
|
|
137
|
+
viewBox="0 0 8 8"
|
|
138
|
+
fill="none"
|
|
139
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
140
|
+
>
|
|
141
|
+
<path
|
|
142
|
+
d="M7 1L1 7M1 1L7 7"
|
|
143
|
+
stroke="#98A2B3"
|
|
144
|
+
strokeWidth="1.5"
|
|
145
|
+
strokeLinecap="round"
|
|
146
|
+
strokeLinejoin="round"
|
|
147
|
+
/>
|
|
148
|
+
</svg>
|
|
149
|
+
);
|
|
31
150
|
};
|
|
32
|
-
|
|
33
|
-
|
|
151
|
+
|
|
152
|
+
export const DotList = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
34
153
|
<path d="M8.25 14.5C7.42 14.5 6.75 15.17 6.75 16C6.75 16.83 7.42 17.5 8.25 17.5C9.08 17.5 9.75 16.83 9.75 16C9.75 15.17 9.08 14.5 8.25 14.5ZM8.25 8.5C7.42 8.5 6.75 9.17 6.75 10C6.75 10.83 7.42 11.5 8.25 11.5C9.08 11.5 9.75 10.83 9.75 10C9.75 9.17 9.08 8.5 8.25 8.5ZM8.25 20.5C7.42 20.5 6.75 21.18 6.75 22C6.75 22.82 7.43 23.5 8.25 23.5C9.07 23.5 9.75 22.82 9.75 22C9.75 21.18 9.08 20.5 8.25 20.5ZM11.25 23H25.25V21H11.25V23ZM11.25 17H25.25V15H11.25V17ZM11.25 9V11H25.25V9H11.25Z" fill="#98A2B3" />
|
|
35
|
-
</svg
|
|
36
|
-
|
|
154
|
+
</svg>`
|
|
155
|
+
|
|
156
|
+
export const NumberList = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
37
157
|
<path d="M7 21H9V21.5H8V22.5H9V23H7V24H10V20H7V21ZM8 12H9V8H7V9H8V12ZM7 15H8.8L7 17.1V18H10V17H8.2L10 14.9V14H7V15ZM12 9V11H26V9H12ZM12 23H26V21H12V23ZM12 17H26V15H12V17Z" fill="#98A2B3" />
|
|
38
|
-
</svg
|
|
39
|
-
|
|
40
|
-
|
|
158
|
+
</svg>`
|
|
159
|
+
|
|
160
|
+
export const Italic = '<svg width="24" height="24" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 8V11H16.21L12.79 19H10V22H18V19H15.79L19.21 11H22V8H14Z" fill="#98A2B3" /></svg>'
|
|
161
|
+
|
|
162
|
+
export const Quotes = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
163
|
<path d="M10 21H13L15 17V11H9V17H12L10 21ZM18 21H21L23 17V11H17V17H20L18 21Z" fill="#98A2B3" />
|
|
42
|
-
</svg
|
|
43
|
-
|
|
164
|
+
</svg>`
|
|
165
|
+
|
|
166
|
+
export const Heading2 = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
167
|
<path d="M20.748 22H18.0215V17.25H13.9824V22H11.2402V10.625H13.9824V15.1406H18.0215V10.625H20.748V22Z" fill="#98A2B3" />
|
|
45
|
-
</svg
|
|
46
|
-
|
|
168
|
+
</svg>`
|
|
169
|
+
|
|
170
|
+
export const Heading1 = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
47
171
|
<path d="M21.7822 22H18.8525V15.9062H13.1396V22H10.21V7.78125H13.1396V13.543H18.8525V7.78125H21.7822V22Z" fill="#98A2B3" />
|
|
48
|
-
</svg
|
|
49
|
-
|
|
172
|
+
</svg>`
|
|
173
|
+
|
|
174
|
+
export const Bold = `<svg xmlns="http://www.w3.org/2000/svg" width="11" height="14" viewBox="0 0 11 14" fill="none">
|
|
50
175
|
<path d="M8.6 6.79C9.57 6.12 10.25 5.02 10.25 4C10.25 1.74 8.5 0 6.25 0H0V14H7.04C9.13 14 10.75 12.3 10.75 10.21C10.75 8.69 9.89 7.39 8.6 6.79ZM3 2.5H6C6.83 2.5 7.5 3.17 7.5 4C7.5 4.83 6.83 5.5 6 5.5H3V2.5ZM6.5 11.5H3V8.5H6.5C7.33 8.5 8 9.17 8 10C8 10.83 7.33 11.5 6.5 11.5Z" fill="#98A2B3"/>
|
|
51
|
-
</svg
|
|
176
|
+
</svg>`
|
|
@@ -17,6 +17,6 @@ const LicenceKey_1 = require("./LicenceKey");
|
|
|
17
17
|
core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule, infinite_row_model_1.InfiniteRowModelModule, server_side_row_model_1.ServerSideRowModelModule, row_grouping_1.RowGroupingModule, set_filter_1.SetFilterModule]);
|
|
18
18
|
core_2.LicenseManager.setLicenseKey(LicenceKey_1.LICENSEKEY);
|
|
19
19
|
const AgGrid = ({ style, gridOptions, onGridReady, gridRef }) => {
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style === null || style === void 0 ? void 0 : style.height, width: style === null || style === void 0 ? void 0 : style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
|
|
21
21
|
};
|
|
22
22
|
exports.default = AgGrid;
|
|
@@ -10,18 +10,23 @@ const drag_and_drop_icon_png_1 = tslib_1.__importDefault(require("../../../asset
|
|
|
10
10
|
const checkbox_1 = require("primereact/checkbox");
|
|
11
11
|
const button_1 = require("primereact/button");
|
|
12
12
|
const context_provider_1 = require("../context-provider");
|
|
13
|
+
const helper_1 = require("../helper");
|
|
13
14
|
// import { ColumnDef } from "../Types";
|
|
14
15
|
const ColumnGroup = (props) => {
|
|
15
16
|
var _a, _b, _c, _d;
|
|
16
17
|
const { dataFromProps } = props;
|
|
17
18
|
const columnGroupRef = (0, react_1.useRef)(null);
|
|
18
19
|
const btnRef = (0, react_1.useRef)(null);
|
|
19
|
-
const [
|
|
20
|
-
const
|
|
20
|
+
const [searchText, setSearchedText] = (0, react_1.useState)("");
|
|
21
|
+
const [checkedColumns, setCheckedColumns] = (0, react_1.useState)(new Set());
|
|
22
|
+
const { gridApi, setGridData, setSelectedGroup, setFeatureDetails, featureDetails, initialCheckBoxData, intialColumns,
|
|
23
|
+
// setIntialColumns,
|
|
24
|
+
} = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
21
25
|
const [columns, setColumns] = (0, react_1.useState)([]);
|
|
22
26
|
const [renderColumns, setRenderColumns] = (0, react_1.useState)([]);
|
|
23
27
|
const [columnsSelectedForGroup, setColumnsSelectedForGroup] = (0, react_1.useState)([]);
|
|
24
28
|
const [selectedCheckBoxesLength, setSelectedCheckBoxesLength] = (0, react_1.useState)(null);
|
|
29
|
+
console.log("intiallllllllll", intialColumns, selectedCheckBoxesLength);
|
|
25
30
|
// const [featureDetails, setFeatureDetails] = useState<Features>({
|
|
26
31
|
// searchedText: "",
|
|
27
32
|
// filterQueries: [],
|
|
@@ -54,8 +59,15 @@ const ColumnGroup = (props) => {
|
|
|
54
59
|
};
|
|
55
60
|
const onSelectedCheckbox = (item, e) => {
|
|
56
61
|
const isChecked = e.checked;
|
|
57
|
-
const
|
|
58
|
-
|
|
62
|
+
const updatedCheckedColumns = new Set(checkedColumns);
|
|
63
|
+
if (isChecked) {
|
|
64
|
+
updatedCheckedColumns.add(item.id);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
updatedCheckedColumns.delete(item.id);
|
|
68
|
+
}
|
|
69
|
+
setCheckedColumns(updatedCheckedColumns);
|
|
70
|
+
const updatedColumns = renderColumns.map((listItem) => listItem.id === item.id ? Object.assign(Object.assign({}, listItem), { rowGroup: isChecked }) : listItem);
|
|
59
71
|
// Sort columns: checked (true) come before unchecked (false)
|
|
60
72
|
const sortedColumns = updatedColumns.sort((a, b) => (b.rowGroup ? 1 : 0) - (a.rowGroup ? 1 : 0));
|
|
61
73
|
// setColumns(sortedColumns);
|
|
@@ -63,66 +75,105 @@ const ColumnGroup = (props) => {
|
|
|
63
75
|
const lengthOfSelectedCheckBoxes = sortedColumns.filter((col) => col.rowGroup).length;
|
|
64
76
|
setSelectedCheckBoxesLength(lengthOfSelectedCheckBoxes);
|
|
65
77
|
};
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
// Filter columns based on search text
|
|
80
|
+
const filteredColumns = columns === null || columns === void 0 ? void 0 : columns.filter((column) => { var _a, _b; return (_b = (_a = column === null || column === void 0 ? void 0 : column.headerName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(searchText === null || searchText === void 0 ? void 0 : searchText.toLowerCase()); });
|
|
81
|
+
// Ensure checked columns are first in the filtered list
|
|
82
|
+
const sortedFilteredColumns = [...filteredColumns].sort((a, b) => {
|
|
83
|
+
if (checkedColumns.has(a.id) && !checkedColumns.has(b.id))
|
|
84
|
+
return -1;
|
|
85
|
+
if (!checkedColumns.has(a.id) && checkedColumns.has(b.id))
|
|
86
|
+
return 1;
|
|
87
|
+
return 0;
|
|
88
|
+
});
|
|
89
|
+
setRenderColumns(sortedFilteredColumns);
|
|
90
|
+
}, [searchText, columns, checkedColumns]);
|
|
91
|
+
const clearSearchAndSaveGrouping = (e) => {
|
|
92
|
+
const sortedFilteredColumns = [...columns].sort((a, b) => {
|
|
93
|
+
if (checkedColumns.has(a.id) && !checkedColumns.has(b.id))
|
|
94
|
+
return -1;
|
|
95
|
+
if (!checkedColumns.has(a.id) && checkedColumns.has(b.id))
|
|
96
|
+
return 1;
|
|
97
|
+
return 0;
|
|
98
|
+
});
|
|
99
|
+
setRenderColumns(sortedFilteredColumns);
|
|
100
|
+
setSearchedText("");
|
|
101
|
+
saveGrouping(e, sortedFilteredColumns);
|
|
73
102
|
};
|
|
74
|
-
|
|
75
|
-
|
|
103
|
+
console.log("columns innnnnnnn", dataFromProps);
|
|
104
|
+
// Save Grouping
|
|
105
|
+
const saveGrouping = (e, renderColumns) => {
|
|
76
106
|
var _a, _b;
|
|
107
|
+
// Clear previously selected groups
|
|
77
108
|
setSelectedGroup([]);
|
|
78
109
|
const groupedColumns = [];
|
|
110
|
+
// Update feature details
|
|
79
111
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
|
|
112
|
+
// Log the renderColumns and checkedColumns for debugging
|
|
113
|
+
console.log("Rendering Columns:", renderColumns);
|
|
114
|
+
console.log("Checked Columns:", checkedColumns);
|
|
115
|
+
// Deep clone the render columns to avoid mutation
|
|
116
|
+
const columnsData = (0, helper_1.deepClone)(renderColumns);
|
|
80
117
|
// Iterate over the columns to identify grouped and pinned columns
|
|
81
|
-
const updateColumns =
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
const updateColumns = columnsData.map((column) => {
|
|
119
|
+
const newColumn = Object.assign({}, column); // Create a new object to avoid direct mutation
|
|
120
|
+
// Set rowGroup to true or false based on checked columns
|
|
121
|
+
if (checkedColumns.has(newColumn.id)) {
|
|
122
|
+
newColumn.rowGroup = true; // Group this column
|
|
123
|
+
groupedColumns.push(newColumn);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
newColumn.rowGroup = false; // Ungroup this column
|
|
85
127
|
}
|
|
86
|
-
//
|
|
87
|
-
if (
|
|
88
|
-
|
|
128
|
+
// Handle hiding of pinned columns
|
|
129
|
+
if (newColumn.pinned) {
|
|
130
|
+
newColumn.hide = true;
|
|
89
131
|
}
|
|
90
|
-
return
|
|
132
|
+
return newColumn;
|
|
91
133
|
});
|
|
92
134
|
// Update the grid's column definitions with the modified columns
|
|
93
|
-
(_a = gridApi.current) === null || _a === void 0 ? void 0 : _a.api.
|
|
135
|
+
(_a = gridApi.current) === null || _a === void 0 ? void 0 : _a.api.setColumnDefs(updateColumns);
|
|
94
136
|
// Apply the grouping order based on the updated columns
|
|
95
|
-
|
|
137
|
+
const groupedColumnIds = groupedColumns.map((col) => col.colId); // Get the IDs of grouped columns
|
|
138
|
+
(_b = gridApi.current) === null || _b === void 0 ? void 0 : _b.api.setRowGroupColumns(groupedColumnIds.slice(0, 2)); // Ensure max 2 columns are grouped
|
|
96
139
|
// Update the grid's data state to reflect the new column configuration
|
|
97
|
-
setGridData((prev) => {
|
|
98
|
-
return { rowData: prev.rowData, columnData: updateColumns };
|
|
99
|
-
});
|
|
140
|
+
setGridData((prev) => (Object.assign(Object.assign({}, prev), { columnData: updateColumns })));
|
|
100
141
|
// Store the grouped columns in the state for future reference
|
|
101
142
|
setColumnsSelectedForGroup(groupedColumns);
|
|
102
143
|
// Update the render columns state to reflect the new configuration
|
|
103
144
|
setRenderColumns(updateColumns);
|
|
104
145
|
// Hide the column grouping UI element if it exists
|
|
105
|
-
(columnGroupRef === null || columnGroupRef === void 0 ? void 0 : columnGroupRef.current)
|
|
146
|
+
if (columnGroupRef === null || columnGroupRef === void 0 ? void 0 : columnGroupRef.current) {
|
|
147
|
+
columnGroupRef.current.hide(e);
|
|
148
|
+
}
|
|
149
|
+
console.log("Updated Columns:", updateColumns); // Log updated columns for debugging
|
|
106
150
|
};
|
|
107
151
|
// Remove grouping
|
|
108
152
|
const clearListItems = (e) => {
|
|
109
|
-
var _a, _b;
|
|
110
153
|
e.stopPropagation();
|
|
111
154
|
setSelectedGroup([]);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
155
|
+
setCheckedColumns(new Set());
|
|
156
|
+
setSearchedText("");
|
|
157
|
+
if (gridApi) {
|
|
158
|
+
// Use deep copy of `intialColumns` to ensure no unintended mutation
|
|
159
|
+
const clonedInitialColumns = (0, helper_1.deepClone)(intialColumns);
|
|
160
|
+
console.log("clonedInitialColumns", clonedInitialColumns);
|
|
161
|
+
// Update grid's column definitions
|
|
162
|
+
gridApi.current.api.setColumnDefs(clonedInitialColumns);
|
|
163
|
+
gridApi.current.columnApi.setRowGroupColumns([]);
|
|
164
|
+
// Reflect the new column configuration in the state
|
|
165
|
+
setGridData((prev) => (Object.assign(Object.assign({}, prev), { columnData: clonedInitialColumns })));
|
|
166
|
+
// Reset states accordingly
|
|
167
|
+
setColumnsSelectedForGroup([]);
|
|
168
|
+
setRenderColumns(clonedInitialColumns);
|
|
169
|
+
setSelectedCheckBoxesLength(0);
|
|
170
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
|
|
171
|
+
if (columnGroupRef === null || columnGroupRef === void 0 ? void 0 : columnGroupRef.current) {
|
|
172
|
+
columnGroupRef.current.hide();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
125
175
|
};
|
|
176
|
+
console.log("intialllllll columns", intialColumns);
|
|
126
177
|
const handleHide = () => {
|
|
127
178
|
var _a, _b, _c;
|
|
128
179
|
// Reset the renderColumns when the OverlayPanel is hidden
|
|
@@ -134,16 +185,20 @@ const ColumnGroup = (props) => {
|
|
|
134
185
|
};
|
|
135
186
|
(0, react_1.useEffect)(() => {
|
|
136
187
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
137
|
-
// Get columns from
|
|
188
|
+
// Get columns from grid
|
|
138
189
|
if ((_d = (_c = (_b = (_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.columnModel) === null || _c === void 0 ? void 0 : _c.columnDefs) === null || _d === void 0 ? void 0 : _d.length) {
|
|
190
|
+
// Deep clone columns from the grid to avoid mutation
|
|
139
191
|
const columnsFromGrid = (_h = (_g = (_f = (_e = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _e === void 0 ? void 0 : _e.api) === null || _f === void 0 ? void 0 : _f.columnModel) === null || _g === void 0 ? void 0 : _g.columnDefs) === null || _h === void 0 ? void 0 : _h.map((column) => {
|
|
140
|
-
column
|
|
141
|
-
return column;
|
|
192
|
+
return Object.assign(Object.assign({}, column), { rowGroup: false }); // Create a shallow copy with `rowGroup` set to false
|
|
142
193
|
});
|
|
194
|
+
// Update state with the cloned columns
|
|
143
195
|
setColumns(columnsFromGrid);
|
|
144
196
|
setRenderColumns(columnsFromGrid);
|
|
145
197
|
}
|
|
146
198
|
}, [(_d = (_c = (_b = (_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.columnModel) === null || _c === void 0 ? void 0 : _c.columnDefs) === null || _d === void 0 ? void 0 : _d.length]);
|
|
147
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${(columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 ? "bg-primary-50" : "bg-white"} hover:bg-primary-25 br-8 cursor-pointer pd-9 flex align-items-cente gap-1 zoom_animate`, ref: btnRef, onClick: showColumnOptions }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01", size: 18, color: (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0
|
|
199
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${(columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 ? "bg-primary-50" : "bg-white"} hover:bg-primary-25 br-8 cursor-pointer pd-9 flex align-items-cente gap-1 zoom_animate`, ref: btnRef, onClick: showColumnOptions }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01", size: 18, color: (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0
|
|
200
|
+
? "text-primary-400"
|
|
201
|
+
: "text-gray-500" }), (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-center" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-primary-400 font-semibold ml-1" }, { children: columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 text-primary-400 font-semibold" }, { children: [(0, jsx_runtime_1.jsx)("p", Object.assign({ className: "ml-2" }, { children: "Selected" })), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: (e) => clearListItems(e), className: "h-auto p-0", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", color: "text-primary-400", size: 18 }) })] }))] })))] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: columnGroupRef, className: "column-group p-1", onHide: handleHide }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-header" }, { children: [(0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "my-0" }, { children: "Grouping" })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 mb-4" }, { children: "Select one or two columns for sorting" }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-body" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-right w-full p-2 bg-gray-50" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix top-0", style: { right: "20px" } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { onChange: (e) => setSearchedText(e.target.value), value: searchText, disabled: false, placeholder: "Enter any column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column gap-1 mt-1 mr-1 max-h-15rem max-w-30rem overflow-y-auto" }, { children: renderColumns === null || renderColumns === void 0 ? void 0 : renderColumns.map((column, index) => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 pl-2" }, { children: [checkedColumns.has(column === null || column === void 0 ? void 0 : column.id) && ((0, jsx_runtime_1.jsx)("img", { onDragStart: (e) => onDragStart(e, index), onDragOver: onDragOver, onDrop: (e) => onDrop(e, index), src: drag_and_drop_icon_png_1.default, width: 20, height: 20 })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex gap-2 ${checkedColumns.has(column === null || column === void 0 ? void 0 : column.id) && "bg-primary-25"} hover:bg-primary-25 border-round-sm p-3 w-full` }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { checked: checkedColumns.has(column === null || column === void 0 ? void 0 : column.id), onChange: (e) => onSelectedCheckbox(column, e), disabled: checkedColumns.size === 2 &&
|
|
202
|
+
!checkedColumns.has(column === null || column === void 0 ? void 0 : column.id) }), (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "max-w-28rem line-clamp line-clamp-1 inline-block", title: column.headerName }, { children: column.headerName }))] }))] }), column === null || column === void 0 ? void 0 : column.id))) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-footer gap-2 border-top-1 border-gray-200 flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", text: true, label: "Remove Grouping", onClick: (e) => clearListItems(e) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", label: "Save Grouping", onClick: (e) => clearSearchAndSaveGrouping(e) })] }))] }))] }));
|
|
148
203
|
};
|
|
149
204
|
exports.default = ColumnGroup;
|
|
@@ -56,9 +56,9 @@ function HideColumn() {
|
|
|
56
56
|
setInputValue(text);
|
|
57
57
|
const searchedColumns = [];
|
|
58
58
|
storeNodes.filter((column) => {
|
|
59
|
-
var _a;
|
|
59
|
+
var _a, _b;
|
|
60
60
|
if (column === null || column === void 0 ? void 0 : column.visibleInPanel) {
|
|
61
|
-
if ((_a = column === null || column === void 0 ? void 0 : column.headerName) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(text.toLowerCase())) {
|
|
61
|
+
if ((_b = (_a = column === null || column === void 0 ? void 0 : column.headerName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(text === null || text === void 0 ? void 0 : text.toLowerCase())) {
|
|
62
62
|
searchedColumns.push(column);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const helper_1 = require("./helper");
|
|
7
7
|
exports.FeatureContext = (0, react_1.createContext)(null);
|
|
8
8
|
function MyProvider({ children, value }) {
|
|
9
|
-
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData } = value;
|
|
9
|
+
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns } = value;
|
|
10
10
|
// States for sort
|
|
11
11
|
const [columnData] = (0, react_1.useState)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
|
|
12
12
|
const [sortValue, setSortValue] = (0, react_1.useState)({});
|
|
@@ -51,7 +51,8 @@ function MyProvider({ children, value }) {
|
|
|
51
51
|
if (clearFilters) {
|
|
52
52
|
let currentFeature = featureDetails;
|
|
53
53
|
currentFeature.filterQueries = [];
|
|
54
|
-
|
|
54
|
+
setSelectedGroup([]);
|
|
55
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
|
|
55
56
|
setGlobalFilters([]);
|
|
56
57
|
callGrid(currentFeature);
|
|
57
58
|
}
|
|
@@ -95,7 +96,9 @@ function MyProvider({ children, value }) {
|
|
|
95
96
|
columnToRender,
|
|
96
97
|
selectedGroup,
|
|
97
98
|
setSelectedGroup,
|
|
98
|
-
initialCheckBoxData
|
|
99
|
+
initialCheckBoxData,
|
|
100
|
+
intialColumns,
|
|
101
|
+
setIntialColumns
|
|
99
102
|
} }, { children: children })));
|
|
100
103
|
}
|
|
101
104
|
exports.default = MyProvider;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleCheckboxClick = exports.getGroupIds = exports.handleUncheckedState = exports.handleCheckedState = exports.updateGroupState = exports.determineConditions = exports.updateRecords = exports.autoGroupColumnDef = exports.fillOperation = exports.updateCells = exports.getCheckedStatus = exports.sortColumns = exports.parseIfNeeded = exports.applyDefaultFilters = exports.initialCheckBoxData = void 0;
|
|
3
|
+
exports.deepClone = exports.handleCheckboxClick = exports.getGroupIds = exports.handleUncheckedState = exports.handleCheckedState = exports.updateGroupState = exports.determineConditions = exports.updateRecords = exports.autoGroupColumnDef = exports.fillOperation = exports.updateCells = exports.getCheckedStatus = exports.sortColumns = exports.parseIfNeeded = exports.applyDefaultFilters = exports.initialCheckBoxData = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const constants_1 = require("./constants");
|
|
6
7
|
// initial checkbox data
|
|
7
8
|
exports.initialCheckBoxData = {
|
|
@@ -189,6 +190,7 @@ const autoGroupColumnDef = (isTreeEnable, headerName, groupField, GroupHeaderCom
|
|
|
189
190
|
? () => headerCheckboxRenderer("", GroupHeaderComponent)
|
|
190
191
|
: GroupHeaderComponent,
|
|
191
192
|
cellRenderer: "agGroupCellRenderer",
|
|
193
|
+
minWidth: 200,
|
|
192
194
|
cellRendererParams: (params) => {
|
|
193
195
|
var _a;
|
|
194
196
|
// Render custom component for all group childs
|
|
@@ -219,7 +221,7 @@ exports.autoGroupColumnDef = autoGroupColumnDef;
|
|
|
219
221
|
// This function determines how to update `includedRecords` and `excludedRecords`
|
|
220
222
|
// depending on whether all checkboxes are checked or not (`allBoxChecked` state)
|
|
221
223
|
const updateRecords = (rowData, featureDetails, gridData) => {
|
|
222
|
-
var _a, _b, _c
|
|
224
|
+
var _a, _b, _c;
|
|
223
225
|
const { excludedRecords, includedRecords, allBoxChecked } = featureDetails.checkBoxSelection;
|
|
224
226
|
let newExcludedRecords = [...excludedRecords];
|
|
225
227
|
let newIncludedRecords = [...includedRecords];
|
|
@@ -227,24 +229,15 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
227
229
|
if (allBoxChecked) {
|
|
228
230
|
// Update excluded records: add or remove the current rowData
|
|
229
231
|
newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(rowData))
|
|
230
|
-
? excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.filter((item) => item !== rowData)
|
|
232
|
+
? excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id))
|
|
231
233
|
: [...excludedRecords, rowData];
|
|
232
|
-
// Check if all records are included; reset if so
|
|
233
|
-
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
234
|
-
return {
|
|
235
|
-
excludedRecords: [],
|
|
236
|
-
includedRecords: [],
|
|
237
|
-
isIndeterminate: false,
|
|
238
|
-
allBoxChecked: true,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
234
|
// Check if all records are excluded; reset if so
|
|
242
|
-
|
|
235
|
+
if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
243
236
|
return exports.initialCheckBoxData;
|
|
244
237
|
}
|
|
245
238
|
// Otherwise, update the excluded records and indeterminate state
|
|
246
239
|
else {
|
|
247
|
-
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { excludedRecords: newExcludedRecords, isIndeterminate:
|
|
240
|
+
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { excludedRecords: newExcludedRecords, isIndeterminate: (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) > 0 });
|
|
248
241
|
}
|
|
249
242
|
}
|
|
250
243
|
// When not all checkboxes are checked
|
|
@@ -254,7 +247,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
254
247
|
? includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id))
|
|
255
248
|
: [...includedRecords, rowData];
|
|
256
249
|
// Check if all records are included; reset if so
|
|
257
|
-
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((
|
|
250
|
+
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
258
251
|
return {
|
|
259
252
|
excludedRecords: [],
|
|
260
253
|
includedRecords: [],
|
|
@@ -263,7 +256,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
263
256
|
};
|
|
264
257
|
}
|
|
265
258
|
// Check if all records are excluded; reset if so
|
|
266
|
-
else if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((
|
|
259
|
+
else if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_c = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
267
260
|
return exports.initialCheckBoxData;
|
|
268
261
|
}
|
|
269
262
|
// Otherwise, update the included records
|
|
@@ -275,15 +268,15 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
275
268
|
exports.updateRecords = updateRecords;
|
|
276
269
|
// Utility function to determine conditions for updating group states
|
|
277
270
|
// Based on various flags and states, determines whether to add or remove group IDs
|
|
278
|
-
const determineConditions = (isChecked, allBoxChecked, isEveryParentGroupInclude,
|
|
271
|
+
const determineConditions = (isChecked, allBoxChecked, isEveryParentGroupInclude, isEverySuperParentGroupInclude, isSomeParentGroupExcluded, isSomeSuperParentGroupExcluded) => ({
|
|
279
272
|
addParent: (!allBoxChecked && isChecked && isEveryParentGroupInclude) ||
|
|
280
|
-
(allBoxChecked && isChecked && !
|
|
281
|
-
addSuperParent: (!allBoxChecked && isChecked &&
|
|
282
|
-
(allBoxChecked && isChecked && !
|
|
273
|
+
(allBoxChecked && isChecked && !isSomeParentGroupExcluded),
|
|
274
|
+
addSuperParent: (!allBoxChecked && isChecked && isEverySuperParentGroupInclude) ||
|
|
275
|
+
(allBoxChecked && isChecked && !isSomeSuperParentGroupExcluded),
|
|
283
276
|
removeParent: (!allBoxChecked && !isChecked && !isEveryParentGroupInclude) ||
|
|
284
|
-
(allBoxChecked && !isChecked &&
|
|
285
|
-
removeSuperParent: (!allBoxChecked && !isChecked && !
|
|
286
|
-
(allBoxChecked && !isChecked &&
|
|
277
|
+
(allBoxChecked && !isChecked && isSomeParentGroupExcluded),
|
|
278
|
+
removeSuperParent: (!allBoxChecked && !isChecked && !isEverySuperParentGroupInclude) ||
|
|
279
|
+
(allBoxChecked && !isChecked && isSomeSuperParentGroupExcluded),
|
|
287
280
|
});
|
|
288
281
|
exports.determineConditions = determineConditions;
|
|
289
282
|
// Function to update the selected groups in the state
|
|
@@ -311,8 +304,9 @@ const updateGroupState = (groupingColumns, parentId, superParentId, conditions,
|
|
|
311
304
|
if (groupingColumns === 2) {
|
|
312
305
|
if (addSuperParent)
|
|
313
306
|
updateSelectedGroup(superParentId, true, setSelectedGroup); // Add super parent group ID
|
|
314
|
-
if (addParent)
|
|
315
|
-
updateSelectedGroup(parentId, true, setSelectedGroup);
|
|
307
|
+
if (addParent) {
|
|
308
|
+
updateSelectedGroup(parentId, true, setSelectedGroup);
|
|
309
|
+
} // Add parent group ID
|
|
316
310
|
if (removeSuperParent)
|
|
317
311
|
updateSelectedGroup(superParentId, false, setSelectedGroup); // Remove super parent group ID
|
|
318
312
|
if (removeParent)
|
|
@@ -320,10 +314,12 @@ const updateGroupState = (groupingColumns, parentId, superParentId, conditions,
|
|
|
320
314
|
}
|
|
321
315
|
// Handle logic when there is 1 grouping column
|
|
322
316
|
else if (groupingColumns === 1) {
|
|
323
|
-
if (addParent)
|
|
324
|
-
updateSelectedGroup(parentId, true, setSelectedGroup); //
|
|
325
|
-
|
|
317
|
+
if (addParent) {
|
|
318
|
+
updateSelectedGroup(parentId, true, setSelectedGroup); // Add parent ID
|
|
319
|
+
}
|
|
320
|
+
if (removeParent) {
|
|
326
321
|
updateSelectedGroup(parentId, false, setSelectedGroup); // Remove parent group ID
|
|
322
|
+
}
|
|
327
323
|
}
|
|
328
324
|
};
|
|
329
325
|
exports.updateGroupState = updateGroupState;
|
|
@@ -341,13 +337,14 @@ const handleCheckedState = (params, featureDetails, gridData, setFeatureDetails,
|
|
|
341
337
|
const { groupData, parentGroupData } = gatherGroupData(params);
|
|
342
338
|
let newExcludedRecords = [...excludedRecords];
|
|
343
339
|
let newIncludedRecords = [...includedRecords];
|
|
340
|
+
// newExcludedRecords.filter((item) => item?.id !== group.id)
|
|
344
341
|
// Update records based on the checkbox state
|
|
345
342
|
groupData.forEach((group) => {
|
|
346
343
|
var _a, _b;
|
|
347
344
|
if (allBoxChecked) {
|
|
348
345
|
newExcludedRecords = (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.includes(group))
|
|
349
|
-
? newExcludedRecords.filter((item) => item !== group)
|
|
350
|
-
:
|
|
346
|
+
? newExcludedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== group.id)
|
|
347
|
+
: newExcludedRecords;
|
|
351
348
|
}
|
|
352
349
|
else if (!((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) && ((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
|
|
353
350
|
newIncludedRecords = newIncludedRecords.includes(group)
|
|
@@ -356,17 +353,13 @@ const handleCheckedState = (params, featureDetails, gridData, setFeatureDetails,
|
|
|
356
353
|
}
|
|
357
354
|
else {
|
|
358
355
|
newIncludedRecords = newIncludedRecords.includes(group)
|
|
359
|
-
? newIncludedRecords
|
|
360
|
-
if (item.id !== group.id)
|
|
361
|
-
group.isSelected = false;
|
|
362
|
-
return item.id !== group.id;
|
|
363
|
-
})
|
|
356
|
+
? newIncludedRecords
|
|
364
357
|
: [...newIncludedRecords, group];
|
|
365
358
|
}
|
|
366
359
|
});
|
|
367
360
|
updateCheckboxData(newIncludedRecords, newExcludedRecords, gridData, featureDetails, setFeatureDetails);
|
|
368
|
-
const isParent = determineParentGroupState(parentGroupData, newIncludedRecords, newExcludedRecords, allBoxChecked);
|
|
369
|
-
handleGroupSelection(params, setSelectedGroup, groupingColumns,
|
|
361
|
+
// const isParent = determineParentGroupState(parentGroupData, newIncludedRecords, newExcludedRecords, allBoxChecked, groupData);
|
|
362
|
+
handleGroupSelection(params, setSelectedGroup, groupingColumns, newIncludedRecords, newExcludedRecords, parentGroupData, allBoxChecked);
|
|
370
363
|
};
|
|
371
364
|
exports.handleCheckedState = handleCheckedState;
|
|
372
365
|
// Utility function to handle unchecked state updates
|
|
@@ -401,14 +394,16 @@ exports.handleUncheckedState = handleUncheckedState;
|
|
|
401
394
|
// Utility function to update checkbox data in the state
|
|
402
395
|
const updateCheckboxData = (newIncludedRecords, newExcludedRecords, gridData, featureDetails, setFeatureDetails) => {
|
|
403
396
|
var _a, _b;
|
|
404
|
-
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
397
|
+
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length) || ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === 0 && (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === 0)) {
|
|
405
398
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: [], includedRecords: [], isIndeterminate: false, allBoxChecked: true }) }));
|
|
406
399
|
}
|
|
407
400
|
else if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
408
401
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: exports.initialCheckBoxData }));
|
|
409
402
|
}
|
|
410
403
|
else {
|
|
411
|
-
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: newExcludedRecords, includedRecords: newIncludedRecords, isIndeterminate: featureDetails.checkBoxSelection.allBoxChecked
|
|
404
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: newExcludedRecords, includedRecords: newIncludedRecords, isIndeterminate: featureDetails.checkBoxSelection.allBoxChecked
|
|
405
|
+
? true
|
|
406
|
+
: featureDetails.checkBoxSelection.isIndeterminate }) }));
|
|
412
407
|
}
|
|
413
408
|
};
|
|
414
409
|
// Utility function to determine parent group inclusion or exclusion states
|
|
@@ -418,45 +413,57 @@ const determineParentGroupState = (parentGroupData, newIncludedRecords, newExclu
|
|
|
418
413
|
return allBoxChecked ? isAnyParentGroupExcluded : isAnyParentGroupInclude;
|
|
419
414
|
};
|
|
420
415
|
// Utility function to handle group selection logic for checked state
|
|
421
|
-
const handleGroupSelection = (params, setSelectedGroup, groupingColumns,
|
|
416
|
+
const handleGroupSelection = (params, setSelectedGroup, groupingColumns, newIncludedRecords, newExcludedRecords, parentGroupData, allBoxChecked) => {
|
|
422
417
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
423
|
-
|
|
418
|
+
const isEverySuperParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => newIncludedRecords.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id)));
|
|
419
|
+
// const isAnyParentGroupInclude = groupData?.some((parent) =>
|
|
420
|
+
// newIncludedRecords.some((included) => included?.id === parent?.id)
|
|
421
|
+
// );
|
|
422
|
+
const isEverySuperParentGroupExcluded = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => newExcludedRecords.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id)));
|
|
423
|
+
if (groupingColumns === 2 &&
|
|
424
|
+
!((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) &&
|
|
425
|
+
((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
|
|
424
426
|
(_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.childrenAfterGroup) === null || _d === void 0 ? void 0 : _d.forEach((childNode) => {
|
|
425
427
|
setSelectedGroup((prev) => prev.includes(childNode.id) ? prev : [...prev, childNode.id]);
|
|
426
428
|
});
|
|
427
429
|
setSelectedGroup((prev) => prev.includes(params.node.id) ? prev : [...prev, params.node.id]);
|
|
428
430
|
}
|
|
429
|
-
else if (((_e = params === null || params === void 0 ? void 0 : params.node) === null || _e === void 0 ? void 0 : _e.leafGroup) &&
|
|
431
|
+
else if (((_e = params === null || params === void 0 ? void 0 : params.node) === null || _e === void 0 ? void 0 : _e.leafGroup) &&
|
|
432
|
+
((_f = params === null || params === void 0 ? void 0 : params.node) === null || _f === void 0 ? void 0 : _f.level) === 1 &&
|
|
433
|
+
!allBoxChecked) {
|
|
430
434
|
setSelectedGroup((prev) => prev.includes(params.node.id) ? prev : [...prev, params.node.id]);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
?
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
if (isEverySuperParentGroupInclude) {
|
|
436
|
+
setSelectedGroup((prev) => {
|
|
437
|
+
var _a, _b, _c, _d;
|
|
438
|
+
return prev.includes((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.id)
|
|
439
|
+
? prev
|
|
440
|
+
: [...prev, (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.id];
|
|
441
|
+
});
|
|
442
|
+
}
|
|
437
443
|
}
|
|
438
|
-
else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) &&
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
});
|
|
444
|
+
else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) &&
|
|
445
|
+
((_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.level) === 1 &&
|
|
446
|
+
allBoxChecked) {
|
|
447
|
+
setSelectedGroup((prev) => prev.includes(params.node.id) ? prev : [...prev, params.node.id]);
|
|
448
|
+
if (isEverySuperParentGroupExcluded || (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === 0) {
|
|
449
|
+
setSelectedGroup((prev) => {
|
|
450
|
+
var _a, _b, _c, _d;
|
|
451
|
+
return prev.includes((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.id)
|
|
452
|
+
? prev
|
|
453
|
+
: [...prev, (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.id];
|
|
454
|
+
});
|
|
455
|
+
}
|
|
451
456
|
}
|
|
452
457
|
else {
|
|
453
|
-
setSelectedGroup((prev) => { var _a; return prev.includes(params.node.id) ? prev : [...prev, (
|
|
458
|
+
setSelectedGroup((prev) => { var _a, _b; return prev.includes((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.id) ? prev : [...prev, (_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.id]; });
|
|
454
459
|
}
|
|
455
460
|
};
|
|
456
461
|
// Utility function to handle group deselection logic for unchecked state
|
|
457
462
|
const handleGroupDeselection = (params, setSelectedGroup, groupingColumns, isParent, isEveryParentGroupInclude) => {
|
|
458
463
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
459
|
-
if (groupingColumns === 2 &&
|
|
464
|
+
if (groupingColumns === 2 &&
|
|
465
|
+
!((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) &&
|
|
466
|
+
((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
|
|
460
467
|
(_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.childrenAfterGroup) === null || _d === void 0 ? void 0 : _d.forEach((childNode) => {
|
|
461
468
|
setSelectedGroup((prev) => prev === null || prev === void 0 ? void 0 : prev.filter((id) => id !== (childNode === null || childNode === void 0 ? void 0 : childNode.id)));
|
|
462
469
|
});
|
|
@@ -480,7 +487,9 @@ const handleGroupDeselection = (params, setSelectedGroup, groupingColumns, isPar
|
|
|
480
487
|
return prev;
|
|
481
488
|
});
|
|
482
489
|
}
|
|
483
|
-
else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) &&
|
|
490
|
+
else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) &&
|
|
491
|
+
((_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.level) === 1 &&
|
|
492
|
+
!isParent) {
|
|
484
493
|
setSelectedGroup((prev) => {
|
|
485
494
|
if (prev === null || prev === void 0 ? void 0 : prev.includes(params.node.id)) {
|
|
486
495
|
return prev === null || prev === void 0 ? void 0 : prev.filter((id) => { var _a; return id !== ((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.id); });
|
|
@@ -540,12 +549,80 @@ const handleCheckboxClick = (e, params, featureDetails, gridData, setFeatureDeta
|
|
|
540
549
|
const parentGroupData = (_c = (_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.childrenAfterGroup) === null || _c === void 0 ? void 0 : _c.map((childNode) => childNode === null || childNode === void 0 ? void 0 : childNode.data);
|
|
541
550
|
const superParentData = (_g = (_f = (_e = (_d = params === null || params === void 0 ? void 0 : params.node) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.parent) === null || _f === void 0 ? void 0 : _f.allLeafChildren) === null || _g === void 0 ? void 0 : _g.map((children) => children === null || children === void 0 ? void 0 : children.data);
|
|
542
551
|
// Determine if all or any parent groups are included/excluded
|
|
543
|
-
const isEveryParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => {
|
|
544
|
-
|
|
545
|
-
|
|
552
|
+
const isEveryParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => {
|
|
553
|
+
var _a;
|
|
554
|
+
return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.includedRecords) === null || _a === void 0 ? void 0 : _a.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
|
|
555
|
+
});
|
|
556
|
+
// const isEveryParentGroupExcluded = parentGroupData?.every((parent) =>
|
|
557
|
+
// updatedCheckBoxData?.excludedRecords?.some(
|
|
558
|
+
// (excluded) => excluded?.id === parent?.id
|
|
559
|
+
// )
|
|
560
|
+
// );
|
|
561
|
+
const isSomeParentGroupExcluded = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.some((parent) => {
|
|
562
|
+
var _a;
|
|
563
|
+
return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.excludedRecords) === null || _a === void 0 ? void 0 : _a.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
|
|
564
|
+
});
|
|
565
|
+
// const isEverySuperParentGroupExcluded = superParentData?.every((parent) =>
|
|
566
|
+
// updatedCheckBoxData?.excludedRecords?.some(
|
|
567
|
+
// (excluded) => excluded?.id === parent?.id
|
|
568
|
+
// )
|
|
569
|
+
// );
|
|
570
|
+
const isSomeSuperParentGroupExcluded = superParentData === null || superParentData === void 0 ? void 0 : superParentData.some((parent) => {
|
|
571
|
+
var _a;
|
|
572
|
+
return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.excludedRecords) === null || _a === void 0 ? void 0 : _a.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
|
|
573
|
+
});
|
|
574
|
+
const isEverySuperParentGroupInclude = superParentData === null || superParentData === void 0 ? void 0 : superParentData.every((parent) => {
|
|
575
|
+
var _a;
|
|
576
|
+
return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.includedRecords) === null || _a === void 0 ? void 0 : _a.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
|
|
577
|
+
});
|
|
546
578
|
// Determine the conditions to update group state
|
|
547
|
-
const conditions = (0, exports.determineConditions)(isChecked, updatedCheckBoxData.allBoxChecked, isEveryParentGroupInclude,
|
|
579
|
+
const conditions = (0, exports.determineConditions)(isChecked, updatedCheckBoxData.allBoxChecked, isEveryParentGroupInclude, isEverySuperParentGroupInclude, isSomeParentGroupExcluded, isSomeSuperParentGroupExcluded);
|
|
548
580
|
// Update group state based on determined conditions
|
|
549
581
|
(0, exports.updateGroupState)(groupingColumns, (_j = (_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.parent) === null || _j === void 0 ? void 0 : _j.id, (_m = (_l = (_k = params === null || params === void 0 ? void 0 : params.node) === null || _k === void 0 ? void 0 : _k.parent) === null || _l === void 0 ? void 0 : _l.parent) === null || _m === void 0 ? void 0 : _m.id, conditions, setSelectedGroup);
|
|
550
582
|
};
|
|
551
583
|
exports.handleCheckboxClick = handleCheckboxClick;
|
|
584
|
+
const deepClone = (obj) => {
|
|
585
|
+
var _a, _b, _c;
|
|
586
|
+
// If the input is not an object or is null, return the value itself (primitive types are returned directly)
|
|
587
|
+
if (obj === null || typeof obj !== "object") {
|
|
588
|
+
return obj;
|
|
589
|
+
}
|
|
590
|
+
// Handle Date objects by creating a new Date instance with the same value
|
|
591
|
+
if (obj instanceof Date) {
|
|
592
|
+
return new Date(obj);
|
|
593
|
+
}
|
|
594
|
+
// Handle RegExp objects by creating a new RegExp instance with the same pattern and flags
|
|
595
|
+
if (obj instanceof RegExp) {
|
|
596
|
+
return new RegExp(obj);
|
|
597
|
+
}
|
|
598
|
+
// Handle React JSX elements
|
|
599
|
+
// If the object is a valid React element, clone it along with its props and children
|
|
600
|
+
if (react_1.default.isValidElement(obj)) {
|
|
601
|
+
const element = obj; // Explicitly assert type to ReactElement
|
|
602
|
+
// Recursively clone all child elements, if any
|
|
603
|
+
const clonedChildren = ((_a = element === null || element === void 0 ? void 0 : element.props) === null || _a === void 0 ? void 0 : _a.children)
|
|
604
|
+
? (_b = react_1.default.Children) === null || _b === void 0 ? void 0 : _b.map((_c = element === null || element === void 0 ? void 0 : element.props) === null || _c === void 0 ? void 0 : _c.children, (child) => (0, exports.deepClone)(child))
|
|
605
|
+
: undefined; // Set to undefined if no children exist
|
|
606
|
+
// Return a cloned React element with its props and recursively cloned children
|
|
607
|
+
return react_1.default.cloneElement(element, Object.assign({}, element === null || element === void 0 ? void 0 : element.props), // Spread the existing props
|
|
608
|
+
clonedChildren // Include cloned children
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
// Handle Arrays
|
|
612
|
+
// Recursively clone each element in the array
|
|
613
|
+
if (Array.isArray(obj)) {
|
|
614
|
+
return obj === null || obj === void 0 ? void 0 : obj.map(exports.deepClone);
|
|
615
|
+
}
|
|
616
|
+
// Handle Objects
|
|
617
|
+
// Recursively clone each property in the object
|
|
618
|
+
const clonedObj = {}; // Create a new empty object to hold cloned properties
|
|
619
|
+
for (const key in obj) {
|
|
620
|
+
// Use hasOwnProperty to avoid cloning inherited properties
|
|
621
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
622
|
+
clonedObj[key] = (0, exports.deepClone)(obj[key]); // Recursively clone each property
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
// Return the fully cloned object
|
|
626
|
+
return clonedObj;
|
|
627
|
+
};
|
|
628
|
+
exports.deepClone = deepClone;
|
|
@@ -24,6 +24,7 @@ function ParentForGrid(props) {
|
|
|
24
24
|
const [api, setApi] = (0, react_1.useState)(null);
|
|
25
25
|
const [totalRecords, setTotalRecords] = (0, react_1.useState)(0);
|
|
26
26
|
const [gridReadyEvent, setGridReadyEvent] = (0, react_1.useState)();
|
|
27
|
+
const [intialColumns, setIntialColumns] = (0, react_1.useState)(null);
|
|
27
28
|
const [defaultFilters, setDefaultFilters] = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.defaultFilters) || []);
|
|
28
29
|
const [selectedGroup, setSelectedGroup] = (0, react_1.useState)([]);
|
|
29
30
|
const [emptyResponse] = (0, react_1.useState)({
|
|
@@ -74,6 +75,7 @@ function ParentForGrid(props) {
|
|
|
74
75
|
sortable: false,
|
|
75
76
|
};
|
|
76
77
|
}, []);
|
|
78
|
+
// console.log("propsssssssss", props)
|
|
77
79
|
// Function to handle header checkbox click event
|
|
78
80
|
const handleHeaderCheckbox = (props) => {
|
|
79
81
|
// get the group and subgroupids
|
|
@@ -140,33 +142,34 @@ function ParentForGrid(props) {
|
|
|
140
142
|
});
|
|
141
143
|
// Gets call onLoad,scroll and whenever any featureDetails changed
|
|
142
144
|
const onGridReady = (params, updatedFeatures) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
var _m, _o;
|
|
143
146
|
setApi(params.api);
|
|
144
147
|
setGridReadyEvent(params);
|
|
145
148
|
let currentFeatures = updatedFeatures;
|
|
146
149
|
if (!updatedFeatures) {
|
|
147
150
|
currentFeatures = featureDetails;
|
|
148
151
|
}
|
|
149
|
-
if (props.rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE) {
|
|
150
|
-
params.api.setGridOption("rowData", []);
|
|
152
|
+
if ((props === null || props === void 0 ? void 0 : props.rowModelType) === (constants_1.ROWMODELTYPE === null || constants_1.ROWMODELTYPE === void 0 ? void 0 : constants_1.ROWMODELTYPE.CLIENT_SIDE)) {
|
|
153
|
+
params === null || params === void 0 ? void 0 : params.api.setGridOption("rowData", []);
|
|
151
154
|
const result = yield getData(0, 0, currentFeatures);
|
|
152
155
|
if (result.rowData) {
|
|
153
156
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: result.rowData }));
|
|
154
157
|
gridRef.current.api.hideOverlay();
|
|
155
|
-
params.api.applyTransaction({ add: result.rowData });
|
|
158
|
+
(_m = params === null || params === void 0 ? void 0 : params.api) === null || _m === void 0 ? void 0 : _m.applyTransaction({ add: result.rowData });
|
|
156
159
|
}
|
|
157
160
|
else {
|
|
158
|
-
params.api.applyTransaction({ add: [] });
|
|
161
|
+
(_o = params === null || params === void 0 ? void 0 : params.api) === null || _o === void 0 ? void 0 : _o.applyTransaction({ add: [] });
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
164
|
else if (props.rowModelType === constants_1.ROWMODELTYPE.SERVER_SIDE) {
|
|
162
165
|
const dataSource = {
|
|
163
166
|
getRows: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
var
|
|
167
|
+
var _p, _q, _r;
|
|
165
168
|
const startRow = params.request.startRow;
|
|
166
169
|
const endRow = params.request.endRow;
|
|
167
170
|
// Scroll should not exit MAX_RECORDS_TO_LOAD
|
|
168
171
|
if (endRow > maxLength && maxLength > 0) {
|
|
169
|
-
gridRef.current.api.hideOverlay();
|
|
172
|
+
(_p = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current.api) === null || _p === void 0 ? void 0 : _p.hideOverlay();
|
|
170
173
|
// supply rows for requested block to grid
|
|
171
174
|
params.success({
|
|
172
175
|
rowData: gridData.rowData,
|
|
@@ -177,7 +180,7 @@ function ParentForGrid(props) {
|
|
|
177
180
|
// get data for request from our fake server
|
|
178
181
|
const response = yield getData(startRow, endRow, currentFeatures, params);
|
|
179
182
|
// simulating real server call with a 500ms delay
|
|
180
|
-
if (((
|
|
183
|
+
if (((_q = response.rowData) === null || _q === void 0 ? void 0 : _q.length) > 0) {
|
|
181
184
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
|
|
182
185
|
gridRef.current.api.hideOverlay();
|
|
183
186
|
// supply rows for requested block to grid
|
|
@@ -187,14 +190,14 @@ function ParentForGrid(props) {
|
|
|
187
190
|
else {
|
|
188
191
|
// params.fail();
|
|
189
192
|
const gridRows = startRow >= constants_1.BLOCK_SIZE ? gridData.rowData : [];
|
|
190
|
-
if (!((
|
|
193
|
+
if (!((_r = params === null || params === void 0 ? void 0 : params.parentNode) === null || _r === void 0 ? void 0 : _r.id))
|
|
191
194
|
gridRef.current.api.showNoRowsOverlay();
|
|
192
195
|
params.success({ rowData: gridRows });
|
|
193
196
|
return;
|
|
194
197
|
}
|
|
195
198
|
}),
|
|
196
199
|
};
|
|
197
|
-
params.api.setGridOption("serverSideDatasource", dataSource);
|
|
200
|
+
params === null || params === void 0 ? void 0 : params.api.setGridOption("serverSideDatasource", dataSource);
|
|
198
201
|
}
|
|
199
202
|
});
|
|
200
203
|
// Specify unique id for every row for grid
|
|
@@ -217,7 +220,7 @@ function ParentForGrid(props) {
|
|
|
217
220
|
var _a;
|
|
218
221
|
// Custom component for specific group header/parent
|
|
219
222
|
const GroupHeaderRenderer = (params) => {
|
|
220
|
-
var _a, _b, _c, _d
|
|
223
|
+
var _a, _b, _c, _d;
|
|
221
224
|
const Wrapper = () => {
|
|
222
225
|
return (0, jsx_runtime_1.jsx)(utilComponents_1.GroupHeader, { params: params });
|
|
223
226
|
};
|
|
@@ -231,18 +234,27 @@ function ParentForGrid(props) {
|
|
|
231
234
|
(0, helper_1.handleUncheckedState)(params, featureDetails, gridData, setFeatureDetails, setSelectedGroup, groupingColumns);
|
|
232
235
|
}
|
|
233
236
|
};
|
|
237
|
+
const HeaderComponent = props === null || props === void 0 ? void 0 : props.rowGroupHeaderComponent;
|
|
234
238
|
// To display checkbox
|
|
235
239
|
if ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxForGroups) {
|
|
236
240
|
// To display checkbox on right
|
|
237
241
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(group_checkbox_1.default, { checked: (selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.includes((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.id)) ||
|
|
238
242
|
(((_c = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection) === null || _c === void 0 ? void 0 : _c.allBoxChecked) &&
|
|
239
|
-
!((_d = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection) === null || _d === void 0 ? void 0 : _d.isIndeterminate)), onChange: (e) => onChange(e, params), isIndeterminate: false, shouldRenderOnRight: false }),
|
|
243
|
+
!((_d = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection) === null || _d === void 0 ? void 0 : _d.isIndeterminate)), onChange: (e) => onChange(e, params), isIndeterminate: false, shouldRenderOnRight: false }), props.rowGroupHeaderComponent ?
|
|
244
|
+
(0, jsx_runtime_1.jsx)(HeaderComponent, { params: params }) : params.node.field] })));
|
|
240
245
|
}
|
|
241
246
|
return (0, jsx_runtime_1.jsx)(Wrapper, {});
|
|
242
247
|
};
|
|
248
|
+
const GridHeaderComponent = () => {
|
|
249
|
+
if (props === null || props === void 0 ? void 0 : props.GroupHeaderComponent) {
|
|
250
|
+
const CustomComponent = props === null || props === void 0 ? void 0 : props.GroupHeaderComponent;
|
|
251
|
+
return (0, jsx_runtime_1.jsx)(CustomComponent, {});
|
|
252
|
+
}
|
|
253
|
+
return (0, jsx_runtime_1.jsx)("span", { children: "Group " });
|
|
254
|
+
};
|
|
243
255
|
// Cell renderer with checkbox
|
|
244
256
|
const cellRendererConditionally = (params) => {
|
|
245
|
-
var _a, _b;
|
|
257
|
+
var _a, _b, _c;
|
|
246
258
|
if ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxForGroupChild) {
|
|
247
259
|
if (!(props === null || props === void 0 ? void 0 : props.ChildComponentForGroup)) {
|
|
248
260
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [cellCheckBoxRenderer(params), (0, jsx_runtime_1.jsx)("p", { children: params === null || params === void 0 ? void 0 : params.data[props === null || props === void 0 ? void 0 : props.groupField] })] })));
|
|
@@ -250,7 +262,7 @@ function ParentForGrid(props) {
|
|
|
250
262
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: ((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params), cellCheckBoxRenderer(params)] }))) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [cellCheckBoxRenderer(params), props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params)] }))) }));
|
|
251
263
|
}
|
|
252
264
|
else {
|
|
253
|
-
return (0, jsx_runtime_1.
|
|
265
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(props === null || props === void 0 ? void 0 : props.ChildComponentForGroup) ? props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params) : (0, jsx_runtime_1.jsx)("span", { children: params === null || params === void 0 ? void 0 : params.data[(_c = params === null || params === void 0 ? void 0 : params.colDef) === null || _c === void 0 ? void 0 : _c.field] }), " "] });
|
|
254
266
|
}
|
|
255
267
|
};
|
|
256
268
|
// Group default values
|
|
@@ -259,7 +271,7 @@ function ParentForGrid(props) {
|
|
|
259
271
|
return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
|
|
260
272
|
props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
|
|
261
273
|
props === null || props === void 0 ? void 0 : props.groupField, // Group field
|
|
262
|
-
|
|
274
|
+
GridHeaderComponent, // Header component
|
|
263
275
|
headerCheckBoxRenderer, //
|
|
264
276
|
props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, props.conditionsToDisplay.displayGroupCount, cellRendererConditionally, GroupHeaderRenderer // Custom component for group header
|
|
265
277
|
);
|
|
@@ -268,12 +280,24 @@ function ParentForGrid(props) {
|
|
|
268
280
|
return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
|
|
269
281
|
props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
|
|
270
282
|
props === null || props === void 0 ? void 0 : props.groupField, // Group field
|
|
271
|
-
|
|
283
|
+
GridHeaderComponent, // Header component
|
|
272
284
|
headerCheckBoxRenderer, //
|
|
273
285
|
props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, props.conditionsToDisplay.displayGroupCount, GroupHeaderRenderer // Custom component for group header
|
|
274
286
|
);
|
|
275
287
|
}
|
|
276
288
|
};
|
|
289
|
+
(0, react_1.useEffect)(() => {
|
|
290
|
+
// Initialize `intialColumns` only if it hasn't been set yet
|
|
291
|
+
if (!intialColumns) {
|
|
292
|
+
// Perform a deep copy of the columns array using `JSON.parse(JSON.stringify())`
|
|
293
|
+
const deepCopyOfColumns = (0, helper_1.deepClone)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
|
|
294
|
+
setIntialColumns(deepCopyOfColumns);
|
|
295
|
+
}
|
|
296
|
+
}, [intialColumns]);
|
|
297
|
+
// const gridStyle = {
|
|
298
|
+
// width: props?.style?.width, // Full width
|
|
299
|
+
// ...(totalRecords > 6 && { height: props?.style?.height }), // Set height only if records > 6
|
|
300
|
+
// };
|
|
277
301
|
// Options that grid should have
|
|
278
302
|
const gridOptions = {
|
|
279
303
|
columnDefs: (_c = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _c === void 0 ? void 0 : _c.map((column) => {
|
|
@@ -288,7 +312,12 @@ function ParentForGrid(props) {
|
|
|
288
312
|
return Object.assign(Object.assign({}, column), { headerName: (_b = column === null || column === void 0 ? void 0 : column.headerName) === null || _b === void 0 ? void 0 : _b.toUpperCase() });
|
|
289
313
|
}
|
|
290
314
|
}),
|
|
291
|
-
autoGroupColumnDef: manageColumnGrouping(),
|
|
315
|
+
// autoGroupColumnDef: manageColumnGrouping(),
|
|
316
|
+
// Manage column grouping and use valueFormatter to handle display of '--'
|
|
317
|
+
autoGroupColumnDef: Object.assign(Object.assign({}, manageColumnGrouping()), { valueFormatter: (params) => {
|
|
318
|
+
// Replace '--' with an empty string or a custom placeholder
|
|
319
|
+
return (params === null || params === void 0 ? void 0 : params.value) === '--' ? '' : params === null || params === void 0 ? void 0 : params.value;
|
|
320
|
+
} }),
|
|
292
321
|
treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false,
|
|
293
322
|
getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null,
|
|
294
323
|
defaultColDef: defaultColDef,
|
|
@@ -313,6 +342,7 @@ function ParentForGrid(props) {
|
|
|
313
342
|
fillOperation: myOpertaion,
|
|
314
343
|
getRowId: getRowId,
|
|
315
344
|
fillHandleDirection: "y",
|
|
345
|
+
// ...(totalRecords > 6 && { domLayout: 'autoHeight' }) // for auto height based on table content
|
|
316
346
|
};
|
|
317
347
|
// Fucntion to call the grid
|
|
318
348
|
const callGrid = (featureDetails) => {
|
|
@@ -371,7 +401,7 @@ function ParentForGrid(props) {
|
|
|
371
401
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
|
|
372
402
|
}
|
|
373
403
|
}, [props === null || props === void 0 ? void 0 : props.emptyCheckboxStatus]);
|
|
374
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: style.height, width: style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: {
|
|
404
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: style === null || style === void 0 ? void 0 : style.height, width: style === null || style === void 0 ? void 0 : style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: {
|
|
375
405
|
featureDetails,
|
|
376
406
|
setFeatureDetails,
|
|
377
407
|
gridData,
|
|
@@ -398,6 +428,8 @@ function ParentForGrid(props) {
|
|
|
398
428
|
selectedGroup: selectedGroup,
|
|
399
429
|
setSelectedGroup: setSelectedGroup,
|
|
400
430
|
initialCheckBoxData: initialCheckBoxData,
|
|
431
|
+
intialColumns,
|
|
432
|
+
setIntialColumns
|
|
401
433
|
} }, { children: ((_l = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _l === void 0 ? void 0 : _l.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady, gridRef: gridRef })] }) })) }) }));
|
|
402
434
|
}
|
|
403
435
|
exports.default = ParentForGrid;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupHeader = exports.dataCellRenderer = void 0;
|
|
3
|
+
exports.GridHeaderComponent = exports.GroupHeader = exports.dataCellRenderer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
// import Checkbox from "./grid-checkbox";
|
|
6
6
|
// Render checkbox as well as initial component/data from props
|
|
@@ -16,3 +16,9 @@ const GroupHeader = (params) => {
|
|
|
16
16
|
return (0, jsx_runtime_1.jsx)("p", { children: "My Custom Group" });
|
|
17
17
|
};
|
|
18
18
|
exports.GroupHeader = GroupHeader;
|
|
19
|
+
const GridHeaderComponent = (props) => {
|
|
20
|
+
if (props === null || props === void 0 ? void 0 : props.GroupHeaderComponent)
|
|
21
|
+
return props === null || props === void 0 ? void 0 : props.GroupHeaderComponent;
|
|
22
|
+
return (0, jsx_runtime_1.jsx)("span", { children: "Group" });
|
|
23
|
+
};
|
|
24
|
+
exports.GridHeaderComponent = GridHeaderComponent;
|
|
@@ -274,8 +274,8 @@ const FormulaComponent = (props) => {
|
|
|
274
274
|
const onFilter = (e) => {
|
|
275
275
|
if (e.target.value) {
|
|
276
276
|
let opts = props === null || props === void 0 ? void 0 : props.fieldOptions.filter((x) => {
|
|
277
|
-
var _a, _b;
|
|
278
|
-
return (_b = (_a = x === null || x === void 0 ? void 0 : x[props === null || props === void 0 ? void 0 : props.fieldFilterOption]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(e.target.value.toLowerCase());
|
|
277
|
+
var _a, _b, _c, _d;
|
|
278
|
+
return (_b = (_a = x === null || x === void 0 ? void 0 : x[props === null || props === void 0 ? void 0 : props.fieldFilterOption]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes((_d = (_c = e === null || e === void 0 ? void 0 : e.target) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.toLowerCase());
|
|
279
279
|
});
|
|
280
280
|
setFieldOptions(opts);
|
|
281
281
|
}
|
|
@@ -13,7 +13,8 @@ const MultiSelectDropDown = (props) => {
|
|
|
13
13
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.dropdownType === "status" ?
|
|
14
14
|
(0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'select_status_prv absolute left_section_item z-5' }, { children: items.length > 0 ?
|
|
15
15
|
(0, jsx_runtime_1.jsx)("ul", Object.assign({ className: 'p-0 m-0 list-none' }, { children: items.map((status, i) => {
|
|
16
|
-
|
|
16
|
+
var _a, _b;
|
|
17
|
+
return (0, jsx_runtime_1.jsx)("li", { style: { background: status.color }, className: `${(_b = (_a = status === null || status === void 0 ? void 0 : status.name) === null || _a === void 0 ? void 0 : _a.replaceAll(' ', '')) === null || _b === void 0 ? void 0 : _b.toLowerCase()}` }, i);
|
|
17
18
|
}) }))
|
|
18
19
|
:
|
|
19
20
|
(0, jsx_runtime_1.jsx)("ul", Object.assign({ className: 'p-0 m-0 list-none' }, { children: (0, jsx_runtime_1.jsx)("li", { className: 'all' }) })) }))
|
|
@@ -43,7 +44,8 @@ const MultiSelectDropDown = (props) => {
|
|
|
43
44
|
setItems(props.value);
|
|
44
45
|
}, [props.value]);
|
|
45
46
|
const itemTemplate = (option) => {
|
|
46
|
-
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `status_dropdown_item pl-6 ${(_b = (_a = option === null || option === void 0 ? void 0 : option.name) === null || _a === void 0 ? void 0 : _a.replaceAll(' ', '')) === null || _b === void 0 ? void 0 : _b.toLowerCase()}` }, { children: [(0, jsx_runtime_1.jsx)("div", { className: 'status_dot', style: { background: option.color } }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'otption_name mr-8' }, { children: option.name }))] })) }));
|
|
47
49
|
};
|
|
48
50
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.dropdownType === 'withIcon' &&
|
|
49
51
|
(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative ${props.className} ${isMoreThanOne ? `selected_multile ${`selected_num_` + items.length}` : ''}` }, { children: [(0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, { panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? 'hidePanelHeader' : ''}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: { minWidth: props.dropdownWidth ? props.dropdownWidth + 'px' : '', maxWidth: props.dropdownWidth ? props.dropdownWidth + 'px' : '' }, className: `w-full md:w-20rem ${props.maxWidth ? `${'optionBodyMaxWidth_' + props.maxWidth}` : ''}`, panelStyle: { width: props.panelWidth ? props.panelWidth + 'px' : '' } }), items.length > 0 &&
|
|
@@ -142,6 +142,7 @@ export interface PropsFromProduct {
|
|
|
142
142
|
columnHeaderHeight?: number;
|
|
143
143
|
AdvancedFilter?: React.FC;
|
|
144
144
|
removeCallBack?: (featureDetails: Features) => void;
|
|
145
|
+
rowGroupHeaderComponent: React.FC;
|
|
145
146
|
}
|
|
146
147
|
export interface ResoponseFromCallback {
|
|
147
148
|
totalRecords: number;
|
|
@@ -27,6 +27,8 @@ interface MyProviderProps {
|
|
|
27
27
|
setSelectedGroup: (group: string[]) => void;
|
|
28
28
|
selectedGroup: string[];
|
|
29
29
|
initialCheckBoxData: CheckBoxSelection;
|
|
30
|
+
intialColumns: ColumnDef[];
|
|
31
|
+
setIntialColumns: React.Dispatch<React.SetStateAction<any>>;
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,6 +20,7 @@ export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: str
|
|
|
20
20
|
field: string;
|
|
21
21
|
headerComponent: React.FC<{}> | (() => React.ReactElement<any, any>);
|
|
22
22
|
cellRenderer: string;
|
|
23
|
+
minWidth: number;
|
|
23
24
|
cellRendererParams: (params: any) => {
|
|
24
25
|
suppressCount: boolean;
|
|
25
26
|
innerRenderer: React.FC<{}>;
|
|
@@ -34,10 +35,9 @@ export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: str
|
|
|
34
35
|
checkbox?: undefined;
|
|
35
36
|
};
|
|
36
37
|
headerName?: undefined;
|
|
37
|
-
minWidth?: undefined;
|
|
38
38
|
};
|
|
39
39
|
export declare const updateRecords: (rowData: any, featureDetails: any, gridData: any) => any;
|
|
40
|
-
export declare const determineConditions: (isChecked: any, allBoxChecked: any, isEveryParentGroupInclude: any,
|
|
40
|
+
export declare const determineConditions: (isChecked: any, allBoxChecked: any, isEveryParentGroupInclude: any, isEverySuperParentGroupInclude: any, isSomeParentGroupExcluded: any, isSomeSuperParentGroupExcluded: any) => {
|
|
41
41
|
addParent: any;
|
|
42
42
|
addSuperParent: any;
|
|
43
43
|
removeParent: any;
|
|
@@ -51,3 +51,4 @@ export declare const getGroupIds: (gridRef: any) => {
|
|
|
51
51
|
secondGroupIds: string[];
|
|
52
52
|
};
|
|
53
53
|
export declare const handleCheckboxClick: (e: any, params: any, featureDetails: any, gridData: any, setFeatureDetails: any, groupingColumns: any, setSelectedGroup: any) => void;
|
|
54
|
+
export declare const deepClone: (obj: any) => any;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const dataCellRenderer: (cellRendererParams: any, column: any, props: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export declare const GroupHeader: (params: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const GridHeaderComponent: (props: any) => any;
|