@revolist/revogrid 4.17.2 → 4.18.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-DHSqT1hc.js → cell-renderer-ChTDsUI9.js} +3 -3
- package/dist/cjs/{cell-renderer-DHSqT1hc.js.map → cell-renderer-ChTDsUI9.js.map} +1 -1
- package/dist/cjs/{column.drag.plugin-Bz_MVClL.js → column.drag.plugin-C79X0yTw.js} +84 -4
- package/dist/cjs/column.drag.plugin-C79X0yTw.js.map +1 -0
- package/dist/cjs/{column.service-Cq2d9W4R.js → column.service-D9RDDMpb.js} +2 -391
- package/dist/cjs/column.service-D9RDDMpb.js.map +1 -0
- package/dist/cjs/{header-cell-renderer-BbmGu-fy.js → header-cell-renderer-CbdtxSW8.js} +3 -3
- package/dist/cjs/{header-cell-renderer-BbmGu-fy.js.map → header-cell-renderer-CbdtxSW8.js.map} +1 -1
- package/dist/cjs/index.cjs.js +5 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +286 -20
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revo-grid.entry.cjs.js.map +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +2 -2
- package/dist/cjs/revogr-data.revogr-header.revogr-viewport-scroll.vnode-html.entry.cjs.js.map +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +5 -5
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/{viewport.helpers-DWmWzj7C.js → viewport.helpers-BAovztDd.js} +5 -3
- package/dist/cjs/viewport.helpers-BAovztDd.js.map +1 -0
- package/dist/collection/components/header/revogr-header-style.css +15 -17
- package/dist/collection/components/revoGrid/viewport.helpers.js +3 -1
- package/dist/collection/components/revoGrid/viewport.helpers.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.service.js +11 -16
- package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
- package/dist/collection/services/selection.store.connector.js +13 -46
- package/dist/collection/services/selection.store.connector.js.map +1 -1
- package/dist/collection/store/selection/selection.helpers.js +0 -4
- package/dist/collection/store/selection/selection.helpers.js.map +1 -1
- package/dist/collection/types/selection.js.map +1 -1
- package/dist/esm/{cell-renderer-BjdtMiBM.js → cell-renderer-ePazz-Zt.js} +3 -3
- package/dist/esm/{cell-renderer-BjdtMiBM.js.map → cell-renderer-ePazz-Zt.js.map} +1 -1
- package/dist/{revo-grid/column.drag.plugin-CIivVS-c.js → esm/column.drag.plugin-CS8ilBtr.js} +84 -5
- package/dist/esm/column.drag.plugin-CS8ilBtr.js.map +1 -0
- package/dist/esm/{column.service-CspjVf-q.js → column.service-DT_CqxqZ.js} +4 -389
- package/dist/esm/column.service-DT_CqxqZ.js.map +1 -0
- package/dist/esm/{header-cell-renderer-bvKLyRcy.js → header-cell-renderer-DNIoql0s.js} +3 -3
- package/dist/{revo-grid/header-cell-renderer-bvKLyRcy.js.map → esm/header-cell-renderer-DNIoql0s.js.map} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/revo-grid.entry.js +285 -19
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +2 -2
- package/dist/esm/revogr-data.revogr-header.revogr-viewport-scroll.vnode-html.entry.js.map +1 -1
- package/dist/esm/revogr-data_4.entry.js +5 -5
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/esm/{viewport.helpers-B3EYGhqf.js → viewport.helpers-VXhsJZtn.js} +5 -3
- package/dist/esm/viewport.helpers-VXhsJZtn.js.map +1 -0
- package/dist/revo-grid/{cell-renderer-BjdtMiBM.js → cell-renderer-ePazz-Zt.js} +3 -3
- package/dist/revo-grid/{cell-renderer-BjdtMiBM.js.map → cell-renderer-ePazz-Zt.js.map} +1 -1
- package/dist/{esm/column.drag.plugin-CIivVS-c.js → revo-grid/column.drag.plugin-CS8ilBtr.js} +84 -5
- package/dist/revo-grid/column.drag.plugin-CS8ilBtr.js.map +1 -0
- package/dist/revo-grid/{column.service-CspjVf-q.js → column.service-DT_CqxqZ.js} +4 -389
- package/dist/revo-grid/column.service-DT_CqxqZ.js.map +1 -0
- package/dist/revo-grid/{header-cell-renderer-bvKLyRcy.js → header-cell-renderer-DNIoql0s.js} +3 -3
- package/dist/{esm/header-cell-renderer-bvKLyRcy.js.map → revo-grid/header-cell-renderer-DNIoql0s.js.map} +1 -1
- package/dist/revo-grid/index.esm.js +5 -5
- package/dist/revo-grid/revo-grid.entry.esm.js.map +1 -1
- package/dist/revo-grid/revo-grid.entry.js +285 -19
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +2 -2
- package/dist/revo-grid/revogr-data.revogr-header.revogr-viewport-scroll.vnode-html.entry.esm.js.map +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +5 -5
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/{viewport.helpers-B3EYGhqf.js → viewport.helpers-VXhsJZtn.js} +5 -3
- package/dist/revo-grid/viewport.helpers-VXhsJZtn.js.map +1 -0
- package/dist/types/components/revoGrid/viewport.helpers.d.ts +3 -0
- package/dist/types/services/selection.store.connector.d.ts +0 -5
- package/dist/types/store/selection/selection.helpers.d.ts +0 -1
- package/dist/types/types/selection.d.ts +1 -0
- package/hydrate/index.js +638 -676
- package/hydrate/index.mjs +638 -676
- package/package.json +6 -6
- package/standalone/column.service.js +2 -387
- package/standalone/column.service.js.map +1 -1
- package/standalone/index.js +2 -2
- package/standalone/revo-grid.js +362 -17
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-data2.js +1 -1
- package/standalone/revogr-header2.js +2 -2
- package/standalone/revogr-header2.js.map +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +3 -1
- package/standalone/revogr-viewport-scroll2.js.map +1 -1
- package/dist/cjs/column.drag.plugin-Bz_MVClL.js.map +0 -1
- package/dist/cjs/column.service-Cq2d9W4R.js.map +0 -1
- package/dist/cjs/viewport.helpers-DWmWzj7C.js.map +0 -1
- package/dist/esm/column.drag.plugin-CIivVS-c.js.map +0 -1
- package/dist/esm/column.service-CspjVf-q.js.map +0 -1
- package/dist/esm/viewport.helpers-B3EYGhqf.js.map +0 -1
- package/dist/revo-grid/column.drag.plugin-CIivVS-c.js.map +0 -1
- package/dist/revo-grid/column.service-CspjVf-q.js.map +0 -1
- package/dist/revo-grid/viewport.helpers-B3EYGhqf.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revolist/revogrid",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Virtual reactive data grid spreadsheet component - RevoGrid.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"require": "./dist/index.cjs.js"
|
|
69
69
|
},
|
|
70
70
|
"./standalone": {
|
|
71
|
-
"types": "./standalone/
|
|
71
|
+
"types": "./standalone/index.d.ts",
|
|
72
72
|
"import": "./standalone/revo-grid.js"
|
|
73
73
|
},
|
|
74
74
|
"./standalone/revo-grid.js": {
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"release": "npm run build && npm publish --public --tag pre-release && npm run package:update"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@angular/core": "^
|
|
106
|
+
"@angular/core": "^20.3.0",
|
|
107
107
|
"@revolist/stencil-vue2-output-target": "^0.0.6",
|
|
108
108
|
"@revolist/svelte-output-target": "0.0.7",
|
|
109
|
-
"@stencil/angular-output-target": "
|
|
109
|
+
"@stencil/angular-output-target": "1.1.1",
|
|
110
110
|
"@stencil/core": "4.36.3",
|
|
111
111
|
"@stencil/react-output-target": "0.5.3",
|
|
112
112
|
"@stencil/sass": "^3.2.2",
|
|
@@ -131,8 +131,8 @@
|
|
|
131
131
|
"prettier": "3.3.2",
|
|
132
132
|
"react": "^18.3.1",
|
|
133
133
|
"react-dom": "^18.3.1",
|
|
134
|
-
"rxjs": "^7.8.
|
|
135
|
-
"svelte": "^5.38.
|
|
134
|
+
"rxjs": "^7.8.2",
|
|
135
|
+
"svelte": "^5.38.10",
|
|
136
136
|
"typedoc": "^0.26.5",
|
|
137
137
|
"typedoc-plugin-markdown": "^4.2.3",
|
|
138
138
|
"typescript": "^5.5.4",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import { v as toFinite, w as keys, n as isArrayLike, u as baseIteratee, l as isArray,
|
|
4
|
+
import { v as toFinite, w as keys, n as isArrayLike, u as baseIteratee, l as isArray, x as isIterateeCall, a as getVisibleSourceItem, b as getSourceItem } from './data.store.js';
|
|
5
5
|
import '@stencil/core/internal/client';
|
|
6
6
|
import './platform.js';
|
|
7
7
|
import { G as GRID_INTERNALS, b as DISABLED_CLASS, C as CELL_CLASS } from './consts.js';
|
|
@@ -365,391 +365,6 @@ function getColumnByProp(columns, prop) {
|
|
|
365
365
|
return findColumn(columns, prop);
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
/**
|
|
369
|
-
* Selection store
|
|
370
|
-
*/
|
|
371
|
-
function defaultState() {
|
|
372
|
-
return {
|
|
373
|
-
range: null,
|
|
374
|
-
tempRange: null,
|
|
375
|
-
tempRangeType: null,
|
|
376
|
-
focus: null,
|
|
377
|
-
edit: null,
|
|
378
|
-
lastCell: null,
|
|
379
|
-
nextFocus: null,
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
class SelectionStore {
|
|
383
|
-
constructor() {
|
|
384
|
-
this.unsubscribe = [];
|
|
385
|
-
this.store = createStore(defaultState());
|
|
386
|
-
this.store.on('set', (key, newVal) => {
|
|
387
|
-
if (key === 'tempRange' && !newVal) {
|
|
388
|
-
this.store.set('tempRangeType', null);
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
onChange(propName, cb) {
|
|
393
|
-
this.unsubscribe.push(this.store.onChange(propName, cb));
|
|
394
|
-
}
|
|
395
|
-
clearFocus() {
|
|
396
|
-
setStore(this.store, { focus: null, range: null, edit: null, tempRange: null });
|
|
397
|
-
}
|
|
398
|
-
setFocus(focus, end) {
|
|
399
|
-
if (!end) {
|
|
400
|
-
setStore(this.store, { focus });
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
setStore(this.store, {
|
|
404
|
-
focus,
|
|
405
|
-
range: getRange(focus, end),
|
|
406
|
-
edit: null,
|
|
407
|
-
tempRange: null,
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
setNextFocus(focus) {
|
|
412
|
-
setStore(this.store, { nextFocus: focus });
|
|
413
|
-
}
|
|
414
|
-
setTempArea(range) {
|
|
415
|
-
setStore(this.store, { tempRange: range === null || range === void 0 ? void 0 : range.area, tempRangeType: range === null || range === void 0 ? void 0 : range.type, edit: null });
|
|
416
|
-
}
|
|
417
|
-
clearTemp() {
|
|
418
|
-
setStore(this.store, { tempRange: null });
|
|
419
|
-
}
|
|
420
|
-
/** Can be applied from selection change or from simple keyboard change clicks */
|
|
421
|
-
setRangeArea(range) {
|
|
422
|
-
setStore(this.store, { range, edit: null, tempRange: null });
|
|
423
|
-
}
|
|
424
|
-
setRange(start, end) {
|
|
425
|
-
const range = getRange(start, end);
|
|
426
|
-
this.setRangeArea(range);
|
|
427
|
-
}
|
|
428
|
-
setLastCell(lastCell) {
|
|
429
|
-
setStore(this.store, { lastCell });
|
|
430
|
-
}
|
|
431
|
-
setEdit(val) {
|
|
432
|
-
const focus = this.store.get('focus');
|
|
433
|
-
if (focus && typeof val === 'string') {
|
|
434
|
-
setStore(this.store, {
|
|
435
|
-
edit: { x: focus.x, y: focus.y, val },
|
|
436
|
-
});
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
setStore(this.store, { edit: null });
|
|
440
|
-
}
|
|
441
|
-
dispose() {
|
|
442
|
-
this.unsubscribe.forEach(f => f());
|
|
443
|
-
this.store.dispose();
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
const EMPTY_INDEX = -1;
|
|
448
|
-
class SelectionStoreConnector {
|
|
449
|
-
constructor() {
|
|
450
|
-
// dirty flag required to cleanup whole store in case visibility of panels changed
|
|
451
|
-
this.dirty = false;
|
|
452
|
-
this.stores = {};
|
|
453
|
-
this.columnStores = {};
|
|
454
|
-
this.rowStores = {};
|
|
455
|
-
/**
|
|
456
|
-
* Helpers for data conversion
|
|
457
|
-
*/
|
|
458
|
-
this.storesByType = {};
|
|
459
|
-
this.storesXToType = {};
|
|
460
|
-
this.storesYToType = {};
|
|
461
|
-
this.sections = [];
|
|
462
|
-
}
|
|
463
|
-
get focusedStore() {
|
|
464
|
-
var _a;
|
|
465
|
-
for (let y in this.stores) {
|
|
466
|
-
for (let x in this.stores[y]) {
|
|
467
|
-
const focused = (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.store.get('focus');
|
|
468
|
-
if (focused) {
|
|
469
|
-
return {
|
|
470
|
-
entity: this.stores[y][x],
|
|
471
|
-
cell: focused,
|
|
472
|
-
position: {
|
|
473
|
-
x: parseInt(x, 10),
|
|
474
|
-
y: parseInt(y, 10),
|
|
475
|
-
},
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
return null;
|
|
481
|
-
}
|
|
482
|
-
get edit() {
|
|
483
|
-
var _a;
|
|
484
|
-
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('edit');
|
|
485
|
-
}
|
|
486
|
-
get focused() {
|
|
487
|
-
var _a;
|
|
488
|
-
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('focus');
|
|
489
|
-
}
|
|
490
|
-
get selectedRange() {
|
|
491
|
-
var _a;
|
|
492
|
-
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('range');
|
|
493
|
-
}
|
|
494
|
-
registerSection(e) {
|
|
495
|
-
if (!e) {
|
|
496
|
-
this.sections.length = 0;
|
|
497
|
-
// some elements removed, rebuild stores
|
|
498
|
-
this.dirty = true;
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
if (this.sections.indexOf(e) === -1) {
|
|
502
|
-
this.sections.push(e);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
// check if require to cleanup all stores
|
|
506
|
-
beforeUpdate() {
|
|
507
|
-
if (this.dirty) {
|
|
508
|
-
for (let y in this.stores) {
|
|
509
|
-
for (let x in this.stores[y]) {
|
|
510
|
-
this.stores[y][x].dispose();
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
this.dirty = false;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
registerColumn(x, type) {
|
|
517
|
-
// if hidden just create store but no operations needed
|
|
518
|
-
if (isHiddenStore(x)) {
|
|
519
|
-
return new SelectionStore();
|
|
520
|
-
}
|
|
521
|
-
if (this.columnStores[x]) {
|
|
522
|
-
return this.columnStores[x];
|
|
523
|
-
}
|
|
524
|
-
this.columnStores[x] = new SelectionStore();
|
|
525
|
-
// build cross-linking type to position
|
|
526
|
-
this.storesByType[type] = x;
|
|
527
|
-
this.storesXToType[x] = type;
|
|
528
|
-
return this.columnStores[x];
|
|
529
|
-
}
|
|
530
|
-
registerRow(y, type) {
|
|
531
|
-
// if hidden just create store
|
|
532
|
-
if (isHiddenStore(y)) {
|
|
533
|
-
return new SelectionStore();
|
|
534
|
-
}
|
|
535
|
-
if (this.rowStores[y]) {
|
|
536
|
-
return this.rowStores[y];
|
|
537
|
-
}
|
|
538
|
-
this.rowStores[y] = new SelectionStore();
|
|
539
|
-
// build cross linking type to position
|
|
540
|
-
this.storesByType[type] = y;
|
|
541
|
-
this.storesYToType[y] = type;
|
|
542
|
-
return this.rowStores[y];
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* Cross store proxy, based on multiple dimensions
|
|
546
|
-
*/
|
|
547
|
-
register({ x, y }) {
|
|
548
|
-
var _a, _b;
|
|
549
|
-
// if hidden just create store
|
|
550
|
-
if (isHiddenStore(x) || isHiddenStore(y)) {
|
|
551
|
-
return new SelectionStore();
|
|
552
|
-
}
|
|
553
|
-
if (!this.stores[y]) {
|
|
554
|
-
this.stores[y] = {};
|
|
555
|
-
}
|
|
556
|
-
if (this.stores[y][x]) {
|
|
557
|
-
// Store already registered. Do not register twice
|
|
558
|
-
return this.stores[y][x];
|
|
559
|
-
}
|
|
560
|
-
this.stores[y][x] = new SelectionStore();
|
|
561
|
-
// proxy update, column store trigger only range area
|
|
562
|
-
(_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.onChange('range', c => {
|
|
563
|
-
this.columnStores[x].setRangeArea(c);
|
|
564
|
-
this.rowStores[y].setRangeArea(c);
|
|
565
|
-
});
|
|
566
|
-
// clean up on remove
|
|
567
|
-
(_b = this.stores[y][x]) === null || _b === void 0 ? void 0 : _b.store.on('dispose', () => this.destroy(x, y));
|
|
568
|
-
return this.stores[y][x];
|
|
569
|
-
}
|
|
570
|
-
destroy(x, y) {
|
|
571
|
-
var _a, _b;
|
|
572
|
-
(_a = this.columnStores[x]) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
573
|
-
(_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
574
|
-
delete this.rowStores[y];
|
|
575
|
-
delete this.columnStores[x];
|
|
576
|
-
// clear x cross-link
|
|
577
|
-
if (this.storesXToType[x]) {
|
|
578
|
-
const type = this.storesXToType[x];
|
|
579
|
-
delete this.storesXToType[x];
|
|
580
|
-
delete this.storesByType[type];
|
|
581
|
-
}
|
|
582
|
-
// clear y cross-link
|
|
583
|
-
if (this.storesYToType[y]) {
|
|
584
|
-
const type = this.storesYToType[y];
|
|
585
|
-
delete this.storesYToType[y];
|
|
586
|
-
delete this.storesByType[type];
|
|
587
|
-
}
|
|
588
|
-
if (this.stores[y]) {
|
|
589
|
-
delete this.stores[y][x];
|
|
590
|
-
}
|
|
591
|
-
// clear empty rows
|
|
592
|
-
if (!Object.keys(this.stores[y] || {}).length) {
|
|
593
|
-
delete this.stores[y];
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
setEditByCell(storePos, editCell) {
|
|
597
|
-
this.focusByCell(storePos, editCell, editCell);
|
|
598
|
-
this.setEdit('');
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Sets the next focus cell before the current one.
|
|
602
|
-
*
|
|
603
|
-
* @param focus - The cell to set as the next focus.
|
|
604
|
-
*/
|
|
605
|
-
beforeNextFocusCell(focus) {
|
|
606
|
-
var _a;
|
|
607
|
-
// If there is no focused store, return early.
|
|
608
|
-
if (!this.focusedStore) {
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
// Get the next store based on the current focus and the last cell.
|
|
612
|
-
const lastCell = this.focusedStore.entity.store.get('lastCell');
|
|
613
|
-
const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
|
|
614
|
-
// Set the next focus cell in the store.
|
|
615
|
-
(_a = next === null || next === void 0 ? void 0 : next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
|
|
616
|
-
}
|
|
617
|
-
focusByCell(storePos, start, end) {
|
|
618
|
-
const store = this.stores[storePos.y][storePos.x];
|
|
619
|
-
this.focus(store, { focus: start, end });
|
|
620
|
-
}
|
|
621
|
-
focus(store, { focus, end }) {
|
|
622
|
-
const currentStorePointer = this.getCurrentStorePointer(store);
|
|
623
|
-
if (!currentStorePointer) {
|
|
624
|
-
return null;
|
|
625
|
-
}
|
|
626
|
-
// check for the focus in nearby store/viewport
|
|
627
|
-
const lastCell = store.store.get('lastCell');
|
|
628
|
-
const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
|
|
629
|
-
// if next store present - update
|
|
630
|
-
if (next === null || next === void 0 ? void 0 : next.store) {
|
|
631
|
-
const item = Object.assign(Object.assign({}, focus), next.item);
|
|
632
|
-
this.focus(next.store, { focus: item, end: item });
|
|
633
|
-
return null;
|
|
634
|
-
}
|
|
635
|
-
if (lastCell) {
|
|
636
|
-
focus = cropCellToMax(focus, lastCell);
|
|
637
|
-
end = cropCellToMax(end, lastCell);
|
|
638
|
-
}
|
|
639
|
-
store.setFocus(focus, end);
|
|
640
|
-
return focus;
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Retrieves the current store pointer based on the active store.
|
|
644
|
-
* Clears focus from all stores except the active one.
|
|
645
|
-
*/
|
|
646
|
-
getCurrentStorePointer(store) {
|
|
647
|
-
let currentStorePointer;
|
|
648
|
-
// Iterate through all stores
|
|
649
|
-
for (let y in this.stores) {
|
|
650
|
-
for (let x in this.stores[y]) {
|
|
651
|
-
const s = this.stores[y][x];
|
|
652
|
-
// Clear focus from stores other than the active one
|
|
653
|
-
if (s !== store) {
|
|
654
|
-
s.clearFocus();
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
// Update the current store pointer with the active store coordinates
|
|
658
|
-
currentStorePointer = {
|
|
659
|
-
x: parseInt(x, 10),
|
|
660
|
-
y: parseInt(y, 10)
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
return currentStorePointer;
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* Retrieves the next store based on the focus cell and current store pointer.
|
|
669
|
-
* If the next store exists, returns an object with the next store and the item in the new store.
|
|
670
|
-
* If the next store does not exist, returns null.
|
|
671
|
-
*/
|
|
672
|
-
getNextStore(focus, currentStorePointer, lastCell) {
|
|
673
|
-
// item in new store
|
|
674
|
-
const nextItem = nextCell(focus, lastCell);
|
|
675
|
-
let nextStore;
|
|
676
|
-
if (nextItem) {
|
|
677
|
-
Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
|
|
678
|
-
let stores;
|
|
679
|
-
switch (type) {
|
|
680
|
-
case 'x':
|
|
681
|
-
// Get the X stores for the current Y coordinate of the current store pointer
|
|
682
|
-
stores = this.getXStores(currentStorePointer.y);
|
|
683
|
-
break;
|
|
684
|
-
case 'y':
|
|
685
|
-
// Get the Y stores for the current X coordinate of the current store pointer
|
|
686
|
-
stores = this.getYStores(currentStorePointer.x);
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
689
|
-
// Get the next store based on the item in the new store
|
|
690
|
-
if (nextItemCoord >= 0) {
|
|
691
|
-
nextStore = stores[++currentStorePointer[type]];
|
|
692
|
-
}
|
|
693
|
-
else {
|
|
694
|
-
nextStore = stores[--currentStorePointer[type]];
|
|
695
|
-
const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
|
|
696
|
-
if (nextLastCell) {
|
|
697
|
-
nextItem[type] = nextLastCell[type] + nextItemCoord;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
return {
|
|
703
|
-
store: nextStore,
|
|
704
|
-
item: nextItem,
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
clearAll() {
|
|
708
|
-
var _a;
|
|
709
|
-
for (let y in this.stores) {
|
|
710
|
-
for (let x in this.stores[y]) {
|
|
711
|
-
(_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.clearFocus();
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
setEdit(val) {
|
|
716
|
-
if (!this.focusedStore) {
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
this.focusedStore.entity.setEdit(val);
|
|
720
|
-
}
|
|
721
|
-
/**
|
|
722
|
-
* Select all cells across all stores
|
|
723
|
-
*/
|
|
724
|
-
selectAll() {
|
|
725
|
-
for (let y in this.stores) {
|
|
726
|
-
for (let x in this.stores[y]) {
|
|
727
|
-
const store = this.stores[y][x];
|
|
728
|
-
if (!store) {
|
|
729
|
-
continue;
|
|
730
|
-
}
|
|
731
|
-
const lastCell = store.store.get('lastCell');
|
|
732
|
-
if (lastCell) {
|
|
733
|
-
store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
getXStores(y) {
|
|
739
|
-
return this.stores[y];
|
|
740
|
-
}
|
|
741
|
-
getYStores(x) {
|
|
742
|
-
const stores = {};
|
|
743
|
-
for (let i in this.stores) {
|
|
744
|
-
stores[i] = this.stores[i][x];
|
|
745
|
-
}
|
|
746
|
-
return stores;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
function isHiddenStore(pos) {
|
|
751
|
-
return pos === EMPTY_INDEX;
|
|
752
|
-
}
|
|
753
368
|
function nextCell(cell, lastCell) {
|
|
754
369
|
const nextItem = {};
|
|
755
370
|
let types = ['x', 'y'];
|
|
@@ -1339,7 +954,7 @@ function doPropMerge(existing, extra) {
|
|
|
1339
954
|
return props;
|
|
1340
955
|
}
|
|
1341
956
|
|
|
1342
|
-
export {
|
|
957
|
+
export { getCellRaw as A, getCellDataParsed as B, getColumnType as C, getColumnSizes as D, isColGrouping as E, getColumns as F, GROUP_DEPTH as G, gatherGroup as H, getColumnByProp as I, reduce as J, baseEach as K, toInteger as L, ColumnService as M, getCellEditor as N, isRowDragService as O, PSEUDO_GROUP_ITEM as P, doPropMerge as Q, cropCellToMax as a, isRangeSingleCell as b, columnTypes as c, PSEUDO_GROUP_ITEM_ID as d, PSEUDO_GROUP_ITEM_VALUE as e, PSEUDO_GROUP_COLUMN as f, getRange as g, GROUP_EXPANDED as h, isRowType as i, GROUP_COLUMN_PROP as j, GROUP_ORIGINAL_INDEX as k, GROUP_EXPAND_BTN as l, GROUP_EXPAND_EVENT as m, nextCell as n, GROUPING_ROW_TYPE as o, getSource as p, getExpanded as q, rowTypes as r, gatherGrouping as s, getGroupingName as t, isGrouping as u, isGroupingColumn as v, measureEqualDepth as w, getParsedGroup as x, isSameGroup as y, getCellData as z };
|
|
1343
958
|
//# sourceMappingURL=column.service.js.map
|
|
1344
959
|
|
|
1345
960
|
//# sourceMappingURL=column.service.js.map
|