simple-table-core 3.0.0-beta.14 → 3.0.0-beta.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.
@@ -1,5 +1,7 @@
1
1
  import { SimpleTableConfig } from "../../types/SimpleTableConfig";
2
2
  import { CustomTheme } from "../../types/CustomTheme";
3
+ import { ColumnEditorRowRenderer } from "../../types/ColumnEditorRowRendererProps";
4
+ import { ColumnEditorCustomRenderer } from "../../types/ColumnEditorCustomRendererProps";
3
5
  import HeaderObject, { Accessor } from "../../types/HeaderObject";
4
6
  export interface ResolvedIcons {
5
7
  drag: string | HTMLElement | SVGSVGElement;
@@ -18,7 +20,8 @@ export interface MergedColumnEditorConfig {
18
20
  searchPlaceholder: string;
19
21
  allowColumnPinning: boolean;
20
22
  searchFunction?: (header: HeaderObject, searchText: string) => boolean;
21
- rowRenderer?: any;
23
+ rowRenderer?: ColumnEditorRowRenderer;
24
+ customRenderer?: ColumnEditorCustomRenderer;
22
25
  }
23
26
  export declare class TableInitializer {
24
27
  static resolveIcons(config: SimpleTableConfig): ResolvedIcons;
@@ -31,6 +31,7 @@ import type HeaderRendererProps from "./types/HeaderRendererProps";
31
31
  import type { HeaderRenderer, HeaderRendererComponents } from "./types/HeaderRendererProps";
32
32
  import type ColumnEditorRowRendererProps from "./types/ColumnEditorRowRendererProps";
33
33
  import type { ColumnEditorRowRenderer, ColumnEditorRowRendererComponents } from "./types/ColumnEditorRowRendererProps";
34
+ import type { ColumnEditorCustomRendererProps, ColumnEditorCustomRenderer } from "./types/ColumnEditorCustomRendererProps";
34
35
  import type HeaderDropdownProps from "./types/HeaderDropdownProps";
35
36
  import type { HeaderDropdown } from "./types/HeaderDropdownProps";
36
37
  import type { RowButtonProps } from "./types/RowButton";
@@ -45,4 +46,4 @@ import type { SimpleTableProps } from "./types/SimpleTableProps";
45
46
  import type { RowId } from "./types/RowId";
46
47
  import type { PinnedSectionsState } from "./types/PinnedSectionsState";
47
48
  export { SimpleTableVanilla };
48
- export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, CustomThemeProps, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowId, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SimpleTableConfig, SimpleTableProps, SortColumn, TableAPI, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, PinnedSectionsState, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
49
+ export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, CustomThemeProps, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowId, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SimpleTableConfig, SimpleTableProps, SortColumn, TableAPI, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, PinnedSectionsState, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
@@ -1,5 +1,6 @@
1
1
  import HeaderObject from "./HeaderObject";
2
2
  import { ColumnEditorRowRenderer } from "./ColumnEditorRowRendererProps";
3
+ import { ColumnEditorCustomRenderer } from "./ColumnEditorCustomRendererProps";
3
4
  /**
4
5
  * Custom search function for filtering columns in the column editor
5
6
  * @param header - The header object to check
@@ -26,7 +27,9 @@ export interface ColumnEditorConfig {
26
27
  allowColumnPinning?: boolean;
27
28
  /** Custom renderer for column editor row layout to reposition icons and labels */
28
29
  rowRenderer?: ColumnEditorRowRenderer;
30
+ /** Custom renderer for the entire column editor panel. Receives pre-built sections (search, list, reset) and headers. */
31
+ customRenderer?: ColumnEditorCustomRenderer;
29
32
  }
30
- export declare const DEFAULT_COLUMN_EDITOR_CONFIG: Required<Omit<ColumnEditorConfig, "searchFunction" | "rowRenderer">>;
33
+ export declare const DEFAULT_COLUMN_EDITOR_CONFIG: Required<Omit<ColumnEditorConfig, "searchFunction" | "rowRenderer" | "customRenderer">>;
31
34
  /** Column editor config with defaults applied (text, searchEnabled, searchPlaceholder are required) */
32
- export type MergedColumnEditorConfig = Required<Pick<ColumnEditorConfig, "text" | "searchEnabled" | "searchPlaceholder" | "allowColumnPinning">> & Pick<ColumnEditorConfig, "searchFunction" | "rowRenderer">;
35
+ export type MergedColumnEditorConfig = Required<Pick<ColumnEditorConfig, "text" | "searchEnabled" | "searchPlaceholder" | "allowColumnPinning">> & Pick<ColumnEditorConfig, "searchFunction" | "rowRenderer" | "customRenderer">;
@@ -0,0 +1,14 @@
1
+ import type HeaderObject from "./HeaderObject";
2
+ export interface ColumnEditorCustomRendererProps {
3
+ /** The current headers array */
4
+ headers: HeaderObject[];
5
+ /** Pre-built search input section, or null if search is disabled */
6
+ searchSection: HTMLElement | null;
7
+ /** Pre-built column list section with drag-and-drop, checkboxes, etc. */
8
+ listSection: HTMLElement;
9
+ /** Pre-built reset button section, or null if no default headers are configured */
10
+ resetSection: HTMLElement | null;
11
+ /** Function to reset columns to their default configuration */
12
+ resetColumns?: () => void;
13
+ }
14
+ export type ColumnEditorCustomRenderer = (props: ColumnEditorCustomRendererProps) => HTMLElement | string | null;