@alaarab/ogrid-vue 2.1.13 → 2.1.15
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
CHANGED
|
@@ -71,8 +71,8 @@ var MarchingAntsOverlay = defineComponent({
|
|
|
71
71
|
return () => {
|
|
72
72
|
if (!selRect.value && !clipRect.value) return null;
|
|
73
73
|
return h("div", { style: { position: "relative" } }, [
|
|
74
|
-
// Selection range: solid green border (hidden when clipboard range overlaps)
|
|
75
|
-
selRect.value && !clipRangeMatchesSel.value ? h("svg", {
|
|
74
|
+
// Selection range: solid green border (hidden when clipboard range overlaps or single-cell — CSS outline handles that)
|
|
75
|
+
selRect.value && !clipRangeMatchesSel.value && !(props.selectionRange && props.selectionRange.startRow === props.selectionRange.endRow && props.selectionRange.startCol === props.selectionRange.endCol) ? h("svg", {
|
|
76
76
|
style: {
|
|
77
77
|
position: "absolute",
|
|
78
78
|
top: `${selRect.value.top}px`,
|
|
@@ -151,7 +151,10 @@ var StatusBar = defineComponent({
|
|
|
151
151
|
display: "flex",
|
|
152
152
|
alignItems: "center",
|
|
153
153
|
gap: "16px",
|
|
154
|
-
fontSize: "0.875rem"
|
|
154
|
+
fontSize: "0.875rem",
|
|
155
|
+
lineHeight: "20px",
|
|
156
|
+
minHeight: "33px",
|
|
157
|
+
boxSizing: "border-box"
|
|
155
158
|
}
|
|
156
159
|
}, parts.map(
|
|
157
160
|
(p, i) => h("span", {
|
|
@@ -961,15 +964,17 @@ function useCellSelection(params) {
|
|
|
961
964
|
}
|
|
962
965
|
}
|
|
963
966
|
if (!cellIndex) cellIndex = buildCellIndex(wrapperRef.value);
|
|
967
|
+
let rebuilt = false;
|
|
964
968
|
for (let r = minR; r <= maxR; r++) {
|
|
965
969
|
for (let c = minC; c <= maxC; c++) {
|
|
966
970
|
const key = `${r},${c + colOff}`;
|
|
967
971
|
let el = cellIndex?.get(key);
|
|
968
|
-
if (el && !el.isConnected) {
|
|
972
|
+
if (el && !el.isConnected && !rebuilt) {
|
|
973
|
+
rebuilt = true;
|
|
969
974
|
cellIndex = buildCellIndex(wrapperRef.value);
|
|
970
975
|
el = cellIndex?.get(key);
|
|
971
976
|
}
|
|
972
|
-
if (el) {
|
|
977
|
+
if (el && el.isConnected) {
|
|
973
978
|
styleCellInRange(el, r, c, minR, maxR, minC, maxC, anchor);
|
|
974
979
|
}
|
|
975
980
|
}
|
|
@@ -1097,10 +1102,13 @@ function useCellSelection(params) {
|
|
|
1097
1102
|
const finalRange = liveDragRange;
|
|
1098
1103
|
if (finalRange) {
|
|
1099
1104
|
setSelectionRange(finalRange);
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1105
|
+
const anchor = dragStart;
|
|
1106
|
+
if (anchor) {
|
|
1107
|
+
setActiveCell({
|
|
1108
|
+
rowIndex: anchor.row,
|
|
1109
|
+
columnIndex: anchor.col + getColOffset()
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1104
1112
|
}
|
|
1105
1113
|
}
|
|
1106
1114
|
clearDragAttrs();
|
|
@@ -1607,7 +1615,7 @@ function useFillHandle(params) {
|
|
|
1607
1615
|
norm.endRow = Math.min(norm.endRow, vr.endIndex);
|
|
1608
1616
|
}
|
|
1609
1617
|
setSelectionRange(norm);
|
|
1610
|
-
setActiveCell({ rowIndex:
|
|
1618
|
+
setActiveCell({ rowIndex: drag.startRow, columnIndex: drag.startCol + getColOffset() });
|
|
1611
1619
|
const currentItems = items.value;
|
|
1612
1620
|
const currentCols = visibleCols.value;
|
|
1613
1621
|
const callback = onCellValueChanged.value;
|
|
@@ -2426,10 +2434,23 @@ function useColumnResize(params) {
|
|
|
2426
2434
|
document.addEventListener("mouseup", onUp);
|
|
2427
2435
|
cleanupFn = cleanup;
|
|
2428
2436
|
};
|
|
2437
|
+
const handleResizeDoubleClick = (e, col) => {
|
|
2438
|
+
e.preventDefault();
|
|
2439
|
+
e.stopPropagation();
|
|
2440
|
+
const columnId = col.columnId;
|
|
2441
|
+
const thEl = e.currentTarget.closest("th") ?? e.currentTarget.parentElement;
|
|
2442
|
+
const container = thEl?.closest("table")?.parentElement ?? void 0;
|
|
2443
|
+
const idealWidth = measureColumnContentWidth(columnId, minWidth, container);
|
|
2444
|
+
setColumnSizingOverrides({
|
|
2445
|
+
...columnSizingOverrides.value,
|
|
2446
|
+
[columnId]: { widthPx: idealWidth }
|
|
2447
|
+
});
|
|
2448
|
+
onColumnResized?.(columnId, idealWidth);
|
|
2449
|
+
};
|
|
2429
2450
|
const getColumnWidth = (col) => {
|
|
2430
2451
|
return columnSizingOverrides.value[col.columnId]?.widthPx ?? col.idealWidth ?? col.defaultWidth ?? defaultWidth;
|
|
2431
2452
|
};
|
|
2432
|
-
return { handleResizeStart, getColumnWidth };
|
|
2453
|
+
return { handleResizeStart, handleResizeDoubleClick, getColumnWidth };
|
|
2433
2454
|
}
|
|
2434
2455
|
function useDebounce(value, delayMs) {
|
|
2435
2456
|
const debouncedValue = ref(value.value);
|
|
@@ -3244,7 +3265,7 @@ function createDataGridTable(ui) {
|
|
|
3244
3265
|
columnReorder: { isDragging: isReorderDragging, dropIndicatorX, handleHeaderMouseDown: handleReorderMouseDown },
|
|
3245
3266
|
virtualScroll: { containerRef: vsContainerRef, visibleRange, totalHeight: _totalHeight, scrollToRow: _scrollToRow },
|
|
3246
3267
|
virtualScrollEnabled,
|
|
3247
|
-
columnResize: { handleResizeStart, getColumnWidth }
|
|
3268
|
+
columnResize: { handleResizeStart, handleResizeDoubleClick, getColumnWidth }
|
|
3248
3269
|
} = useDataGridTableSetup({ props: propsRef });
|
|
3249
3270
|
const onWrapperMousedown = (e) => {
|
|
3250
3271
|
lastMouseShift.value = e.shiftKey;
|
|
@@ -3417,8 +3438,8 @@ function createDataGridTable(ui) {
|
|
|
3417
3438
|
if (col.type === "numeric") cellClasses.push("ogrid-cell-content--numeric");
|
|
3418
3439
|
else if (col.type === "boolean") cellClasses.push("ogrid-cell-content--boolean");
|
|
3419
3440
|
if (descriptor.canEditAny) cellClasses.push("ogrid-cell-content--editable");
|
|
3420
|
-
if (descriptor.isActive
|
|
3421
|
-
if (descriptor.isInRange) cellClasses.push("ogrid-cell-in-range");
|
|
3441
|
+
if (descriptor.isActive) cellClasses.push("ogrid-cell-content--active");
|
|
3442
|
+
if (descriptor.isInRange && !descriptor.isActive) cellClasses.push("ogrid-cell-in-range");
|
|
3422
3443
|
if (descriptor.isInCutRange) cellClasses.push("ogrid-cell-cut");
|
|
3423
3444
|
const styledContent = cellStyle ? h("span", { style: cellStyle }, content) : content;
|
|
3424
3445
|
return h("div", {
|
|
@@ -3610,6 +3631,7 @@ function createDataGridTable(ui) {
|
|
|
3610
3631
|
e.stopPropagation();
|
|
3611
3632
|
handleResizeStart(e, col);
|
|
3612
3633
|
},
|
|
3634
|
+
onDblclick: (e) => handleResizeDoubleClick(e, col),
|
|
3613
3635
|
class: "ogrid-resize-handle"
|
|
3614
3636
|
})
|
|
3615
3637
|
]);
|
|
@@ -13,6 +13,7 @@ export interface UseColumnResizeParams {
|
|
|
13
13
|
}
|
|
14
14
|
export interface UseColumnResizeResult<T> {
|
|
15
15
|
handleResizeStart: (e: MouseEvent, col: IColumnDef<T>) => void;
|
|
16
|
+
handleResizeDoubleClick: (e: MouseEvent, col: IColumnDef<T>) => void;
|
|
16
17
|
getColumnWidth: (col: IColumnDef<T>) => number;
|
|
17
18
|
}
|
|
18
19
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-vue",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.15",
|
|
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.1.
|
|
39
|
+
"@alaarab/ogrid-core": "2.1.15"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"vue": "^3.3.0"
|