@izumisy-tailor/tailor-data-viewer 0.1.14 → 0.1.16

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@izumisy-tailor/tailor-data-viewer",
3
3
  "private": false,
4
- "version": "0.1.14",
4
+ "version": "0.1.16",
5
5
  "type": "module",
6
6
  "description": "Flexible data viewer component for Tailor Platform",
7
7
  "files": [
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@tailor-platform/app-shell": ">=0.20.0",
54
- "@tailor-platform/sdk": "^1.6.0",
54
+ "@tailor-platform/sdk": ">=1.4.0",
55
55
  "react": "^18.0.0 || ^19.0.0",
56
56
  "react-dom": "^18.0.0 || ^19.0.0"
57
57
  },
@@ -129,9 +129,6 @@ export function DataViewTabContent({
129
129
  [tableData],
130
130
  );
131
131
 
132
- // Track cursor history for previous page navigation
133
- const [cursorHistory] = useState<string[]>([]);
134
-
135
132
  // CSV Download handler
136
133
  const handleDownloadCsv = useCallback(() => {
137
134
  if (!selectedTable || tableData.data.length === 0) return;
@@ -189,8 +186,6 @@ export function DataViewTabContent({
189
186
  [onTableConfirm],
190
187
  );
191
188
 
192
- const hasPreviousPage = cursorHistory.length > 0;
193
-
194
189
  // Show table selector centered if table is not locked yet
195
190
  if (!isTableLocked) {
196
191
  return (
@@ -317,7 +312,7 @@ export function DataViewTabContent({
317
312
  currentCount={tableData.data.length}
318
313
  onNext={tableData.nextPage}
319
314
  onPrevious={tableData.previousPage}
320
- hasPreviousPage={hasPreviousPage}
315
+ hasPreviousPage={tableData.hasPreviousPage}
321
316
  />
322
317
  </div>
323
318
  );
@@ -33,6 +33,7 @@ export interface TableDataState {
33
33
  error: Error | null;
34
34
  sortState: SortState | null;
35
35
  pagination: PaginationState;
36
+ hasPreviousPage: boolean;
36
37
  refetch: () => Promise<void>;
37
38
  setSort: (field: string, direction?: "Asc" | "Desc") => void;
38
39
  nextPage: () => void;
@@ -325,6 +326,7 @@ export function useTableData(
325
326
  error,
326
327
  sortState,
327
328
  pagination,
329
+ hasPreviousPage: cursorHistory.length > 0 || pagination.after !== null,
328
330
  refetch: fetchData,
329
331
  setSort,
330
332
  nextPage,