next-helios-fe 1.8.72 → 1.8.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -159,8 +159,8 @@ export const Table: TableComponentProps = ({
|
|
159
159
|
xlsx.writeFile(workbook, fileName + ".xlsx");
|
160
160
|
};
|
161
161
|
|
162
|
-
|
163
|
-
if (page
|
162
|
+
useEffect(() => {
|
163
|
+
if (page === 1) {
|
164
164
|
paginationRef.current?.scrollTo({
|
165
165
|
left: 0,
|
166
166
|
behavior: "smooth",
|
@@ -169,25 +169,10 @@ export const Table: TableComponentProps = ({
|
|
169
169
|
document.getElementById(`pagination-page-${page - 1}`)?.scrollIntoView({
|
170
170
|
behavior: "smooth",
|
171
171
|
block: "nearest",
|
172
|
-
inline: "
|
173
|
-
});
|
174
|
-
}
|
175
|
-
};
|
176
|
-
|
177
|
-
const handleOnNextClick = () => {
|
178
|
-
if (page + 1 === Math.ceil(data?.length / maxRow)) {
|
179
|
-
paginationRef.current?.scrollTo({
|
180
|
-
left: paginationRef.current?.scrollWidth,
|
181
|
-
behavior: "smooth",
|
182
|
-
});
|
183
|
-
} else {
|
184
|
-
document.getElementById(`pagination-page-${page + 1}`)?.scrollIntoView({
|
185
|
-
behavior: "smooth",
|
186
|
-
block: "nearest",
|
187
|
-
inline: "end",
|
172
|
+
inline: "center",
|
188
173
|
});
|
189
174
|
}
|
190
|
-
};
|
175
|
+
}, [page]);
|
191
176
|
|
192
177
|
const filteredData = useMemo(() => {
|
193
178
|
const tempData = data
|
@@ -464,7 +449,7 @@ export const Table: TableComponentProps = ({
|
|
464
449
|
</td>
|
465
450
|
)}
|
466
451
|
{!options?.hideNumberColumn && (
|
467
|
-
<td className="sticky left-0 w-8 px-4 py-1.5 bg-secondary-bg text-center">
|
452
|
+
<td className="sticky z-10 left-0 w-8 px-4 py-1.5 bg-secondary-bg text-center">
|
468
453
|
{(page - 1) * maxRow + index + 1}
|
469
454
|
</td>
|
470
455
|
)}
|
@@ -741,7 +726,7 @@ export const Table: TableComponentProps = ({
|
|
741
726
|
</th>
|
742
727
|
)}
|
743
728
|
{!options?.hideNumberColumn && (
|
744
|
-
<th className="sticky left-0 w-8 px-4 py-2
|
729
|
+
<th className="sticky left-0 z-10 w-8 px-4 py-2 bg-secondary-bg font-medium text-center whitespace-nowrap">
|
745
730
|
<div className="flex flex-col">
|
746
731
|
<span>No.</span>
|
747
732
|
{options?.toolbar?.columnSearch?.show !== false && (
|
@@ -813,7 +798,7 @@ export const Table: TableComponentProps = ({
|
|
813
798
|
}}
|
814
799
|
/>
|
815
800
|
</div>
|
816
|
-
<div className="block md:hidden !text-sm">
|
801
|
+
<div className="block md:hidden w-36 !text-sm">
|
817
802
|
<Form.Select
|
818
803
|
options={{
|
819
804
|
width: "fit",
|
@@ -833,7 +818,7 @@ export const Table: TableComponentProps = ({
|
|
833
818
|
/>
|
834
819
|
</div>
|
835
820
|
{filteredData && filteredData.length !== 0 && (
|
836
|
-
<span className="hidden
|
821
|
+
<span className="hidden lg:block text-sm text-disabled">{`Showing ${
|
837
822
|
(page - 1) * maxRow + 1
|
838
823
|
} to ${
|
839
824
|
page * maxRow > filteredData?.length
|
@@ -848,10 +833,6 @@ export const Table: TableComponentProps = ({
|
|
848
833
|
disabled={page === 1}
|
849
834
|
onClick={() => {
|
850
835
|
setPage(1);
|
851
|
-
paginationRef.current?.scrollTo({
|
852
|
-
left: 0,
|
853
|
-
behavior: "smooth",
|
854
|
-
});
|
855
836
|
}}
|
856
837
|
>
|
857
838
|
<Icon icon="gravity-ui:chevrons-left" />
|
@@ -862,14 +843,13 @@ export const Table: TableComponentProps = ({
|
|
862
843
|
disabled={page === 1}
|
863
844
|
onClick={() => {
|
864
845
|
setPage((prev) => prev - 1);
|
865
|
-
handleOnPreviousClick();
|
866
846
|
}}
|
867
847
|
>
|
868
848
|
<Icon icon="gravity-ui:chevron-left" />
|
869
849
|
</button>
|
870
850
|
<div
|
871
851
|
ref={paginationRef}
|
872
|
-
className="flex gap-2 max-w-20 overflow-auto [&::-webkit-scrollbar]:hidden"
|
852
|
+
className="flex gap-2 max-w-20 xl:max-w-[124px] overflow-auto [&::-webkit-scrollbar]:hidden"
|
873
853
|
>
|
874
854
|
{Array.from({
|
875
855
|
length: Math.ceil(filteredData?.length / maxRow),
|
@@ -896,7 +876,6 @@ export const Table: TableComponentProps = ({
|
|
896
876
|
disabled={filteredData?.length <= page * maxRow}
|
897
877
|
onClick={() => {
|
898
878
|
setPage((prev) => prev + 1);
|
899
|
-
handleOnNextClick();
|
900
879
|
}}
|
901
880
|
>
|
902
881
|
<Icon icon="gravity-ui:chevron-right" />
|
@@ -907,10 +886,6 @@ export const Table: TableComponentProps = ({
|
|
907
886
|
disabled={filteredData?.length <= page * maxRow}
|
908
887
|
onClick={() => {
|
909
888
|
setPage(Math.ceil(filteredData?.length / maxRow));
|
910
|
-
paginationRef.current?.scrollTo({
|
911
|
-
left: paginationRef.current?.scrollWidth,
|
912
|
-
behavior: "smooth",
|
913
|
-
});
|
914
889
|
}}
|
915
890
|
>
|
916
891
|
<Icon icon="gravity-ui:chevrons-right" />
|
@@ -193,7 +193,7 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
193
193
|
createPortal(
|
194
194
|
<div
|
195
195
|
ref={tooltipRef}
|
196
|
-
className={`absolute z-
|
196
|
+
className={`absolute z-10 duration-200 transition-opacity ${
|
197
197
|
visible ? "" : "hidden pointer-events-none"
|
198
198
|
} ${options?.enableHover ? "" : "pointer-events-none"}`}
|
199
199
|
style={getTooltipPosition()}
|