@alaarab/ogrid-vue 2.4.2 → 2.5.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/esm/index.js +1 -5100
- package/dist/esm/styles/ogrid-layout.css +48 -0
- package/dist/types/components/FormulaRefOverlay.d.ts +1 -1
- package/dist/types/composables/useCellSelection.d.ts +1 -1
- package/dist/types/composables/useColumnReorder.d.ts +2 -2
- package/dist/types/composables/useColumnResize.d.ts +2 -2
- package/dist/types/composables/useDataGridState.d.ts +2 -2
- package/dist/types/composables/useFillHandle.d.ts +1 -1
- package/dist/types/composables/useFormulaBar.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/types/dataGridTypes.d.ts +11 -2
- package/dist/types/utils/dataGridViewModel.d.ts +2 -2
- package/package.json +2 -2
|
@@ -310,9 +310,21 @@
|
|
|
310
310
|
border-radius: 1px;
|
|
311
311
|
cursor: crosshair;
|
|
312
312
|
pointer-events: auto;
|
|
313
|
+
touch-action: none; /* Prevent browser scroll/zoom during fill handle drag */
|
|
313
314
|
z-index: var(--ogrid-z-fill-handle, 3);
|
|
314
315
|
}
|
|
315
316
|
|
|
317
|
+
/* Increase touch target on touch-capable devices */
|
|
318
|
+
@media (pointer: coarse) {
|
|
319
|
+
.ogrid-fill-handle {
|
|
320
|
+
width: 14px;
|
|
321
|
+
height: 14px;
|
|
322
|
+
right: -7px;
|
|
323
|
+
bottom: -7px;
|
|
324
|
+
border-radius: 2px;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
316
328
|
/* === Resize handle === */
|
|
317
329
|
|
|
318
330
|
.ogrid-resize-handle {
|
|
@@ -323,6 +335,15 @@
|
|
|
323
335
|
width: 8px;
|
|
324
336
|
cursor: col-resize;
|
|
325
337
|
user-select: none;
|
|
338
|
+
touch-action: none; /* Prevent browser scroll/zoom during column resize drag */
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* Increase touch target on touch-capable devices */
|
|
342
|
+
@media (pointer: coarse) {
|
|
343
|
+
.ogrid-resize-handle {
|
|
344
|
+
width: 16px;
|
|
345
|
+
right: -8px;
|
|
346
|
+
}
|
|
326
347
|
}
|
|
327
348
|
|
|
328
349
|
/* === Drop indicator === */
|
|
@@ -391,3 +412,30 @@
|
|
|
391
412
|
min-height: 100%;
|
|
392
413
|
min-width: 40px;
|
|
393
414
|
}
|
|
415
|
+
|
|
416
|
+
/* === Responsive Layout === */
|
|
417
|
+
|
|
418
|
+
/* Compact pagination on small screens */
|
|
419
|
+
@media (max-width: 576px) {
|
|
420
|
+
.ogrid-pagination {
|
|
421
|
+
flex-direction: column;
|
|
422
|
+
align-items: stretch;
|
|
423
|
+
gap: 8px;
|
|
424
|
+
padding: 6px 8px;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.ogrid-pagination-nav {
|
|
428
|
+
order: -1;
|
|
429
|
+
justify-content: center;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.ogrid-pagination-info {
|
|
433
|
+
font-size: 11px;
|
|
434
|
+
text-align: center;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.ogrid-pagination-size {
|
|
438
|
+
font-size: 11px;
|
|
439
|
+
justify-content: center;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Port of React's FormulaRefOverlay component.
|
|
6
6
|
*/
|
|
7
7
|
import { type PropType } from 'vue';
|
|
8
|
-
import { type FormulaReference } from '@alaarab/ogrid-core';
|
|
8
|
+
import { type FormulaReference } from '@alaarab/ogrid-core/formula';
|
|
9
9
|
export declare const FormulaRefOverlay: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
10
|
containerEl: {
|
|
11
11
|
type: PropType<HTMLElement | null>;
|
|
@@ -10,7 +10,7 @@ export interface UseCellSelectionParams {
|
|
|
10
10
|
export interface UseCellSelectionResult {
|
|
11
11
|
selectionRange: ShallowRef<ISelectionRange | null>;
|
|
12
12
|
setSelectionRange: (range: ISelectionRange | null) => void;
|
|
13
|
-
handleCellMouseDown: (e:
|
|
13
|
+
handleCellMouseDown: (e: PointerEvent, rowIndex: number, globalColIndex: number) => void;
|
|
14
14
|
handleSelectAllCells: () => void;
|
|
15
15
|
isDragging: Ref<boolean>;
|
|
16
16
|
}
|
|
@@ -11,10 +11,10 @@ export interface UseColumnReorderParams {
|
|
|
11
11
|
export interface UseColumnReorderResult {
|
|
12
12
|
isDragging: Ref<boolean>;
|
|
13
13
|
dropIndicatorX: Ref<number | null>;
|
|
14
|
-
handleHeaderMouseDown: (columnId: string, event:
|
|
14
|
+
handleHeaderMouseDown: (columnId: string, event: PointerEvent) => void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Manages column reordering via drag-and-drop on header cells.
|
|
18
|
-
* Uses RAF-throttled
|
|
18
|
+
* Uses RAF-throttled pointer tracking and core's calculateDropTarget/reorderColumnArray.
|
|
19
19
|
*/
|
|
20
20
|
export declare function useColumnReorder(params: UseColumnReorderParams): UseColumnReorderResult;
|
|
@@ -12,8 +12,8 @@ export interface UseColumnResizeParams {
|
|
|
12
12
|
onColumnResized?: (columnId: string, width: number) => void;
|
|
13
13
|
}
|
|
14
14
|
export interface UseColumnResizeResult<T> {
|
|
15
|
-
handleResizeStart: (e:
|
|
16
|
-
handleResizeDoubleClick: (e:
|
|
15
|
+
handleResizeStart: (e: PointerEvent, col: IColumnDef<T>) => void;
|
|
16
|
+
handleResizeDoubleClick: (e: PointerEvent, col: IColumnDef<T>) => void;
|
|
17
17
|
getColumnWidth: (col: IColumnDef<T>) => number;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
@@ -70,11 +70,11 @@ export interface DataGridCellInteractionState {
|
|
|
70
70
|
endCol: number;
|
|
71
71
|
} | null;
|
|
72
72
|
setSelectionRange: (range: DataGridCellInteractionState['selectionRange']) => void;
|
|
73
|
-
handleCellMouseDown: (e:
|
|
73
|
+
handleCellMouseDown: (e: PointerEvent, rowIndex: number, globalColIndex: number) => void;
|
|
74
74
|
handleSelectAllCells: () => void;
|
|
75
75
|
hasCellSelection: boolean;
|
|
76
76
|
handleGridKeyDown: (e: KeyboardEvent) => void;
|
|
77
|
-
handleFillHandleMouseDown: (e:
|
|
77
|
+
handleFillHandleMouseDown: (e: PointerEvent) => void;
|
|
78
78
|
handleCopy: () => void;
|
|
79
79
|
handleCut: () => void;
|
|
80
80
|
handlePaste: () => Promise<void>;
|
|
@@ -24,7 +24,7 @@ export interface UseFillHandleResult {
|
|
|
24
24
|
startRow: number;
|
|
25
25
|
startCol: number;
|
|
26
26
|
} | null) => void;
|
|
27
|
-
handleFillHandleMouseDown: (e:
|
|
27
|
+
handleFillHandleMouseDown: (e: PointerEvent) => void;
|
|
28
28
|
/** Fill the current selection down from the top row (Ctrl+D). No-op if no selection or editable=false. */
|
|
29
29
|
fillDown: () => void;
|
|
30
30
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Manages the formula bar text, editing mode, and reference extraction.
|
|
5
5
|
*/
|
|
6
6
|
import { type Ref } from 'vue';
|
|
7
|
-
import { type FormulaReference } from '@alaarab/ogrid-core';
|
|
7
|
+
import { type FormulaReference } from '@alaarab/ogrid-core/formula';
|
|
8
8
|
export interface UseFormulaBarParams {
|
|
9
9
|
/** Active cell column index (0-based). */
|
|
10
10
|
activeCol: Ref<number | null>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { ISheetDef, IColumnReorderConfig, CsvColumn, FormulaExportOptions, StatusBarPart, StatusBarPartsInput, PaginationViewModel, GridContextMenuItem, IColumnHeaderMenuItem, GridContextMenuHandlerProps, ColumnHeaderMenuInput, ColumnHeaderMenuHandlers, ParseValueResult, AggregationResult, GridRowComparatorProps, ColumnPinState, IDropTarget, ICalculateDropTargetParams, IVisibleRange, IVisibleColumnRange, SortFilterRequest, SortFilterResponse, OverlayRect, ISortState, ArrowNavigationContext, ArrowNavigationResult, IFillFormulaOptions, FormulaReference, IResponsiveColumnsConfig, ZIndexKey, ICellAddress, ICellRange, CellKey, FormulaErrorType, TokenType, Token, ASTNode, BinaryOp, IFormulaContext, IFormulaFunction, IEvaluator, IRecalcResult, IFormulaEngineConfig, IGridDataAccessor, INamedRange, IAuditEntry, IAuditTrail, } from '@alaarab/ogrid-core';
|
|
2
|
+
export { escapeCsvValue, buildCsvHeader, buildCsvRows, exportToCsv, triggerCsvDownload, getCellValue, isColumnEditable, createGridDataAccessor, flattenColumns, buildHeaderRows, isFilterConfig, getFilterField, mergeFilter, deriveFilterOptionsFromData, getMultiSelectFilterFields, getStatusBarParts, getDataGridStatusBarConfig, getPaginationViewModel, PAGE_SIZE_OPTIONS, MAX_PAGE_BUTTONS, GRID_CONTEXT_MENU_ITEMS, COLUMN_HEADER_MENU_ITEMS, getContextMenuHandlers, getColumnHeaderMenuItems, formatShortcut, parseValue, numberParser, currencyParser, dateParser, emailParser, booleanParser, computeAggregations, processClientSideData, areGridRowPropsEqual, isRowInRange, getPinStateForColumn, reorderColumnArray, calculateDropTarget, computeVisibleRange, computeTotalHeight, getScrollTopForRow, computeVisibleColumnRange, partitionColumnsForVirtualization, createSortFilterWorker, terminateSortFilterWorker, extractValueMatrix, processClientSideDataAsync, CellDescriptorCache, debounce, measureRange, buildCellIndex, injectGlobalStyles, computeNextSortState, measureColumnContentWidth, AUTOSIZE_EXTRA_PX, AUTOSIZE_MAX_PX, findCtrlArrowTarget, computeTabNavigation, computeArrowNavigation, applyCellDeletion, rangesEqual, clampSelectionToBounds, computeAutoScrollSpeed, applyRangeRowSelection, computeRowSelectionState, formatCellValueForTsv, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, applyFillValues, UndoRedoStack, validateColumns, validateRowIds, validateVirtualScrollConfig, indexToColumnLetter, columnLetterToIndex, formatCellReference, getResponsiveHiddenColumns, RESPONSIVE_BREAKPOINTS, resolveResponsiveConfig, applyResponsiveHiding, } from '@alaarab/ogrid-core';
|
|
3
|
+
export { CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, ROW_NUMBER_COLUMN_ID, ROW_NUMBER_COLUMN_MIN_WIDTH, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, GRID_BORDER_RADIUS, DEFAULT_DEBOUNCE_MS, PEOPLE_SEARCH_DEBOUNCE_MS, SIDEBAR_TRANSITION_MS, Z_INDEX, } from '@alaarab/ogrid-core';
|
|
4
|
+
export { FormulaError, FormulaEngine, FormulaEvaluator, DependencyGraph, tokenize, parse, createBuiltInFunctions, parseCellRef, parseRange, formatAddress, toCellKey, fromCellKey, adjustFormulaReferences, toNumber, formulaToString, toBoolean, flattenArgs, isFormulaError, REF_ERROR, DIV_ZERO_ERROR, VALUE_ERROR, NAME_ERROR, CIRC_ERROR, GENERAL_ERROR, NA_ERROR, extractFormulaReferences, processFormulaBarCommit, deriveFormulaBarText, handleFormulaBarKeyDown, canInsertReference, insertReferenceAtCursor, FORMULA_REF_COLORS, FORMULA_BAR_CSS, FORMULA_BAR_STYLES, } from '@alaarab/ogrid-core/formula';
|
|
2
5
|
export type { IColumnDef, ICellEditorProps, IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, } from './types';
|
|
3
6
|
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, IColumnGroupDef, IColumnDefinition, ICellValueChangedEvent, CellEditorParams, IValueParserParams, IDateFilterValue, HeaderCell, HeaderRow, RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, } from './types';
|
|
4
7
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from './types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IColumnDef, IColumnGroupDef, ICellValueChangedEvent } from './columnTypes';
|
|
2
|
-
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IOGridApi, IVirtualScrollConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference, } from '@alaarab/ogrid-core';
|
|
2
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IOGridApi, IVirtualScrollConfig, IResponsiveColumnsConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference, } from '@alaarab/ogrid-core';
|
|
3
3
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from '@alaarab/ogrid-core';
|
|
4
|
-
import type { RowId, UserLike, IFilters, FilterValue, RowSelectionMode, IRowSelectionChangeEvent, IStatusBarProps, IDataSource, ISideBarDef, IVirtualScrollConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference } from '@alaarab/ogrid-core';
|
|
4
|
+
import type { RowId, UserLike, IFilters, FilterValue, RowSelectionMode, IRowSelectionChangeEvent, IStatusBarProps, IDataSource, ISideBarDef, IVirtualScrollConfig, IResponsiveColumnsConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference } from '@alaarab/ogrid-core';
|
|
5
5
|
/** Base props shared by both client-side and server-side OGrid modes. */
|
|
6
6
|
interface IOGridBaseProps<T> {
|
|
7
7
|
columns: (IColumnDef<T> | IColumnGroupDef<T>)[];
|
|
@@ -81,6 +81,13 @@ interface IOGridBaseProps<T> {
|
|
|
81
81
|
onCellError?: (error: Error, info: unknown) => void;
|
|
82
82
|
/** Enable column reordering via drag-and-drop on header cells. Default: false. */
|
|
83
83
|
columnReorder?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Responsive column hiding. Columns with `responsivePriority` are hidden at narrower widths.
|
|
86
|
+
* - `true`: enable with default breakpoints
|
|
87
|
+
* - `IResponsiveColumnsConfig`: custom breakpoints
|
|
88
|
+
* - `false` / omitted: disabled
|
|
89
|
+
*/
|
|
90
|
+
responsiveColumns?: boolean | IResponsiveColumnsConfig;
|
|
84
91
|
/** Virtual scrolling configuration. Set `enabled: true` with a fixed `rowHeight` to virtualize large datasets. */
|
|
85
92
|
virtualScroll?: IVirtualScrollConfig;
|
|
86
93
|
/** Offload sort/filter to a Web Worker for large datasets. Falls back to sync when sort column has a custom compare. */
|
|
@@ -195,6 +202,8 @@ export interface IOGridDataGridProps<T> {
|
|
|
195
202
|
onCellError?: (error: Error, info: unknown) => void;
|
|
196
203
|
/** Enable column reordering via drag-and-drop on header cells. Default: false. */
|
|
197
204
|
columnReorder?: boolean;
|
|
205
|
+
/** Responsive column hiding config (passed from IOGridBaseProps). */
|
|
206
|
+
responsiveColumns?: boolean | IResponsiveColumnsConfig;
|
|
198
207
|
/** Virtual scrolling configuration. */
|
|
199
208
|
virtualScroll?: IVirtualScrollConfig;
|
|
200
209
|
/** Fixed row height in pixels. Overrides default row height (36px). */
|
|
@@ -8,7 +8,7 @@ export { getHeaderFilterConfig, getCellRenderDescriptor, resolveCellDisplayConte
|
|
|
8
8
|
export type { HeaderFilterConfigInput, HeaderFilterConfig, CellRenderDescriptorInput, CellRenderDescriptor, CellRenderMode, } from '@alaarab/ogrid-core';
|
|
9
9
|
import type { CellRenderDescriptor } from '@alaarab/ogrid-core';
|
|
10
10
|
export interface CellInteractionHandlers {
|
|
11
|
-
handleCellMouseDown: (e:
|
|
11
|
+
handleCellMouseDown: (e: PointerEvent, rowIndex: number, colIndex: number) => void;
|
|
12
12
|
setActiveCell: (cell: {
|
|
13
13
|
rowIndex: number;
|
|
14
14
|
columnIndex: number;
|
|
@@ -30,7 +30,7 @@ export interface CellInteractionProps {
|
|
|
30
30
|
'data-in-range'?: 'true';
|
|
31
31
|
tabindex: number;
|
|
32
32
|
role?: 'button';
|
|
33
|
-
|
|
33
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
34
34
|
onClick: () => void;
|
|
35
35
|
onContextmenu: (e: MouseEvent) => void;
|
|
36
36
|
onDblclick?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "OGrid Vue – Vue 3 composables, headless components, and utilities for OGrid data grids.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"node": ">=18"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@alaarab/ogrid-core": "2.
|
|
39
|
+
"@alaarab/ogrid-core": "2.5.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"vue": "^3.3.0"
|