@iyulab/flex-table 0.10.0 → 0.10.1

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,12 @@
1
+ import type { CellRange } from '../core/selection.js';
2
+ import type { ColumnDefinition, DataRow } from '../models/types.js';
3
+ /**
4
+ * Copy selected range to clipboard as TSV.
5
+ */
6
+ export declare function copyToClipboard(data: DataRow[], columns: ColumnDefinition[], range: CellRange): string;
7
+ /**
8
+ * Parse TSV/CSV clipboard text into a 2D array of strings.
9
+ * Handles RFC 4180 quoted fields: double-quote escaping, embedded tabs/newlines.
10
+ */
11
+ export declare function parseClipboardText(text: string): string[][];
12
+ export declare function parseValueForColumn(raw: string, col: ColumnDefinition): unknown;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { CellPosition } from './selection.js';
2
+ export interface EditState {
3
+ position: CellPosition;
4
+ originalValue: unknown;
5
+ }
6
+ /**
7
+ * Manages cell editing state.
8
+ */
9
+ export declare class EditingState {
10
+ current: EditState | null;
11
+ start(position: CellPosition, originalValue: unknown): void;
12
+ isEditing(row: number, col: number): boolean;
13
+ cancel(): EditState | null;
14
+ commit(): EditState | null;
15
+ }
@@ -0,0 +1,28 @@
1
+ import type { DataRow } from '../models/types.js';
2
+ /**
3
+ * Filter predicate function.
4
+ * Receives the cell value and the full row.
5
+ */
6
+ export type FilterPredicate = (value: unknown, row: DataRow) => boolean;
7
+ /**
8
+ * A filter applied to a specific column.
9
+ */
10
+ export interface ColumnFilter {
11
+ /** Column key this filter applies to */
12
+ key: string;
13
+ /** Filter predicate */
14
+ predicate: FilterPredicate;
15
+ }
16
+ /**
17
+ * Callback invoked when a filter predicate throws an error.
18
+ */
19
+ export type FilterErrorCallback = (error: unknown, row: DataRow, filter: ColumnFilter) => void;
20
+ /**
21
+ * Compute filtered indices.
22
+ * Returns data indices that pass ALL filters (AND logic).
23
+ * Original data is never mutated.
24
+ *
25
+ * If a filter predicate throws, the row is included (fail-open)
26
+ * and the optional `onError` callback is invoked.
27
+ */
28
+ export declare function computeFilteredIndices(data: DataRow[], filters: ColumnFilter[], onError?: FilterErrorCallback): number[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { SelectionMode } from '../models/types.js';
2
+ /**
3
+ * Manages row-level selection state (checkbox-based).
4
+ * Separate from cell-level SelectionState.
5
+ */
6
+ export declare class RowSelectionState {
7
+ private _selected;
8
+ private _mode;
9
+ private _rowCount;
10
+ get mode(): SelectionMode;
11
+ set mode(value: SelectionMode);
12
+ setRowCount(count: number): void;
13
+ get selectedIndices(): number[];
14
+ get selectedCount(): number;
15
+ get isAllSelected(): boolean;
16
+ get isSomeSelected(): boolean;
17
+ isSelected(index: number): boolean;
18
+ toggle(index: number): void;
19
+ select(index: number): void;
20
+ deselect(index: number): void;
21
+ selectAll(): void;
22
+ deselectAll(): void;
23
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Represents the active cell position.
3
+ */
4
+ export interface CellPosition {
5
+ row: number;
6
+ col: number;
7
+ }
8
+ /**
9
+ * A rectangular range of cells.
10
+ */
11
+ export interface CellRange {
12
+ startRow: number;
13
+ startCol: number;
14
+ endRow: number;
15
+ endCol: number;
16
+ }
17
+ /**
18
+ * Returns normalized range (start <= end).
19
+ */
20
+ export declare function normalizeRange(range: CellRange): CellRange;
21
+ /**
22
+ * Manages active cell state and range selection.
23
+ */
24
+ export declare class SelectionState {
25
+ activeCell: CellPosition | null;
26
+ /** Anchor cell for range selection (Shift+Arrow/Click) */
27
+ rangeAnchor: CellPosition | null;
28
+ /** Current range end (the active cell is the range end during Shift selection) */
29
+ range: CellRange | null;
30
+ private _rowCount;
31
+ private _colCount;
32
+ setDimensions(rowCount: number, colCount: number): void;
33
+ setActive(row: number, col: number): CellPosition | null;
34
+ /** Set active cell and extend range from anchor */
35
+ setActiveWithRange(row: number, col: number): CellPosition | null;
36
+ /** Check if a cell is within the current selection range */
37
+ isInRange(row: number, col: number): boolean;
38
+ /** Get the effective range: either the explicit range or just the active cell */
39
+ getEffectiveRange(): CellRange | null;
40
+ clear(): void;
41
+ moveUp(): CellPosition | null;
42
+ moveDown(): CellPosition | null;
43
+ moveLeft(): CellPosition | null;
44
+ moveRight(): CellPosition | null;
45
+ moveNext(): CellPosition | null;
46
+ movePrev(): CellPosition | null;
47
+ moveToStart(): CellPosition | null;
48
+ moveToEnd(): CellPosition | null;
49
+ moveToRowStart(): CellPosition | null;
50
+ moveToRowEnd(): CellPosition | null;
51
+ shiftMoveUp(): CellPosition | null;
52
+ shiftMoveDown(): CellPosition | null;
53
+ shiftMoveLeft(): CellPosition | null;
54
+ shiftMoveRight(): CellPosition | null;
55
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { ColumnDefinition, DataRow } from '../models/types.js';
2
+ /**
3
+ * Sort direction.
4
+ */
5
+ export type SortDirection = 'asc' | 'desc';
6
+ /**
7
+ * A single sort criterion.
8
+ */
9
+ export interface SortCriteria {
10
+ /** Column key to sort by */
11
+ key: string;
12
+ /** Sort direction */
13
+ direction: SortDirection;
14
+ }
15
+ /**
16
+ * Compute sorted index mapping.
17
+ * Returns an array where result[visualIndex] = dataIndex.
18
+ * Original data is never mutated.
19
+ */
20
+ export declare function computeSortedIndices(data: DataRow[], criteria: SortCriteria[], columns: ColumnDefinition[]): number[];
21
+ /**
22
+ * Toggle sort for a column key in the criteria array.
23
+ * Cycle: none → asc → desc → none.
24
+ * If multi is true (Shift+click), add as secondary sort.
25
+ * If multi is false, replace all criteria with this column.
26
+ */
27
+ export declare function toggleSort(criteria: SortCriteria[], key: string, multi: boolean): SortCriteria[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A single undoable action.
3
+ */
4
+ export interface UndoAction {
5
+ /** Human-readable label for debugging */
6
+ label: string;
7
+ /** Revert the action */
8
+ undo: () => void;
9
+ /** Re-apply the action */
10
+ redo: () => void;
11
+ }
12
+ /**
13
+ * Manages undo/redo history.
14
+ */
15
+ export declare class UndoStack {
16
+ private _undoStack;
17
+ private _redoStack;
18
+ private _maxSize;
19
+ /** Get/set the maximum number of undo actions stored. */
20
+ get maxSize(): number;
21
+ set maxSize(value: number);
22
+ get canUndo(): boolean;
23
+ get canRedo(): boolean;
24
+ get undoCount(): number;
25
+ get redoCount(): number;
26
+ /**
27
+ * Push a new action onto the undo stack.
28
+ * Clears the redo stack (new action invalidates redo history).
29
+ */
30
+ push(action: UndoAction): void;
31
+ /**
32
+ * Undo the most recent action.
33
+ * Returns the action label, or null if nothing to undo.
34
+ */
35
+ undo(): string | null;
36
+ /**
37
+ * Redo the most recently undone action.
38
+ * Returns the action label, or null if nothing to redo.
39
+ */
40
+ redo(): string | null;
41
+ /**
42
+ * Clear all undo/redo history.
43
+ */
44
+ clear(): void;
45
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ColumnDefinition, DataRow } from '../models/types.js';
2
+ export type ExportFormat = 'csv' | 'tsv' | 'json';
3
+ /**
4
+ * Export data to the specified format.
5
+ */
6
+ export declare function exportData(data: DataRow[], columns: ColumnDefinition[], format: ExportFormat): string;
7
+ /**
8
+ * Trigger a file download in the browser.
9
+ */
10
+ export declare function downloadFile(content: string, filename: string, mimeType: string): void;
11
+ export declare function getExportMimeType(format: ExportFormat): string;
12
+ export declare function getExportExtension(format: ExportFormat): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,237 @@
1
+ import { LitElement } from 'lit';
2
+ import type { ExportFormat } from './export/export.js';
3
+ import type { CellPosition } from './core/selection.js';
4
+ import type { SortCriteria } from './core/sorting.js';
5
+ import type { FilterPredicate } from './core/filtering.js';
6
+ import type { ColumnDefinition, DataRow, SelectionMode, DataMode } from './models/types.js';
7
+ import type { TemplateResult } from 'lit';
8
+ export declare class FlexTable extends LitElement {
9
+ static styles: import("lit").CSSResult;
10
+ columns: ColumnDefinition[];
11
+ data: DataRow[];
12
+ rowHeight: number;
13
+ showRowNumbers: boolean;
14
+ theme: 'light' | 'dark' | undefined;
15
+ maxRows: number;
16
+ editable: boolean;
17
+ showFilters: boolean;
18
+ /** Enable row-level checkbox selection. */
19
+ selectable: boolean;
20
+ /** Row selection mode: 'single' or 'multi' (default: 'multi'). */
21
+ set selectionMode(value: SelectionMode);
22
+ get selectionMode(): SelectionMode;
23
+ /** Data processing mode: 'client' (default) or 'server'. */
24
+ dataMode: DataMode;
25
+ /** Footer/summary row data. Keys match column keys; values are display strings. */
26
+ footerData: Record<string, string | TemplateResult> | null;
27
+ set maxUndoSize(value: number);
28
+ get maxUndoSize(): number;
29
+ private _scrollTop;
30
+ private _scrollLeft;
31
+ private _viewportHeight;
32
+ private _viewportWidth;
33
+ private _colLeftOffsets;
34
+ private _totalRowWidth;
35
+ private _activeCell;
36
+ private _editingCell;
37
+ private _sortCriteria;
38
+ private _selection;
39
+ private _editing;
40
+ private _rowSelection;
41
+ private _undo;
42
+ private _filters;
43
+ private _filteredIndices;
44
+ private _sortedIndices;
45
+ private _openFilterKey;
46
+ private _rowSelectionVersion;
47
+ private _viewDirty;
48
+ private _resizing;
49
+ private _resizeCleanup;
50
+ private _columnWidths;
51
+ get visibleColumns(): ColumnDefinition[];
52
+ private get _prefixWidth();
53
+ /** Whether an undo operation is available. */
54
+ get canUndo(): boolean;
55
+ /** Whether a redo operation is available. */
56
+ get canRedo(): boolean;
57
+ get activeCell(): CellPosition | null;
58
+ get editingCell(): CellPosition | null;
59
+ get sortCriteria(): SortCriteria[];
60
+ /** Number of rows after filtering (before pagination). */
61
+ get filteredRowCount(): number;
62
+ /** Get data indices of currently selected rows. */
63
+ getSelectedRows(): {
64
+ selectedIndices: number[];
65
+ selectedRows: DataRow[];
66
+ };
67
+ /** Select all visible rows (multi mode only). */
68
+ selectAll(): void;
69
+ /** Deselect all rows. */
70
+ deselectAll(): void;
71
+ private _dispatchRowSelectionEvent;
72
+ /**
73
+ * Set a filter for a column. Replaces any existing filter on the same key.
74
+ */
75
+ setFilter(key: string, predicate: FilterPredicate): void;
76
+ /**
77
+ * Remove the filter for a column.
78
+ */
79
+ removeFilter(key: string): void;
80
+ /**
81
+ * Remove all filters.
82
+ */
83
+ clearFilters(): void;
84
+ /**
85
+ * Get current active filter keys.
86
+ */
87
+ get filterKeys(): string[];
88
+ /**
89
+ * Explicitly request a re-render after external data mutations.
90
+ * Useful when `data` array contents are mutated in-place without reassignment.
91
+ */
92
+ refreshData(): void;
93
+ private _dispatchUndoStateEvent;
94
+ private _dispatchFilterEvent;
95
+ /**
96
+ * Add a column at the specified index (default: end).
97
+ * Returns the added column definition.
98
+ */
99
+ addColumn(def: ColumnDefinition, index?: number): ColumnDefinition;
100
+ /**
101
+ * Delete a column by its key.
102
+ * Removes related filters, sort criteria, and column width overrides.
103
+ */
104
+ deleteColumn(key: string): void;
105
+ /**
106
+ * Move a column to a new position.
107
+ * @param key Column key to move.
108
+ * @param newIndex Target index in the columns array.
109
+ */
110
+ moveColumn(key: string, newIndex: number): void;
111
+ /**
112
+ * Add a row at the specified index (default: end).
113
+ * Returns the new row.
114
+ */
115
+ addRow(row?: DataRow, index?: number): DataRow | null;
116
+ /**
117
+ * Delete rows at the specified data indices.
118
+ * If no indices provided, deletes the currently selected rows.
119
+ */
120
+ deleteRows(indices?: number[]): void;
121
+ /**
122
+ * Apply multiple cell changes as a single undo-able operation.
123
+ * @param changes Array of { row (data index), key, value } objects.
124
+ */
125
+ updateRows(changes: Array<{
126
+ row: number;
127
+ key: string;
128
+ value: unknown;
129
+ }>): void;
130
+ private _createEmptyRow;
131
+ /**
132
+ * Export table data to string in the specified format.
133
+ * @param options.selectionOnly - Export only the currently selected range
134
+ */
135
+ exportToString(format: ExportFormat, options?: {
136
+ selectionOnly?: boolean;
137
+ }): string;
138
+ /**
139
+ * Export table data and trigger file download.
140
+ */
141
+ exportToFile(format: ExportFormat, filename?: string): void;
142
+ private _getSelectedDataRows;
143
+ /**
144
+ * Get the effective width for a column, checking internal overrides first.
145
+ */
146
+ getColumnWidth(key: string): number | undefined;
147
+ private _getColWidth;
148
+ private get headerHeight();
149
+ /** Number of rows visible after filter + sort. */
150
+ private get _visibleRowCount();
151
+ private get totalBodyHeight();
152
+ private get visibleRange();
153
+ connectedCallback(): void;
154
+ disconnectedCallback(): void;
155
+ protected firstUpdated(): void;
156
+ private _updateColOffsets;
157
+ private get visibleColRange();
158
+ protected willUpdate(changedProperties: Map<string, unknown>): void;
159
+ protected updated(): void;
160
+ /** Recompute filter → sort pipeline. */
161
+ private _recomputeView;
162
+ /** Map visual row index to data row index */
163
+ private _toDataIndex;
164
+ private _focusEditor;
165
+ private _measureViewport;
166
+ private _onScroll;
167
+ private _onDocumentClick;
168
+ private _onContextMenu;
169
+ private _onCellClickEvent;
170
+ private _onRowNumberClick;
171
+ private _onCellDblClick;
172
+ /** Check if a column is editable based on global + per-column settings */
173
+ private _isCellEditable;
174
+ private _startEdit;
175
+ private _commitEdit;
176
+ private _applyEdit;
177
+ private _cancelEdit;
178
+ private _onEditorKeyDown;
179
+ private _syncActiveCell;
180
+ private _onKeyDown;
181
+ private _handleCtrlKey;
182
+ private _handleAltKey;
183
+ private _handleNavigation;
184
+ private _handleCopy;
185
+ private _handlePaste;
186
+ private _readClipboardText;
187
+ private _expandRowsForPaste;
188
+ private _applyPasteData;
189
+ private _handleDelete;
190
+ private _clearRange;
191
+ private _scrollToActiveCell;
192
+ private _dispatchSelectionEvent;
193
+ private _onHeaderClick;
194
+ private _selectColumn;
195
+ /** Public API: select an entire column by index. */
196
+ selectColumn(colIndex: number): void;
197
+ /** Calculate cumulative left offset for a left-pinned column */
198
+ private _getPinnedLeft;
199
+ /** Calculate cumulative right offset for a right-pinned column */
200
+ private _getPinnedRight;
201
+ private _renderHeaderCell;
202
+ private _adjustFilterDropdown;
203
+ private _onFilterBtnClick;
204
+ private _renderFilterDropdown;
205
+ private _renderTextFilter;
206
+ private _renderNumberFilter;
207
+ private _invalidCells;
208
+ private _cellKey;
209
+ private _markCellInvalid;
210
+ private _isCellInvalid;
211
+ private _textFilterState;
212
+ private _numberFilterState;
213
+ private _dateFilterState;
214
+ private _applyNumberFilter;
215
+ private _renderDateFilter;
216
+ private _applyDateFilter;
217
+ private _renderBooleanFilter;
218
+ private _clearColumnFilter;
219
+ private _onResizeAutoFit;
220
+ private _onResizeStart;
221
+ render(): TemplateResult<1>;
222
+ private _onSelectAllChange;
223
+ private _onRowCheckboxChange;
224
+ private _renderFooter;
225
+ private _renderRow;
226
+ private _renderCell;
227
+ private _renderEditor;
228
+ /** Convert value to YYYY-MM-DD for date input (local timezone) */
229
+ private _toDateInputValue;
230
+ /** Convert value to YYYY-MM-DDTHH:mm for datetime-local input (local timezone) */
231
+ private _toDateTimeInputValue;
232
+ }
233
+ declare global {
234
+ interface HTMLElementTagNameMap {
235
+ 'flex-table': FlexTable;
236
+ }
237
+ }
@@ -0,0 +1 @@
1
+ import './flex-table.js';
@@ -0,0 +1,11 @@
1
+ export { FlexTable } from './flex-table.js';
2
+ export type { ColumnDefinition, ColumnType, DataRow, CellRenderer, CellEditor, CellValidator, SelectionMode, DataMode } from './models/types.js';
3
+ export type { CellPosition, CellRange } from './core/selection.js';
4
+ export type { SortCriteria, SortDirection } from './core/sorting.js';
5
+ export type { ColumnFilter, FilterPredicate, FilterErrorCallback } from './core/filtering.js';
6
+ export { RowSelectionState } from './core/row-selection.js';
7
+ export { UndoStack } from './core/undo.js';
8
+ export type { UndoAction } from './core/undo.js';
9
+ export type { ExportFormat } from './export/export.js';
10
+ export { exportData } from './export/export.js';
11
+ export { renderCell } from './renderers/cell-renderer.js';
@@ -0,0 +1,65 @@
1
+ import type { TemplateResult } from 'lit';
2
+ /**
3
+ * Built-in column data types for rendering and editing.
4
+ * Any string is accepted as a type — unknown types fall back to 'text' behavior.
5
+ */
6
+ export type ColumnType = 'text' | 'number' | 'boolean' | 'date' | 'datetime' | (string & {});
7
+ /**
8
+ * Custom cell renderer function.
9
+ * Receives the cell value, the full row data, and the column definition.
10
+ * Returns either a Lit TemplateResult or a plain string.
11
+ */
12
+ export type CellRenderer = (value: unknown, row: DataRow, col: ColumnDefinition) => TemplateResult | string;
13
+ /**
14
+ * Custom cell editor function.
15
+ * Receives the cell value, the full row data, and the column definition.
16
+ * Should return a Lit TemplateResult containing an input element with class "ft-editor".
17
+ */
18
+ export type CellEditor = (value: unknown, row: DataRow, col: ColumnDefinition) => TemplateResult;
19
+ /**
20
+ * Cell validator function. Returns null/undefined if valid, or an error message string.
21
+ */
22
+ export type CellValidator = (value: unknown, row: DataRow, col: ColumnDefinition) => string | null | undefined;
23
+ /**
24
+ * Row selection mode.
25
+ */
26
+ export type SelectionMode = 'single' | 'multi';
27
+ /**
28
+ * Data processing mode.
29
+ * - 'client': flex-table performs sorting/filtering locally (default).
30
+ * - 'server': flex-table only dispatches events; consumer provides pre-sorted/filtered data.
31
+ */
32
+ export type DataMode = 'client' | 'server';
33
+ /**
34
+ * Definition of a single column in the table.
35
+ */
36
+ export interface ColumnDefinition {
37
+ /** Unique key matching data property names */
38
+ key: string;
39
+ /** Display header text */
40
+ header: string;
41
+ /** Data type for rendering/editing (default: 'text'). Unknown types fall back to 'text'. */
42
+ type?: ColumnType;
43
+ /** Column width in pixels (default: auto) */
44
+ width?: number;
45
+ /** Minimum column width in pixels (default: 40) */
46
+ minWidth?: number;
47
+ /** Whether the column is hidden */
48
+ hidden?: boolean;
49
+ /** Whether the column is sortable (default: true) */
50
+ sortable?: boolean;
51
+ /** Custom cell renderer — overrides built-in type rendering */
52
+ renderer?: CellRenderer;
53
+ /** Whether the column is editable (default: true — follows global editable setting) */
54
+ editable?: boolean;
55
+ /** Custom cell editor — overrides built-in type editing */
56
+ editor?: CellEditor;
57
+ /** Pin the column to one side during horizontal scroll */
58
+ pinned?: 'left' | 'right';
59
+ /** Cell validator — called before committing edits */
60
+ validator?: CellValidator;
61
+ }
62
+ /**
63
+ * A single data row — schema-agnostic key-value map.
64
+ */
65
+ export type DataRow = Record<string, unknown>;
@@ -0,0 +1,2 @@
1
+ export { useODataSource } from './use-odata-source.js';
2
+ export type { UseODataSourceOptions, UseODataSourceResult } from './types.js';
@@ -0,0 +1,19 @@
1
+ import type { SortCriteria } from '../core/sorting.js';
2
+ export interface UseODataSourceOptions {
3
+ pageSize?: number;
4
+ defaultOrderBy?: string;
5
+ fixedFilter?: Record<string, unknown>;
6
+ }
7
+ export interface UseODataSourceResult<T> {
8
+ data: T[];
9
+ totalCount: number;
10
+ loading: boolean;
11
+ error: string | null;
12
+ page: number;
13
+ setPage: (page: number) => void;
14
+ sortCriteria: SortCriteria[];
15
+ onSortChange: (e: CustomEvent) => void;
16
+ setSearch: (term: string) => void;
17
+ search: string;
18
+ refresh: () => void;
19
+ }
@@ -0,0 +1,6 @@
1
+ import type { UseODataSourceOptions, UseODataSourceResult } from './types.js';
2
+ /**
3
+ * OData v4 서버 사이드 데이터소스 React 훅.
4
+ * flex-table의 dataMode="server"와 함께 사용한다.
5
+ */
6
+ export declare function useODataSource<T = Record<string, unknown>>(url: string, options?: UseODataSourceOptions): UseODataSourceResult<T>;
@@ -0,0 +1,29 @@
1
+ import { type EventName } from '@lit/react';
2
+ import { FlexTable } from './flex-table.js';
3
+ export declare const FlexTableReact: import("@lit/react").ReactWebComponent<FlexTable, {
4
+ onCellSelect: EventName<CustomEvent>;
5
+ onCellEditCommit: EventName<CustomEvent>;
6
+ onCellEditCancel: EventName<CustomEvent>;
7
+ onCellEditStart: EventName<CustomEvent>;
8
+ onSortChange: EventName<CustomEvent>;
9
+ onFilterChange: EventName<CustomEvent>;
10
+ onRowAdd: EventName<CustomEvent>;
11
+ onRowDelete: EventName<CustomEvent>;
12
+ onColumnResize: EventName<CustomEvent>;
13
+ onColumnSelect: EventName<CustomEvent>;
14
+ onColumnAdd: EventName<CustomEvent>;
15
+ onColumnDelete: EventName<CustomEvent>;
16
+ onColumnReorder: EventName<CustomEvent>;
17
+ onSelectionChange: EventName<CustomEvent>;
18
+ onClipboardCopy: EventName<CustomEvent>;
19
+ onClipboardCut: EventName<CustomEvent>;
20
+ onClipboardPaste: EventName<CustomEvent>;
21
+ onClipboardError: EventName<CustomEvent>;
22
+ onUndoStateChange: EventName<CustomEvent>;
23
+ onValidationError: EventName<CustomEvent>;
24
+ onBatchUpdate: EventName<CustomEvent>;
25
+ onContextMenu: EventName<CustomEvent>;
26
+ onFilterError: EventName<CustomEvent>;
27
+ }>;
28
+ export type { FlexTable };
29
+ export type { ColumnDefinition, DataRow, ColumnType, CellRenderer, CellEditor, CellValidator, SelectionMode, DataMode } from './models/types.js';
@@ -0,0 +1,5 @@
1
+ import type { ColumnDefinition, DataRow } from '../models/types.js';
2
+ /**
3
+ * Render a cell value using the column's custom renderer or built-in type rendering.
4
+ */
5
+ export declare function renderCell(value: unknown, row: DataRow, col: ColumnDefinition): unknown;
@@ -0,0 +1 @@
1
+ export declare const flexTableStyles: import("lit").CSSResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/flex-table",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "A minimalist, input-centric data grid web component",
5
5
  "type": "module",
6
6
  "main": "./dist/flex-table.js",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "dev": "vite serve demo",
28
- "build": "tsc && vite build",
28
+ "build": "vite build && tsc --emitDeclarationOnly",
29
29
  "build:demo": "vite build --config vite.config.demo.ts",
30
30
  "typecheck": "tsc --noEmit",
31
31
  "test": "vitest run",