@iyulab/flex-table 0.12.0 → 0.14.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.
- package/dist/export/export.d.ts +4 -3
- package/dist/export/xlsx-writer.d.ts +10 -0
- package/dist/{flex-table-DJvbRtBl.js → flex-table-fp3j2egA.js} +622 -100
- package/dist/flex-table.d.ts +21 -1
- package/dist/flex-table.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/models/types.d.ts +27 -0
- package/dist/react.js +1 -1
- package/dist/renderers/format.d.ts +19 -0
- package/dist/renderers/format.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/flex-table.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export declare class FlexTable extends LitElement {
|
|
|
15
15
|
maxRows: number;
|
|
16
16
|
editable: boolean;
|
|
17
17
|
showFilters: boolean;
|
|
18
|
+
/** Enable built-in context menu on cell right-click. */
|
|
19
|
+
showContextMenu: boolean;
|
|
18
20
|
/** Enable row-level checkbox selection. */
|
|
19
21
|
selectable: boolean;
|
|
20
22
|
/** Row selection mode: 'single' or 'multi' (default: 'multi'). */
|
|
@@ -44,6 +46,9 @@ export declare class FlexTable extends LitElement {
|
|
|
44
46
|
private _sortedIndices;
|
|
45
47
|
private _openFilterKey;
|
|
46
48
|
private _rowSelectionVersion;
|
|
49
|
+
private _autocompleteState;
|
|
50
|
+
private _headerMenu;
|
|
51
|
+
private _bodyContextMenu;
|
|
47
52
|
private _viewDirty;
|
|
48
53
|
private _isDragging;
|
|
49
54
|
private _wasDrag;
|
|
@@ -117,6 +122,13 @@ export declare class FlexTable extends LitElement {
|
|
|
117
122
|
* @param newIndex Target index in the columns array.
|
|
118
123
|
*/
|
|
119
124
|
moveColumn(key: string, newIndex: number): void;
|
|
125
|
+
/** Hide a column by its key. Fires `column-visibility-change` event. */
|
|
126
|
+
hideColumn(key: string): void;
|
|
127
|
+
/** Show a previously hidden column by its key. Fires `column-visibility-change` event. */
|
|
128
|
+
showColumn(key: string): void;
|
|
129
|
+
private _setColumnHidden;
|
|
130
|
+
/** Returns all columns marked as hidden. */
|
|
131
|
+
getHiddenColumns(): ColumnDefinition[];
|
|
120
132
|
/**
|
|
121
133
|
* Add a row at the specified index (default: end).
|
|
122
134
|
* Returns the new row.
|
|
@@ -143,7 +155,7 @@ export declare class FlexTable extends LitElement {
|
|
|
143
155
|
*/
|
|
144
156
|
exportToString(format: ExportFormat, options?: {
|
|
145
157
|
selectionOnly?: boolean;
|
|
146
|
-
}): string;
|
|
158
|
+
}): string | Uint8Array;
|
|
147
159
|
/**
|
|
148
160
|
* Export table data and trigger file download.
|
|
149
161
|
*/
|
|
@@ -187,6 +199,9 @@ export declare class FlexTable extends LitElement {
|
|
|
187
199
|
private _applyEdit;
|
|
188
200
|
private _cancelEdit;
|
|
189
201
|
private _onEditorKeyDown;
|
|
202
|
+
private _getAutocompleteCandidates;
|
|
203
|
+
private _onAutocompleteInput;
|
|
204
|
+
private _selectAutocompleteCandidate;
|
|
190
205
|
private _syncActiveCell;
|
|
191
206
|
private _onKeyDown;
|
|
192
207
|
private _handleCtrlKey;
|
|
@@ -213,6 +228,11 @@ export declare class FlexTable extends LitElement {
|
|
|
213
228
|
/** Calculate cumulative right offset for a right-pinned column */
|
|
214
229
|
private _getPinnedRight;
|
|
215
230
|
private _renderHeaderCell;
|
|
231
|
+
private _onHeaderContextMenu;
|
|
232
|
+
private _showHiddenBefore;
|
|
233
|
+
private _renderHeaderContextMenu;
|
|
234
|
+
private _renderBodyContextMenu;
|
|
235
|
+
private _applySortFromMenu;
|
|
216
236
|
private _adjustFilterDropdown;
|
|
217
237
|
private _onFilterBtnClick;
|
|
218
238
|
private _renderFilterDropdown;
|
package/dist/flex-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./flex-table-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./flex-table-fp3j2egA.js";
|
|
2
2
|
export { i as FlexTable, t as RowSelectionState, r as UndoStack, n as exportData, e as renderCell };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FlexTable } from './flex-table.js';
|
|
2
|
-
export type { ColumnDefinition, ColumnType, DataRow, CellRenderer, CellEditor, CellValidator, SelectionMode, DataMode } from './models/types.js';
|
|
2
|
+
export type { ColumnDefinition, ColumnType, DataRow, CellRenderer, CellEditor, CellValidator, SelectionMode, DataMode, CellStyle, ConditionalRule } from './models/types.js';
|
|
3
3
|
export type { CellPosition, CellRange } from './core/selection.js';
|
|
4
4
|
export type { SortCriteria, SortDirection } from './core/sorting.js';
|
|
5
5
|
export type { ColumnFilter, FilterPredicate, FilterErrorCallback } from './core/filtering.js';
|
package/dist/models/types.d.ts
CHANGED
|
@@ -65,6 +65,33 @@ export interface ColumnDefinition {
|
|
|
65
65
|
validator?: CellValidator;
|
|
66
66
|
/** Allowed values for select columns (strings or label/value pairs) */
|
|
67
67
|
options?: string[] | SelectOption[];
|
|
68
|
+
/**
|
|
69
|
+
* Autocomplete for text editing.
|
|
70
|
+
* - true: show suggestions from existing column values
|
|
71
|
+
* - 'strict': same as true, but rejects values not in the list
|
|
72
|
+
*/
|
|
73
|
+
autocomplete?: boolean | 'strict';
|
|
74
|
+
/**
|
|
75
|
+
* Display format for cell values. Applied during rendering; raw value is preserved.
|
|
76
|
+
* - String: number format pattern (e.g. '#,##0.00', '0.00%', '$#,##0') or date pattern (e.g. 'yyyy-MM-dd')
|
|
77
|
+
* - Function: custom formatter receiving (value, row, col)
|
|
78
|
+
*/
|
|
79
|
+
format?: string | ((value: unknown, row: DataRow, col: ColumnDefinition) => string);
|
|
80
|
+
/** Per-column conditional formatting rules applied during cell rendering */
|
|
81
|
+
conditionalRules?: ConditionalRule[];
|
|
82
|
+
}
|
|
83
|
+
/** Style applied to a cell by a conditional formatting rule */
|
|
84
|
+
export interface CellStyle {
|
|
85
|
+
background?: string;
|
|
86
|
+
color?: string;
|
|
87
|
+
fontWeight?: 'bold' | 'normal';
|
|
88
|
+
fontStyle?: 'italic' | 'normal';
|
|
89
|
+
}
|
|
90
|
+
/** A single conditional formatting rule */
|
|
91
|
+
export interface ConditionalRule {
|
|
92
|
+
/** Returns true when this rule's style should be applied */
|
|
93
|
+
when: (value: unknown, row: DataRow, col: ColumnDefinition) => boolean;
|
|
94
|
+
style: CellStyle;
|
|
68
95
|
}
|
|
69
96
|
/**
|
|
70
97
|
* A single data row — schema-agnostic key-value map.
|
package/dist/react.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cell value formatting: number and date patterns.
|
|
3
|
+
* Patterns follow Excel-like conventions.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Apply a format string or function to a cell value.
|
|
7
|
+
* Returns empty string for null/undefined.
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyFormat(value: unknown, format: string | ((value: unknown) => string)): string;
|
|
10
|
+
/**
|
|
11
|
+
* Parse an Excel-style number format string and apply it.
|
|
12
|
+
* Supported patterns: '#,##0', '#,##0.00', '0.00%', '$#,##0.00', '#,##0.00%'
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatNumberValue(value: unknown, fmt: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Format a Date or ISO string value using a pattern.
|
|
17
|
+
* Tokens: yyyy, yy, MM, dd, HH, hh, mm, ss
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatDateValue(value: unknown, fmt: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|