@starasia/admin 14.11.0 → 14.12.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.
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface HighlightProps {
4
+ /** Teks yang dirender; substring yang cocok dengan `query` di-`<mark>`. */
5
+ text: string;
6
+ /** Kata kunci — bisa multi-kata (dipisah spasi) untuk global search. Kosong → teks polos. */
7
+ query?: string;
8
+ /** Override style `<mark>` (default: bg warning-subtlest, warna teks inherit). */
9
+ markStyle?: React.CSSProperties;
10
+ }
11
+ /**
12
+ * Menyorot (highlight) substring yang cocok dengan `query` di dalam `text`.
13
+ * Pakai `<mark>` **inline** → aman berdampingan dengan ellipsis cell (beda dari
14
+ * membungkus `<Text>` yang block). Case-insensitive; mendukung beberapa kata
15
+ * (dipisah spasi) untuk global search.
16
+ *
17
+ * Dipakai manual di `render` kolom, atau otomatis via prop `highlight` di
18
+ * `<TableLayout>` (menyorot string-cell kolom yang key-nya ada di map itu).
19
+ *
20
+ * ```tsx
21
+ * <Highlight text={row.description} query={filter.getRaw('description') ?? ''} />
22
+ * ```
23
+ */
24
+ export declare const Highlight: ({ text, query, markStyle }: HighlightProps) => React.JSX.Element;
@@ -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, footer, stickyFooter, 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, highlight, sort, defaultSort, onSortChange, height, mobileLayout, mobileBreakpoint, groupSeparator, summary, footer, stickyFooter, emptyState, loading, loadingRows, rowActions, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, isRowSelectable, }: TableLayoutProps<T>) => React.JSX.Element;
@@ -262,6 +262,15 @@ export interface TableLayoutProps<T> {
262
262
  * Muncul saat hover / saat salah satu item aktif.
263
263
  */
264
264
  columnMenu?: boolean;
265
+ /**
266
+ * Sorot (highlight) hasil pencarian: map `{ [columnKey]: query }`. Untuk kolom
267
+ * yang key-nya ada di map & sel-nya berupa **string accessor** (bukan custom
268
+ * `render`), substring yang cocok dibungkus `<mark>` inline (ellipsis tetap
269
+ * jalan). Query kosong = tak menyorot. Isi dari filter `text` per-kolom
270
+ * (`controls.getRaw(key)`) dan/atau global search (`params.search`). Untuk sel
271
+ * `render`, sorot manual via komponen `<Highlight>`.
272
+ */
273
+ highlight?: Record<string, string>;
265
274
  /**
266
275
  * Sort aktif (controlled). Kalau `onSortChange` diisi → mode server (TableLayout
267
276
  * tidak mengurutkan data sendiri, hanya emit). Tanpa `onSortChange` → client-side.
@@ -33,3 +33,4 @@ export * from './LayoutDialog';
33
33
  export * from './ImagePreview';
34
34
  export * from './SelectionActionBar';
35
35
  export * from './EntityCard';
36
+ export * from './Highlight';