@revolist/revogrid 4.26.2 → 4.27.1
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-Cf2Pu4S0.js → cell-renderer-BDIx0xys.js} +3 -3
- package/dist/cjs/{column.service-C7p5eC5V.js → column.service-D-ENzqyb.js} +5 -3
- package/dist/cjs/{dimension.helpers-CgHhnN1d.js → dimension.helpers-CptesQOZ.js} +52 -8
- package/dist/cjs/{edit.utils-rAcGublN.js → edit.utils-CBAbQhGP.js} +1 -1
- package/dist/cjs/{header-cell-renderer-DHClfIto.js → header-cell-renderer-B5Y4fdZC.js} +1 -1
- package/dist/cjs/{index--FdNLz1Z.js → index-BVESmpqW.js} +1 -1
- package/dist/cjs/index.cjs.js +72 -55
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +131 -86
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +51 -19
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +4 -4
- package/dist/cjs/revogr-data_4.cjs.entry.js +21 -15
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +9 -9
- package/dist/cjs/{column.drag.plugin-CK5HADlW.js → row-resize.plugin-sK9_rcUN.js} +759 -86
- package/dist/cjs/{text-editor-F04kTx53.js → text-editor-CJyQaYei.js} +2 -2
- package/dist/cjs/{throttle-fV6BUmM7.js → throttle-BsaP4fgu.js} +3 -3
- package/dist/cjs/{viewport.store-B4Clk4m9.js → viewport.store-mhsdi61t.js} +1 -1
- package/dist/collection/components/data/revogr-data-style.css +11 -0
- package/dist/collection/components/data/revogr-data.js +14 -8
- package/dist/collection/components/header/revogr-header-style.css +1 -0
- package/dist/collection/components/overlay/keyboard.service.js +33 -3
- package/dist/collection/components/overlay/revogr-overlay-selection.js +12 -10
- package/dist/collection/components/revoGrid/plugin.service.js +2 -2
- package/dist/collection/components/revoGrid/revo-grid.js +80 -30
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +24 -13
- package/dist/collection/components/revoGrid/viewport.service.js +1 -1
- package/dist/collection/plugins/filter/filter.constants.js +9 -0
- package/dist/collection/plugins/filter/filter.panel.js +8 -8
- package/dist/collection/plugins/filter/filter.plugin.js +109 -10
- package/dist/collection/plugins/filter/filter.style.css +2 -0
- package/dist/collection/plugins/groupingRow/grouping.const.js +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +93 -56
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +1 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js +1 -1
- package/dist/collection/plugins/groupingRow/grouping.sorting.service.js +58 -0
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +5 -3
- package/dist/collection/plugins/index.js +1 -0
- package/dist/collection/plugins/row-resize/index.js +6 -0
- package/dist/collection/plugins/row-resize/row-resize.plugin.js +416 -0
- package/dist/collection/plugins/row-resize/row-resize.types.js +1 -0
- package/dist/collection/plugins/row-resize/row-resize.utils.js +55 -0
- package/dist/collection/plugins/sorting/sorting.plugin.js +16 -13
- package/dist/collection/plugins/wcag/index.js +5 -4
- package/dist/collection/serve/controller.js +1 -1
- package/dist/collection/services/data.provider.js +8 -2
- package/dist/collection/services/dimension.provider.js +17 -1
- package/dist/collection/services/local.scroll.timer.js +3 -3
- package/dist/collection/services/selection.store.connector.js +4 -2
- package/dist/collection/store/dataSource/data.pending.plugin.js +21 -0
- package/dist/collection/store/dataSource/data.store.js +25 -3
- package/dist/collection/store/dataSource/trimmed.plugin.js +9 -6
- package/dist/collection/store/dimension/dimension.trim.plugin.js +1 -3
- package/dist/collection/types/events.js +4 -1
- package/dist/collection/utils/column.utils.js +1 -1
- package/dist/esm/{cell-renderer-11cf-lu3.js → cell-renderer-D9ze8OJw.js} +3 -3
- package/dist/esm/{column.service-Cfw3L0PN.js → column.service-pu_fdQ0S.js} +5 -4
- package/dist/{revo-grid/dimension.helpers-fl4HSSK9.js → esm/dimension.helpers-Cln9sALu.js} +52 -9
- package/dist/{revo-grid/edit.utils-4e9fsqOR.js → esm/edit.utils-3ZbhQCv_.js} +1 -1
- package/dist/esm/{header-cell-renderer-Cqtg1ETB.js → header-cell-renderer-YCiVIQ2E.js} +1 -1
- package/dist/esm/{index-D24ku9ej.js → index-BvMNbQyq.js} +1 -1
- package/dist/esm/index.js +14 -11
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +113 -68
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +51 -19
- package/dist/esm/revogr-clipboard_3.entry.js +4 -4
- package/dist/esm/revogr-data_4.entry.js +21 -15
- package/dist/esm/revogr-filter-panel.entry.js +9 -9
- package/dist/esm/{column.drag.plugin-DDBKeTGI.js → row-resize.plugin-DBOgjLdE.js} +748 -87
- package/dist/{revo-grid/text-editor-DlMnLkRK.js → esm/text-editor-eHtrwvxH.js} +2 -2
- package/dist/{revo-grid/throttle-Cpk1LoGk.js → esm/throttle-3rhqdcLy.js} +3 -3
- package/dist/{revo-grid/viewport.store-BSXmsiZc.js → esm/viewport.store-DWMKRDSH.js} +1 -1
- package/dist/revo-grid/{cell-renderer-11cf-lu3.js → cell-renderer-D9ze8OJw.js} +3 -3
- package/dist/revo-grid/{column.service-Cfw3L0PN.js → column.service-pu_fdQ0S.js} +5 -4
- package/dist/{esm/dimension.helpers-fl4HSSK9.js → revo-grid/dimension.helpers-Cln9sALu.js} +52 -9
- package/dist/{esm/edit.utils-4e9fsqOR.js → revo-grid/edit.utils-3ZbhQCv_.js} +1 -1
- package/dist/revo-grid/{header-cell-renderer-Cqtg1ETB.js → header-cell-renderer-YCiVIQ2E.js} +1 -1
- package/dist/revo-grid/{index-D24ku9ej.js → index-BvMNbQyq.js} +1 -1
- package/dist/revo-grid/index.esm.js +14 -11
- package/dist/revo-grid/revo-grid.entry.js +113 -68
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +51 -19
- package/dist/revo-grid/revogr-clipboard_3.entry.js +4 -4
- package/dist/revo-grid/revogr-data_4.entry.js +21 -15
- package/dist/revo-grid/revogr-filter-panel.entry.js +9 -9
- package/dist/revo-grid/{column.drag.plugin-DDBKeTGI.js → row-resize.plugin-DBOgjLdE.js} +748 -87
- package/dist/{esm/text-editor-DlMnLkRK.js → revo-grid/text-editor-eHtrwvxH.js} +2 -2
- package/dist/{esm/throttle-Cpk1LoGk.js → revo-grid/throttle-3rhqdcLy.js} +3 -3
- package/dist/{esm/viewport.store-BSXmsiZc.js → revo-grid/viewport.store-DWMKRDSH.js} +1 -1
- package/dist/types/components/data/revogr-data.d.ts +1 -0
- package/dist/types/components/overlay/keyboard.service.d.ts +6 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +3 -1
- package/dist/types/components/revoGrid/revo-grid.d.ts +9 -1
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +3 -1
- package/dist/types/components.d.ts +23 -10
- package/dist/types/plugins/filter/filter.constants.d.ts +6 -0
- package/dist/types/plugins/filter/filter.plugin.d.ts +15 -0
- package/dist/types/plugins/groupingRow/grouping.const.d.ts +1 -0
- package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +5 -7
- package/dist/types/plugins/groupingRow/grouping.sorting.service.d.ts +7 -0
- package/dist/types/plugins/groupingRow/grouping.trimmed.service.d.ts +9 -0
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/row-resize/index.d.ts +3 -0
- package/dist/types/plugins/row-resize/row-resize.plugin.d.ts +46 -0
- package/dist/types/plugins/row-resize/row-resize.types.d.ts +40 -0
- package/dist/types/plugins/row-resize/row-resize.utils.d.ts +14 -0
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +5 -0
- package/dist/types/services/data.provider.d.ts +2 -0
- package/dist/types/services/dimension.provider.d.ts +7 -1
- package/dist/types/store/dataSource/data.pending.plugin.d.ts +9 -0
- package/dist/types/store/dataSource/data.store.d.ts +10 -0
- package/dist/types/store/dataSource/trimmed.plugin.d.ts +5 -0
- package/dist/types/types/events.d.ts +1 -1
- package/dist/types/types/interfaces.d.ts +3 -1
- package/hydrate/index.js +980 -191
- package/hydrate/index.mjs +980 -191
- package/package.json +1 -1
- package/readme.md +4 -1
- package/standalone/column.service.js +1 -1
- package/standalone/data.store.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-overlay-selection2.js +1 -1
- package/standalone/revogr-row-headers2.js +1 -1
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, a as createEvent, d as Host, g as getElement } from './index-CtimkLsB.js';
|
|
5
|
-
import { c as columnTypes,
|
|
6
|
-
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex,
|
|
5
|
+
import { c as columnTypes, K as reduce, D as getColumnType, r as rowTypes, i as isRowType, E as getColumnSizes, a as cropCellToMax, n as nextCell, J as getColumnByProp, H as getColumns } from './column.service-pu_fdQ0S.js';
|
|
6
|
+
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, h as gatherTrimmedItems, l as getItemByIndex, R as RESIZE_INTERVAL, a as getVisibleSourceItem } from './dimension.helpers-Cln9sALu.js';
|
|
7
7
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
8
8
|
import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
9
|
-
import { D as DimensionStore, t as themeTokenCssVariables, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, f as FilterPlugin, E as ExportFilePlugin,
|
|
10
|
-
import { V as ViewportStore } from './viewport.store-
|
|
11
|
-
import { t as timeout } from './index-
|
|
9
|
+
import { D as DimensionStore, t as themeTokenCssVariables, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, f as FilterPlugin, E as ExportFilePlugin, P as SortingPlugin, I as RowResizePlugin, u as ColumnMovePlugin } from './row-resize.plugin-DBOgjLdE.js';
|
|
10
|
+
import { V as ViewportStore } from './viewport.store-DWMKRDSH.js';
|
|
11
|
+
import { t as timeout } from './index-BvMNbQyq.js';
|
|
12
12
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
13
13
|
import './filter.button-DMhpuAiw.js';
|
|
14
|
-
import './header-cell-renderer-
|
|
14
|
+
import './header-cell-renderer-YCiVIQ2E.js';
|
|
15
15
|
|
|
16
16
|
class ColumnDataProvider {
|
|
17
17
|
get stores() {
|
|
@@ -228,9 +228,15 @@ class DataProvider {
|
|
|
228
228
|
store.addTrimmed(trimmed);
|
|
229
229
|
this.dimensionProvider.setTrimmed(trimmed, type);
|
|
230
230
|
if (type === 'rgRow') {
|
|
231
|
-
this.dimensionProvider.setData(
|
|
231
|
+
this.dimensionProvider.setData(store.store.get('items').length, type);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
+
/** Keep a row source empty until its current asynchronous update is ready. */
|
|
235
|
+
setItemsPending(pending, type = 'rgRow') {
|
|
236
|
+
const store = this.stores[type];
|
|
237
|
+
store.setItemsPending(pending);
|
|
238
|
+
this.dimensionProvider.setData(store.store.get('items').length, type, type !== 'rgRow');
|
|
239
|
+
}
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
const DEFAULT_VIRTUAL_X = ['rgCol'];
|
|
@@ -246,7 +252,9 @@ function isVirtualXDimension(type, disableVirtualX = false, virtualX = DEFAULT_V
|
|
|
246
252
|
class DimensionProvider {
|
|
247
253
|
constructor(viewports, config) {
|
|
248
254
|
this.viewports = viewports;
|
|
249
|
-
|
|
255
|
+
this.config = config;
|
|
256
|
+
this.rowDefinitions = [];
|
|
257
|
+
const sizeChanged = debounce((k) => this.config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
250
258
|
this.stores = [...rowTypes, ...columnTypes].reduce((sources, t) => {
|
|
251
259
|
sources[t] = new DimensionStore(t);
|
|
252
260
|
sources[t].store.onChange('realSize', () => sizeChanged(t));
|
|
@@ -264,6 +272,20 @@ class DimensionProvider {
|
|
|
264
272
|
this.viewports.stores[t].setOriginalSizes(this.stores[t].store.get('originItemSize'));
|
|
265
273
|
this.setItemCount(count, t);
|
|
266
274
|
}
|
|
275
|
+
getRowDefinitions() {
|
|
276
|
+
return this.rowDefinitions;
|
|
277
|
+
}
|
|
278
|
+
syncRowDefinitions(definitions) {
|
|
279
|
+
this.rowDefinitions = definitions;
|
|
280
|
+
}
|
|
281
|
+
setRowDefinitions(definitions) {
|
|
282
|
+
var _a, _b;
|
|
283
|
+
if (definitions === this.rowDefinitions) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
this.syncRowDefinitions(definitions);
|
|
287
|
+
(_b = (_a = this.config).rowDefinitionsChanged) === null || _b === void 0 ? void 0 : _b.call(_a, definitions);
|
|
288
|
+
}
|
|
267
289
|
/**
|
|
268
290
|
* Apply new custom sizes to dimension and view port
|
|
269
291
|
* @param type - dimension type
|
|
@@ -720,7 +742,7 @@ class ViewportService {
|
|
|
720
742
|
const changedItems = {};
|
|
721
743
|
for (const i of Object.keys(detail || {})) {
|
|
722
744
|
const size = detail[i];
|
|
723
|
-
const virtualIndex = parseInt(i, 10);
|
|
745
|
+
const virtualIndex = Number.parseInt(i, 10);
|
|
724
746
|
const item = getSourceItem(store, virtualIndex);
|
|
725
747
|
if (item) {
|
|
726
748
|
changedItems[virtualIndex] = Object.assign(Object.assign({}, item), { size });
|
|
@@ -849,29 +871,25 @@ class GridScrollingService {
|
|
|
849
871
|
this.elements = {};
|
|
850
872
|
}
|
|
851
873
|
async proxyScroll(e, key, skipEvent) {
|
|
852
|
-
var _a;
|
|
853
874
|
let newEventPromise;
|
|
854
875
|
let event = e;
|
|
855
|
-
for (
|
|
876
|
+
for (const elKey in (skipEvent ? {} : this.elements)) {
|
|
856
877
|
// skip
|
|
857
878
|
if (e.dimension === 'rgCol' && elKey === 'headerRow') {
|
|
858
879
|
continue;
|
|
859
880
|
// pinned column only
|
|
860
881
|
}
|
|
861
|
-
|
|
882
|
+
if (this.isPinnedColumn(key) && e.dimension === 'rgCol') {
|
|
862
883
|
if (elKey === key || !e.delta) {
|
|
863
884
|
continue;
|
|
864
885
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}
|
|
886
|
+
const changedEvent = this.changeScroll(this.elements[elKey], e);
|
|
887
|
+
if (changedEvent) {
|
|
888
|
+
newEventPromise = changedEvent;
|
|
869
889
|
}
|
|
870
890
|
}
|
|
871
891
|
else {
|
|
872
|
-
|
|
873
|
-
await ((_a = el.setScroll) === null || _a === void 0 ? void 0 : _a.call(el, e));
|
|
874
|
-
}
|
|
892
|
+
await this.setScroll(this.elements[elKey], e);
|
|
875
893
|
}
|
|
876
894
|
}
|
|
877
895
|
const newEvent = await newEventPromise;
|
|
@@ -881,12 +899,27 @@ class GridScrollingService {
|
|
|
881
899
|
this.setViewport(skipEvent && this.isPinnedColumn(key)
|
|
882
900
|
? Object.assign(Object.assign({}, event), { dimension: key }) : event);
|
|
883
901
|
}
|
|
902
|
+
changeScroll(elements, e) {
|
|
903
|
+
let changedEvent;
|
|
904
|
+
for (const element of elements) {
|
|
905
|
+
if (element.changeScroll) {
|
|
906
|
+
changedEvent = element.changeScroll(e);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
return changedEvent;
|
|
910
|
+
}
|
|
911
|
+
async setScroll(elements, e) {
|
|
912
|
+
var _a;
|
|
913
|
+
for (const element of elements) {
|
|
914
|
+
await ((_a = element.setScroll) === null || _a === void 0 ? void 0 : _a.call(element, e));
|
|
915
|
+
}
|
|
916
|
+
}
|
|
884
917
|
/**
|
|
885
918
|
* Silent scroll update for mobile devices when we have negative scroll top
|
|
886
919
|
*/
|
|
887
920
|
async scrollSilentService(e, key) {
|
|
888
921
|
var _a;
|
|
889
|
-
for (
|
|
922
|
+
for (const elKey in this.elements) {
|
|
890
923
|
// skip same element update
|
|
891
924
|
if (elKey === key) {
|
|
892
925
|
continue;
|
|
@@ -894,7 +927,7 @@ class GridScrollingService {
|
|
|
894
927
|
if (columnTypes.includes(key) &&
|
|
895
928
|
(elKey === 'headerRow' ||
|
|
896
929
|
columnTypes.includes(elKey))) {
|
|
897
|
-
for (
|
|
930
|
+
for (const el of this.elements[elKey]) {
|
|
898
931
|
await ((_a = el.changeScroll) === null || _a === void 0 ? void 0 : _a.call(el, e, true));
|
|
899
932
|
}
|
|
900
933
|
continue;
|
|
@@ -902,7 +935,7 @@ class GridScrollingService {
|
|
|
902
935
|
}
|
|
903
936
|
}
|
|
904
937
|
isPinnedColumn(key) {
|
|
905
|
-
return !!key && ['colPinStart', 'colPinEnd'].
|
|
938
|
+
return !!key && ['colPinStart', 'colPinEnd'].includes(key);
|
|
906
939
|
}
|
|
907
940
|
registerElements(els) {
|
|
908
941
|
this.elements = els;
|
|
@@ -1183,9 +1216,11 @@ class SelectionStoreConnector {
|
|
|
1183
1216
|
continue;
|
|
1184
1217
|
}
|
|
1185
1218
|
const lastCell = store.store.get('lastCell');
|
|
1186
|
-
if (lastCell) {
|
|
1187
|
-
store.
|
|
1219
|
+
if (!lastCell || lastCell.x <= 0 || lastCell.y <= 0) {
|
|
1220
|
+
store.setRangeArea(null);
|
|
1221
|
+
continue;
|
|
1188
1222
|
}
|
|
1223
|
+
store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
|
|
1189
1224
|
}
|
|
1190
1225
|
}
|
|
1191
1226
|
}
|
|
@@ -1287,24 +1322,12 @@ const rowDefinitionByType = (newVal = []) => {
|
|
|
1287
1322
|
}
|
|
1288
1323
|
return result;
|
|
1289
1324
|
};
|
|
1290
|
-
const rowDefinitionRemoveByType = (oldVal = []) => {
|
|
1291
|
-
const result = {};
|
|
1292
|
-
for (const v of oldVal) {
|
|
1293
|
-
let rowDefs = result[v.type];
|
|
1294
|
-
if (!rowDefs) {
|
|
1295
|
-
rowDefs = result[v.type] = [];
|
|
1296
|
-
}
|
|
1297
|
-
if (typeof v.size === 'number') {
|
|
1298
|
-
rowDefs.push(v.index);
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
return result;
|
|
1302
|
-
};
|
|
1303
1325
|
|
|
1304
1326
|
function isMobileDevice() {
|
|
1305
1327
|
return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;
|
|
1306
1328
|
}
|
|
1307
1329
|
|
|
1330
|
+
const toAriaIndex = (index) => `${index + 1}`;
|
|
1308
1331
|
/**
|
|
1309
1332
|
* WCAG Plugin is responsible for enhancing the accessibility features of the RevoGrid component.
|
|
1310
1333
|
* It ensures that the grid is fully compliant with Web Content Accessibility Guidelines (WCAG) 2.1.
|
|
@@ -1348,14 +1371,14 @@ class WCAGPlugin extends BasePlugin {
|
|
|
1348
1371
|
column.columnProperties = (...args) => {
|
|
1349
1372
|
const result = (columnProperties === null || columnProperties === void 0 ? void 0 : columnProperties(...args)) || {};
|
|
1350
1373
|
result.role = 'columnheader';
|
|
1351
|
-
result['aria-colindex'] =
|
|
1374
|
+
result['aria-colindex'] = toAriaIndex(index);
|
|
1352
1375
|
return result;
|
|
1353
1376
|
};
|
|
1354
1377
|
column.cellProperties = (...args) => {
|
|
1355
1378
|
const wcagProps = {
|
|
1356
1379
|
['role']: 'gridcell',
|
|
1357
|
-
['aria-colindex']:
|
|
1358
|
-
['aria-rowindex']:
|
|
1380
|
+
['aria-colindex']: toAriaIndex(index),
|
|
1381
|
+
['aria-rowindex']: toAriaIndex(args[0].rowIndex),
|
|
1359
1382
|
['tabindex']: -1,
|
|
1360
1383
|
};
|
|
1361
1384
|
const columnProps = (cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties(...args)) || {};
|
|
@@ -1370,7 +1393,7 @@ class WCAGPlugin extends BasePlugin {
|
|
|
1370
1393
|
revogrid.setAttribute('aria-rowcount', `${detail.source.length}`);
|
|
1371
1394
|
});
|
|
1372
1395
|
this.addEventListener('beforerowrender', ({ detail, }) => {
|
|
1373
|
-
detail.node.$attrs$ = Object.assign(Object.assign({}, detail.node.$attrs$), { role: 'row', ['aria-rowindex']: detail.item.itemIndex });
|
|
1396
|
+
detail.node.$attrs$ = Object.assign(Object.assign({}, detail.node.$attrs$), { role: 'row', ['aria-rowindex']: toAriaIndex(detail.item.itemIndex) });
|
|
1374
1397
|
});
|
|
1375
1398
|
// focuscell
|
|
1376
1399
|
this.addEventListener('afterfocus', async (e) => {
|
|
@@ -1417,7 +1440,7 @@ class PluginService {
|
|
|
1417
1440
|
return;
|
|
1418
1441
|
}
|
|
1419
1442
|
// Step 1: Identify plugins to remove, compare new and old plugins
|
|
1420
|
-
const pluginsToRemove = (prevPlugins === null || prevPlugins === void 0 ? void 0 : prevPlugins.filter(prevPlugin => !plugins.
|
|
1443
|
+
const pluginsToRemove = (prevPlugins === null || prevPlugins === void 0 ? void 0 : prevPlugins.filter(prevPlugin => !plugins.includes(prevPlugin))) || [];
|
|
1421
1444
|
// Step 2: Remove old plugins
|
|
1422
1445
|
pluginsToRemove.forEach(plugin => {
|
|
1423
1446
|
var _a, _b;
|
|
@@ -1430,7 +1453,7 @@ class PluginService {
|
|
|
1430
1453
|
// Step 3: Register user plugins
|
|
1431
1454
|
plugins === null || plugins === void 0 ? void 0 : plugins.forEach(userPlugin => {
|
|
1432
1455
|
// check if plugin already exists, if so, skip
|
|
1433
|
-
const existingPlugin = this.internalPlugins.
|
|
1456
|
+
const existingPlugin = this.internalPlugins.some(createdPlugin => createdPlugin instanceof userPlugin);
|
|
1434
1457
|
if (existingPlugin) {
|
|
1435
1458
|
return;
|
|
1436
1459
|
}
|
|
@@ -1638,7 +1661,12 @@ const RevoGridComponent = class {
|
|
|
1638
1661
|
/** When true, grid in read only mode. */
|
|
1639
1662
|
this.readonly = false;
|
|
1640
1663
|
/** When true, columns are resizable. */
|
|
1641
|
-
this.resize =
|
|
1664
|
+
this.resize = true;
|
|
1665
|
+
/**
|
|
1666
|
+
* Enables row resizing. Pass a configuration object to customize the
|
|
1667
|
+
* height limits or enable resize edges across the full row.
|
|
1668
|
+
*/
|
|
1669
|
+
this.resizeRow = false;
|
|
1642
1670
|
/**
|
|
1643
1671
|
* Prevents horizontal scroll state from being mirrored across viewport sections.
|
|
1644
1672
|
*/
|
|
@@ -1709,15 +1737,15 @@ const RevoGridComponent = class {
|
|
|
1709
1737
|
*/
|
|
1710
1738
|
this.autoSizeColumn = false;
|
|
1711
1739
|
/**
|
|
1712
|
-
* Enables filter plugin.
|
|
1740
|
+
* Enables filter plugin. Enabled by default; set to `false` to opt out.
|
|
1713
1741
|
* Can be boolean.
|
|
1714
1742
|
* Or can be filter collection See `FilterCollection` for more info.
|
|
1715
1743
|
*/
|
|
1716
|
-
this.filter =
|
|
1744
|
+
this.filter = true;
|
|
1717
1745
|
/**
|
|
1718
1746
|
* Enable column move plugin.
|
|
1719
1747
|
*/
|
|
1720
|
-
this.canMoveColumns =
|
|
1748
|
+
this.canMoveColumns = true;
|
|
1721
1749
|
/**
|
|
1722
1750
|
* Trimmed rows.
|
|
1723
1751
|
* Functionality which allows to hide rows from main data set.
|
|
@@ -1727,7 +1755,7 @@ const RevoGridComponent = class {
|
|
|
1727
1755
|
/**
|
|
1728
1756
|
* Enable export plugin.
|
|
1729
1757
|
*/
|
|
1730
|
-
this.exporting =
|
|
1758
|
+
this.exporting = true;
|
|
1731
1759
|
/**
|
|
1732
1760
|
* Stretch strategy for columns by `StretchColumn` plugin.
|
|
1733
1761
|
* For example if there are more space on the right last column size would be increased.
|
|
@@ -1819,7 +1847,7 @@ const RevoGridComponent = class {
|
|
|
1819
1847
|
var _a;
|
|
1820
1848
|
if (this.dataProvider && this.columnProvider && !skipDataUpdate) {
|
|
1821
1849
|
const columnProp = (_a = this.columnProvider.getColumn(col, colType)) === null || _a === void 0 ? void 0 : _a.prop;
|
|
1822
|
-
if (
|
|
1850
|
+
if (columnProp !== undefined) {
|
|
1823
1851
|
this.dataProvider.setCellData({
|
|
1824
1852
|
type: rowType,
|
|
1825
1853
|
rowIndex: row,
|
|
@@ -2415,29 +2443,31 @@ const RevoGridComponent = class {
|
|
|
2415
2443
|
vals: after,
|
|
2416
2444
|
oldVals: before,
|
|
2417
2445
|
});
|
|
2418
|
-
|
|
2446
|
+
this.dimensionProvider.syncRowDefinitions(newVal);
|
|
2419
2447
|
const newRows = rowDefinitionByType(newVal);
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
// clear all old data and drop sizes
|
|
2424
|
-
for (const t in remove) {
|
|
2425
|
-
if (remove.hasOwnProperty(t)) {
|
|
2426
|
-
const type = t;
|
|
2427
|
-
const store = this.dataProvider.stores[type];
|
|
2428
|
-
const sourceLength = store.store.get('source').length;
|
|
2429
|
-
this.dimensionProvider.clearSize(type, sourceLength);
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
// set new sizes
|
|
2448
|
+
const oldRows = rowDefinitionByType(oldVal);
|
|
2449
|
+
const dataProvider = this.dataProvider;
|
|
2450
|
+
const dimensionProvider = this.dimensionProvider;
|
|
2434
2451
|
rowTypes.forEach((t) => {
|
|
2435
|
-
var _a;
|
|
2436
2452
|
const newSizes = newRows[t];
|
|
2437
|
-
|
|
2438
|
-
if (newSizes
|
|
2439
|
-
|
|
2453
|
+
const oldSizes = oldRows[t];
|
|
2454
|
+
if (!newSizes && !oldSizes && !forceUpdate) {
|
|
2455
|
+
return;
|
|
2440
2456
|
}
|
|
2457
|
+
const sizes = Object.assign({}, dimensionProvider.stores[t].store.get('sizes'));
|
|
2458
|
+
const definitionSizes = (newSizes === null || newSizes === void 0 ? void 0 : newSizes.sizes) || {};
|
|
2459
|
+
const previousDefinitionSizes = (oldSizes === null || oldSizes === void 0 ? void 0 : oldSizes.sizes) || {};
|
|
2460
|
+
const items = dataProvider.stores[t].store.get('items');
|
|
2461
|
+
items.forEach((physicalIndex, virtualIndex) => {
|
|
2462
|
+
if (Object.hasOwn(previousDefinitionSizes, physicalIndex) &&
|
|
2463
|
+
sizes[virtualIndex] === previousDefinitionSizes[physicalIndex]) {
|
|
2464
|
+
delete sizes[virtualIndex];
|
|
2465
|
+
}
|
|
2466
|
+
if (Object.hasOwn(definitionSizes, physicalIndex)) {
|
|
2467
|
+
sizes[virtualIndex] = definitionSizes[physicalIndex];
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
dimensionProvider.setCustomSizes(t, sizes);
|
|
2441
2471
|
});
|
|
2442
2472
|
}
|
|
2443
2473
|
trimmedRowsChanged(newVal = {}) {
|
|
@@ -2486,6 +2516,9 @@ const RevoGridComponent = class {
|
|
|
2486
2516
|
rowHeadersChange(rowHeaders) {
|
|
2487
2517
|
this.rowheaderschanged.emit(rowHeaders);
|
|
2488
2518
|
}
|
|
2519
|
+
resizeRowChanged() {
|
|
2520
|
+
this.syncRowResizeConfig();
|
|
2521
|
+
}
|
|
2489
2522
|
/**
|
|
2490
2523
|
* Register external VNodes
|
|
2491
2524
|
*/
|
|
@@ -2508,6 +2541,7 @@ const RevoGridComponent = class {
|
|
|
2508
2541
|
*/
|
|
2509
2542
|
pluginsChanged(plugins = [], prevPlugins) {
|
|
2510
2543
|
this.pluginService.addUserPluginsAndCreate(this.element, plugins, prevPlugins, this.getPluginData());
|
|
2544
|
+
this.syncRowResizeConfig();
|
|
2511
2545
|
}
|
|
2512
2546
|
// #endregion
|
|
2513
2547
|
// #region Plugins
|
|
@@ -2548,10 +2582,15 @@ const RevoGridComponent = class {
|
|
|
2548
2582
|
this.pluginService.add(new SortingPlugin(this.element, pluginData));
|
|
2549
2583
|
// register grouping plugin
|
|
2550
2584
|
this.pluginService.add(new GroupingRowPlugin(this.element, pluginData));
|
|
2585
|
+
this.pluginService.add(new RowResizePlugin(this.element, pluginData));
|
|
2551
2586
|
if (this.canMoveColumns) {
|
|
2552
2587
|
this.pluginService.add(new ColumnMovePlugin(this.element, pluginData));
|
|
2553
2588
|
}
|
|
2554
2589
|
}
|
|
2590
|
+
syncRowResizeConfig() {
|
|
2591
|
+
const plugin = this.pluginService.getByClass(RowResizePlugin);
|
|
2592
|
+
plugin === null || plugin === void 0 ? void 0 : plugin.syncGridConfig();
|
|
2593
|
+
}
|
|
2555
2594
|
getPluginData() {
|
|
2556
2595
|
if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {
|
|
2557
2596
|
return;
|
|
@@ -2594,6 +2633,9 @@ const RevoGridComponent = class {
|
|
|
2594
2633
|
this.themeService.setDefinitions(this.themeDefinitions);
|
|
2595
2634
|
this.dimensionProvider = new DimensionProvider(this.viewportProvider, {
|
|
2596
2635
|
realSizeChanged: (k) => this.contentsizechanged.emit(k),
|
|
2636
|
+
rowDefinitionsChanged: definitions => {
|
|
2637
|
+
this.rowDefinitions = definitions;
|
|
2638
|
+
},
|
|
2597
2639
|
});
|
|
2598
2640
|
this.dimensionProvider.setSettings({ originItemSize: getColumnSize(this.colSize) }, 'rgCol');
|
|
2599
2641
|
this.columnProvider = new ColumnDataProvider();
|
|
@@ -2784,6 +2826,9 @@ const RevoGridComponent = class {
|
|
|
2784
2826
|
"rowHeaders": [{
|
|
2785
2827
|
"rowHeadersChange": 0
|
|
2786
2828
|
}],
|
|
2829
|
+
"resizeRow": [{
|
|
2830
|
+
"resizeRowChanged": 0
|
|
2831
|
+
}],
|
|
2787
2832
|
"registerVNode": [{
|
|
2788
2833
|
"registerOutsideVNodes": 0
|
|
2789
2834
|
}],
|
|
@@ -47,5 +47,5 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
47
47
|
|
|
48
48
|
patchBrowser().then(async (options) => {
|
|
49
49
|
await globalScripts();
|
|
50
|
-
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"themeDefinitions":[16],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"colSize":[{"colSizeChanged":0}],"theme":[{"themeChanged":0}],"themeDefinitions":[{"themeDefinitionsChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"allowDuplicateOperators":[4,"allow-duplicate-operators"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
50
|
+
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"resizeRow":[4,"resize-row"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"themeDefinitions":[16],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"colSize":[{"colSizeChanged":0}],"theme":[{"themeChanged":0}],"themeDefinitions":[{"themeDefinitionsChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"resizeRow":[{"resizeRowChanged":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"allowDuplicateOperators":[4,"allow-duplicate-operators"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
51
51
|
});
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, d as Host, a as createEvent, g as getElement } from './index-CtimkLsB.js';
|
|
5
|
-
import {
|
|
5
|
+
import { l as getItemByIndex, b as getSourceItem, k as getItemByPosition, F as FOCUS_CLASS, J as codesLetter, R as RESIZE_INTERVAL, z as MOBILE_CLASS, A as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, r as ROW_HEADER_TYPE, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-Cln9sALu.js';
|
|
6
6
|
import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-BvSmBueA.js';
|
|
7
|
-
import { g as getRange,
|
|
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-
|
|
9
|
-
import { t as timeout, g as getScrollbarSize } from './index-
|
|
7
|
+
import { g as getRange, N as ColumnService, z as getCellData, O as getCellEditor, b as isRangeSingleCell } from './column.service-pu_fdQ0S.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-3ZbhQCv_.js';
|
|
9
|
+
import { t as timeout, g as getScrollbarSize } from './index-BvMNbQyq.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-DWMKRDSH.js';
|
|
12
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-
|
|
13
|
+
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-3rhqdcLy.js';
|
|
14
14
|
|
|
15
15
|
const Attribution = class {
|
|
16
16
|
constructor(hostRef) {
|
|
@@ -281,6 +281,16 @@ const DIRECTION_CODES = [
|
|
|
281
281
|
class KeyboardService {
|
|
282
282
|
constructor(sv) {
|
|
283
283
|
this.sv = sv;
|
|
284
|
+
/** Keep focus transitions in keydown order so rendering can scroll each cell into view. */
|
|
285
|
+
this.keyChangeQueue = Promise.resolve(false);
|
|
286
|
+
this.keyChangeGeneration = 0;
|
|
287
|
+
this.applyingKeyChange = false;
|
|
288
|
+
}
|
|
289
|
+
/** Cancel delayed directional input after focus or edit context changes externally. */
|
|
290
|
+
invalidatePendingChanges() {
|
|
291
|
+
if (!this.applyingKeyChange) {
|
|
292
|
+
this.keyChangeGeneration += 1;
|
|
293
|
+
}
|
|
284
294
|
}
|
|
285
295
|
/**
|
|
286
296
|
* Appends printable key input that arrives after edit mode was requested
|
|
@@ -383,13 +393,33 @@ class KeyboardService {
|
|
|
383
393
|
if (!data) {
|
|
384
394
|
return false;
|
|
385
395
|
}
|
|
396
|
+
const keyChangeGeneration = this.keyChangeGeneration;
|
|
386
397
|
// this interval needed for several cases
|
|
387
398
|
// grid could be resized before next click
|
|
388
399
|
// at this case to avoid screen jump we use this interval
|
|
389
400
|
await timeout(RESIZE_INTERVAL + 30);
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
|
|
401
|
+
const applyKeyChange = async () => {
|
|
402
|
+
if (keyChangeGeneration !== this.keyChangeGeneration) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
const range = this.sv.selectionStore.get('range');
|
|
406
|
+
const focus = this.sv.selectionStore.get('focus');
|
|
407
|
+
this.applyingKeyChange = true;
|
|
408
|
+
let changed;
|
|
409
|
+
try {
|
|
410
|
+
changed = this.keyPositionChange(data.changes, range, focus, data.isMulti);
|
|
411
|
+
}
|
|
412
|
+
finally {
|
|
413
|
+
this.applyingKeyChange = false;
|
|
414
|
+
}
|
|
415
|
+
await new Promise(resolve => requestAnimationFrame(() => {
|
|
416
|
+
requestAnimationFrame(() => resolve());
|
|
417
|
+
}));
|
|
418
|
+
return changed;
|
|
419
|
+
};
|
|
420
|
+
const queuedChange = this.keyChangeQueue.then(applyKeyChange, applyKeyChange);
|
|
421
|
+
this.keyChangeQueue = queuedChange.catch(() => false);
|
|
422
|
+
return queuedChange;
|
|
393
423
|
}
|
|
394
424
|
keyPositionChange(changes, range, focus, isMulti = false) {
|
|
395
425
|
if (!range || !focus) {
|
|
@@ -773,6 +803,8 @@ const OverlaySelection = class {
|
|
|
773
803
|
* Selection & Keyboard
|
|
774
804
|
*/
|
|
775
805
|
selectionServiceSet(selectionStore) {
|
|
806
|
+
var _a;
|
|
807
|
+
(_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges();
|
|
776
808
|
// clear subscriptions
|
|
777
809
|
this.unsubscribeSelectionStore.forEach(v => v());
|
|
778
810
|
this.unsubscribeSelectionStore.length = 0;
|
|
@@ -800,6 +832,7 @@ const OverlaySelection = class {
|
|
|
800
832
|
getData: () => this.getData(),
|
|
801
833
|
selectAll: () => this.selectAll.emit(),
|
|
802
834
|
});
|
|
835
|
+
this.unsubscribeSelectionStore.push(selectionStore.onChange('focus', () => { var _a; return (_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges(); }), selectionStore.onChange('edit', () => { var _a; return (_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges(); }));
|
|
803
836
|
this.createAutoFillService();
|
|
804
837
|
}
|
|
805
838
|
/** Autofill */
|
|
@@ -836,11 +869,12 @@ const OverlaySelection = class {
|
|
|
836
869
|
this.selectionServiceSet(this.selectionStore);
|
|
837
870
|
}
|
|
838
871
|
disconnectedCallback() {
|
|
839
|
-
var _a;
|
|
872
|
+
var _a, _b;
|
|
840
873
|
// clear subscriptions
|
|
874
|
+
(_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges();
|
|
841
875
|
this.unsubscribeSelectionStore.forEach(v => v());
|
|
842
876
|
this.unsubscribeSelectionStore.length = 0;
|
|
843
|
-
(
|
|
877
|
+
(_b = this.columnService) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
844
878
|
}
|
|
845
879
|
async componentWillRender() {
|
|
846
880
|
var _a, _b;
|
|
@@ -852,9 +886,7 @@ const OverlaySelection = class {
|
|
|
852
886
|
renderRange(range) {
|
|
853
887
|
const cell = getCell(range, this.dimensionRow.state, this.dimensionCol.state);
|
|
854
888
|
const styles = styleByCellProps(cell);
|
|
855
|
-
return
|
|
856
|
-
h("div", { class: SELECTION_BORDER_CLASS, style: styles }, this.isMobileDevice && (h("div", { class: "range-handlers" }, h("span", { class: MOBILE_CLASS }), h("span", { class: MOBILE_CLASS })))),
|
|
857
|
-
];
|
|
889
|
+
return (h("div", { class: SELECTION_BORDER_CLASS, style: styles }, this.isMobileDevice && (h("div", { class: "range-handlers" }, h("span", { class: MOBILE_CLASS }), h("span", { class: MOBILE_CLASS })))));
|
|
858
890
|
}
|
|
859
891
|
renderEditor() {
|
|
860
892
|
// Check if edit access
|
|
@@ -907,7 +939,7 @@ const OverlaySelection = class {
|
|
|
907
939
|
}
|
|
908
940
|
// Range
|
|
909
941
|
if (range) {
|
|
910
|
-
nodes.push(
|
|
942
|
+
nodes.push(this.renderRange(range));
|
|
911
943
|
}
|
|
912
944
|
// Autofill
|
|
913
945
|
if (focus && !this.readonly && this.range) {
|
|
@@ -918,9 +950,9 @@ const OverlaySelection = class {
|
|
|
918
950
|
nodes.push(h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
919
951
|
}
|
|
920
952
|
}
|
|
921
|
-
return (h(Host, { key: '
|
|
953
|
+
return (h(Host, { key: '230e2122c5c7065c072f02019d616a64949d54d0', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
922
954
|
// it's done to be able to throw events from different levels, not just from editor
|
|
923
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '
|
|
955
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '47740a79c605258b4024384510358be927d000b7', name: "data" })));
|
|
924
956
|
}
|
|
925
957
|
/**
|
|
926
958
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -1117,12 +1149,12 @@ const OverlaySelection = class {
|
|
|
1117
1149
|
clearCell() {
|
|
1118
1150
|
var _a;
|
|
1119
1151
|
const range = this.selectionStore.get('range');
|
|
1120
|
-
|
|
1152
|
+
const focused = this.selectionStore.get('focus');
|
|
1153
|
+
if (range && (!isRangeSingleCell(range) || !focused)) {
|
|
1121
1154
|
const data = this.columnService.getRangeStaticData(range, '');
|
|
1122
1155
|
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(data, range, range);
|
|
1123
1156
|
}
|
|
1124
1157
|
else if (this.canEdit()) {
|
|
1125
|
-
const focused = this.selectionStore.get('focus');
|
|
1126
1158
|
if (!focused) {
|
|
1127
1159
|
return;
|
|
1128
1160
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, a as createEvent, h, d as Host, g as getElement } from './index-CtimkLsB.js';
|
|
5
|
-
import { E as EDIT_INPUT_WR,
|
|
6
|
-
import { T as TextEditor } from './text-editor-
|
|
7
|
-
import { n as isEditorCtrConstructible } from './edit.utils-
|
|
5
|
+
import { E as EDIT_INPUT_WR, k as getItemByPosition, b as getSourceItem, B as DRAGG_TEXT } from './dimension.helpers-Cln9sALu.js';
|
|
6
|
+
import { T as TextEditor } from './text-editor-eHtrwvxH.js';
|
|
7
|
+
import { n as isEditorCtrConstructible } from './edit.utils-3ZbhQCv_.js';
|
|
8
8
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
9
|
-
import './index-
|
|
9
|
+
import './index-BvMNbQyq.js';
|
|
10
10
|
|
|
11
11
|
const Clipboard = class {
|
|
12
12
|
constructor(hostRef) {
|