@alaarab/ogrid-vue 2.1.7 → 2.1.8
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 +11 -34
- package/dist/esm/styles/ogrid-theme.css +0 -18
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { injectGlobalStyles, Z_INDEX, getStatusBarParts, measureRange, flattenColumns, getMultiSelectFilterFields, deriveFilterOptionsFromData, processClientSideData, validateColumns, validateRowIds, computeRowSelectionState, UndoRedoStack, CHECKBOX_COLUMN_WIDTH, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, computeAggregations, getDataGridStatusBarConfig, computeVisibleRange, computeTotalHeight, buildHeaderRows, ROW_NUMBER_COLUMN_WIDTH, getHeaderFilterConfig, getCellRenderDescriptor, buildInlineEditorProps, buildPopoverEditorProps, resolveCellDisplayContent, resolveCellStyle, rangesEqual, normalizeSelectionRange, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, measureColumnContentWidth, getPinStateForColumn, parseValue, applyFillValues, applyCellDeletion, computeTabNavigation, computeArrowNavigation, computeNextSortState, mergeFilter, applyRangeRowSelection, getScrollTopForRow, getCellValue, calculateDropTarget, reorderColumnArray, computeAutoScrollSpeed } from '@alaarab/ogrid-core';
|
|
1
|
+
import { injectGlobalStyles, Z_INDEX, getStatusBarParts, measureRange, flattenColumns, getMultiSelectFilterFields, deriveFilterOptionsFromData, processClientSideData, validateColumns, validateRowIds, computeRowSelectionState, buildCellIndex, UndoRedoStack, CHECKBOX_COLUMN_WIDTH, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, computeAggregations, getDataGridStatusBarConfig, computeVisibleRange, computeTotalHeight, buildHeaderRows, ROW_NUMBER_COLUMN_WIDTH, getHeaderFilterConfig, getCellRenderDescriptor, buildInlineEditorProps, buildPopoverEditorProps, resolveCellDisplayContent, resolveCellStyle, rangesEqual, normalizeSelectionRange, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, measureColumnContentWidth, getPinStateForColumn, parseValue, applyFillValues, applyCellDeletion, computeTabNavigation, computeArrowNavigation, computeNextSortState, mergeFilter, applyRangeRowSelection, getScrollTopForRow, getCellValue, calculateDropTarget, reorderColumnArray, computeAutoScrollSpeed } from '@alaarab/ogrid-core';
|
|
2
2
|
export * from '@alaarab/ogrid-core';
|
|
3
3
|
export { buildInlineEditorProps, buildPopoverEditorProps, getCellRenderDescriptor, getHeaderFilterConfig, isInSelectionRange, normalizeSelectionRange, resolveCellDisplayContent, resolveCellStyle, toUserLike } from '@alaarab/ogrid-core';
|
|
4
4
|
import { defineComponent, ref, computed, onMounted, watch, toValue, onUnmounted, h, shallowRef, triggerRef, nextTick, Teleport, isRef, isReadonly, unref, customRef } from 'vue';
|
|
@@ -921,18 +921,6 @@ function useCellSelection(params) {
|
|
|
921
921
|
};
|
|
922
922
|
const markedCells = /* @__PURE__ */ new Set();
|
|
923
923
|
let cellIndex = null;
|
|
924
|
-
const buildCellIndex = () => {
|
|
925
|
-
const wrapper = wrapperRef.value;
|
|
926
|
-
if (!wrapper) return;
|
|
927
|
-
cellIndex = /* @__PURE__ */ new Map();
|
|
928
|
-
const cells = wrapper.querySelectorAll("[data-row-index][data-col-index]");
|
|
929
|
-
for (let i = 0; i < cells.length; i++) {
|
|
930
|
-
const el = cells[i];
|
|
931
|
-
const r = el.getAttribute("data-row-index") ?? "";
|
|
932
|
-
const c = el.getAttribute("data-col-index") ?? "";
|
|
933
|
-
cellIndex.set(`${r},${c}`, el);
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
924
|
const styleCellInRange = (el, r, c, minR, maxR, minC, maxC, anchor) => {
|
|
937
925
|
if (!el.hasAttribute(DRAG_ATTR)) el.setAttribute(DRAG_ATTR, "");
|
|
938
926
|
const isAnchor = anchor && r === anchor.row && c === anchor.col;
|
|
@@ -972,13 +960,13 @@ function useCellSelection(params) {
|
|
|
972
960
|
markedCells.delete(el);
|
|
973
961
|
}
|
|
974
962
|
}
|
|
975
|
-
if (!cellIndex) buildCellIndex();
|
|
963
|
+
if (!cellIndex) cellIndex = buildCellIndex(wrapperRef.value);
|
|
976
964
|
for (let r = minR; r <= maxR; r++) {
|
|
977
965
|
for (let c = minC; c <= maxC; c++) {
|
|
978
966
|
const key = `${r},${c + colOff}`;
|
|
979
967
|
let el = cellIndex?.get(key);
|
|
980
968
|
if (el && !el.isConnected) {
|
|
981
|
-
buildCellIndex();
|
|
969
|
+
cellIndex = buildCellIndex(wrapperRef.value);
|
|
982
970
|
el = cellIndex?.get(key);
|
|
983
971
|
}
|
|
984
972
|
if (el) {
|
|
@@ -1074,7 +1062,7 @@ function useCellSelection(params) {
|
|
|
1074
1062
|
if (!dragMoved) {
|
|
1075
1063
|
dragMoved = true;
|
|
1076
1064
|
isDragging.value = true;
|
|
1077
|
-
buildCellIndex();
|
|
1065
|
+
cellIndex = buildCellIndex(wrapperRef.value);
|
|
1078
1066
|
}
|
|
1079
1067
|
lastMousePos = { cx: e.clientX, cy: e.clientY };
|
|
1080
1068
|
updateAutoScroll();
|
|
@@ -1508,20 +1496,7 @@ function useFillHandle(params) {
|
|
|
1508
1496
|
fillDragEnd = { endRow: drag.startRow, endCol: drag.startCol };
|
|
1509
1497
|
liveFillRange = null;
|
|
1510
1498
|
const markedCells = /* @__PURE__ */ new Set();
|
|
1511
|
-
let fillCellIndex =
|
|
1512
|
-
const buildFillCellIndex = () => {
|
|
1513
|
-
const wrapper = wrapperRef.value;
|
|
1514
|
-
if (!wrapper) return;
|
|
1515
|
-
fillCellIndex = /* @__PURE__ */ new Map();
|
|
1516
|
-
const cells = wrapper.querySelectorAll("[data-row-index][data-col-index]");
|
|
1517
|
-
for (let i = 0; i < cells.length; i++) {
|
|
1518
|
-
const el = cells[i];
|
|
1519
|
-
const r = el.getAttribute("data-row-index") ?? "";
|
|
1520
|
-
const c = el.getAttribute("data-col-index") ?? "";
|
|
1521
|
-
fillCellIndex.set(`${r},${c}`, el);
|
|
1522
|
-
}
|
|
1523
|
-
};
|
|
1524
|
-
buildFillCellIndex();
|
|
1499
|
+
let fillCellIndex = buildCellIndex(wrapperRef.value);
|
|
1525
1500
|
const applyDragAttrs = (range) => {
|
|
1526
1501
|
const wrapper = wrapperRef.value;
|
|
1527
1502
|
if (!wrapper) return;
|
|
@@ -1543,8 +1518,8 @@ function useFillHandle(params) {
|
|
|
1543
1518
|
const key = `${r},${c + colOff}`;
|
|
1544
1519
|
let el = fillCellIndex?.get(key);
|
|
1545
1520
|
if (el && !el.isConnected) {
|
|
1546
|
-
|
|
1547
|
-
el = fillCellIndex
|
|
1521
|
+
fillCellIndex = buildCellIndex(wrapperRef.value);
|
|
1522
|
+
el = fillCellIndex.get(key);
|
|
1548
1523
|
}
|
|
1549
1524
|
if (el) {
|
|
1550
1525
|
if (!el.hasAttribute(DRAG_ATTR2)) el.setAttribute(DRAG_ATTR2, "");
|
|
@@ -1558,7 +1533,6 @@ function useFillHandle(params) {
|
|
|
1558
1533
|
el.removeAttribute(DRAG_ATTR2);
|
|
1559
1534
|
}
|
|
1560
1535
|
markedCells.clear();
|
|
1561
|
-
fillCellIndex = null;
|
|
1562
1536
|
};
|
|
1563
1537
|
let lastFillMousePos = null;
|
|
1564
1538
|
const resolveRange = (cx, cy) => {
|
|
@@ -2238,7 +2212,10 @@ function useDataGridState(params) {
|
|
|
2238
2212
|
setPopoverAnchorEl(null);
|
|
2239
2213
|
setPendingEditorValue(void 0);
|
|
2240
2214
|
if (rowIndex < items.value.length - 1) {
|
|
2241
|
-
|
|
2215
|
+
const newRow = rowIndex + 1;
|
|
2216
|
+
const localCol = globalColIndex - colOffset.value;
|
|
2217
|
+
setActiveCell({ rowIndex: newRow, columnIndex: globalColIndex });
|
|
2218
|
+
setSelectionRange({ startRow: newRow, startCol: localCol, endRow: newRow, endCol: localCol });
|
|
2242
2219
|
}
|
|
2243
2220
|
};
|
|
2244
2221
|
const cancelPopoverEdit = () => {
|
|
@@ -17,24 +17,6 @@
|
|
|
17
17
|
--ogrid-loading-overlay: rgba(255, 255, 255, 0.7);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
@media (prefers-color-scheme: dark) {
|
|
21
|
-
:root:not([data-theme="light"]) {
|
|
22
|
-
--ogrid-bg: #1e1e1e;
|
|
23
|
-
--ogrid-fg: rgba(255, 255, 255, 0.87);
|
|
24
|
-
--ogrid-fg-secondary: rgba(255, 255, 255, 0.6);
|
|
25
|
-
--ogrid-fg-muted: rgba(255, 255, 255, 0.5);
|
|
26
|
-
--ogrid-border: rgba(255, 255, 255, 0.12);
|
|
27
|
-
--ogrid-header-bg: rgba(255, 255, 255, 0.06);
|
|
28
|
-
--ogrid-hover-bg: rgba(255, 255, 255, 0.08);
|
|
29
|
-
--ogrid-selected-row-bg: #1a3a5c;
|
|
30
|
-
--ogrid-active-cell-bg: rgba(255, 255, 255, 0.06);
|
|
31
|
-
--ogrid-range-bg: rgba(46, 160, 67, 0.15);
|
|
32
|
-
--ogrid-accent: #4da6ff;
|
|
33
|
-
--ogrid-selection-color: #2ea043;
|
|
34
|
-
--ogrid-loading-overlay: rgba(0, 0, 0, 0.7);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
20
|
[data-theme="dark"] {
|
|
39
21
|
--ogrid-bg: #1e1e1e;
|
|
40
22
|
--ogrid-fg: rgba(255, 255, 255, 0.87);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-vue",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
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.8"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"vue": "^3.3.0"
|