@revolist/revogrid 4.22.1 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cell-renderer-BQdEGQXP.js → cell-renderer-DWJ9Px9f.js} +9 -3
- package/dist/cjs/{column.drag.plugin-RDjQhKCH.js → column.drag.plugin-CaEBDG-Q.js} +391 -256
- package/dist/cjs/{column.service-DXYMehqK.js → column.service-f612L4ql.js} +1 -1
- package/dist/cjs/{dimension.helpers-CiiNnlLa.js → dimension.helpers-B9HgANnM.js} +14 -145
- package/dist/cjs/{edit.utils-CecCfA4E.js → edit.utils-pKeiYFLJ.js} +1 -1
- package/dist/cjs/{header-cell-renderer-DGyBrK8I.js → header-cell-renderer-4yq9_WbM.js} +1 -1
- package/dist/cjs/index-DxaSE5uZ.js +136 -0
- package/dist/cjs/index.cjs.js +37 -32
- package/dist/cjs/revo-grid.cjs.entry.js +35 -15
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +43 -25
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +10 -8
- package/dist/cjs/revogr-data_4.cjs.entry.js +26 -17
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +2 -1
- package/dist/cjs/{text-editor-DnLZW1a-.js → text-editor-B4W-m-r-.js} +3 -3
- package/dist/cjs/{throttle-CfgQFkfR.js → throttle-BCwEuJJq.js} +59 -24
- package/dist/cjs/viewport.helpers-BND76K2j.js +140 -0
- package/dist/cjs/{viewport.store-q6YdR9mg.js → viewport.store-BlKQ4x9H.js} +16 -16
- package/dist/collection/components/data/revogr-data.js +5 -3
- package/dist/collection/components/header/header-group-renderer.js +1 -1
- package/dist/collection/components/header/header-renderer.js +1 -1
- package/dist/collection/components/header/revogr-header-style.css +13 -3
- package/dist/collection/components/header/revogr-header.js +5 -2
- package/dist/collection/components/order/order-row.service.js +6 -5
- package/dist/collection/components/overlay/keyboard.service.js +23 -1
- package/dist/collection/components/overlay/selection.utils.js +8 -6
- package/dist/collection/components/revoGrid/revo-grid.js +6 -5
- package/dist/collection/components/revoGrid/viewport.service.js +2 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +10 -6
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +4 -10
- package/dist/collection/plugins/filter/filter.panel.js +2 -1
- package/dist/collection/plugins/filter/filter.plugin.js +11 -4
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +25 -1
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js +4 -4
- package/dist/collection/plugins/sorting/sorting.func.js +173 -15
- package/dist/collection/plugins/sorting/sorting.plugin.js +167 -84
- package/dist/collection/plugins/sorting/sorting.sign.js +7 -1
- package/dist/collection/serve/controller.js +98 -37
- package/dist/collection/serve/data.js +273 -144
- package/dist/collection/services/dimension.provider.js +16 -1
- package/dist/collection/services/local.scroll.service.js +59 -24
- package/dist/collection/services/scroll.dimension.helpers.js +83 -0
- package/dist/collection/services/selection.store.connector.js +4 -1
- package/dist/collection/store/dimension/dimension.recalculate.plugin.js +22 -9
- package/dist/collection/store/dimension/dimension.store.js +4 -2
- package/dist/collection/store/vp/viewport.helpers.js +9 -0
- package/dist/collection/store/vp/viewport.store.js +5 -16
- package/dist/collection/utils/store.utils.js +3 -3
- package/dist/{revo-grid/cell-renderer-CALsEsnh.js → esm/cell-renderer-8UiGd-s7.js} +9 -3
- package/dist/esm/{column.drag.plugin-Dy5ztusn.js → column.drag.plugin-BsfhsfmB.js} +388 -255
- package/dist/esm/{column.service-CCvAi5l4.js → column.service-DbpulTog.js} +1 -1
- package/dist/{revo-grid/debounce-BfO9dz9v.js → esm/debounce-PCRWZliA.js} +1 -1
- package/dist/{revo-grid/dimension.helpers-DmIvjIa7.js → esm/dimension.helpers-CGKwSvw6.js} +7 -128
- package/dist/esm/{edit.utils-DYN6XZh8.js → edit.utils-Dnnbd0xG.js} +1 -1
- package/dist/{revo-grid/header-cell-renderer-DU8wKAbg.js → esm/header-cell-renderer-DGI2FAD8.js} +1 -1
- package/dist/esm/index-Db3qZoW5.js +127 -0
- package/dist/esm/index.js +11 -10
- package/dist/esm/revo-grid.entry.js +34 -14
- package/dist/esm/revogr-attribution_7.entry.js +42 -24
- package/dist/esm/revogr-clipboard_3.entry.js +11 -9
- package/dist/esm/revogr-data_4.entry.js +27 -18
- package/dist/esm/revogr-filter-panel.entry.js +3 -2
- package/dist/esm/{text-editor-DpCnd6Fq.js → text-editor-C3RUSwH5.js} +2 -2
- package/dist/esm/{throttle-ERvyruXb.js → throttle-CaUDyxyU.js} +60 -25
- package/dist/esm/viewport.helpers-CoCAvmZs.js +133 -0
- package/dist/{revo-grid/viewport.store-CFjDW-3l.js → esm/viewport.store-COAfzAyu.js} +15 -17
- package/dist/{esm/cell-renderer-CALsEsnh.js → revo-grid/cell-renderer-8UiGd-s7.js} +9 -3
- package/dist/revo-grid/{column.drag.plugin-Dy5ztusn.js → column.drag.plugin-BsfhsfmB.js} +388 -255
- package/dist/revo-grid/{column.service-CCvAi5l4.js → column.service-DbpulTog.js} +1 -1
- package/dist/{esm/debounce-BfO9dz9v.js → revo-grid/debounce-PCRWZliA.js} +1 -1
- package/dist/{esm/dimension.helpers-DmIvjIa7.js → revo-grid/dimension.helpers-CGKwSvw6.js} +7 -128
- package/dist/revo-grid/{edit.utils-DYN6XZh8.js → edit.utils-Dnnbd0xG.js} +1 -1
- package/dist/{esm/header-cell-renderer-DU8wKAbg.js → revo-grid/header-cell-renderer-DGI2FAD8.js} +1 -1
- package/dist/revo-grid/index-Db3qZoW5.js +127 -0
- package/dist/revo-grid/index.esm.js +11 -10
- package/dist/revo-grid/revo-grid.entry.js +34 -14
- package/dist/revo-grid/revogr-attribution_7.entry.js +42 -24
- package/dist/revo-grid/revogr-clipboard_3.entry.js +11 -9
- package/dist/revo-grid/revogr-data_4.entry.js +27 -18
- package/dist/revo-grid/revogr-filter-panel.entry.js +3 -2
- package/dist/revo-grid/{text-editor-DpCnd6Fq.js → text-editor-C3RUSwH5.js} +2 -2
- package/dist/revo-grid/{throttle-ERvyruXb.js → throttle-CaUDyxyU.js} +60 -25
- package/dist/revo-grid/viewport.helpers-CoCAvmZs.js +133 -0
- package/dist/{esm/viewport.store-CFjDW-3l.js → revo-grid/viewport.store-COAfzAyu.js} +15 -17
- package/dist/types/components/header/header-group-renderer.d.ts +1 -0
- package/dist/types/components/header/header-renderer.d.ts +1 -0
- package/dist/types/components/overlay/keyboard.service.d.ts +5 -0
- package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +8 -0
- package/dist/types/plugins/sorting/sorting.func.d.ts +25 -2
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +84 -9
- package/dist/types/plugins/sorting/sorting.sign.d.ts +5 -1
- package/dist/types/plugins/sorting/sorting.types.d.ts +46 -1
- package/dist/types/services/local.scroll.service.d.ts +10 -2
- package/dist/types/services/scroll.dimension.helpers.d.ts +20 -0
- package/dist/types/store/vp/viewport.helpers.d.ts +2 -0
- package/dist/types/types/interfaces.d.ts +11 -0
- package/hydrate/index.js +649 -365
- package/hydrate/index.mjs +649 -365
- package/package.json +1 -1
- package/standalone/column.service.js +1 -1
- package/standalone/data.store.js +1 -1
- package/standalone/debounce.js +1 -1
- package/standalone/dimension.helpers.js +1 -1
- package/standalone/index.js +1 -1
- package/standalone/local.scroll.timer.js +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-data2.js +1 -1
- package/standalone/revogr-filter-panel.js +1 -1
- package/standalone/revogr-header2.js +1 -1
- package/standalone/revogr-order-editor2.js +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
- package/standalone/revogr-row-headers.js +1 -1
- package/standalone/revogr-row-headers2.js +1 -1
- package/standalone/revogr-scroll-virtual2.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +1 -1
- package/standalone/selection.utils.js +1 -1
- package/standalone/throttle.js +1 -1
- package/standalone/toNumber.js +1 -1
- package/dist/cjs/viewport.helpers-BAovztDd.js +0 -58
- package/dist/esm/viewport.helpers-VXhsJZtn.js +0 -52
- package/dist/revo-grid/viewport.helpers-VXhsJZtn.js +0 -52
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { Q as toFinite, U as keys, V as isArrayLike, W as baseIteratee, N as isArray, G as GRID_INTERNALS, X as isIterateeCall, a as getVisibleSourceItem, o as DISABLED_CLASS, C as CELL_CLASS, b as getSourceItem } from './dimension.helpers-CGKwSvw6.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Converts `value` to an integer.
|
|
@@ -482,4 +482,4 @@ function debounce(func, wait, options) {
|
|
|
482
482
|
return debounced;
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
export { Symbol as S,
|
|
485
|
+
export { Symbol as S, isObjectLike as a, baseGetTag as b, isSymbol as c, debounce as d, freeGlobal as f, isObject as i, root as r, toNumber as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { i as isObject, b as baseGetTag, r as root, S as Symbol, a as isObjectLike, f as freeGlobal, c as isSymbol, t as toNumber } from './debounce-PCRWZliA.js';
|
|
5
5
|
import { S as StencilCore } from './index-Chp_81rd.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -2706,7 +2706,7 @@ function createRange(fromRight) {
|
|
|
2706
2706
|
* _.range(0);
|
|
2707
2707
|
* // => []
|
|
2708
2708
|
*/
|
|
2709
|
-
var range
|
|
2709
|
+
var range = createRange();
|
|
2710
2710
|
|
|
2711
2711
|
const appendToMap = (map, propName, value) => {
|
|
2712
2712
|
let refs = map.get(propName);
|
|
@@ -3021,9 +3021,9 @@ function gatherTrimmedItems(trimmedItems) {
|
|
|
3021
3021
|
* @param data - The data to set on the store.
|
|
3022
3022
|
*/
|
|
3023
3023
|
function setStore(store, data) {
|
|
3024
|
-
Object.
|
|
3025
|
-
store.set(key,
|
|
3026
|
-
}
|
|
3024
|
+
for (const key of Object.keys(data)) {
|
|
3025
|
+
store.set(key, data[key]);
|
|
3026
|
+
}
|
|
3027
3027
|
}
|
|
3028
3028
|
|
|
3029
3029
|
const MIN_COL_SIZE = 30;
|
|
@@ -3132,127 +3132,6 @@ var osPlatform;
|
|
|
3132
3132
|
})(osPlatform || (osPlatform = {}));
|
|
3133
3133
|
var OsPlatform = osPlatform;
|
|
3134
3134
|
|
|
3135
|
-
/* Generate range on size
|
|
3136
|
-
*/
|
|
3137
|
-
function range(size, startAt = 0) {
|
|
3138
|
-
const res = [];
|
|
3139
|
-
const end = startAt + size;
|
|
3140
|
-
for (let i = startAt; i < end; i++) {
|
|
3141
|
-
res.push(i);
|
|
3142
|
-
}
|
|
3143
|
-
return res;
|
|
3144
|
-
}
|
|
3145
|
-
/* Find index position in array */
|
|
3146
|
-
function findPositionInArray(el, compareFn) {
|
|
3147
|
-
return (function (arr) {
|
|
3148
|
-
let m = 0;
|
|
3149
|
-
let n = arr.length - 1;
|
|
3150
|
-
while (m <= n) {
|
|
3151
|
-
const k = (n + m) >> 1;
|
|
3152
|
-
const cmp = compareFn(el, arr[k]);
|
|
3153
|
-
if (cmp > 0) {
|
|
3154
|
-
m = k + 1;
|
|
3155
|
-
}
|
|
3156
|
-
else if (cmp < 0) {
|
|
3157
|
-
n = k - 1;
|
|
3158
|
-
}
|
|
3159
|
-
else {
|
|
3160
|
-
return k;
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
return -m - 1;
|
|
3164
|
-
})(this);
|
|
3165
|
-
}
|
|
3166
|
-
/**
|
|
3167
|
-
* Sorted push
|
|
3168
|
-
*/
|
|
3169
|
-
function pushSorted(arr, el, fn) {
|
|
3170
|
-
arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);
|
|
3171
|
-
return arr;
|
|
3172
|
-
}
|
|
3173
|
-
// (arr1[index1] < arr2[index2])
|
|
3174
|
-
function simpleCompare(el1, el2) {
|
|
3175
|
-
return el1 < el2;
|
|
3176
|
-
}
|
|
3177
|
-
/**
|
|
3178
|
-
* Merge sorted array helper function
|
|
3179
|
-
*/
|
|
3180
|
-
function mergeSortedArray(arr1, arr2, compareFn = simpleCompare) {
|
|
3181
|
-
const merged = [];
|
|
3182
|
-
let index1 = 0;
|
|
3183
|
-
let index2 = 0;
|
|
3184
|
-
let current = 0;
|
|
3185
|
-
while (current < arr1.length + arr2.length) {
|
|
3186
|
-
let isArr1Depleted = index1 >= arr1.length;
|
|
3187
|
-
let isArr2Depleted = index2 >= arr2.length;
|
|
3188
|
-
if (!isArr1Depleted && (isArr2Depleted || compareFn(arr1[index1], arr2[index2]))) {
|
|
3189
|
-
merged[current] = arr1[index1];
|
|
3190
|
-
index1++;
|
|
3191
|
-
}
|
|
3192
|
-
else {
|
|
3193
|
-
merged[current] = arr2[index2];
|
|
3194
|
-
index2++;
|
|
3195
|
-
}
|
|
3196
|
-
current++;
|
|
3197
|
-
}
|
|
3198
|
-
return merged;
|
|
3199
|
-
}
|
|
3200
|
-
/**
|
|
3201
|
-
* Calculate system scrollbar size
|
|
3202
|
-
*/
|
|
3203
|
-
function getScrollbarSize(document) {
|
|
3204
|
-
// Create a temporary div container and append it to the body
|
|
3205
|
-
const container = document.createElement('div');
|
|
3206
|
-
// Apply styling to ensure the div is scrollable
|
|
3207
|
-
container.style.overflow = 'scroll';
|
|
3208
|
-
container.style.visibility = 'hidden'; // make sure the container isn't visible
|
|
3209
|
-
container.style.position = 'absolute';
|
|
3210
|
-
container.style.top = '-9999px'; // move it out of the screen
|
|
3211
|
-
container.style.width = '50px'; // arbitrary width
|
|
3212
|
-
container.style.height = '50px'; // arbitrary height
|
|
3213
|
-
// Append the div to the body
|
|
3214
|
-
document.body.appendChild(container);
|
|
3215
|
-
// Calculate the width of the scrollbar
|
|
3216
|
-
const scrollbarWidth = container.offsetWidth - container.clientWidth;
|
|
3217
|
-
// Remove the div from the body after calculation
|
|
3218
|
-
document.body.removeChild(container);
|
|
3219
|
-
// Return the calculated width of the scrollbar
|
|
3220
|
-
return scrollbarWidth;
|
|
3221
|
-
}
|
|
3222
|
-
/* Scale a value between 2 ranges
|
|
3223
|
-
*
|
|
3224
|
-
* Sample:
|
|
3225
|
-
* // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
|
|
3226
|
-
* const n = scaleValue(55, [0,100], [0,1000]);
|
|
3227
|
-
*
|
|
3228
|
-
* Ranges of two values
|
|
3229
|
-
* @from
|
|
3230
|
-
* @to
|
|
3231
|
-
*
|
|
3232
|
-
* ~~ return value does the equivalent of Math.floor but faster.
|
|
3233
|
-
*/
|
|
3234
|
-
function scaleValue(value, from, to) {
|
|
3235
|
-
return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
|
|
3236
|
-
}
|
|
3237
|
-
/**
|
|
3238
|
-
* Async timeout
|
|
3239
|
-
*/
|
|
3240
|
-
async function timeout(delay = 0) {
|
|
3241
|
-
await new Promise((r) => {
|
|
3242
|
-
setTimeout(() => r(), delay);
|
|
3243
|
-
});
|
|
3244
|
-
}
|
|
3245
|
-
/**
|
|
3246
|
-
* Type script mixins
|
|
3247
|
-
*/
|
|
3248
|
-
function applyMixins(derivedCtor, constructors) {
|
|
3249
|
-
constructors.forEach(baseCtor => {
|
|
3250
|
-
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
3251
|
-
Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));
|
|
3252
|
-
});
|
|
3253
|
-
});
|
|
3254
|
-
}
|
|
3255
|
-
|
|
3256
3135
|
/**
|
|
3257
3136
|
* Data store
|
|
3258
3137
|
* Manage the state of a data source and provide methods for updating, adding, and refreshing the data.
|
|
@@ -3286,7 +3165,7 @@ class DataStore {
|
|
|
3286
3165
|
}
|
|
3287
3166
|
// clear items
|
|
3288
3167
|
this.store.set('items', []);
|
|
3289
|
-
const items = range
|
|
3168
|
+
const items = range(0, (source === null || source === void 0 ? void 0 : source.length) || 0);
|
|
3290
3169
|
// set proxy first
|
|
3291
3170
|
setStore(this.store, {
|
|
3292
3171
|
source,
|
|
@@ -3617,4 +3496,4 @@ function getItemByIndex(dimension, index) {
|
|
|
3617
3496
|
return item;
|
|
3618
3497
|
}
|
|
3619
3498
|
|
|
3620
|
-
export {
|
|
3499
|
+
export { DRAGG_TEXT as A, ROW_FOCUSED_CLASS as B, CELL_CLASS as C, DataStore as D, EDIT_INPUT_WR as E, FOCUS_CLASS as F, GRID_INTERNALS as G, HEADER_CLASS as H, codesLetter as I, keyValues as J, createStore as K, identity as L, MIN_COL_SIZE as M, isArray as N, KeyCodesEnum as O, OsPlatform as P, toFinite as Q, RESIZE_INTERVAL as R, SELECTION_BORDER_CLASS as S, TMP_SELECTION_BG_CLASS as T, keys as U, isArrayLike as V, baseIteratee as W, isIterateeCall as X, getVisibleSourceItem as a, getSourceItem as b, getSourcePhysicalIndex as c, setSourceByPhysicalIndex as d, setItems as e, getSourceItemVirtualIndexByProp as f, getPhysical as g, gatherTrimmedItems as h, calculateDimensionData as i, getItemByPosition as j, getItemByIndex as k, setStore as l, DATA_COL as m, DATA_ROW as n, DISABLED_CLASS as o, proxyPlugin as p, ROW_HEADER_TYPE as q, HEADER_SORTABLE_CLASS as r, setSourceByVirtualIndex as s, trimmedPlugin as t, HEADER_ROW_CLASS as u, HEADER_ACTUAL_ROW_CLASS as v, DRAG_ICON_CLASS as w, DRAGGABLE_CLASS as x, MOBILE_CLASS as y, CELL_HANDLER_CLASS as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { O as KeyCodesEnum, P as OsPlatform, I as codesLetter, J as keyValues, E as EDIT_INPUT_WR } from './dimension.helpers-CGKwSvw6.js';
|
|
5
5
|
|
|
6
6
|
function isMetaKey(code) {
|
|
7
7
|
const keys = [
|
package/dist/{esm/header-cell-renderer-DU8wKAbg.js → revo-grid/header-cell-renderer-DGI2FAD8.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h } from './index-Chp_81rd.js';
|
|
5
|
-
import { Q as doPropMerge } from './column.service-
|
|
5
|
+
import { Q as doPropMerge } from './column.service-DbpulTog.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Dispatches a custom event to a specified target element.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist OU ❤️
|
|
3
|
+
*/
|
|
4
|
+
import './dimension.helpers-CGKwSvw6.js';
|
|
5
|
+
|
|
6
|
+
/* Generate range on size
|
|
7
|
+
*/
|
|
8
|
+
function range(size, startAt = 0) {
|
|
9
|
+
const res = [];
|
|
10
|
+
const end = startAt + size;
|
|
11
|
+
for (let i = startAt; i < end; i++) {
|
|
12
|
+
res.push(i);
|
|
13
|
+
}
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
/* Find index position in array */
|
|
17
|
+
function findPositionInArray(el, compareFn) {
|
|
18
|
+
return (function (arr) {
|
|
19
|
+
let m = 0;
|
|
20
|
+
let n = arr.length - 1;
|
|
21
|
+
while (m <= n) {
|
|
22
|
+
const k = (n + m) >> 1;
|
|
23
|
+
const cmp = compareFn(el, arr[k]);
|
|
24
|
+
if (cmp > 0) {
|
|
25
|
+
m = k + 1;
|
|
26
|
+
}
|
|
27
|
+
else if (cmp < 0) {
|
|
28
|
+
n = k - 1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return k;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return -m - 1;
|
|
35
|
+
})(this);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sorted push
|
|
39
|
+
*/
|
|
40
|
+
function pushSorted(arr, el, fn) {
|
|
41
|
+
arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);
|
|
42
|
+
return arr;
|
|
43
|
+
}
|
|
44
|
+
// (arr1[index1] < arr2[index2])
|
|
45
|
+
function simpleCompare(el1, el2) {
|
|
46
|
+
return el1 < el2;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Merge sorted array helper function
|
|
50
|
+
*/
|
|
51
|
+
function mergeSortedArray(arr1, arr2, compareFn = simpleCompare) {
|
|
52
|
+
const merged = [];
|
|
53
|
+
let index1 = 0;
|
|
54
|
+
let index2 = 0;
|
|
55
|
+
let current = 0;
|
|
56
|
+
while (current < arr1.length + arr2.length) {
|
|
57
|
+
let isArr1Depleted = index1 >= arr1.length;
|
|
58
|
+
let isArr2Depleted = index2 >= arr2.length;
|
|
59
|
+
if (!isArr1Depleted && (isArr2Depleted || compareFn(arr1[index1], arr2[index2]))) {
|
|
60
|
+
merged[current] = arr1[index1];
|
|
61
|
+
index1++;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
merged[current] = arr2[index2];
|
|
65
|
+
index2++;
|
|
66
|
+
}
|
|
67
|
+
current++;
|
|
68
|
+
}
|
|
69
|
+
return merged;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Calculate system scrollbar size
|
|
73
|
+
*/
|
|
74
|
+
function getScrollbarSize(document) {
|
|
75
|
+
// Create a temporary div container and append it to the body
|
|
76
|
+
const container = document.createElement('div');
|
|
77
|
+
// Apply styling to ensure the div is scrollable
|
|
78
|
+
container.style.overflow = 'scroll';
|
|
79
|
+
container.style.visibility = 'hidden'; // make sure the container isn't visible
|
|
80
|
+
container.style.position = 'absolute';
|
|
81
|
+
container.style.top = '-9999px'; // move it out of the screen
|
|
82
|
+
container.style.width = '50px'; // arbitrary width
|
|
83
|
+
container.style.height = '50px'; // arbitrary height
|
|
84
|
+
// Append the div to the body
|
|
85
|
+
document.body.appendChild(container);
|
|
86
|
+
// Calculate the width of the scrollbar
|
|
87
|
+
const scrollbarWidth = container.offsetWidth - container.clientWidth;
|
|
88
|
+
// Remove the div from the body after calculation
|
|
89
|
+
document.body.removeChild(container);
|
|
90
|
+
// Return the calculated width of the scrollbar
|
|
91
|
+
return scrollbarWidth;
|
|
92
|
+
}
|
|
93
|
+
/* Scale a value between 2 ranges
|
|
94
|
+
*
|
|
95
|
+
* Sample:
|
|
96
|
+
* // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
|
|
97
|
+
* const n = scaleValue(55, [0,100], [0,1000]);
|
|
98
|
+
*
|
|
99
|
+
* Ranges of two values
|
|
100
|
+
* @from
|
|
101
|
+
* @to
|
|
102
|
+
*
|
|
103
|
+
* ~~ return value does the equivalent of Math.floor but faster.
|
|
104
|
+
*/
|
|
105
|
+
function scaleValue(value, from, to) {
|
|
106
|
+
return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Async timeout
|
|
110
|
+
*/
|
|
111
|
+
async function timeout(delay = 0) {
|
|
112
|
+
await new Promise((r) => {
|
|
113
|
+
setTimeout(() => r(), delay);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Type script mixins
|
|
118
|
+
*/
|
|
119
|
+
function applyMixins(derivedCtor, constructors) {
|
|
120
|
+
constructors.forEach(baseCtor => {
|
|
121
|
+
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
122
|
+
Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { applyMixins as a, findPositionInArray as f, getScrollbarSize as g, mergeSortedArray as m, pushSorted as p, range as r, scaleValue as s, timeout as t };
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-
|
|
5
|
-
import { B as BasePlugin } from './column.drag.plugin-
|
|
6
|
-
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn,
|
|
7
|
-
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-
|
|
8
|
-
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-
|
|
9
|
-
export {
|
|
10
|
-
export { T as TextEditor } from './text-editor-
|
|
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-
|
|
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-DbpulTog.js';
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-BsfhsfmB.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-BsfhsfmB.js';
|
|
7
|
+
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-DGI2FAD8.js';
|
|
8
|
+
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-8UiGd-s7.js';
|
|
9
|
+
export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
|
|
10
|
+
export { T as TextEditor } from './text-editor-C3RUSwH5.js';
|
|
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
|
-
export {
|
|
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-COAfzAyu.js';
|
|
14
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';
|
|
15
|
-
import './debounce-
|
|
16
|
+
import './debounce-PCRWZliA.js';
|
|
16
17
|
|
|
17
18
|
const REVOGRID_EVENTS = new Map([
|
|
18
19
|
['contentsizechanged', 'contentsizechanged'],
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, d as createEvent, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-
|
|
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
|
|
7
|
-
import { d as debounce } from './debounce-
|
|
8
|
-
import {
|
|
9
|
-
import { V as ViewportStore } from './viewport.store-
|
|
5
|
+
import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-DbpulTog.js';
|
|
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
|
+
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
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 { c as clampViewportCoordinate, V as ViewportStore } from './viewport.store-COAfzAyu.js';
|
|
10
|
+
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-BsfhsfmB.js';
|
|
10
11
|
import { T as ThemeService } from './theme.service-BmnDvr6P.js';
|
|
11
|
-
import {
|
|
12
|
+
import { t as timeout } from './index-Db3qZoW5.js';
|
|
12
13
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
13
14
|
import './filter.button-C8XTWPU2.js';
|
|
14
|
-
import './header-cell-renderer-
|
|
15
|
+
import './header-cell-renderer-DGI2FAD8.js';
|
|
15
16
|
|
|
16
17
|
class ColumnDataProvider {
|
|
17
18
|
get stores() {
|
|
@@ -363,6 +364,20 @@ class DimensionProvider {
|
|
|
363
364
|
}
|
|
364
365
|
setViewPortCoordinate({ type, coordinate = this.viewports.stores[type].lastCoordinate, force = false, }) {
|
|
365
366
|
const dimension = this.stores[type].getCurrentState();
|
|
367
|
+
const viewport = this.viewports.stores[type].store;
|
|
368
|
+
const clientSize = viewport.get('clientSize');
|
|
369
|
+
const viewportSize = viewport.get('virtualSize');
|
|
370
|
+
const scrollDimension = getScrollDimension({
|
|
371
|
+
contentSize: dimension.realSize,
|
|
372
|
+
clientSize,
|
|
373
|
+
virtualSize: viewportSize,
|
|
374
|
+
});
|
|
375
|
+
const renderCoordinate = clampViewportCoordinate(coordinate, dimension, viewportSize);
|
|
376
|
+
const renderOffset = clientSize && viewportSize
|
|
377
|
+
? scrollDimension.getRenderOffset(renderCoordinate)
|
|
378
|
+
: 0;
|
|
379
|
+
this.stores[type].setStore({ renderOffset });
|
|
380
|
+
this.viewports.stores[type].setViewport({ renderOffset });
|
|
366
381
|
this.viewports.stores[type].setViewPortCoordinate(coordinate, dimension, force);
|
|
367
382
|
}
|
|
368
383
|
getViewPortPos(e) {
|
|
@@ -511,7 +526,8 @@ class ViewportService {
|
|
|
511
526
|
(_a = this.config.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, detail, true);
|
|
512
527
|
// set resize event
|
|
513
528
|
const changedItems = {};
|
|
514
|
-
for (const
|
|
529
|
+
for (const i of Object.keys(detail || {})) {
|
|
530
|
+
const size = detail[i];
|
|
515
531
|
const virtualIndex = parseInt(i, 10);
|
|
516
532
|
const item = getSourceItem(store, virtualIndex);
|
|
517
533
|
if (item) {
|
|
@@ -914,7 +930,10 @@ class SelectionStoreConnector {
|
|
|
914
930
|
const nextItem = nextCell(focus, lastCell);
|
|
915
931
|
let nextStore;
|
|
916
932
|
if (nextItem) {
|
|
917
|
-
Object.
|
|
933
|
+
Object.keys(nextItem).forEach((t) => {
|
|
934
|
+
var _a;
|
|
935
|
+
const type = t;
|
|
936
|
+
const nextItemCoord = (_a = nextItem[type]) !== null && _a !== void 0 ? _a : 0;
|
|
918
937
|
let stores;
|
|
919
938
|
switch (type) {
|
|
920
939
|
case 'x':
|
|
@@ -1956,12 +1975,13 @@ const RevoGridComponent = class {
|
|
|
1956
1975
|
return;
|
|
1957
1976
|
}
|
|
1958
1977
|
const columns = this.columnProvider.setColumns(beforeApplyEvent.detail);
|
|
1978
|
+
const order = {};
|
|
1979
|
+
for (const prop of Object.keys(beforeApplyEvent.detail.sort)) {
|
|
1980
|
+
order[prop] = beforeApplyEvent.detail.sort[prop].order;
|
|
1981
|
+
}
|
|
1959
1982
|
this.aftercolumnsset.emit({
|
|
1960
1983
|
columns,
|
|
1961
|
-
order
|
|
1962
|
-
acc[prop] = column.order;
|
|
1963
|
-
return acc;
|
|
1964
|
-
}, {}),
|
|
1984
|
+
order,
|
|
1965
1985
|
});
|
|
1966
1986
|
}
|
|
1967
1987
|
disableVirtualXChanged(newVal = false, prevVal = false) {
|
|
@@ -2250,7 +2270,7 @@ const RevoGridComponent = class {
|
|
|
2250
2270
|
if (Object.keys((_a = this.trimmedRows) !== null && _a !== void 0 ? _a : {}).length > 0) {
|
|
2251
2271
|
this.trimmedRowsChanged(this.trimmedRows);
|
|
2252
2272
|
}
|
|
2253
|
-
this.rowDefChanged(this.rowDefinitions);
|
|
2273
|
+
this.rowDefChanged(this.rowDefinitions, undefined, undefined, false);
|
|
2254
2274
|
// init grouping
|
|
2255
2275
|
if (this.grouping && Object.keys(this.grouping).length > 0) {
|
|
2256
2276
|
this.groupingChanged(this.grouping);
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, e as Host, d as createEvent, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition,
|
|
5
|
+
import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, F as FOCUS_CLASS, I as codesLetter, R as RESIZE_INTERVAL, y as MOBILE_CLASS, z as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, q as ROW_HEADER_TYPE, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
6
6
|
import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-BvSmBueA.js';
|
|
7
|
-
import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-
|
|
8
|
-
import { c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-DbpulTog.js';
|
|
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
|
+
import { t as timeout, g as getScrollbarSize } from './index-Db3qZoW5.js';
|
|
10
|
+
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
11
|
+
import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-COAfzAyu.js';
|
|
12
|
+
import { H as HEADER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
13
|
+
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-CaUDyxyU.js';
|
|
13
14
|
|
|
14
15
|
const Attribution = class {
|
|
15
16
|
constructor(hostRef) {
|
|
@@ -107,8 +108,8 @@ function getCurrentCell({ x, y }, { el, rows, cols }) {
|
|
|
107
108
|
cellX = width - 1;
|
|
108
109
|
}
|
|
109
110
|
// Get the row and column items based on the cell position
|
|
110
|
-
const rgRow = getItemByPosition(rows, cellY);
|
|
111
|
-
const rgCol = getItemByPosition(cols, cellX);
|
|
111
|
+
const rgRow = getItemByPosition(rows, cellY + (rows.renderOffset || 0));
|
|
112
|
+
const rgCol = getItemByPosition(cols, cellX + (cols.renderOffset || 0));
|
|
112
113
|
// Set the row and column index to 0 if they are before the first item
|
|
113
114
|
if (rgCol.itemIndex < 0) {
|
|
114
115
|
rgCol.itemIndex = 0;
|
|
@@ -178,10 +179,12 @@ function styleByCellProps(styles) {
|
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
181
|
function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
182
|
+
const rowOffset = dimensionRow.renderOffset || 0;
|
|
183
|
+
const colOffset = dimensionCol.renderOffset || 0;
|
|
184
|
+
const top = getItemByIndex(dimensionRow, y).start - rowOffset;
|
|
185
|
+
const left = getItemByIndex(dimensionCol, x).start - colOffset;
|
|
186
|
+
const bottom = getItemByIndex(dimensionRow, y1).end - rowOffset;
|
|
187
|
+
const right = getItemByIndex(dimensionCol, x1).end - colOffset;
|
|
185
188
|
return {
|
|
186
189
|
left,
|
|
187
190
|
right,
|
|
@@ -279,9 +282,29 @@ class KeyboardService {
|
|
|
279
282
|
constructor(sv) {
|
|
280
283
|
this.sv = sv;
|
|
281
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* Appends printable key input that arrives after edit mode was requested
|
|
287
|
+
* but before the editor input has mounted or received focus.
|
|
288
|
+
*/
|
|
289
|
+
appendPendingEditValue(e) {
|
|
290
|
+
if (isShortcutModifier(e) ||
|
|
291
|
+
e.key.length !== 1 ||
|
|
292
|
+
(e.target instanceof HTMLElement && isEditInput(e.target))) {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
const editCell = this.sv.selectionStore.get('edit');
|
|
296
|
+
if (typeof (editCell === null || editCell === void 0 ? void 0 : editCell.val) !== 'string') {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
this.sv.selectionStore.set('edit', Object.assign(Object.assign({}, editCell), { val: `${editCell.val}${e.key}` }));
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
282
302
|
async keyDown(e, canRange, isEditMode, { range, focus }) {
|
|
283
303
|
// IF EDIT MODE
|
|
284
304
|
if (isEditMode) {
|
|
305
|
+
if (this.appendPendingEditValue(e)) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
285
308
|
switch (e.code) {
|
|
286
309
|
case codesLetter.ESCAPE:
|
|
287
310
|
this.sv.cancel();
|
|
@@ -375,7 +398,8 @@ class KeyboardService {
|
|
|
375
398
|
}
|
|
376
399
|
const eData = this.sv.getData();
|
|
377
400
|
if (isMulti) {
|
|
378
|
-
|
|
401
|
+
const isOutOfBounds = [data.start, data.end].some(cell => isAfterLast(cell, eData.lastCell) || isBeforeFirst(cell));
|
|
402
|
+
if (isOutOfBounds) {
|
|
379
403
|
return false;
|
|
380
404
|
}
|
|
381
405
|
const range = getRange(data.start, data.end);
|
|
@@ -1286,15 +1310,9 @@ const RevogrScrollVirtual = class {
|
|
|
1286
1310
|
*/
|
|
1287
1311
|
async changeScroll(e) {
|
|
1288
1312
|
if (e.delta) {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
break;
|
|
1293
|
-
case 'rgRow':
|
|
1294
|
-
e.coordinate = this.element.scrollTop + e.delta;
|
|
1295
|
-
break;
|
|
1296
|
-
}
|
|
1297
|
-
this.setScroll(e);
|
|
1313
|
+
const scrollProperty = e.dimension === 'rgRow' ? 'scrollTop' : 'scrollLeft';
|
|
1314
|
+
const currentPhysicalCoordinate = this.element[scrollProperty];
|
|
1315
|
+
return this.localScrollService.setScrollByDelta(e, currentPhysicalCoordinate);
|
|
1298
1316
|
}
|
|
1299
1317
|
return e;
|
|
1300
1318
|
}
|
|
@@ -1357,7 +1375,7 @@ const RevogrScrollVirtual = class {
|
|
|
1357
1375
|
}
|
|
1358
1376
|
render() {
|
|
1359
1377
|
const size = getContentSize(this.realSize, this.dimension === 'rgRow' ? this.element.clientHeight : this.element.clientWidth, this.clientSize);
|
|
1360
|
-
return (h(Host, { key: '
|
|
1378
|
+
return (h(Host, { key: '7213817ef941eee4050b714266598ec0c2961ee9', onScroll: (e) => this.onScroll(e) }, h("div", { key: '501da49c63253ab943172494b9dbf5399be56cee', style: {
|
|
1361
1379
|
[this.dimension === 'rgRow' ? 'height' : 'width']: `${size}px`,
|
|
1362
1380
|
} })));
|
|
1363
1381
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import {
|
|
6
|
-
import { T as TextEditor } from './text-editor-
|
|
7
|
-
import { n as isEditorCtrConstructible } from './edit.utils-
|
|
8
|
-
import { d as debounce } from './debounce-
|
|
5
|
+
import { E as EDIT_INPUT_WR, j as getItemByPosition, b as getSourceItem, A as DRAGG_TEXT } from './dimension.helpers-CGKwSvw6.js';
|
|
6
|
+
import { T as TextEditor } from './text-editor-C3RUSwH5.js';
|
|
7
|
+
import { n as isEditorCtrConstructible } from './edit.utils-Dnnbd0xG.js';
|
|
8
|
+
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
9
|
+
import './index-Db3qZoW5.js';
|
|
9
10
|
|
|
10
11
|
const Clipboard = class {
|
|
11
12
|
constructor(hostRef) {
|
|
@@ -332,11 +333,12 @@ class RowOrderService {
|
|
|
332
333
|
getRow(y, { el, rows }) {
|
|
333
334
|
const { top } = el.getBoundingClientRect();
|
|
334
335
|
const topRelative = y - top;
|
|
335
|
-
const
|
|
336
|
+
const rowOffset = rows.renderOffset || 0;
|
|
337
|
+
const rgRow = getItemByPosition(rows, topRelative + rowOffset);
|
|
336
338
|
const absolutePosition = {
|
|
337
339
|
itemIndex: rgRow.itemIndex,
|
|
338
|
-
start: rgRow.start + top,
|
|
339
|
-
end: rgRow.end + top,
|
|
340
|
+
start: rgRow.start - rowOffset + top,
|
|
341
|
+
end: rgRow.end - rowOffset + top,
|
|
340
342
|
};
|
|
341
343
|
return absolutePosition;
|
|
342
344
|
}
|
|
@@ -345,8 +347,8 @@ class RowOrderService {
|
|
|
345
347
|
const { top, left } = el.getBoundingClientRect();
|
|
346
348
|
const topRelative = y - top;
|
|
347
349
|
const leftRelative = x - left;
|
|
348
|
-
const rgRow = getItemByPosition(rows, topRelative);
|
|
349
|
-
const rgCol = getItemByPosition(cols, leftRelative);
|
|
350
|
+
const rgRow = getItemByPosition(rows, topRelative + (rows.renderOffset || 0));
|
|
351
|
+
const rgCol = getItemByPosition(cols, leftRelative + (cols.renderOffset || 0));
|
|
350
352
|
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
351
353
|
}
|
|
352
354
|
}
|