@starasia/admin 8.20.0 → 8.22.0

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.
@@ -40,6 +40,7 @@ interface MobileFilterBarProps {
40
40
  onApplyView: (view: SavedView) => void;
41
41
  onDeleteView: (id: string) => void;
42
42
  onSaveView: (name: string) => void;
43
+ leadingActions?: React.ReactNode;
43
44
  }
44
45
  /**
45
46
  * Mobile (<768px) variant of FilterBar. Replaces the horizontal toolbar with a
@@ -193,5 +193,12 @@ export interface FilterBarProps {
193
193
  storage?: FilterStorageAdapter;
194
194
  /** Called after a full reset (clears filters + search). */
195
195
  onReset?: () => void;
196
+ /**
197
+ * Custom node rendered at the start of the right-hand cluster — immediately
198
+ * to the LEFT of the pagination cluster (e.g. an Export button or bulk-action).
199
+ * On mobile it renders in the top toolbar's action group (alongside Saved
200
+ * Views / Columns). `undefined` renders nothing.
201
+ */
202
+ leadingActions?: ReactNode;
196
203
  }
197
204
  export {};
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { TableLayoutProps } from './types';
3
3
 
4
- export declare const TableLayout: <T>({ columns, data, getRowKey, rowBg, size, resizable, layout, widthStorageKey, columnState, onColumnStateChange, columnMenu, sort, defaultSort, onSortChange, height, mobileLayout, mobileBreakpoint, groupSeparator, summary, emptyState, loading, loadingRows, rowActions, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, isRowSelectable, }: TableLayoutProps<T>) => React.JSX.Element;
4
+ export declare const TableLayout: <T>({ columns, data, getRowKey, rowBg, size, resizable, layout, widthStorageKey, columnState, onColumnStateChange, columnMenu, sort, defaultSort, onSortChange, height, mobileLayout, mobileBreakpoint, groupSeparator, summary, footer, stickyFooter, emptyState, loading, loadingRows, rowActions, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, isRowSelectable, }: TableLayoutProps<T>) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export { TableLayout } from './TableLayout';
2
2
  export { ColumnMenu } from './ColumnMenu';
3
3
  export { useTableSortApiParams, type UseTableSortApiParamsOptions, type TableSortApiParams } from './hooks/useTableSortApiParams';
4
- export type { TableLayoutProps, TableLayoutColumn, TableLayoutColor, TableLayoutAlign, TableLayoutColumnState, TableLayoutCellProps, TableLayoutSort, TableLayoutSortDirection, TableLayoutRowKey, TableLayoutRowAction } from './types';
4
+ export type { TableLayoutProps, TableLayoutColumn, TableLayoutColor, TableLayoutAlign, TableLayoutColumnState, TableLayoutCellProps, TableLayoutFooterRow, TableLayoutFooterCell, TableLayoutSort, TableLayoutSortDirection, TableLayoutRowKey, TableLayoutRowAction } from './types';
@@ -52,6 +52,21 @@ export interface TableLayoutCellProps {
52
52
  /** kalau true, `<td>` tidak dirender (tertutup span dari sel lain) */
53
53
  hidden?: boolean;
54
54
  }
55
+ /** Satu sel di dalam baris footer (<tfoot>). */
56
+ export interface TableLayoutFooterCell {
57
+ /** Isi sel (string atau node apa pun, mis. <Badge>, total terformat). */
58
+ content: ReactNode;
59
+ /** Gabung kolom secara horizontal. */
60
+ colSpan?: number;
61
+ /** Gabung baris footer secara vertikal. */
62
+ rowSpan?: number;
63
+ /** Perataan teks sel. Default `'left'`. */
64
+ align?: TableLayoutAlign;
65
+ }
66
+ /** Satu baris footer (<tr> di dalam <tfoot>). */
67
+ export interface TableLayoutFooterRow {
68
+ cells: TableLayoutFooterCell[];
69
+ }
55
70
  export interface TableLayoutColumn<T> {
56
71
  /**
57
72
  * Identitas stabil kolom — dipakai untuk hide/show & reorder.
@@ -180,8 +195,9 @@ export interface TableLayoutProps<T> {
180
195
  */
181
196
  onSelectionChange?: (keys: TableLayoutRowKey[], rows: T[]) => void;
182
197
  /**
183
- * Return `false` → baris tidak bisa dipilih: checkbox-nya disabled dan
184
- * dikecualikan dari hitungan/aksi select-all. Default: semua baris bisa.
198
+ * Return `false` → baris tidak bisa dipilih: checkbox-nya TIDAK dirender
199
+ * (sel tetap ada agar kolom align) dan baris dikecualikan dari hitungan/aksi
200
+ * select-all. Default: semua baris bisa.
185
201
  */
186
202
  isRowSelectable?: (row: T, index: number) => boolean;
187
203
  /**
@@ -259,6 +275,22 @@ export interface TableLayoutProps<T> {
259
275
  groupSeparator?: (row: T, index: number, prevRow: T | undefined) => ReactNode | null;
260
276
  /** baris summary/total full-width di paling bawah body */
261
277
  summary?: ReactNode;
278
+ /**
279
+ * Baris-baris <tfoot> terstruktur (mis. subtotal + grand total). Tiap baris
280
+ * berisi sel dengan `colSpan`/`rowSpan` sendiri — komponen yang merender
281
+ * <Tr>/<Td>, jadi konsumer tidak perlu menyentuh markup tabel. Total kolom =
282
+ * jumlah leaf columns (+1 bila `selectable`, +1 bila ada row actions). Lebih
283
+ * kaya dari `summary` (yang hanya 1 sel full-width); keduanya boleh dipakai
284
+ * bersamaan.
285
+ */
286
+ footer?: TableLayoutFooterRow[];
287
+ /**
288
+ * Pin footer ke dasar area scroll (position: sticky; bottom: 0) agar selalu
289
+ * terlihat saat baris di-scroll. Default `false`. Dirancang untuk SATU baris
290
+ * footer — footer multi-baris sebaiknya non-sticky (baris akan menumpuk di
291
+ * bottom: 0). Tidak berlaku di mobile (footer = blok biasa di bawah kartu).
292
+ */
293
+ stickyFooter?: boolean;
262
294
  /**
263
295
  * Tampilan saat `data` kosong.
264
296
  * - `content`: node yang dirender (terpusat secara vertikal & horizontal).