@revolist/revogrid 4.23.20 → 4.23.22
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/{column.drag.plugin-ByDJ7Rk3.js → column.drag.plugin-Cz-T4y3M.js} +43 -31
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +44 -19
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +1 -1
- package/dist/collection/components/editors/revogr-edit-style.css +2 -1
- package/dist/collection/components/revoGrid/revo-grid.js +65 -2
- package/dist/collection/components/revoGrid/viewport.service.js +17 -13
- package/dist/collection/plugins/base.plugin.js +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.js +42 -30
- package/dist/collection/services/dimension.provider.js +8 -4
- package/dist/collection/types/events.js +1 -0
- package/dist/esm/{column.drag.plugin-BZacA8n_.js → column.drag.plugin-DKkf7Zqb.js} +43 -31
- package/dist/esm/index.js +3 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +44 -19
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/{column.drag.plugin-BZacA8n_.js → column.drag.plugin-DKkf7Zqb.js} +43 -31
- package/dist/revo-grid/index.esm.js +3 -2
- package/dist/revo-grid/revo-grid.entry.js +44 -19
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/types/components/revoGrid/revo-grid.d.ts +15 -1
- package/dist/types/components/revoGrid/viewport.service.d.ts +3 -1
- package/dist/types/components.d.ts +17 -2
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +3 -1
- package/dist/types/plugins/sorting/sorting.types.d.ts +22 -1
- package/dist/types/services/dimension.provider.d.ts +4 -1
- package/dist/types/types/events.d.ts +1 -1
- package/hydrate/index.js +88 -50
- package/hydrate/index.mjs +88 -50
- package/package.json +1 -1
- package/standalone/index.js +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-edit2.js +1 -1
|
@@ -30,7 +30,7 @@ function mergeSortedRowsWithGroups(indexes, source, sortedRows) {
|
|
|
30
30
|
* 1. @event `beforesorting` - Triggered when sorting just starts. Nothing has happened yet. This can be triggered from a column or from the source. If the type is from rows, the column will be undefined.
|
|
31
31
|
* 2. @event `beforesourcesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted.
|
|
32
32
|
* 3. @event `beforesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted. This event is only called from a column sorting click.
|
|
33
|
-
* 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed.
|
|
33
|
+
* 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. The event detail includes the final sorting state and sorting column metadata when available.
|
|
34
34
|
*
|
|
35
35
|
* Note: If you prevent an event, it will not proceed to the subsequent steps.
|
|
36
36
|
*/
|
|
@@ -172,6 +172,38 @@ export class SortingPlugin extends BasePlugin {
|
|
|
172
172
|
});
|
|
173
173
|
this.setSortingState(state);
|
|
174
174
|
}
|
|
175
|
+
resetSortingForStore(type) {
|
|
176
|
+
const storeService = this.providers.data.stores[type];
|
|
177
|
+
// row data
|
|
178
|
+
const source = storeService.store.get('source');
|
|
179
|
+
// row indexes
|
|
180
|
+
const proxyItems = storeService.store.get('proxyItems');
|
|
181
|
+
// row indexes
|
|
182
|
+
const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
|
|
183
|
+
this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
|
|
184
|
+
storeService.setData({ proxyItems: newItemsOrder });
|
|
185
|
+
}
|
|
186
|
+
applySortingForStore(type, sorting, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
|
|
187
|
+
const storeService = this.providers.data.stores[type];
|
|
188
|
+
// row data
|
|
189
|
+
const source = storeService.store.get('source');
|
|
190
|
+
// row indexes
|
|
191
|
+
const proxyItems = storeService.store.get('proxyItems');
|
|
192
|
+
const sortItems = getSortableRowIndexes(proxyItems, source);
|
|
193
|
+
const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, sortingColumns, sortingOrder);
|
|
194
|
+
const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
|
|
195
|
+
// take row indexes before trim applied and proxy items
|
|
196
|
+
const prevItems = storeService.store.get('items');
|
|
197
|
+
storeService.setData({
|
|
198
|
+
proxyItems: newItemsOrder,
|
|
199
|
+
});
|
|
200
|
+
// take currently visible row indexes
|
|
201
|
+
const newItems = storeService.store.get('items');
|
|
202
|
+
if (!ignoreViewportUpdate) {
|
|
203
|
+
this.providers.dimension
|
|
204
|
+
.updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
175
207
|
startSorting(order, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
|
|
176
208
|
if (!this.sortingPromise) {
|
|
177
209
|
// add job before render
|
|
@@ -263,44 +295,24 @@ export class SortingPlugin extends BasePlugin {
|
|
|
263
295
|
// if no sorting - reset
|
|
264
296
|
if (!Object.keys(sorting || {}).length) {
|
|
265
297
|
for (let type of activeTypes) {
|
|
266
|
-
|
|
267
|
-
// row data
|
|
268
|
-
const source = storeService.store.get('source');
|
|
269
|
-
// row indexes
|
|
270
|
-
const proxyItems = storeService.store.get('proxyItems');
|
|
271
|
-
// row indexes
|
|
272
|
-
const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
|
|
273
|
-
this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
|
|
274
|
-
storeService.setData({ proxyItems: newItemsOrder });
|
|
298
|
+
this.resetSortingForStore(type);
|
|
275
299
|
}
|
|
276
300
|
}
|
|
277
301
|
else {
|
|
278
302
|
for (let type of activeTypes) {
|
|
279
|
-
|
|
280
|
-
// row data
|
|
281
|
-
const source = storeService.store.get('source');
|
|
282
|
-
// row indexes
|
|
283
|
-
const proxyItems = storeService.store.get('proxyItems');
|
|
284
|
-
const sortItems = getSortableRowIndexes(proxyItems, source);
|
|
285
|
-
const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, activeSortingColumns, activeSortingOrder);
|
|
286
|
-
const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
|
|
287
|
-
// take row indexes before trim applied and proxy items
|
|
288
|
-
const prevItems = storeService.store.get('items');
|
|
289
|
-
storeService.setData({
|
|
290
|
-
proxyItems: newItemsOrder,
|
|
291
|
-
});
|
|
292
|
-
// take currently visible row indexes
|
|
293
|
-
const newItems = storeService.store.get('items');
|
|
294
|
-
if (!activeIgnoreViewportUpdate) {
|
|
295
|
-
this.providers.dimension
|
|
296
|
-
.updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
|
|
297
|
-
}
|
|
303
|
+
this.applySortingForStore(type, sorting, sortingFunc, activeSortingColumns, activeSortingOrder, activeIgnoreViewportUpdate);
|
|
298
304
|
}
|
|
299
305
|
}
|
|
300
306
|
// refresh columns to redraw column headers and show correct icon
|
|
301
307
|
columnTypes.forEach((type) => {
|
|
302
308
|
this.providers.column.dataSources[type].refresh();
|
|
303
309
|
});
|
|
304
|
-
|
|
310
|
+
const afterSortingDetail = {
|
|
311
|
+
sorting: hasActiveSorting(sorting) ? sorting : undefined,
|
|
312
|
+
sortingColumns: activeSortingColumns,
|
|
313
|
+
sortingOrder: activeSortingOrder,
|
|
314
|
+
types: activeTypes,
|
|
315
|
+
};
|
|
316
|
+
this.emit('aftersortingapply', afterSortingDetail);
|
|
305
317
|
}
|
|
306
318
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import reduce from "lodash/reduce";
|
|
5
4
|
import debounce from "lodash/debounce";
|
|
6
5
|
import { RESIZE_INTERVAL } from "../utils/consts";
|
|
7
6
|
import { columnTypes, rowTypes, getItemByIndex, DimensionStore, gatherTrimmedItems, } from "../store/index";
|
|
8
7
|
import { getColumnSizes } from "../utils/column.utils";
|
|
9
8
|
import { getScrollDimension } from "./scroll.dimension.helpers";
|
|
9
|
+
export const DEFAULT_VIRTUAL_X = ['rgCol'];
|
|
10
|
+
export function isVirtualXDimension(type, disableVirtualX = false, virtualX = DEFAULT_VIRTUAL_X) {
|
|
11
|
+
return !disableVirtualX && virtualX.includes(type);
|
|
12
|
+
}
|
|
10
13
|
/**
|
|
11
14
|
* Dimension provider
|
|
12
15
|
* Stores dimension information and custom sizes
|
|
@@ -17,7 +20,7 @@ export default class DimensionProvider {
|
|
|
17
20
|
constructor(viewports, config) {
|
|
18
21
|
this.viewports = viewports;
|
|
19
22
|
const sizeChanged = debounce((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
20
|
-
this.stores =
|
|
23
|
+
this.stores = [...rowTypes, ...columnTypes].reduce((sources, t) => {
|
|
21
24
|
sources[t] = new DimensionStore(t);
|
|
22
25
|
sources[t].store.onChange('realSize', () => sizeChanged(t));
|
|
23
26
|
return sources;
|
|
@@ -93,8 +96,9 @@ export default class DimensionProvider {
|
|
|
93
96
|
* Applies new columns to the dimension provider
|
|
94
97
|
* @param columns - new columns data
|
|
95
98
|
* @param disableVirtualX - disable virtual data for X axis
|
|
99
|
+
* @param virtualX - column dimensions that should use virtual data
|
|
96
100
|
*/
|
|
97
|
-
applyNewColumns(columns, disableVirtualX, keepOld = false) {
|
|
101
|
+
applyNewColumns(columns, disableVirtualX, keepOld = false, virtualX = DEFAULT_VIRTUAL_X) {
|
|
98
102
|
// Apply new columns to dimension provider
|
|
99
103
|
for (let type of columnTypes) {
|
|
100
104
|
if (!keepOld) {
|
|
@@ -104,7 +108,7 @@ export default class DimensionProvider {
|
|
|
104
108
|
// Get the new columns for the current type
|
|
105
109
|
const items = columns[type];
|
|
106
110
|
// Determine if virtual data should be disabled for the current type
|
|
107
|
-
const noVirtual = type
|
|
111
|
+
const noVirtual = !isVirtualXDimension(type, disableVirtualX, virtualX);
|
|
108
112
|
// Set the items count in the dimension provider
|
|
109
113
|
this.stores[type].setStore({ count: items.length });
|
|
110
114
|
// Set the custom sizes for the columns
|
|
@@ -13,6 +13,7 @@ export const REVOGRID_EVENTS = new Map([
|
|
|
13
13
|
['beforesorting', 'beforesorting'],
|
|
14
14
|
['beforesourcesortingapply', 'beforesourcesortingapply'],
|
|
15
15
|
['beforesortingapply', 'beforesortingapply'],
|
|
16
|
+
['aftersortingapply', 'aftersortingapply'],
|
|
16
17
|
['rowdragstart', 'rowdragstart'],
|
|
17
18
|
['headerclick', 'headerclick'],
|
|
18
19
|
['beforecellfocus', 'beforecellfocus'],
|
|
@@ -350,7 +350,7 @@ class BasePlugin {
|
|
|
350
350
|
},
|
|
351
351
|
});
|
|
352
352
|
if (immediate) {
|
|
353
|
-
callback(nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
|
|
353
|
+
callback((nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.get) ? nativeValueDesc.get.call(this.revogrid) : nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
/**
|
|
@@ -1875,7 +1875,7 @@ function mergeSortedRowsWithGroups(indexes, source, sortedRows) {
|
|
|
1875
1875
|
* 1. @event `beforesorting` - Triggered when sorting just starts. Nothing has happened yet. This can be triggered from a column or from the source. If the type is from rows, the column will be undefined.
|
|
1876
1876
|
* 2. @event `beforesourcesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted.
|
|
1877
1877
|
* 3. @event `beforesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted. This event is only called from a column sorting click.
|
|
1878
|
-
* 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed.
|
|
1878
|
+
* 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. The event detail includes the final sorting state and sorting column metadata when available.
|
|
1879
1879
|
*
|
|
1880
1880
|
* Note: If you prevent an event, it will not proceed to the subsequent steps.
|
|
1881
1881
|
*/
|
|
@@ -2017,6 +2017,38 @@ class SortingPlugin extends BasePlugin {
|
|
|
2017
2017
|
});
|
|
2018
2018
|
this.setSortingState(state);
|
|
2019
2019
|
}
|
|
2020
|
+
resetSortingForStore(type) {
|
|
2021
|
+
const storeService = this.providers.data.stores[type];
|
|
2022
|
+
// row data
|
|
2023
|
+
const source = storeService.store.get('source');
|
|
2024
|
+
// row indexes
|
|
2025
|
+
const proxyItems = storeService.store.get('proxyItems');
|
|
2026
|
+
// row indexes
|
|
2027
|
+
const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
|
|
2028
|
+
this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
|
|
2029
|
+
storeService.setData({ proxyItems: newItemsOrder });
|
|
2030
|
+
}
|
|
2031
|
+
applySortingForStore(type, sorting, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
|
|
2032
|
+
const storeService = this.providers.data.stores[type];
|
|
2033
|
+
// row data
|
|
2034
|
+
const source = storeService.store.get('source');
|
|
2035
|
+
// row indexes
|
|
2036
|
+
const proxyItems = storeService.store.get('proxyItems');
|
|
2037
|
+
const sortItems = getSortableRowIndexes(proxyItems, source);
|
|
2038
|
+
const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, sortingColumns, sortingOrder);
|
|
2039
|
+
const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
|
|
2040
|
+
// take row indexes before trim applied and proxy items
|
|
2041
|
+
const prevItems = storeService.store.get('items');
|
|
2042
|
+
storeService.setData({
|
|
2043
|
+
proxyItems: newItemsOrder,
|
|
2044
|
+
});
|
|
2045
|
+
// take currently visible row indexes
|
|
2046
|
+
const newItems = storeService.store.get('items');
|
|
2047
|
+
if (!ignoreViewportUpdate) {
|
|
2048
|
+
this.providers.dimension
|
|
2049
|
+
.updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2020
2052
|
startSorting(order, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
|
|
2021
2053
|
if (!this.sortingPromise) {
|
|
2022
2054
|
// add job before render
|
|
@@ -2108,45 +2140,25 @@ class SortingPlugin extends BasePlugin {
|
|
|
2108
2140
|
// if no sorting - reset
|
|
2109
2141
|
if (!Object.keys(sorting || {}).length) {
|
|
2110
2142
|
for (let type of activeTypes) {
|
|
2111
|
-
|
|
2112
|
-
// row data
|
|
2113
|
-
const source = storeService.store.get('source');
|
|
2114
|
-
// row indexes
|
|
2115
|
-
const proxyItems = storeService.store.get('proxyItems');
|
|
2116
|
-
// row indexes
|
|
2117
|
-
const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
|
|
2118
|
-
this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
|
|
2119
|
-
storeService.setData({ proxyItems: newItemsOrder });
|
|
2143
|
+
this.resetSortingForStore(type);
|
|
2120
2144
|
}
|
|
2121
2145
|
}
|
|
2122
2146
|
else {
|
|
2123
2147
|
for (let type of activeTypes) {
|
|
2124
|
-
|
|
2125
|
-
// row data
|
|
2126
|
-
const source = storeService.store.get('source');
|
|
2127
|
-
// row indexes
|
|
2128
|
-
const proxyItems = storeService.store.get('proxyItems');
|
|
2129
|
-
const sortItems = getSortableRowIndexes(proxyItems, source);
|
|
2130
|
-
const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, activeSortingColumns, activeSortingOrder);
|
|
2131
|
-
const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
|
|
2132
|
-
// take row indexes before trim applied and proxy items
|
|
2133
|
-
const prevItems = storeService.store.get('items');
|
|
2134
|
-
storeService.setData({
|
|
2135
|
-
proxyItems: newItemsOrder,
|
|
2136
|
-
});
|
|
2137
|
-
// take currently visible row indexes
|
|
2138
|
-
const newItems = storeService.store.get('items');
|
|
2139
|
-
if (!activeIgnoreViewportUpdate) {
|
|
2140
|
-
this.providers.dimension
|
|
2141
|
-
.updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
|
|
2142
|
-
}
|
|
2148
|
+
this.applySortingForStore(type, sorting, sortingFunc, activeSortingColumns, activeSortingOrder, activeIgnoreViewportUpdate);
|
|
2143
2149
|
}
|
|
2144
2150
|
}
|
|
2145
2151
|
// refresh columns to redraw column headers and show correct icon
|
|
2146
2152
|
columnTypes.forEach((type) => {
|
|
2147
2153
|
this.providers.column.dataSources[type].refresh();
|
|
2148
2154
|
});
|
|
2149
|
-
|
|
2155
|
+
const afterSortingDetail = {
|
|
2156
|
+
sorting: hasActiveSorting(sorting) ? sorting : undefined,
|
|
2157
|
+
sortingColumns: activeSortingColumns,
|
|
2158
|
+
sortingOrder: activeSortingOrder,
|
|
2159
|
+
types: activeTypes,
|
|
2160
|
+
};
|
|
2161
|
+
this.emit('aftersortingapply', afterSortingDetail);
|
|
2150
2162
|
}
|
|
2151
2163
|
}
|
|
2152
2164
|
|
package/dist/esm/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
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-
|
|
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-
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-DKkf7Zqb.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-DKkf7Zqb.js';
|
|
7
7
|
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BMmXRsd_.js';
|
|
8
8
|
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-CLTRlCa5.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';
|
|
@@ -27,6 +27,7 @@ const REVOGRID_EVENTS = new Map([
|
|
|
27
27
|
['beforesorting', 'beforesorting'],
|
|
28
28
|
['beforesourcesortingapply', 'beforesourcesortingapply'],
|
|
29
29
|
['beforesortingapply', 'beforesortingapply'],
|
|
30
|
+
['aftersortingapply', 'aftersortingapply'],
|
|
30
31
|
['rowdragstart', 'rowdragstart'],
|
|
31
32
|
['headerclick', 'headerclick'],
|
|
32
33
|
['beforecellfocus', 'beforecellfocus'],
|
package/dist/esm/loader.js
CHANGED
|
@@ -9,7 +9,7 @@ import './theme.service-BmnDvr6P.js';
|
|
|
9
9
|
const defineCustomElements = async (win, options) => {
|
|
10
10
|
if (typeof window === 'undefined') return undefined;
|
|
11
11
|
await globalScripts();
|
|
12
|
-
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"theme":[{"themeChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
12
|
+
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"theme":[{"themeChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export { defineCustomElements };
|
|
@@ -6,7 +6,7 @@ import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as
|
|
|
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-DKkf7Zqb.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';
|
|
@@ -230,6 +230,10 @@ class DataProvider {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
const DEFAULT_VIRTUAL_X = ['rgCol'];
|
|
234
|
+
function isVirtualXDimension(type, disableVirtualX = false, virtualX = DEFAULT_VIRTUAL_X) {
|
|
235
|
+
return !disableVirtualX && virtualX.includes(type);
|
|
236
|
+
}
|
|
233
237
|
/**
|
|
234
238
|
* Dimension provider
|
|
235
239
|
* Stores dimension information and custom sizes
|
|
@@ -240,7 +244,7 @@ class DimensionProvider {
|
|
|
240
244
|
constructor(viewports, config) {
|
|
241
245
|
this.viewports = viewports;
|
|
242
246
|
const sizeChanged = debounce((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
243
|
-
this.stores =
|
|
247
|
+
this.stores = [...rowTypes, ...columnTypes].reduce((sources, t) => {
|
|
244
248
|
sources[t] = new DimensionStore(t);
|
|
245
249
|
sources[t].store.onChange('realSize', () => sizeChanged(t));
|
|
246
250
|
return sources;
|
|
@@ -316,8 +320,9 @@ class DimensionProvider {
|
|
|
316
320
|
* Applies new columns to the dimension provider
|
|
317
321
|
* @param columns - new columns data
|
|
318
322
|
* @param disableVirtualX - disable virtual data for X axis
|
|
323
|
+
* @param virtualX - column dimensions that should use virtual data
|
|
319
324
|
*/
|
|
320
|
-
applyNewColumns(columns, disableVirtualX, keepOld = false) {
|
|
325
|
+
applyNewColumns(columns, disableVirtualX, keepOld = false, virtualX = DEFAULT_VIRTUAL_X) {
|
|
321
326
|
// Apply new columns to dimension provider
|
|
322
327
|
for (let type of columnTypes) {
|
|
323
328
|
if (!keepOld) {
|
|
@@ -327,7 +332,7 @@ class DimensionProvider {
|
|
|
327
332
|
// Get the new columns for the current type
|
|
328
333
|
const items = columns[type];
|
|
329
334
|
// Determine if virtual data should be disabled for the current type
|
|
330
|
-
const noVirtual = type
|
|
335
|
+
const noVirtual = !isVirtualXDimension(type, disableVirtualX, virtualX);
|
|
331
336
|
// Set the items count in the dimension provider
|
|
332
337
|
this.stores[type].setStore({ count: items.length });
|
|
333
338
|
// Set the custom sizes for the columns
|
|
@@ -433,6 +438,9 @@ class ViewportProvider {
|
|
|
433
438
|
}
|
|
434
439
|
}
|
|
435
440
|
|
|
441
|
+
function getViewportResizeDimension(colType, dimension) {
|
|
442
|
+
return dimension === 'rgCol' ? colType : dimension;
|
|
443
|
+
}
|
|
436
444
|
/** Collect Column data */
|
|
437
445
|
function gatherColumnData(data) {
|
|
438
446
|
const colDimension = data.dimensions[data.colType].store;
|
|
@@ -492,20 +500,20 @@ class ViewportService {
|
|
|
492
500
|
colStore,
|
|
493
501
|
onHeaderresize: e => this.onColumnResize(val, e, colStore),
|
|
494
502
|
};
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
clientSize: e.detail.size,
|
|
500
|
-
};
|
|
501
|
-
// virtual size will be handled by dimension provider if disabled
|
|
502
|
-
if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)
|
|
503
|
-
|| (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {
|
|
504
|
-
vpState.virtualSize = e.detail.size;
|
|
505
|
-
}
|
|
506
|
-
(_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(e.detail.dimension, vpState);
|
|
503
|
+
column.onResizeviewport = (e) => {
|
|
504
|
+
var _a;
|
|
505
|
+
const vpState = {
|
|
506
|
+
clientSize: e.detail.size,
|
|
507
507
|
};
|
|
508
|
-
|
|
508
|
+
const dimension = getViewportResizeDimension(val, e.detail.dimension);
|
|
509
|
+
const isVirtualColumn = columnTypes.includes(dimension)
|
|
510
|
+
&& isVirtualXDimension(dimension, config.disableVirtualX, config.virtualX);
|
|
511
|
+
// Keep virtual dimensions in sync with their viewport size.
|
|
512
|
+
if ((dimension === 'rgRow' && !config.disableVirtualY) || isVirtualColumn) {
|
|
513
|
+
vpState.virtualSize = e.detail.size;
|
|
514
|
+
}
|
|
515
|
+
(_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(dimension, vpState);
|
|
516
|
+
};
|
|
509
517
|
const colData = gatherColumnData(column);
|
|
510
518
|
const columnSelectionStore = this.registerCol(colData.position.x, val);
|
|
511
519
|
// render per each column data collections vertically
|
|
@@ -1405,6 +1413,7 @@ const RevoGridComponent = class {
|
|
|
1405
1413
|
this.beforesorting = createEvent(this, "beforesorting", 7);
|
|
1406
1414
|
this.beforesourcesortingapply = createEvent(this, "beforesourcesortingapply", 7);
|
|
1407
1415
|
this.beforesortingapply = createEvent(this, "beforesortingapply", 7);
|
|
1416
|
+
this.aftersortingapply = createEvent(this, "aftersortingapply", 7);
|
|
1408
1417
|
this.rowdragstart = createEvent(this, "rowdragstart", 7);
|
|
1409
1418
|
this.headerclick = createEvent(this, "headerclick", 7);
|
|
1410
1419
|
this.beforecellfocus = createEvent(this, "beforecellfocus", 7);
|
|
@@ -1554,6 +1563,12 @@ const RevoGridComponent = class {
|
|
|
1554
1563
|
* Can be used for initial rendering performance improvement.
|
|
1555
1564
|
*/
|
|
1556
1565
|
this.disableVirtualX = false;
|
|
1566
|
+
/**
|
|
1567
|
+
* Column dimensions that use X axis virtual rendering.
|
|
1568
|
+
* Defaults to regular columns only to preserve pinned column behavior.
|
|
1569
|
+
* Set to `['rgCol', 'colPinStart', 'colPinEnd']` to virtualize all column areas.
|
|
1570
|
+
*/
|
|
1571
|
+
this.virtualX = ['rgCol'];
|
|
1557
1572
|
/**
|
|
1558
1573
|
* Disable lazy rendering mode for the `Y axis`.
|
|
1559
1574
|
* Use when not many rows present and you don't need rerenader cells during scroll.
|
|
@@ -2005,7 +2020,7 @@ const RevoGridComponent = class {
|
|
|
2005
2020
|
if (beforeSetEvent.defaultPrevented) {
|
|
2006
2021
|
return;
|
|
2007
2022
|
}
|
|
2008
|
-
this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init);
|
|
2023
|
+
this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init, this.virtualX);
|
|
2009
2024
|
const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);
|
|
2010
2025
|
if (beforeApplyEvent.defaultPrevented) {
|
|
2011
2026
|
return;
|
|
@@ -2081,12 +2096,18 @@ const RevoGridComponent = class {
|
|
|
2081
2096
|
};
|
|
2082
2097
|
this.viewport.setFocus(colType, pending.rowType, cell, cell);
|
|
2083
2098
|
}
|
|
2084
|
-
|
|
2099
|
+
refreshColumnsOnConfigChange(newVal, prevVal) {
|
|
2085
2100
|
if (newVal === prevVal) {
|
|
2086
2101
|
return;
|
|
2087
2102
|
}
|
|
2088
2103
|
this.columnChanged(this.columns);
|
|
2089
2104
|
}
|
|
2105
|
+
disableVirtualXChanged(newVal = false, prevVal = false) {
|
|
2106
|
+
this.refreshColumnsOnConfigChange(newVal, prevVal);
|
|
2107
|
+
}
|
|
2108
|
+
virtualXChanged(newVal = ['rgCol'], prevVal = ['rgCol']) {
|
|
2109
|
+
this.refreshColumnsOnConfigChange(newVal, prevVal);
|
|
2110
|
+
}
|
|
2090
2111
|
rowSizeChanged(s) {
|
|
2091
2112
|
if (!this.dimensionProvider) {
|
|
2092
2113
|
return;
|
|
@@ -2412,6 +2433,7 @@ const RevoGridComponent = class {
|
|
|
2412
2433
|
selectionStoreConnector: this.selectionStoreConnector,
|
|
2413
2434
|
noHorizontalScrollTransfer: this.noHorizontalScrollTransfer,
|
|
2414
2435
|
disableVirtualX: this.disableVirtualX,
|
|
2436
|
+
virtualX: this.virtualX,
|
|
2415
2437
|
disableVirtualY: this.disableVirtualY,
|
|
2416
2438
|
resize: c => this.aftercolumnresize.emit(c),
|
|
2417
2439
|
}, contentHeight);
|
|
@@ -2486,6 +2508,9 @@ const RevoGridComponent = class {
|
|
|
2486
2508
|
"disableVirtualX": [{
|
|
2487
2509
|
"disableVirtualXChanged": 0
|
|
2488
2510
|
}],
|
|
2511
|
+
"virtualX": [{
|
|
2512
|
+
"virtualXChanged": 0
|
|
2513
|
+
}],
|
|
2489
2514
|
"rowSize": [{
|
|
2490
2515
|
"rowSizeChanged": 0
|
|
2491
2516
|
}],
|
package/dist/esm/revo-grid.js
CHANGED
|
@@ -48,5 +48,5 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
48
48
|
|
|
49
49
|
patchBrowser().then(async (options) => {
|
|
50
50
|
await globalScripts();
|
|
51
|
-
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"theme":[{"themeChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
51
|
+
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"theme":[{"themeChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
52
52
|
});
|
|
@@ -147,7 +147,7 @@ const Clipboard = class {
|
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
|
|
150
|
-
const revogrEditStyleCss = () => `revogr-edit{display:block;position:absolute;background-color
|
|
150
|
+
const revogrEditStyleCss = () => `revogr-edit{display:block;position:absolute;background-color:var(--revo-grid-background, #fff)}revogr-edit input{height:100%;width:100%;box-sizing:border-box;background-color:var(--revo-grid-background, transparent)}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}`;
|
|
151
151
|
|
|
152
152
|
const RevoEdit = class {
|
|
153
153
|
constructor(hostRef) {
|