@revolist/revogrid 4.23.8 → 4.23.9
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/cjs/{cell-renderer-Dcz022q7.js → cell-renderer-Dl9kKeKp.js} +1 -1
- package/dist/cjs/{column.drag.plugin-CHyc9aCK.js → column.drag.plugin-BRraLvz3.js} +2 -2
- package/dist/cjs/{column.service-C1Qvcf5l.js → column.service-BNWNiJW3.js} +62 -23
- package/dist/cjs/{header-cell-renderer-vVr4IWNV.js → header-cell-renderer-DyjOxArm.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/revo-grid.cjs.entry.js +5 -5
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +40 -4
- package/dist/cjs/revogr-data_4.cjs.entry.js +3 -3
- package/dist/collection/components/data/column.service.js +62 -23
- package/dist/collection/components/overlay/clipboard.utils.js +26 -0
- package/dist/collection/components/overlay/revogr-overlay-selection.js +27 -7
- package/dist/collection/components/revoGrid/revo-grid.js +14 -7
- package/dist/collection/serve/controller.js +1 -0
- package/dist/esm/{cell-renderer-BtN-NGCk.js → cell-renderer-CdF2Jm3B.js} +1 -1
- package/dist/esm/{column.drag.plugin-DEKk4rrp.js → column.drag.plugin-V9DDE3mU.js} +2 -2
- package/dist/esm/{column.service-CC_SD8W3.js → column.service-C6hByxPy.js} +62 -23
- package/dist/esm/{header-cell-renderer-B-LX2sgu.js → header-cell-renderer-BMmXRsd_.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/revo-grid.entry.js +5 -5
- package/dist/esm/revogr-attribution_7.entry.js +40 -4
- package/dist/esm/revogr-data_4.entry.js +3 -3
- package/dist/revo-grid/{cell-renderer-BtN-NGCk.js → cell-renderer-CdF2Jm3B.js} +1 -1
- package/dist/revo-grid/{column.drag.plugin-DEKk4rrp.js → column.drag.plugin-V9DDE3mU.js} +2 -2
- package/dist/revo-grid/{column.service-CC_SD8W3.js → column.service-C6hByxPy.js} +62 -23
- package/dist/revo-grid/{header-cell-renderer-B-LX2sgu.js → header-cell-renderer-BMmXRsd_.js} +1 -1
- package/dist/revo-grid/index.esm.js +5 -5
- package/dist/revo-grid/revo-grid.entry.js +5 -5
- package/dist/revo-grid/revogr-attribution_7.entry.js +40 -4
- package/dist/revo-grid/revogr-data_4.entry.js +3 -3
- package/dist/types/components/data/column.service.d.ts +10 -1
- package/dist/types/components/overlay/clipboard.utils.d.ts +3 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +4 -3
- package/dist/types/components/revoGrid/revo-grid.d.ts +4 -4
- package/dist/types/components.d.ts +14 -14
- package/dist/types/types/interfaces.d.ts +8 -0
- package/hydrate/index.js +103 -28
- package/hydrate/index.mjs +103 -28
- package/package.json +1 -1
- package/readme.md +20 -1
- package/standalone/column.service.js +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
|
@@ -817,43 +817,82 @@ class ColumnService {
|
|
|
817
817
|
mapping,
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
|
-
getTransformedDataToApply(start, data) {
|
|
820
|
+
getTransformedDataToApply({ start, data, targetRange, }) {
|
|
821
821
|
const changed = {};
|
|
822
822
|
const copyRowLength = data.length;
|
|
823
|
+
if (!copyRowLength) {
|
|
824
|
+
return {
|
|
825
|
+
changed,
|
|
826
|
+
range: null,
|
|
827
|
+
};
|
|
828
|
+
}
|
|
823
829
|
const colLength = this.columns.length;
|
|
824
830
|
const rowLength = this.dataStore.get('items').length;
|
|
831
|
+
const bounds = this.getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength);
|
|
832
|
+
if (!bounds) {
|
|
833
|
+
return {
|
|
834
|
+
changed,
|
|
835
|
+
range: null,
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
const { startRow, startCol, endRow } = bounds;
|
|
839
|
+
let maxCol = startCol - 1;
|
|
840
|
+
let lastRow = startRow - 1;
|
|
825
841
|
// rows
|
|
826
|
-
let rowIndex =
|
|
827
|
-
let maxCol = 0;
|
|
828
|
-
for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {
|
|
842
|
+
for (let rowIndex = startRow, i = 0; rowIndex <= endRow; rowIndex++, i++) {
|
|
829
843
|
// copy original data link
|
|
830
844
|
const copyRow = data[i % copyRowLength];
|
|
831
845
|
const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
for (let j = 0; colIndex < colLength && j < copyColLength; colIndex++, j++) {
|
|
835
|
-
const p = this.columns[colIndex].prop;
|
|
836
|
-
const currentCol = j % colLength;
|
|
837
|
-
/** if can write */
|
|
838
|
-
if (!this.isReadOnly(rowIndex, colIndex)) {
|
|
839
|
-
/** to show before save */
|
|
840
|
-
if (!changed[rowIndex]) {
|
|
841
|
-
changed[rowIndex] = {};
|
|
842
|
-
}
|
|
843
|
-
changed[rowIndex][p] = copyRow[currentCol];
|
|
844
|
-
}
|
|
846
|
+
if (!copyColLength) {
|
|
847
|
+
continue;
|
|
845
848
|
}
|
|
846
|
-
maxCol = Math.max(maxCol,
|
|
849
|
+
maxCol = Math.max(maxCol, this.applyClipboardRow(changed, {
|
|
850
|
+
bounds,
|
|
851
|
+
copyColLength,
|
|
852
|
+
copyRow,
|
|
853
|
+
rowIndex,
|
|
854
|
+
start,
|
|
855
|
+
targetRange,
|
|
856
|
+
}));
|
|
857
|
+
lastRow = rowIndex;
|
|
847
858
|
}
|
|
848
|
-
const range = getRange(start, {
|
|
849
|
-
y: rowIndex - 1,
|
|
850
|
-
x: maxCol,
|
|
851
|
-
});
|
|
852
859
|
return {
|
|
853
860
|
changed,
|
|
854
|
-
range,
|
|
861
|
+
range: this.getAppliedRange(bounds, lastRow, maxCol),
|
|
855
862
|
};
|
|
856
863
|
}
|
|
864
|
+
getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength) {
|
|
865
|
+
var _a, _b, _c;
|
|
866
|
+
const startRow = (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y) !== null && _a !== void 0 ? _a : start.y;
|
|
867
|
+
const startCol = (_b = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x) !== null && _b !== void 0 ? _b : start.x;
|
|
868
|
+
const endRow = Math.min(rowLength - 1, (_c = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y1) !== null && _c !== void 0 ? _c : start.y + copyRowLength - 1);
|
|
869
|
+
if (endRow < startRow || startCol >= colLength) {
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
return { startRow, startCol, endRow, colLength };
|
|
873
|
+
}
|
|
874
|
+
applyClipboardRow(changed, { bounds, copyColLength, copyRow, rowIndex, start, targetRange, }) {
|
|
875
|
+
var _a;
|
|
876
|
+
const endCol = Math.min(bounds.colLength - 1, (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x1) !== null && _a !== void 0 ? _a : start.x + copyColLength - 1);
|
|
877
|
+
for (let colIndex = bounds.startCol, j = 0; colIndex <= endCol; colIndex++, j++) {
|
|
878
|
+
if (this.isReadOnly(rowIndex, colIndex)) {
|
|
879
|
+
continue;
|
|
880
|
+
}
|
|
881
|
+
const prop = this.columns[colIndex].prop;
|
|
882
|
+
changed[rowIndex] = changed[rowIndex] || {};
|
|
883
|
+
changed[rowIndex][prop] = copyRow[j % copyColLength];
|
|
884
|
+
}
|
|
885
|
+
return endCol;
|
|
886
|
+
}
|
|
887
|
+
getAppliedRange({ startRow, startCol }, lastRow, maxCol) {
|
|
888
|
+
if (lastRow < startRow || maxCol < startCol) {
|
|
889
|
+
return null;
|
|
890
|
+
}
|
|
891
|
+
return getRange({ x: startCol, y: startRow }, {
|
|
892
|
+
y: lastRow,
|
|
893
|
+
x: maxCol,
|
|
894
|
+
});
|
|
895
|
+
}
|
|
857
896
|
getRangeStaticData(d, value) {
|
|
858
897
|
const changed = {};
|
|
859
898
|
// rows
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h } from './index-Chp_81rd.js';
|
|
5
|
-
import { Q as doPropMerge } from './column.service-
|
|
5
|
+
import { Q as doPropMerge } from './column.service-C6hByxPy.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Dispatches a custom event to a specified target element.
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-
|
|
5
|
-
import { B as BasePlugin } from './column.drag.plugin-
|
|
6
|
-
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-
|
|
7
|
-
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-
|
|
8
|
-
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-
|
|
4
|
+
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-C6hByxPy.js';
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-V9DDE3mU.js';
|
|
6
|
+
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-V9DDE3mU.js';
|
|
7
|
+
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BMmXRsd_.js';
|
|
8
|
+
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-CdF2Jm3B.js';
|
|
9
9
|
export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-C3RUSwH5.js';
|
|
11
11
|
export { k as isAll, c as isClear, h as isCopy, a as isCtrlKey, b as isCtrlMetaKey, g as isCut, m as isEditInput, n as isEditorCtrConstructible, f as isEnterKeyValue, i as isMetaKey, j as isPaste, l as isShortcutModifier, d as isTab, e as isTabKeyValue } from './edit.utils-Dnnbd0xG.js';
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, d as createEvent, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-
|
|
5
|
+
import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-C6hByxPy.js';
|
|
6
6
|
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL } from './dimension.helpers-CGKwSvw6.js';
|
|
7
7
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
8
8
|
import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
9
|
-
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-
|
|
9
|
+
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-V9DDE3mU.js';
|
|
10
10
|
import { V as ViewportStore } from './viewport.store-_c579YyM.js';
|
|
11
11
|
import { T as ThemeService } from './theme.service-BmnDvr6P.js';
|
|
12
12
|
import { t as timeout } from './index-Db3qZoW5.js';
|
|
13
13
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
14
14
|
import './filter.button-C8XTWPU2.js';
|
|
15
|
-
import './header-cell-renderer-
|
|
15
|
+
import './header-cell-renderer-BMmXRsd_.js';
|
|
16
16
|
|
|
17
17
|
class ColumnDataProvider {
|
|
18
18
|
get stores() {
|
|
@@ -1445,7 +1445,7 @@ const RevoGridComponent = class {
|
|
|
1445
1445
|
this.rowSize = 0;
|
|
1446
1446
|
/** Indicates default column size. */
|
|
1447
1447
|
this.colSize = 100;
|
|
1448
|
-
/** When true, user can range
|
|
1448
|
+
/** When true, user can select a cell range. Required for range-based clipboard fill. */
|
|
1449
1449
|
this.range = false;
|
|
1450
1450
|
/** When true, grid in read only mode. */
|
|
1451
1451
|
this.readonly = false;
|
|
@@ -1457,7 +1457,7 @@ const RevoGridComponent = class {
|
|
|
1457
1457
|
this.noHorizontalScrollTransfer = false;
|
|
1458
1458
|
/** When true cell focus appear. */
|
|
1459
1459
|
this.canFocus = true;
|
|
1460
|
-
/** When true enable clipboard. */
|
|
1460
|
+
/** When true enable clipboard. Can be boolean or clipboard config. */
|
|
1461
1461
|
this.useClipboard = true;
|
|
1462
1462
|
/**
|
|
1463
1463
|
* Columns - defines an array of grid columns.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, h, e as Host, d as createEvent, g as getElement } from './index-Chp_81rd.js';
|
|
5
5
|
import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, F as FOCUS_CLASS, I as codesLetter, R as RESIZE_INTERVAL, y as MOBILE_CLASS, z as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, q as ROW_HEADER_TYPE, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
6
6
|
import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-BvSmBueA.js';
|
|
7
|
-
import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-
|
|
7
|
+
import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-C6hByxPy.js';
|
|
8
8
|
import { l as isShortcutModifier, m as isEditInput, c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll } from './edit.utils-Dnnbd0xG.js';
|
|
9
9
|
import { t as timeout, g as getScrollbarSize } from './index-Db3qZoW5.js';
|
|
10
10
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
@@ -649,6 +649,30 @@ class AutoFillService {
|
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
+
function getRangeFillClipboardData(data, useClipboard) {
|
|
653
|
+
var _a;
|
|
654
|
+
if (!isClipboardRangeFillEnabled(useClipboard)) {
|
|
655
|
+
return null;
|
|
656
|
+
}
|
|
657
|
+
const normalized = trimTrailingEmptyClipboardRows(data);
|
|
658
|
+
return normalized.length === 1 && ((_a = normalized[0]) === null || _a === void 0 ? void 0 : _a.length) === 1
|
|
659
|
+
? normalized
|
|
660
|
+
: null;
|
|
661
|
+
}
|
|
662
|
+
function isClipboardRangeFillEnabled(useClipboard) {
|
|
663
|
+
return (typeof useClipboard === 'object' && useClipboard.rangeFill === true);
|
|
664
|
+
}
|
|
665
|
+
function trimTrailingEmptyClipboardRows(data) {
|
|
666
|
+
const rows = [...data];
|
|
667
|
+
while (rows.length > 1 && isEmptyClipboardRow(rows[rows.length - 1])) {
|
|
668
|
+
rows.pop();
|
|
669
|
+
}
|
|
670
|
+
return rows;
|
|
671
|
+
}
|
|
672
|
+
function isEmptyClipboardRow(row) {
|
|
673
|
+
return !row || row.every(cell => cell === '');
|
|
674
|
+
}
|
|
675
|
+
|
|
652
676
|
const revogrOverlayStyleCss = () => `revogr-overlay-selection{display:block;position:relative;width:100%}revogr-overlay-selection .autofill-handle{position:absolute;width:14px;height:14px;margin-left:-13px;margin-top:-13px;z-index:10;cursor:crosshair}revogr-overlay-selection .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection.mobile .autofill-handle{position:absolute;width:30px;height:30px;margin-left:-29px;margin-top:-29px;z-index:10;cursor:crosshair}revogr-overlay-selection.mobile .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:12px;height:12px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection .selection-border-range{position:absolute;pointer-events:none;z-index:9;box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset}revogr-overlay-selection .selection-border-range .range-handlers{height:100%;background-color:transparent;width:75%;max-width:50px;min-width:20px;left:50%;transform:translateX(-50%);position:absolute}revogr-overlay-selection .selection-border-range .range-handlers>span{pointer-events:auto;height:20px;width:20px;position:absolute;left:50%;transform:translateX(-50%)}revogr-overlay-selection .selection-border-range .range-handlers>span:before,revogr-overlay-selection .selection-border-range .range-handlers>span:after{position:absolute;border-radius:5px;width:15px;height:5px;left:50%;transform:translateX(-50%);background-color:rgba(0, 0, 0, 0.2)}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child{top:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child:before{content:"";top:0}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child{bottom:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child:after{content:"";bottom:0}revogr-overlay-selection revogr-edit{z-index:10}`;
|
|
653
677
|
|
|
654
678
|
const OverlaySelection = class {
|
|
@@ -896,9 +920,9 @@ const OverlaySelection = class {
|
|
|
896
920
|
nodes.push(h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
897
921
|
}
|
|
898
922
|
}
|
|
899
|
-
return (h(Host, { key: '
|
|
923
|
+
return (h(Host, { key: 'ff303c39d59e4ef217421fa11b9a80de07311b07', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
900
924
|
// it's done to be able to throw events from different levels, not just from editor
|
|
901
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '
|
|
925
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '3cbe4c3ad7d447f779e9e20f73eec2e3107275e0', name: "data" })));
|
|
902
926
|
}
|
|
903
927
|
/**
|
|
904
928
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -1063,13 +1087,25 @@ const OverlaySelection = class {
|
|
|
1063
1087
|
if (!focus || isEditing) {
|
|
1064
1088
|
return;
|
|
1065
1089
|
}
|
|
1066
|
-
|
|
1090
|
+
const rangeFillData = getRangeFillClipboardData(data, this.useClipboard);
|
|
1091
|
+
const targetRange = rangeFillData
|
|
1092
|
+
? this.getClipboardPasteTargetRange()
|
|
1093
|
+
: null;
|
|
1094
|
+
let { changed, range } = this.columnService.getTransformedDataToApply({
|
|
1095
|
+
start: focus,
|
|
1096
|
+
data: rangeFillData || data,
|
|
1097
|
+
targetRange,
|
|
1098
|
+
});
|
|
1067
1099
|
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
|
|
1068
1100
|
if (canPaste) {
|
|
1069
1101
|
return;
|
|
1070
1102
|
}
|
|
1071
1103
|
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range, range);
|
|
1072
1104
|
}
|
|
1105
|
+
getClipboardPasteTargetRange() {
|
|
1106
|
+
const range = this.selectionStore.get('range');
|
|
1107
|
+
return range && !isRangeSingleCell(range) ? range : null;
|
|
1108
|
+
}
|
|
1073
1109
|
async focusNext() {
|
|
1074
1110
|
var _a;
|
|
1075
1111
|
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { M as ColumnService, u as isGrouping } from './column.service-
|
|
5
|
+
import { M as ColumnService, u as isGrouping } from './column.service-C6hByxPy.js';
|
|
6
6
|
import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
7
|
-
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-
|
|
7
|
+
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-CdF2Jm3B.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
9
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-BMmXRsd_.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-CaUDyxyU.js';
|
|
11
11
|
import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
12
12
|
import './debounce-PCRWZliA.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h, f as Build } from './index-Chp_81rd.js';
|
|
5
5
|
import { n as DATA_ROW, w as DRAG_ICON_CLASS, x as DRAGGABLE_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
6
|
-
import { l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, G as GROUP_DEPTH, h as GROUP_EXPANDED, P as PSEUDO_GROUP_ITEM, O as isRowDragService, B as getCellDataParsed } from './column.service-
|
|
6
|
+
import { l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, G as GROUP_DEPTH, h as GROUP_EXPANDED, P as PSEUDO_GROUP_ITEM, O as isRowDragService, B as getCellDataParsed } from './column.service-C6hByxPy.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders sorting direction and optional additive sorting rank.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-
|
|
4
|
+
import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-C6hByxPy.js';
|
|
5
5
|
import { K as createStore, l as setStore, i as calculateDimensionData, L as identity, N as isArray, b as getSourceItem, g as getPhysical, e as setItems, j as getItemByPosition } from './dimension.helpers-CGKwSvw6.js';
|
|
6
6
|
import { j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
|
|
7
7
|
import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
|
|
8
8
|
import { h } from './index-Chp_81rd.js';
|
|
9
9
|
import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
|
|
10
10
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
11
|
-
import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-
|
|
11
|
+
import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-BMmXRsd_.js';
|
|
12
12
|
|
|
13
13
|
function calculateRealSize({ count, originItemSize, sizes, }) {
|
|
14
14
|
const safeCount = Math.max(0, count);
|
|
@@ -817,43 +817,82 @@ class ColumnService {
|
|
|
817
817
|
mapping,
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
|
-
getTransformedDataToApply(start, data) {
|
|
820
|
+
getTransformedDataToApply({ start, data, targetRange, }) {
|
|
821
821
|
const changed = {};
|
|
822
822
|
const copyRowLength = data.length;
|
|
823
|
+
if (!copyRowLength) {
|
|
824
|
+
return {
|
|
825
|
+
changed,
|
|
826
|
+
range: null,
|
|
827
|
+
};
|
|
828
|
+
}
|
|
823
829
|
const colLength = this.columns.length;
|
|
824
830
|
const rowLength = this.dataStore.get('items').length;
|
|
831
|
+
const bounds = this.getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength);
|
|
832
|
+
if (!bounds) {
|
|
833
|
+
return {
|
|
834
|
+
changed,
|
|
835
|
+
range: null,
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
const { startRow, startCol, endRow } = bounds;
|
|
839
|
+
let maxCol = startCol - 1;
|
|
840
|
+
let lastRow = startRow - 1;
|
|
825
841
|
// rows
|
|
826
|
-
let rowIndex =
|
|
827
|
-
let maxCol = 0;
|
|
828
|
-
for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {
|
|
842
|
+
for (let rowIndex = startRow, i = 0; rowIndex <= endRow; rowIndex++, i++) {
|
|
829
843
|
// copy original data link
|
|
830
844
|
const copyRow = data[i % copyRowLength];
|
|
831
845
|
const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
for (let j = 0; colIndex < colLength && j < copyColLength; colIndex++, j++) {
|
|
835
|
-
const p = this.columns[colIndex].prop;
|
|
836
|
-
const currentCol = j % colLength;
|
|
837
|
-
/** if can write */
|
|
838
|
-
if (!this.isReadOnly(rowIndex, colIndex)) {
|
|
839
|
-
/** to show before save */
|
|
840
|
-
if (!changed[rowIndex]) {
|
|
841
|
-
changed[rowIndex] = {};
|
|
842
|
-
}
|
|
843
|
-
changed[rowIndex][p] = copyRow[currentCol];
|
|
844
|
-
}
|
|
846
|
+
if (!copyColLength) {
|
|
847
|
+
continue;
|
|
845
848
|
}
|
|
846
|
-
maxCol = Math.max(maxCol,
|
|
849
|
+
maxCol = Math.max(maxCol, this.applyClipboardRow(changed, {
|
|
850
|
+
bounds,
|
|
851
|
+
copyColLength,
|
|
852
|
+
copyRow,
|
|
853
|
+
rowIndex,
|
|
854
|
+
start,
|
|
855
|
+
targetRange,
|
|
856
|
+
}));
|
|
857
|
+
lastRow = rowIndex;
|
|
847
858
|
}
|
|
848
|
-
const range = getRange(start, {
|
|
849
|
-
y: rowIndex - 1,
|
|
850
|
-
x: maxCol,
|
|
851
|
-
});
|
|
852
859
|
return {
|
|
853
860
|
changed,
|
|
854
|
-
range,
|
|
861
|
+
range: this.getAppliedRange(bounds, lastRow, maxCol),
|
|
855
862
|
};
|
|
856
863
|
}
|
|
864
|
+
getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength) {
|
|
865
|
+
var _a, _b, _c;
|
|
866
|
+
const startRow = (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y) !== null && _a !== void 0 ? _a : start.y;
|
|
867
|
+
const startCol = (_b = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x) !== null && _b !== void 0 ? _b : start.x;
|
|
868
|
+
const endRow = Math.min(rowLength - 1, (_c = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y1) !== null && _c !== void 0 ? _c : start.y + copyRowLength - 1);
|
|
869
|
+
if (endRow < startRow || startCol >= colLength) {
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
return { startRow, startCol, endRow, colLength };
|
|
873
|
+
}
|
|
874
|
+
applyClipboardRow(changed, { bounds, copyColLength, copyRow, rowIndex, start, targetRange, }) {
|
|
875
|
+
var _a;
|
|
876
|
+
const endCol = Math.min(bounds.colLength - 1, (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x1) !== null && _a !== void 0 ? _a : start.x + copyColLength - 1);
|
|
877
|
+
for (let colIndex = bounds.startCol, j = 0; colIndex <= endCol; colIndex++, j++) {
|
|
878
|
+
if (this.isReadOnly(rowIndex, colIndex)) {
|
|
879
|
+
continue;
|
|
880
|
+
}
|
|
881
|
+
const prop = this.columns[colIndex].prop;
|
|
882
|
+
changed[rowIndex] = changed[rowIndex] || {};
|
|
883
|
+
changed[rowIndex][prop] = copyRow[j % copyColLength];
|
|
884
|
+
}
|
|
885
|
+
return endCol;
|
|
886
|
+
}
|
|
887
|
+
getAppliedRange({ startRow, startCol }, lastRow, maxCol) {
|
|
888
|
+
if (lastRow < startRow || maxCol < startCol) {
|
|
889
|
+
return null;
|
|
890
|
+
}
|
|
891
|
+
return getRange({ x: startCol, y: startRow }, {
|
|
892
|
+
y: lastRow,
|
|
893
|
+
x: maxCol,
|
|
894
|
+
});
|
|
895
|
+
}
|
|
857
896
|
getRangeStaticData(d, value) {
|
|
858
897
|
const changed = {};
|
|
859
898
|
// rows
|
package/dist/revo-grid/{header-cell-renderer-B-LX2sgu.js → header-cell-renderer-BMmXRsd_.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h } from './index-Chp_81rd.js';
|
|
5
|
-
import { Q as doPropMerge } from './column.service-
|
|
5
|
+
import { Q as doPropMerge } from './column.service-C6hByxPy.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Dispatches a custom event to a specified target element.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-
|
|
5
|
-
import { B as BasePlugin } from './column.drag.plugin-
|
|
6
|
-
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-
|
|
7
|
-
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-
|
|
8
|
-
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-
|
|
4
|
+
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-C6hByxPy.js';
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-V9DDE3mU.js';
|
|
6
|
+
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-V9DDE3mU.js';
|
|
7
|
+
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BMmXRsd_.js';
|
|
8
|
+
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-CdF2Jm3B.js';
|
|
9
9
|
export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-C3RUSwH5.js';
|
|
11
11
|
export { k as isAll, c as isClear, h as isCopy, a as isCtrlKey, b as isCtrlMetaKey, g as isCut, m as isEditInput, n as isEditorCtrConstructible, f as isEnterKeyValue, i as isMetaKey, j as isPaste, l as isShortcutModifier, d as isTab, e as isTabKeyValue } from './edit.utils-Dnnbd0xG.js';
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, d as createEvent, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-
|
|
5
|
+
import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-C6hByxPy.js';
|
|
6
6
|
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL } from './dimension.helpers-CGKwSvw6.js';
|
|
7
7
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
8
8
|
import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
9
|
-
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-
|
|
9
|
+
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-V9DDE3mU.js';
|
|
10
10
|
import { V as ViewportStore } from './viewport.store-_c579YyM.js';
|
|
11
11
|
import { T as ThemeService } from './theme.service-BmnDvr6P.js';
|
|
12
12
|
import { t as timeout } from './index-Db3qZoW5.js';
|
|
13
13
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
14
14
|
import './filter.button-C8XTWPU2.js';
|
|
15
|
-
import './header-cell-renderer-
|
|
15
|
+
import './header-cell-renderer-BMmXRsd_.js';
|
|
16
16
|
|
|
17
17
|
class ColumnDataProvider {
|
|
18
18
|
get stores() {
|
|
@@ -1445,7 +1445,7 @@ const RevoGridComponent = class {
|
|
|
1445
1445
|
this.rowSize = 0;
|
|
1446
1446
|
/** Indicates default column size. */
|
|
1447
1447
|
this.colSize = 100;
|
|
1448
|
-
/** When true, user can range
|
|
1448
|
+
/** When true, user can select a cell range. Required for range-based clipboard fill. */
|
|
1449
1449
|
this.range = false;
|
|
1450
1450
|
/** When true, grid in read only mode. */
|
|
1451
1451
|
this.readonly = false;
|
|
@@ -1457,7 +1457,7 @@ const RevoGridComponent = class {
|
|
|
1457
1457
|
this.noHorizontalScrollTransfer = false;
|
|
1458
1458
|
/** When true cell focus appear. */
|
|
1459
1459
|
this.canFocus = true;
|
|
1460
|
-
/** When true enable clipboard. */
|
|
1460
|
+
/** When true enable clipboard. Can be boolean or clipboard config. */
|
|
1461
1461
|
this.useClipboard = true;
|
|
1462
1462
|
/**
|
|
1463
1463
|
* Columns - defines an array of grid columns.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, h, e as Host, d as createEvent, g as getElement } from './index-Chp_81rd.js';
|
|
5
5
|
import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, F as FOCUS_CLASS, I as codesLetter, R as RESIZE_INTERVAL, y as MOBILE_CLASS, z as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, q as ROW_HEADER_TYPE, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
6
6
|
import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-BvSmBueA.js';
|
|
7
|
-
import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-
|
|
7
|
+
import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-C6hByxPy.js';
|
|
8
8
|
import { l as isShortcutModifier, m as isEditInput, c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll } from './edit.utils-Dnnbd0xG.js';
|
|
9
9
|
import { t as timeout, g as getScrollbarSize } from './index-Db3qZoW5.js';
|
|
10
10
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
@@ -649,6 +649,30 @@ class AutoFillService {
|
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
+
function getRangeFillClipboardData(data, useClipboard) {
|
|
653
|
+
var _a;
|
|
654
|
+
if (!isClipboardRangeFillEnabled(useClipboard)) {
|
|
655
|
+
return null;
|
|
656
|
+
}
|
|
657
|
+
const normalized = trimTrailingEmptyClipboardRows(data);
|
|
658
|
+
return normalized.length === 1 && ((_a = normalized[0]) === null || _a === void 0 ? void 0 : _a.length) === 1
|
|
659
|
+
? normalized
|
|
660
|
+
: null;
|
|
661
|
+
}
|
|
662
|
+
function isClipboardRangeFillEnabled(useClipboard) {
|
|
663
|
+
return (typeof useClipboard === 'object' && useClipboard.rangeFill === true);
|
|
664
|
+
}
|
|
665
|
+
function trimTrailingEmptyClipboardRows(data) {
|
|
666
|
+
const rows = [...data];
|
|
667
|
+
while (rows.length > 1 && isEmptyClipboardRow(rows[rows.length - 1])) {
|
|
668
|
+
rows.pop();
|
|
669
|
+
}
|
|
670
|
+
return rows;
|
|
671
|
+
}
|
|
672
|
+
function isEmptyClipboardRow(row) {
|
|
673
|
+
return !row || row.every(cell => cell === '');
|
|
674
|
+
}
|
|
675
|
+
|
|
652
676
|
const revogrOverlayStyleCss = () => `revogr-overlay-selection{display:block;position:relative;width:100%}revogr-overlay-selection .autofill-handle{position:absolute;width:14px;height:14px;margin-left:-13px;margin-top:-13px;z-index:10;cursor:crosshair}revogr-overlay-selection .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection.mobile .autofill-handle{position:absolute;width:30px;height:30px;margin-left:-29px;margin-top:-29px;z-index:10;cursor:crosshair}revogr-overlay-selection.mobile .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:12px;height:12px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection .selection-border-range{position:absolute;pointer-events:none;z-index:9;box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset}revogr-overlay-selection .selection-border-range .range-handlers{height:100%;background-color:transparent;width:75%;max-width:50px;min-width:20px;left:50%;transform:translateX(-50%);position:absolute}revogr-overlay-selection .selection-border-range .range-handlers>span{pointer-events:auto;height:20px;width:20px;position:absolute;left:50%;transform:translateX(-50%)}revogr-overlay-selection .selection-border-range .range-handlers>span:before,revogr-overlay-selection .selection-border-range .range-handlers>span:after{position:absolute;border-radius:5px;width:15px;height:5px;left:50%;transform:translateX(-50%);background-color:rgba(0, 0, 0, 0.2)}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child{top:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child:before{content:"";top:0}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child{bottom:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child:after{content:"";bottom:0}revogr-overlay-selection revogr-edit{z-index:10}`;
|
|
653
677
|
|
|
654
678
|
const OverlaySelection = class {
|
|
@@ -896,9 +920,9 @@ const OverlaySelection = class {
|
|
|
896
920
|
nodes.push(h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
897
921
|
}
|
|
898
922
|
}
|
|
899
|
-
return (h(Host, { key: '
|
|
923
|
+
return (h(Host, { key: 'ff303c39d59e4ef217421fa11b9a80de07311b07', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
900
924
|
// it's done to be able to throw events from different levels, not just from editor
|
|
901
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '
|
|
925
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '3cbe4c3ad7d447f779e9e20f73eec2e3107275e0', name: "data" })));
|
|
902
926
|
}
|
|
903
927
|
/**
|
|
904
928
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -1063,13 +1087,25 @@ const OverlaySelection = class {
|
|
|
1063
1087
|
if (!focus || isEditing) {
|
|
1064
1088
|
return;
|
|
1065
1089
|
}
|
|
1066
|
-
|
|
1090
|
+
const rangeFillData = getRangeFillClipboardData(data, this.useClipboard);
|
|
1091
|
+
const targetRange = rangeFillData
|
|
1092
|
+
? this.getClipboardPasteTargetRange()
|
|
1093
|
+
: null;
|
|
1094
|
+
let { changed, range } = this.columnService.getTransformedDataToApply({
|
|
1095
|
+
start: focus,
|
|
1096
|
+
data: rangeFillData || data,
|
|
1097
|
+
targetRange,
|
|
1098
|
+
});
|
|
1067
1099
|
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
|
|
1068
1100
|
if (canPaste) {
|
|
1069
1101
|
return;
|
|
1070
1102
|
}
|
|
1071
1103
|
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range, range);
|
|
1072
1104
|
}
|
|
1105
|
+
getClipboardPasteTargetRange() {
|
|
1106
|
+
const range = this.selectionStore.get('range');
|
|
1107
|
+
return range && !isRangeSingleCell(range) ? range : null;
|
|
1108
|
+
}
|
|
1073
1109
|
async focusNext() {
|
|
1074
1110
|
var _a;
|
|
1075
1111
|
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { M as ColumnService, u as isGrouping } from './column.service-
|
|
5
|
+
import { M as ColumnService, u as isGrouping } from './column.service-C6hByxPy.js';
|
|
6
6
|
import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
7
|
-
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-
|
|
7
|
+
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-CdF2Jm3B.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
9
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-BMmXRsd_.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-CaUDyxyU.js';
|
|
11
11
|
import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
12
12
|
import './debounce-PCRWZliA.js';
|
|
@@ -7,6 +7,11 @@ export type ColumnStores = {
|
|
|
7
7
|
export type RowStores = {
|
|
8
8
|
[T in DimensionRows]: Observable<DSourceState<DataType, DimensionRows>>;
|
|
9
9
|
};
|
|
10
|
+
type DataToApplyOptions = {
|
|
11
|
+
start: Cell;
|
|
12
|
+
data: DataFormat[][];
|
|
13
|
+
targetRange?: RangeArea | null;
|
|
14
|
+
};
|
|
10
15
|
export declare function getCellEditor(column: Pick<ColumnRegular, 'editor'> | undefined, editors?: Editors): EditorCtr | undefined;
|
|
11
16
|
export default class ColumnService {
|
|
12
17
|
private dataStore;
|
|
@@ -30,10 +35,13 @@ export default class ColumnService {
|
|
|
30
35
|
changed: DataLookup;
|
|
31
36
|
mapping: OldNewRangeMapping;
|
|
32
37
|
};
|
|
33
|
-
getTransformedDataToApply(start
|
|
38
|
+
getTransformedDataToApply({ start, data, targetRange, }: DataToApplyOptions): {
|
|
34
39
|
changed: DataLookup;
|
|
35
40
|
range: RangeArea | null;
|
|
36
41
|
};
|
|
42
|
+
private getDataApplyBounds;
|
|
43
|
+
private applyClipboardRow;
|
|
44
|
+
private getAppliedRange;
|
|
37
45
|
getRangeStaticData(d: RangeArea, value: DataFormat): DataLookup;
|
|
38
46
|
getRangeTransformedToProps(d: RangeArea, store: Observable<DSourceState<DataType, DimensionRows>>): {
|
|
39
47
|
prop: ColumnProp;
|
|
@@ -59,3 +67,4 @@ export default class ColumnService {
|
|
|
59
67
|
*/
|
|
60
68
|
export declare function isRowDragService(rowDrag: RowDrag, model: ColumnDataSchemaModel): boolean;
|
|
61
69
|
export declare function doPropMerge(existing: CellProps, extra: CellProps): CellProps;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ClipboardConfig } from "../../types/index";
|
|
2
|
+
export declare function getRangeFillClipboardData(data: string[][], useClipboard: boolean | ClipboardConfig): string[][] | null;
|
|
3
|
+
export declare function isClipboardRangeFillEnabled(useClipboard: boolean | ClipboardConfig): boolean;
|