next-helios-fe 1.8.73 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.8.73",
3
+ "version": "1.8.74",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -159,8 +159,8 @@ export const Table: TableComponentProps = ({
159
159
  xlsx.writeFile(workbook, fileName + ".xlsx");
160
160
  };
161
161
 
162
- const handleOnPreviousClick = () => {
163
- if (page - 1 === 1) {
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: "end",
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
@@ -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 md:block text-sm text-disabled">{`Showing ${
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" />