next-helios-fe 1.8.85 → 1.8.86

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.85",
3
+ "version": "1.8.86",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -158,14 +158,6 @@ export const Table: TableComponentProps = ({
158
158
  });
159
159
  }, [data]);
160
160
 
161
- const handleExportData = (dataTitle: string, data: any[]) => {
162
- const fileName = `${dataTitle}_${dayjs().format("YYYY-MM-DD_HH-mm-ss")}`;
163
- const worksheet = xlsx.utils.json_to_sheet(data);
164
- const workbook = xlsx.utils.book_new();
165
- xlsx.utils.book_append_sheet(workbook, worksheet, "Data");
166
- xlsx.writeFile(workbook, fileName + ".xlsx");
167
- };
168
-
169
161
  useEffect(() => {
170
162
  if (page === 1) {
171
163
  paginationRef.current?.scrollTo({
@@ -173,14 +165,28 @@ export const Table: TableComponentProps = ({
173
165
  behavior: "smooth",
174
166
  });
175
167
  } else {
176
- document.getElementById(`pagination-page-${page - 1}`)?.scrollIntoView({
168
+ paginationRef.current?.scrollTo({
169
+ left: Array.from({ length: page - 2 })
170
+ .map((_, index) => {
171
+ return (
172
+ (document.getElementById(`pagination-page-${index}`)
173
+ ?.offsetWidth || 0) + 8
174
+ );
175
+ })
176
+ .reduce((acc, cur) => acc + cur, 0),
177
177
  behavior: "smooth",
178
- block: "nearest",
179
- inline: "center",
180
178
  });
181
179
  }
182
180
  }, [page]);
183
181
 
182
+ const handleExportData = (dataTitle: string, data: any[]) => {
183
+ const fileName = `${dataTitle}_${dayjs().format("YYYY-MM-DD_HH-mm-ss")}`;
184
+ const worksheet = xlsx.utils.json_to_sheet(data);
185
+ const workbook = xlsx.utils.book_new();
186
+ xlsx.utils.book_append_sheet(workbook, worksheet, "Data");
187
+ xlsx.writeFile(workbook, fileName + ".xlsx");
188
+ };
189
+
184
190
  const filteredData = useMemo(() => {
185
191
  const tempData = data
186
192
  ?.filter((item) => {
@@ -921,7 +927,7 @@ export const Table: TableComponentProps = ({
921
927
  key={index}
922
928
  id={`pagination-page-${index}`}
923
929
  type="button"
924
- className="flex h-9 min-w-9 select-none items-center justify-center rounded-md border hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
930
+ className="flex items-center justify-center h-9 min-w-9 px-4 border rounded-md select-none hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
925
931
  disabled={page === index + 1}
926
932
  onClick={() => {
927
933
  setPage(index + 1);