@revolist/revogrid 4.23.2 → 4.23.4
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-DJueWxN_.js → column.drag.plugin-_W9mYaRy.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/revo-grid.cjs.entry.js +12 -3
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +18 -9
- package/dist/cjs/{viewport.store-BlKQ4x9H.js → viewport.store-BscUCiUk.js} +23 -0
- package/dist/collection/components/revoGrid/viewport.resize.service.js +1 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +17 -9
- package/dist/collection/services/dimension.provider.js +11 -2
- package/dist/collection/store/vp/viewport.helpers.js +23 -0
- package/dist/{revo-grid/column.drag.plugin-DCZW62Uc.js → esm/column.drag.plugin-B9t9kBO5.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/revo-grid.entry.js +12 -3
- package/dist/esm/revogr-attribution_7.entry.js +1 -1
- package/dist/esm/revogr-data_4.entry.js +18 -9
- package/dist/{revo-grid/viewport.store-COAfzAyu.js → esm/viewport.store-_c579YyM.js} +23 -0
- package/dist/{esm/column.drag.plugin-DCZW62Uc.js → revo-grid/column.drag.plugin-B9t9kBO5.js} +1 -1
- package/dist/revo-grid/index.esm.js +3 -3
- package/dist/revo-grid/revo-grid.entry.js +12 -3
- package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +18 -9
- package/dist/{esm/viewport.store-COAfzAyu.js → revo-grid/viewport.store-_c579YyM.js} +23 -0
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +1 -0
- package/dist/types/services/scroll.dimension.helpers.d.ts +19 -0
- package/dist/types/store/vp/viewport.helpers.d.ts +23 -0
- package/hydrate/index.js +51 -10
- package/hydrate/index.mjs +51 -10
- package/package.json +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
var column_service = require('./column.service-C1Qvcf5l.js');
|
|
7
7
|
var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
|
|
8
|
-
var viewport_store = require('./viewport.store-
|
|
8
|
+
var viewport_store = require('./viewport.store-BscUCiUk.js');
|
|
9
9
|
var index$1 = require('./index-DxaSE5uZ.js');
|
|
10
10
|
var index = require('./index-Dq8Xzj5l.js');
|
|
11
11
|
var filter_button = require('./filter.button-w6LWnyhi.js');
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var column_service = require('./column.service-C1Qvcf5l.js');
|
|
7
|
-
var column_drag_plugin = require('./column.drag.plugin-
|
|
7
|
+
var column_drag_plugin = require('./column.drag.plugin-_W9mYaRy.js');
|
|
8
8
|
var headerCellRenderer = require('./header-cell-renderer-QrcXXSkF.js');
|
|
9
9
|
var cellRenderer = require('./cell-renderer-Dcz022q7.js');
|
|
10
10
|
var index$1 = require('./index-DxaSE5uZ.js');
|
|
@@ -12,7 +12,7 @@ var textEditor = require('./text-editor-B4W-m-r-.js');
|
|
|
12
12
|
var edit_utils = require('./edit.utils-pKeiYFLJ.js');
|
|
13
13
|
var index = require('./index-Dq8Xzj5l.js');
|
|
14
14
|
var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
|
|
15
|
-
var viewport_store = require('./viewport.store-
|
|
15
|
+
var viewport_store = require('./viewport.store-BscUCiUk.js');
|
|
16
16
|
var filter_button = require('./filter.button-w6LWnyhi.js');
|
|
17
17
|
require('./debounce-CcpHiH2p.js');
|
|
18
18
|
|
|
@@ -8,8 +8,8 @@ var column_service = require('./column.service-C1Qvcf5l.js');
|
|
|
8
8
|
var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
|
|
9
9
|
var debounce = require('./debounce-CcpHiH2p.js');
|
|
10
10
|
var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var column_drag_plugin = require('./column.drag.plugin-_W9mYaRy.js');
|
|
12
|
+
var viewport_store = require('./viewport.store-BscUCiUk.js');
|
|
13
13
|
var theme_service = require('./theme.service-BgnxGIjK.js');
|
|
14
14
|
var index$1 = require('./index-DxaSE5uZ.js');
|
|
15
15
|
var events = require('./events-DeLDyZlb.js');
|
|
@@ -374,7 +374,16 @@ class DimensionProvider {
|
|
|
374
374
|
clientSize,
|
|
375
375
|
virtualSize: viewportSize,
|
|
376
376
|
});
|
|
377
|
-
|
|
377
|
+
// Render offset must use the true logical scroll coordinate
|
|
378
|
+
// It is the logical scroll position that should be used for compressed-scroll offset math.
|
|
379
|
+
const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
|
|
380
|
+
scrollDimension.logicalScrollSize); // prevents positions past the logical end
|
|
381
|
+
/**
|
|
382
|
+
* If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
|
|
383
|
+
* Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
|
|
384
|
+
*
|
|
385
|
+
* In normal scrolling, logical and physical coordinates are the same, so offset is 0.
|
|
386
|
+
*/
|
|
378
387
|
const renderOffset = clientSize && viewportSize
|
|
379
388
|
? scrollDimension.getRenderOffset(renderCoordinate)
|
|
380
389
|
: 0;
|
|
@@ -10,7 +10,7 @@ var column_service = require('./column.service-C1Qvcf5l.js');
|
|
|
10
10
|
var edit_utils = require('./edit.utils-pKeiYFLJ.js');
|
|
11
11
|
var index$1 = require('./index-DxaSE5uZ.js');
|
|
12
12
|
var debounce = require('./debounce-CcpHiH2p.js');
|
|
13
|
-
var viewport_store = require('./viewport.store-
|
|
13
|
+
var viewport_store = require('./viewport.store-BscUCiUk.js');
|
|
14
14
|
var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
|
|
15
15
|
var throttle = require('./throttle-BCwEuJJq.js');
|
|
16
16
|
|
|
@@ -607,6 +607,7 @@ class GridResizeService {
|
|
|
607
607
|
}
|
|
608
608
|
destroy() {
|
|
609
609
|
var _a;
|
|
610
|
+
this.apply.cancel();
|
|
610
611
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
611
612
|
this.resizeObserver = null;
|
|
612
613
|
}
|
|
@@ -745,6 +746,10 @@ const RevogrViewportScroll = class {
|
|
|
745
746
|
scroll: this.horizontalScroll.scrollLeft,
|
|
746
747
|
noScroll: this.colType !== 'rgCol',
|
|
747
748
|
};
|
|
749
|
+
this.setScrollParams({
|
|
750
|
+
rgRow: calculatedHeight,
|
|
751
|
+
rgCol: calculatedWidth,
|
|
752
|
+
});
|
|
748
753
|
// Process changes in order: width first, then height
|
|
749
754
|
const dimensions = ['rgCol', 'rgRow'];
|
|
750
755
|
for (const dimension of dimensions) {
|
|
@@ -801,26 +806,30 @@ const RevogrViewportScroll = class {
|
|
|
801
806
|
}
|
|
802
807
|
async componentDidRender() {
|
|
803
808
|
var _a, _b, _c, _d;
|
|
809
|
+
this.setScrollParams({
|
|
810
|
+
rgRow: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
811
|
+
rgCol: this.horizontalScroll.clientWidth,
|
|
812
|
+
});
|
|
813
|
+
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
814
|
+
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
815
|
+
}
|
|
816
|
+
setScrollParams(clientSize) {
|
|
804
817
|
this.localScrollService.setParams({
|
|
805
818
|
contentSize: this.contentHeight,
|
|
806
|
-
clientSize:
|
|
819
|
+
clientSize: clientSize.rgRow,
|
|
807
820
|
virtualSize: 0,
|
|
808
821
|
}, 'rgRow');
|
|
809
822
|
this.localScrollService.setParams({
|
|
810
823
|
contentSize: this.contentWidth,
|
|
811
|
-
clientSize:
|
|
824
|
+
clientSize: clientSize.rgCol,
|
|
812
825
|
virtualSize: 0,
|
|
813
826
|
}, 'rgCol');
|
|
814
|
-
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
815
|
-
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
816
827
|
}
|
|
817
828
|
render() {
|
|
818
|
-
var _a, _b
|
|
829
|
+
var _a, _b;
|
|
819
830
|
const physicalContentHeight = throttle.getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
820
|
-
const physicalContentWidth =
|
|
821
|
-
|
|
822
|
-
: throttle.getContentSize(this.contentWidth, (_d = (_c = this.horizontalScroll) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
823
|
-
return (index.h(index.Host, { key: '9b23f5c3c18924a25ecd3e1ee0909ebd03b25048', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, index.h("div", { key: '144f5c79d0a99e6423c1ca448917aedf514f0ae3', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, index.h("div", { key: '10db0971f2db6acf8510cf21d736c82f0d0e5632', class: "header-wrapper", ref: e => (this.header = e) }, index.h("slot", { key: '77e0cd002ccda4a9e420de50648b711cde412a34', name: viewport_helpers.HEADER_SLOT })), index.h("div", { key: 'a78167dc52a24005a35dd94c5a9a43eb7dd289dd', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, index.h("div", { key: 'c277d9d1ffc54452b584eb55b1a29d2a10672fb6', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, index.h("slot", { key: '01fb5630a3d40e231a3aead9ad1c07aa06e69004', name: viewport_helpers.CONTENT_SLOT }))), index.h("div", { key: 'ff7389e77b500b97ea1fc38228da9fc3d6514e30', class: "footer-wrapper", ref: e => (this.footer = e) }, index.h("slot", { key: '3aa725e0a8f38ef5d4bc4dce53037ff55a6c25b3', name: viewport_helpers.FOOTER_SLOT })))));
|
|
831
|
+
const physicalContentWidth = throttle.getContentSize(this.contentWidth, 0);
|
|
832
|
+
return (index.h(index.Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, index.h("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, index.h("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, index.h("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: viewport_helpers.HEADER_SLOT })), index.h("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, index.h("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, index.h("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: viewport_helpers.CONTENT_SLOT }))), index.h("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, index.h("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: viewport_helpers.FOOTER_SLOT })))));
|
|
824
833
|
}
|
|
825
834
|
/**
|
|
826
835
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
@@ -17,6 +17,29 @@ function getViewportMaxCoordinate(dimension, viewportSize, frameOffset = 1) {
|
|
|
17
17
|
}
|
|
18
18
|
return Math.max(0, dimension.realSize - viewportSize - dimension.originItemSize * frameOffset);
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Clamp the viewport coordinate within the valid range.
|
|
22
|
+
* Given a scroll position, pick a safe starting point for rendering visible items.
|
|
23
|
+
*
|
|
24
|
+
* Do not use it when you need the exact scroll position for positioning math.
|
|
25
|
+
*
|
|
26
|
+
* It does two things:
|
|
27
|
+
* 1. If the coordinate is below 0, use 0.
|
|
28
|
+
* 2. If the coordinate is too close to the very end, pull it back a bit.
|
|
29
|
+
*
|
|
30
|
+
* Example:
|
|
31
|
+
*
|
|
32
|
+
* content height: 1000px
|
|
33
|
+
* viewport height: 200px
|
|
34
|
+
* row height: 30px
|
|
35
|
+
* The real max scroll is:
|
|
36
|
+
*
|
|
37
|
+
* 1000 - 200 = 800
|
|
38
|
+
* But clampViewportCoordinate may clamp to:
|
|
39
|
+
*
|
|
40
|
+
* 1000 - 200 - 30 = 770
|
|
41
|
+
* Ask for 800 -> it returns 770.
|
|
42
|
+
*/
|
|
20
43
|
function clampViewportCoordinate(coordinate, dimension, viewportSize, frameOffset = 1) {
|
|
21
44
|
return Math.min(Math.max(0, coordinate), getViewportMaxCoordinate(dimension, viewportSize, frameOffset));
|
|
22
45
|
}
|
|
@@ -138,6 +138,10 @@ export class RevogrViewportScroll {
|
|
|
138
138
|
scroll: this.horizontalScroll.scrollLeft,
|
|
139
139
|
noScroll: this.colType !== 'rgCol',
|
|
140
140
|
};
|
|
141
|
+
this.setScrollParams({
|
|
142
|
+
rgRow: calculatedHeight,
|
|
143
|
+
rgCol: calculatedWidth,
|
|
144
|
+
});
|
|
141
145
|
// Process changes in order: width first, then height
|
|
142
146
|
const dimensions = ['rgCol', 'rgRow'];
|
|
143
147
|
for (const dimension of dimensions) {
|
|
@@ -194,26 +198,30 @@ export class RevogrViewportScroll {
|
|
|
194
198
|
}
|
|
195
199
|
async componentDidRender() {
|
|
196
200
|
var _a, _b, _c, _d;
|
|
201
|
+
this.setScrollParams({
|
|
202
|
+
rgRow: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
203
|
+
rgCol: this.horizontalScroll.clientWidth,
|
|
204
|
+
});
|
|
205
|
+
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
206
|
+
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
207
|
+
}
|
|
208
|
+
setScrollParams(clientSize) {
|
|
197
209
|
this.localScrollService.setParams({
|
|
198
210
|
contentSize: this.contentHeight,
|
|
199
|
-
clientSize:
|
|
211
|
+
clientSize: clientSize.rgRow,
|
|
200
212
|
virtualSize: 0,
|
|
201
213
|
}, 'rgRow');
|
|
202
214
|
this.localScrollService.setParams({
|
|
203
215
|
contentSize: this.contentWidth,
|
|
204
|
-
clientSize:
|
|
216
|
+
clientSize: clientSize.rgCol,
|
|
205
217
|
virtualSize: 0,
|
|
206
218
|
}, 'rgCol');
|
|
207
|
-
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
208
|
-
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
209
219
|
}
|
|
210
220
|
render() {
|
|
211
|
-
var _a, _b
|
|
221
|
+
var _a, _b;
|
|
212
222
|
const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
213
|
-
const physicalContentWidth = this.
|
|
214
|
-
|
|
215
|
-
: getContentSize(this.contentWidth, (_d = (_c = this.horizontalScroll) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
216
|
-
return (h(Host, { key: '9b23f5c3c18924a25ecd3e1ee0909ebd03b25048', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '144f5c79d0a99e6423c1ca448917aedf514f0ae3', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: '10db0971f2db6acf8510cf21d736c82f0d0e5632', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '77e0cd002ccda4a9e420de50648b711cde412a34', name: HEADER_SLOT })), h("div", { key: 'a78167dc52a24005a35dd94c5a9a43eb7dd289dd', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'c277d9d1ffc54452b584eb55b1a29d2a10672fb6', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '01fb5630a3d40e231a3aead9ad1c07aa06e69004', name: CONTENT_SLOT }))), h("div", { key: 'ff7389e77b500b97ea1fc38228da9fc3d6514e30', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '3aa725e0a8f38ef5d4bc4dce53037ff55a6c25b3', name: FOOTER_SLOT })))));
|
|
223
|
+
const physicalContentWidth = getContentSize(this.contentWidth, 0);
|
|
224
|
+
return (h(Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: HEADER_SLOT })), h("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: CONTENT_SLOT }))), h("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: FOOTER_SLOT })))));
|
|
217
225
|
}
|
|
218
226
|
/**
|
|
219
227
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import reduce from "lodash/reduce";
|
|
5
5
|
import debounce from "lodash/debounce";
|
|
6
6
|
import { RESIZE_INTERVAL } from "../utils/consts";
|
|
7
|
-
import { columnTypes, rowTypes, getItemByIndex, DimensionStore, gatherTrimmedItems,
|
|
7
|
+
import { columnTypes, rowTypes, getItemByIndex, DimensionStore, gatherTrimmedItems, } from "../store/index";
|
|
8
8
|
import { getColumnSizes } from "../utils/column.utils";
|
|
9
9
|
import { getScrollDimension } from "./scroll.dimension.helpers";
|
|
10
10
|
/**
|
|
@@ -152,7 +152,16 @@ export default class DimensionProvider {
|
|
|
152
152
|
clientSize,
|
|
153
153
|
virtualSize: viewportSize,
|
|
154
154
|
});
|
|
155
|
-
|
|
155
|
+
// Render offset must use the true logical scroll coordinate
|
|
156
|
+
// It is the logical scroll position that should be used for compressed-scroll offset math.
|
|
157
|
+
const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
|
|
158
|
+
scrollDimension.logicalScrollSize); // prevents positions past the logical end
|
|
159
|
+
/**
|
|
160
|
+
* If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
|
|
161
|
+
* Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
|
|
162
|
+
*
|
|
163
|
+
* In normal scrolling, logical and physical coordinates are the same, so offset is 0.
|
|
164
|
+
*/
|
|
156
165
|
const renderOffset = clientSize && viewportSize
|
|
157
166
|
? scrollDimension.getRenderOffset(renderCoordinate)
|
|
158
167
|
: 0;
|
|
@@ -8,6 +8,29 @@ export function getViewportMaxCoordinate(dimension, viewportSize, frameOffset =
|
|
|
8
8
|
}
|
|
9
9
|
return Math.max(0, dimension.realSize - viewportSize - dimension.originItemSize * frameOffset);
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Clamp the viewport coordinate within the valid range.
|
|
13
|
+
* Given a scroll position, pick a safe starting point for rendering visible items.
|
|
14
|
+
*
|
|
15
|
+
* Do not use it when you need the exact scroll position for positioning math.
|
|
16
|
+
*
|
|
17
|
+
* It does two things:
|
|
18
|
+
* 1. If the coordinate is below 0, use 0.
|
|
19
|
+
* 2. If the coordinate is too close to the very end, pull it back a bit.
|
|
20
|
+
*
|
|
21
|
+
* Example:
|
|
22
|
+
*
|
|
23
|
+
* content height: 1000px
|
|
24
|
+
* viewport height: 200px
|
|
25
|
+
* row height: 30px
|
|
26
|
+
* The real max scroll is:
|
|
27
|
+
*
|
|
28
|
+
* 1000 - 200 = 800
|
|
29
|
+
* But clampViewportCoordinate may clamp to:
|
|
30
|
+
*
|
|
31
|
+
* 1000 - 200 - 30 = 770
|
|
32
|
+
* Ask for 800 -> it returns 770.
|
|
33
|
+
*/
|
|
11
34
|
export function clampViewportCoordinate(coordinate, dimension, viewportSize, frameOffset = 1) {
|
|
12
35
|
return Math.min(Math.max(0, coordinate), getViewportMaxCoordinate(dimension, viewportSize, frameOffset));
|
|
13
36
|
}
|
package/dist/{revo-grid/column.drag.plugin-DCZW62Uc.js → esm/column.drag.plugin-B9t9kBO5.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
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-CC_SD8W3.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
|
-
import { j as calculateRowHeaderSize } from './viewport.store-
|
|
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';
|
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-CC_SD8W3.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, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-B9t9kBO5.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, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-B9t9kBO5.js';
|
|
7
7
|
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BsvUQ8GS.js';
|
|
8
8
|
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-BtN-NGCk.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';
|
|
@@ -11,7 +11,7 @@ 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';
|
|
12
12
|
export { h } from './index-Chp_81rd.js';
|
|
13
13
|
export { C as CELL_CLASS, z as CELL_HANDLER_CLASS, m as DATA_COL, n as DATA_ROW, o as DISABLED_CLASS, x as DRAGGABLE_CLASS, A as DRAGG_TEXT, w as DRAG_ICON_CLASS, D as DataStore, E as EDIT_INPUT_WR, F as FOCUS_CLASS, G as GRID_INTERNALS, v as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, u as HEADER_ROW_CLASS, r as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, y as MOBILE_CLASS, R as RESIZE_INTERVAL, B as ROW_FOCUSED_CLASS, q as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, i as calculateDimensionData, I as codesLetter, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, J as keyValues, p as proxyPlugin, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, l as setStore, t as trimmedPlugin } from './dimension.helpers-CGKwSvw6.js';
|
|
14
|
-
export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-
|
|
14
|
+
export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-_c579YyM.js';
|
|
15
15
|
export { A as AND_OR_BUTTON, e as AndOrButton, a as FILTER_BUTTON_ACTIVE, F as FILTER_BUTTON_CLASS, b as FILTER_PROP, c as FilterButton, T as TRASH_BUTTON, d as TrashButton, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
|
|
16
16
|
import './debounce-PCRWZliA.js';
|
|
17
17
|
|
|
@@ -6,8 +6,8 @@ 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 {
|
|
10
|
-
import {
|
|
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, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-B9t9kBO5.js';
|
|
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';
|
|
@@ -372,7 +372,16 @@ class DimensionProvider {
|
|
|
372
372
|
clientSize,
|
|
373
373
|
virtualSize: viewportSize,
|
|
374
374
|
});
|
|
375
|
-
|
|
375
|
+
// Render offset must use the true logical scroll coordinate
|
|
376
|
+
// It is the logical scroll position that should be used for compressed-scroll offset math.
|
|
377
|
+
const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
|
|
378
|
+
scrollDimension.logicalScrollSize); // prevents positions past the logical end
|
|
379
|
+
/**
|
|
380
|
+
* If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
|
|
381
|
+
* Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
|
|
382
|
+
*
|
|
383
|
+
* In normal scrolling, logical and physical coordinates are the same, so offset is 0.
|
|
384
|
+
*/
|
|
376
385
|
const renderOffset = clientSize && viewportSize
|
|
377
386
|
? scrollDimension.getRenderOffset(renderCoordinate)
|
|
378
387
|
: 0;
|
|
@@ -8,7 +8,7 @@ import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor
|
|
|
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';
|
|
11
|
-
import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-
|
|
11
|
+
import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
|
|
12
12
|
import { H as HEADER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
13
13
|
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-CaUDyxyU.js';
|
|
14
14
|
|
|
@@ -605,6 +605,7 @@ class GridResizeService {
|
|
|
605
605
|
}
|
|
606
606
|
destroy() {
|
|
607
607
|
var _a;
|
|
608
|
+
this.apply.cancel();
|
|
608
609
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
609
610
|
this.resizeObserver = null;
|
|
610
611
|
}
|
|
@@ -743,6 +744,10 @@ const RevogrViewportScroll = class {
|
|
|
743
744
|
scroll: this.horizontalScroll.scrollLeft,
|
|
744
745
|
noScroll: this.colType !== 'rgCol',
|
|
745
746
|
};
|
|
747
|
+
this.setScrollParams({
|
|
748
|
+
rgRow: calculatedHeight,
|
|
749
|
+
rgCol: calculatedWidth,
|
|
750
|
+
});
|
|
746
751
|
// Process changes in order: width first, then height
|
|
747
752
|
const dimensions = ['rgCol', 'rgRow'];
|
|
748
753
|
for (const dimension of dimensions) {
|
|
@@ -799,26 +804,30 @@ const RevogrViewportScroll = class {
|
|
|
799
804
|
}
|
|
800
805
|
async componentDidRender() {
|
|
801
806
|
var _a, _b, _c, _d;
|
|
807
|
+
this.setScrollParams({
|
|
808
|
+
rgRow: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
809
|
+
rgCol: this.horizontalScroll.clientWidth,
|
|
810
|
+
});
|
|
811
|
+
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
812
|
+
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
813
|
+
}
|
|
814
|
+
setScrollParams(clientSize) {
|
|
802
815
|
this.localScrollService.setParams({
|
|
803
816
|
contentSize: this.contentHeight,
|
|
804
|
-
clientSize:
|
|
817
|
+
clientSize: clientSize.rgRow,
|
|
805
818
|
virtualSize: 0,
|
|
806
819
|
}, 'rgRow');
|
|
807
820
|
this.localScrollService.setParams({
|
|
808
821
|
contentSize: this.contentWidth,
|
|
809
|
-
clientSize:
|
|
822
|
+
clientSize: clientSize.rgCol,
|
|
810
823
|
virtualSize: 0,
|
|
811
824
|
}, 'rgCol');
|
|
812
|
-
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
813
|
-
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
814
825
|
}
|
|
815
826
|
render() {
|
|
816
|
-
var _a, _b
|
|
827
|
+
var _a, _b;
|
|
817
828
|
const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
818
|
-
const physicalContentWidth = this.
|
|
819
|
-
|
|
820
|
-
: getContentSize(this.contentWidth, (_d = (_c = this.horizontalScroll) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
821
|
-
return (h(Host, { key: '9b23f5c3c18924a25ecd3e1ee0909ebd03b25048', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '144f5c79d0a99e6423c1ca448917aedf514f0ae3', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: '10db0971f2db6acf8510cf21d736c82f0d0e5632', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '77e0cd002ccda4a9e420de50648b711cde412a34', name: HEADER_SLOT })), h("div", { key: 'a78167dc52a24005a35dd94c5a9a43eb7dd289dd', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'c277d9d1ffc54452b584eb55b1a29d2a10672fb6', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '01fb5630a3d40e231a3aead9ad1c07aa06e69004', name: CONTENT_SLOT }))), h("div", { key: 'ff7389e77b500b97ea1fc38228da9fc3d6514e30', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '3aa725e0a8f38ef5d4bc4dce53037ff55a6c25b3', name: FOOTER_SLOT })))));
|
|
829
|
+
const physicalContentWidth = getContentSize(this.contentWidth, 0);
|
|
830
|
+
return (h(Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: HEADER_SLOT })), h("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: CONTENT_SLOT }))), h("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: FOOTER_SLOT })))));
|
|
822
831
|
}
|
|
823
832
|
/**
|
|
824
833
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
@@ -15,6 +15,29 @@ function getViewportMaxCoordinate(dimension, viewportSize, frameOffset = 1) {
|
|
|
15
15
|
}
|
|
16
16
|
return Math.max(0, dimension.realSize - viewportSize - dimension.originItemSize * frameOffset);
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Clamp the viewport coordinate within the valid range.
|
|
20
|
+
* Given a scroll position, pick a safe starting point for rendering visible items.
|
|
21
|
+
*
|
|
22
|
+
* Do not use it when you need the exact scroll position for positioning math.
|
|
23
|
+
*
|
|
24
|
+
* It does two things:
|
|
25
|
+
* 1. If the coordinate is below 0, use 0.
|
|
26
|
+
* 2. If the coordinate is too close to the very end, pull it back a bit.
|
|
27
|
+
*
|
|
28
|
+
* Example:
|
|
29
|
+
*
|
|
30
|
+
* content height: 1000px
|
|
31
|
+
* viewport height: 200px
|
|
32
|
+
* row height: 30px
|
|
33
|
+
* The real max scroll is:
|
|
34
|
+
*
|
|
35
|
+
* 1000 - 200 = 800
|
|
36
|
+
* But clampViewportCoordinate may clamp to:
|
|
37
|
+
*
|
|
38
|
+
* 1000 - 200 - 30 = 770
|
|
39
|
+
* Ask for 800 -> it returns 770.
|
|
40
|
+
*/
|
|
18
41
|
function clampViewportCoordinate(coordinate, dimension, viewportSize, frameOffset = 1) {
|
|
19
42
|
return Math.min(Math.max(0, coordinate), getViewportMaxCoordinate(dimension, viewportSize, frameOffset));
|
|
20
43
|
}
|
package/dist/{esm/column.drag.plugin-DCZW62Uc.js → revo-grid/column.drag.plugin-B9t9kBO5.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
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-CC_SD8W3.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
|
-
import { j as calculateRowHeaderSize } from './viewport.store-
|
|
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';
|
|
@@ -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-CC_SD8W3.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, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-B9t9kBO5.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, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-B9t9kBO5.js';
|
|
7
7
|
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BsvUQ8GS.js';
|
|
8
8
|
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-BtN-NGCk.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';
|
|
@@ -11,7 +11,7 @@ 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';
|
|
12
12
|
export { h } from './index-Chp_81rd.js';
|
|
13
13
|
export { C as CELL_CLASS, z as CELL_HANDLER_CLASS, m as DATA_COL, n as DATA_ROW, o as DISABLED_CLASS, x as DRAGGABLE_CLASS, A as DRAGG_TEXT, w as DRAG_ICON_CLASS, D as DataStore, E as EDIT_INPUT_WR, F as FOCUS_CLASS, G as GRID_INTERNALS, v as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, u as HEADER_ROW_CLASS, r as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, y as MOBILE_CLASS, R as RESIZE_INTERVAL, B as ROW_FOCUSED_CLASS, q as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, i as calculateDimensionData, I as codesLetter, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, J as keyValues, p as proxyPlugin, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, l as setStore, t as trimmedPlugin } from './dimension.helpers-CGKwSvw6.js';
|
|
14
|
-
export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-
|
|
14
|
+
export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-_c579YyM.js';
|
|
15
15
|
export { A as AND_OR_BUTTON, e as AndOrButton, a as FILTER_BUTTON_ACTIVE, F as FILTER_BUTTON_CLASS, b as FILTER_PROP, c as FilterButton, T as TRASH_BUTTON, d as TrashButton, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
|
|
16
16
|
import './debounce-PCRWZliA.js';
|
|
17
17
|
|
|
@@ -6,8 +6,8 @@ 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 {
|
|
10
|
-
import {
|
|
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, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-B9t9kBO5.js';
|
|
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';
|
|
@@ -372,7 +372,16 @@ class DimensionProvider {
|
|
|
372
372
|
clientSize,
|
|
373
373
|
virtualSize: viewportSize,
|
|
374
374
|
});
|
|
375
|
-
|
|
375
|
+
// Render offset must use the true logical scroll coordinate
|
|
376
|
+
// It is the logical scroll position that should be used for compressed-scroll offset math.
|
|
377
|
+
const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
|
|
378
|
+
scrollDimension.logicalScrollSize); // prevents positions past the logical end
|
|
379
|
+
/**
|
|
380
|
+
* If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
|
|
381
|
+
* Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
|
|
382
|
+
*
|
|
383
|
+
* In normal scrolling, logical and physical coordinates are the same, so offset is 0.
|
|
384
|
+
*/
|
|
376
385
|
const renderOffset = clientSize && viewportSize
|
|
377
386
|
? scrollDimension.getRenderOffset(renderCoordinate)
|
|
378
387
|
: 0;
|
|
@@ -8,7 +8,7 @@ import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor
|
|
|
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';
|
|
11
|
-
import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-
|
|
11
|
+
import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
|
|
12
12
|
import { H as HEADER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
13
13
|
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-CaUDyxyU.js';
|
|
14
14
|
|
|
@@ -605,6 +605,7 @@ class GridResizeService {
|
|
|
605
605
|
}
|
|
606
606
|
destroy() {
|
|
607
607
|
var _a;
|
|
608
|
+
this.apply.cancel();
|
|
608
609
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
609
610
|
this.resizeObserver = null;
|
|
610
611
|
}
|
|
@@ -743,6 +744,10 @@ const RevogrViewportScroll = class {
|
|
|
743
744
|
scroll: this.horizontalScroll.scrollLeft,
|
|
744
745
|
noScroll: this.colType !== 'rgCol',
|
|
745
746
|
};
|
|
747
|
+
this.setScrollParams({
|
|
748
|
+
rgRow: calculatedHeight,
|
|
749
|
+
rgCol: calculatedWidth,
|
|
750
|
+
});
|
|
746
751
|
// Process changes in order: width first, then height
|
|
747
752
|
const dimensions = ['rgCol', 'rgRow'];
|
|
748
753
|
for (const dimension of dimensions) {
|
|
@@ -799,26 +804,30 @@ const RevogrViewportScroll = class {
|
|
|
799
804
|
}
|
|
800
805
|
async componentDidRender() {
|
|
801
806
|
var _a, _b, _c, _d;
|
|
807
|
+
this.setScrollParams({
|
|
808
|
+
rgRow: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
809
|
+
rgCol: this.horizontalScroll.clientWidth,
|
|
810
|
+
});
|
|
811
|
+
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
812
|
+
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
813
|
+
}
|
|
814
|
+
setScrollParams(clientSize) {
|
|
802
815
|
this.localScrollService.setParams({
|
|
803
816
|
contentSize: this.contentHeight,
|
|
804
|
-
clientSize:
|
|
817
|
+
clientSize: clientSize.rgRow,
|
|
805
818
|
virtualSize: 0,
|
|
806
819
|
}, 'rgRow');
|
|
807
820
|
this.localScrollService.setParams({
|
|
808
821
|
contentSize: this.contentWidth,
|
|
809
|
-
clientSize:
|
|
822
|
+
clientSize: clientSize.rgCol,
|
|
810
823
|
virtualSize: 0,
|
|
811
824
|
}, 'rgCol');
|
|
812
|
-
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
813
|
-
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
814
825
|
}
|
|
815
826
|
render() {
|
|
816
|
-
var _a, _b
|
|
827
|
+
var _a, _b;
|
|
817
828
|
const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
818
|
-
const physicalContentWidth = this.
|
|
819
|
-
|
|
820
|
-
: getContentSize(this.contentWidth, (_d = (_c = this.horizontalScroll) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
821
|
-
return (h(Host, { key: '9b23f5c3c18924a25ecd3e1ee0909ebd03b25048', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '144f5c79d0a99e6423c1ca448917aedf514f0ae3', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: '10db0971f2db6acf8510cf21d736c82f0d0e5632', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '77e0cd002ccda4a9e420de50648b711cde412a34', name: HEADER_SLOT })), h("div", { key: 'a78167dc52a24005a35dd94c5a9a43eb7dd289dd', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'c277d9d1ffc54452b584eb55b1a29d2a10672fb6', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '01fb5630a3d40e231a3aead9ad1c07aa06e69004', name: CONTENT_SLOT }))), h("div", { key: 'ff7389e77b500b97ea1fc38228da9fc3d6514e30', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '3aa725e0a8f38ef5d4bc4dce53037ff55a6c25b3', name: FOOTER_SLOT })))));
|
|
829
|
+
const physicalContentWidth = getContentSize(this.contentWidth, 0);
|
|
830
|
+
return (h(Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: HEADER_SLOT })), h("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: CONTENT_SLOT }))), h("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: FOOTER_SLOT })))));
|
|
822
831
|
}
|
|
823
832
|
/**
|
|
824
833
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|