@infinite-table/infinite-react 2.0.5 → 2.0.6

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/index.dev.js CHANGED
@@ -14096,6 +14096,14 @@ function isSortInfoForColumn(sortInfo, col) {
14096
14096
  }
14097
14097
  var InfiniteTableApiImpl = class {
14098
14098
  constructor(context) {
14099
+ this.getColumnOrder = () => {
14100
+ return this.getComputed().computedColumnOrder;
14101
+ };
14102
+ this.getVisibleColumnOrder = () => {
14103
+ const order2 = this.getColumnOrder();
14104
+ const visibleColumns = this.getComputed().computedVisibleColumnsMap;
14105
+ return order2.filter((id) => visibleColumns.has(id));
14106
+ };
14099
14107
  this.persistEdit = (arg) => __async(this, null, function* () {
14100
14108
  var _a, _b;
14101
14109
  arg = arg != null ? arg : {};
@@ -14344,6 +14352,70 @@ var InfiniteTableApiImpl = class {
14344
14352
  this.setColumnOrder = (columnOrder) => {
14345
14353
  this.actions.columnOrder = columnOrder;
14346
14354
  };
14355
+ this.collapseAllGroupRows = () => {
14356
+ const state = this.getDataSourceState();
14357
+ const newState = new GroupRowsState(state.groupRowsState);
14358
+ newState.collapseAll();
14359
+ this.dataSourceActions.groupRowsState = newState;
14360
+ };
14361
+ this.collapseGroupRow = (groupKeys) => {
14362
+ const state = this.getDataSourceState();
14363
+ if (state.groupRowsState.isGroupRowExpanded(groupKeys)) {
14364
+ this.toggleGroupRow(groupKeys);
14365
+ return true;
14366
+ }
14367
+ return false;
14368
+ };
14369
+ this.expandGroupRow = (groupKeys) => {
14370
+ const state = this.getDataSourceState();
14371
+ if (state.groupRowsState.isGroupRowCollapsed(groupKeys)) {
14372
+ this.toggleGroupRow(groupKeys);
14373
+ return true;
14374
+ }
14375
+ return false;
14376
+ };
14377
+ this.toggleGroupRow = (groupKeys) => {
14378
+ const state = this.getDataSourceState();
14379
+ const newState = new GroupRowsState(state.groupRowsState);
14380
+ newState.toggleGroupRow(groupKeys);
14381
+ this.dataSourceActions.groupRowsState = newState;
14382
+ if (state.lazyLoad) {
14383
+ const dataKeys = [LAZY_ROOT_KEY_FOR_GROUPS, ...groupKeys];
14384
+ const currentData = state.originalLazyGroupData.get(dataKeys);
14385
+ if (newState.isGroupRowExpanded(groupKeys)) {
14386
+ if (!(currentData == null ? void 0 : currentData.cache)) {
14387
+ loadData(state.data, state, this.dataSourceActions, {
14388
+ groupKeys
14389
+ });
14390
+ }
14391
+ } else {
14392
+ if (!(currentData == null ? void 0 : currentData.cache)) {
14393
+ const keysToDelete = state.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(groupKeys);
14394
+ keysToDelete.forEach((keys) => {
14395
+ state.lazyLoadCacheOfLoadedBatches.delete(keys);
14396
+ });
14397
+ this.dataSourceActions.lazyLoadCacheOfLoadedBatches = DeepMap.clone(
14398
+ state.lazyLoadCacheOfLoadedBatches
14399
+ );
14400
+ state.originalLazyGroupData.delete(dataKeys);
14401
+ this.dataSourceActions.originalLazyGroupDataChangeDetect = getChangeDetect();
14402
+ }
14403
+ }
14404
+ }
14405
+ };
14406
+ this.toggleSortingForColumn = (columnId, options) => {
14407
+ const col = this.getComputed().computedColumnsMap.get(columnId);
14408
+ if (!col) {
14409
+ return;
14410
+ }
14411
+ let dir = this.getSortingForColumn(columnId);
14412
+ if (dir === null) {
14413
+ dir = 1;
14414
+ } else {
14415
+ dir = dir === 1 ? -1 : null;
14416
+ }
14417
+ this.setSortingForColumn(columnId, dir, options);
14418
+ };
14347
14419
  this.getState = () => {
14348
14420
  return this.context.getState();
14349
14421
  };
@@ -14435,14 +14507,6 @@ var InfiniteTableApiImpl = class {
14435
14507
  isDestroyed() {
14436
14508
  return !this.getState().domRef.current;
14437
14509
  }
14438
- getColumnOrder() {
14439
- return this.getComputed().computedColumnOrder;
14440
- }
14441
- getVisibleColumnOrder() {
14442
- const order2 = this.getColumnOrder();
14443
- const visibleColumns = this.getComputed().computedVisibleColumnsMap;
14444
- return order2.filter((id) => visibleColumns.has(id));
14445
- }
14446
14510
  startEdit(params) {
14447
14511
  return __async(this, null, function* () {
14448
14512
  const { columnId, rowIndex: index, primaryKey } = params;
@@ -14495,70 +14559,6 @@ var InfiniteTableApiImpl = class {
14495
14559
  }));
14496
14560
  });
14497
14561
  }
14498
- collapseAllGroupRows() {
14499
- const state = this.getDataSourceState();
14500
- const newState = new GroupRowsState(state.groupRowsState);
14501
- newState.collapseAll();
14502
- this.dataSourceActions.groupRowsState = newState;
14503
- }
14504
- collapseGroupRow(groupKeys) {
14505
- const state = this.getDataSourceState();
14506
- if (state.groupRowsState.isGroupRowExpanded(groupKeys)) {
14507
- this.toggleGroupRow(groupKeys);
14508
- return true;
14509
- }
14510
- return false;
14511
- }
14512
- expandGroupRow(groupKeys) {
14513
- const state = this.getDataSourceState();
14514
- if (state.groupRowsState.isGroupRowCollapsed(groupKeys)) {
14515
- this.toggleGroupRow(groupKeys);
14516
- return true;
14517
- }
14518
- return false;
14519
- }
14520
- toggleGroupRow(groupKeys) {
14521
- const state = this.getDataSourceState();
14522
- const newState = new GroupRowsState(state.groupRowsState);
14523
- newState.toggleGroupRow(groupKeys);
14524
- this.dataSourceActions.groupRowsState = newState;
14525
- if (state.lazyLoad) {
14526
- const dataKeys = [LAZY_ROOT_KEY_FOR_GROUPS, ...groupKeys];
14527
- const currentData = state.originalLazyGroupData.get(dataKeys);
14528
- if (newState.isGroupRowExpanded(groupKeys)) {
14529
- if (!(currentData == null ? void 0 : currentData.cache)) {
14530
- loadData(state.data, state, this.dataSourceActions, {
14531
- groupKeys
14532
- });
14533
- }
14534
- } else {
14535
- if (!(currentData == null ? void 0 : currentData.cache)) {
14536
- const keysToDelete = state.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(groupKeys);
14537
- keysToDelete.forEach((keys) => {
14538
- state.lazyLoadCacheOfLoadedBatches.delete(keys);
14539
- });
14540
- this.dataSourceActions.lazyLoadCacheOfLoadedBatches = DeepMap.clone(
14541
- state.lazyLoadCacheOfLoadedBatches
14542
- );
14543
- state.originalLazyGroupData.delete(dataKeys);
14544
- this.dataSourceActions.originalLazyGroupDataChangeDetect = getChangeDetect();
14545
- }
14546
- }
14547
- }
14548
- }
14549
- toggleSortingForColumn(columnId, options) {
14550
- const col = this.getComputed().computedColumnsMap.get(columnId);
14551
- if (!col) {
14552
- return;
14553
- }
14554
- let dir = this.getSortingForColumn(columnId);
14555
- if (dir === null) {
14556
- dir = 1;
14557
- } else {
14558
- dir = dir === 1 ? -1 : null;
14559
- }
14560
- this.setSortingForColumn(columnId, dir, options);
14561
- }
14562
14562
  setSortingForColumn(columnId, dir, options) {
14563
14563
  const { computedColumnsMap } = this.getComputed();
14564
14564
  const c = computedColumnsMap.get(columnId);
@@ -16807,7 +16807,7 @@ var useLicense = (licenseKey = "") => {
16807
16807
  const valid = (0, import_react49.useMemo)(() => {
16808
16808
  let valid2 = isValidLicense(licenseKey, {
16809
16809
  publishedAt: 1624970570587,
16810
- version: "2.0.5"
16810
+ version: "2.0.6"
16811
16811
  });
16812
16812
  if (!licenseKey && !valid2 && isInsidePlayground) {
16813
16813
  return true;
package/index.dev.mjs CHANGED
@@ -14082,6 +14082,14 @@ function isSortInfoForColumn(sortInfo, col) {
14082
14082
  }
14083
14083
  var InfiniteTableApiImpl = class {
14084
14084
  constructor(context) {
14085
+ this.getColumnOrder = () => {
14086
+ return this.getComputed().computedColumnOrder;
14087
+ };
14088
+ this.getVisibleColumnOrder = () => {
14089
+ const order2 = this.getColumnOrder();
14090
+ const visibleColumns = this.getComputed().computedVisibleColumnsMap;
14091
+ return order2.filter((id) => visibleColumns.has(id));
14092
+ };
14085
14093
  this.persistEdit = (arg) => __async(this, null, function* () {
14086
14094
  var _a, _b;
14087
14095
  arg = arg != null ? arg : {};
@@ -14330,6 +14338,70 @@ var InfiniteTableApiImpl = class {
14330
14338
  this.setColumnOrder = (columnOrder) => {
14331
14339
  this.actions.columnOrder = columnOrder;
14332
14340
  };
14341
+ this.collapseAllGroupRows = () => {
14342
+ const state = this.getDataSourceState();
14343
+ const newState = new GroupRowsState(state.groupRowsState);
14344
+ newState.collapseAll();
14345
+ this.dataSourceActions.groupRowsState = newState;
14346
+ };
14347
+ this.collapseGroupRow = (groupKeys) => {
14348
+ const state = this.getDataSourceState();
14349
+ if (state.groupRowsState.isGroupRowExpanded(groupKeys)) {
14350
+ this.toggleGroupRow(groupKeys);
14351
+ return true;
14352
+ }
14353
+ return false;
14354
+ };
14355
+ this.expandGroupRow = (groupKeys) => {
14356
+ const state = this.getDataSourceState();
14357
+ if (state.groupRowsState.isGroupRowCollapsed(groupKeys)) {
14358
+ this.toggleGroupRow(groupKeys);
14359
+ return true;
14360
+ }
14361
+ return false;
14362
+ };
14363
+ this.toggleGroupRow = (groupKeys) => {
14364
+ const state = this.getDataSourceState();
14365
+ const newState = new GroupRowsState(state.groupRowsState);
14366
+ newState.toggleGroupRow(groupKeys);
14367
+ this.dataSourceActions.groupRowsState = newState;
14368
+ if (state.lazyLoad) {
14369
+ const dataKeys = [LAZY_ROOT_KEY_FOR_GROUPS, ...groupKeys];
14370
+ const currentData = state.originalLazyGroupData.get(dataKeys);
14371
+ if (newState.isGroupRowExpanded(groupKeys)) {
14372
+ if (!(currentData == null ? void 0 : currentData.cache)) {
14373
+ loadData(state.data, state, this.dataSourceActions, {
14374
+ groupKeys
14375
+ });
14376
+ }
14377
+ } else {
14378
+ if (!(currentData == null ? void 0 : currentData.cache)) {
14379
+ const keysToDelete = state.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(groupKeys);
14380
+ keysToDelete.forEach((keys) => {
14381
+ state.lazyLoadCacheOfLoadedBatches.delete(keys);
14382
+ });
14383
+ this.dataSourceActions.lazyLoadCacheOfLoadedBatches = DeepMap.clone(
14384
+ state.lazyLoadCacheOfLoadedBatches
14385
+ );
14386
+ state.originalLazyGroupData.delete(dataKeys);
14387
+ this.dataSourceActions.originalLazyGroupDataChangeDetect = getChangeDetect();
14388
+ }
14389
+ }
14390
+ }
14391
+ };
14392
+ this.toggleSortingForColumn = (columnId, options) => {
14393
+ const col = this.getComputed().computedColumnsMap.get(columnId);
14394
+ if (!col) {
14395
+ return;
14396
+ }
14397
+ let dir = this.getSortingForColumn(columnId);
14398
+ if (dir === null) {
14399
+ dir = 1;
14400
+ } else {
14401
+ dir = dir === 1 ? -1 : null;
14402
+ }
14403
+ this.setSortingForColumn(columnId, dir, options);
14404
+ };
14333
14405
  this.getState = () => {
14334
14406
  return this.context.getState();
14335
14407
  };
@@ -14421,14 +14493,6 @@ var InfiniteTableApiImpl = class {
14421
14493
  isDestroyed() {
14422
14494
  return !this.getState().domRef.current;
14423
14495
  }
14424
- getColumnOrder() {
14425
- return this.getComputed().computedColumnOrder;
14426
- }
14427
- getVisibleColumnOrder() {
14428
- const order2 = this.getColumnOrder();
14429
- const visibleColumns = this.getComputed().computedVisibleColumnsMap;
14430
- return order2.filter((id) => visibleColumns.has(id));
14431
- }
14432
14496
  startEdit(params) {
14433
14497
  return __async(this, null, function* () {
14434
14498
  const { columnId, rowIndex: index, primaryKey } = params;
@@ -14481,70 +14545,6 @@ var InfiniteTableApiImpl = class {
14481
14545
  }));
14482
14546
  });
14483
14547
  }
14484
- collapseAllGroupRows() {
14485
- const state = this.getDataSourceState();
14486
- const newState = new GroupRowsState(state.groupRowsState);
14487
- newState.collapseAll();
14488
- this.dataSourceActions.groupRowsState = newState;
14489
- }
14490
- collapseGroupRow(groupKeys) {
14491
- const state = this.getDataSourceState();
14492
- if (state.groupRowsState.isGroupRowExpanded(groupKeys)) {
14493
- this.toggleGroupRow(groupKeys);
14494
- return true;
14495
- }
14496
- return false;
14497
- }
14498
- expandGroupRow(groupKeys) {
14499
- const state = this.getDataSourceState();
14500
- if (state.groupRowsState.isGroupRowCollapsed(groupKeys)) {
14501
- this.toggleGroupRow(groupKeys);
14502
- return true;
14503
- }
14504
- return false;
14505
- }
14506
- toggleGroupRow(groupKeys) {
14507
- const state = this.getDataSourceState();
14508
- const newState = new GroupRowsState(state.groupRowsState);
14509
- newState.toggleGroupRow(groupKeys);
14510
- this.dataSourceActions.groupRowsState = newState;
14511
- if (state.lazyLoad) {
14512
- const dataKeys = [LAZY_ROOT_KEY_FOR_GROUPS, ...groupKeys];
14513
- const currentData = state.originalLazyGroupData.get(dataKeys);
14514
- if (newState.isGroupRowExpanded(groupKeys)) {
14515
- if (!(currentData == null ? void 0 : currentData.cache)) {
14516
- loadData(state.data, state, this.dataSourceActions, {
14517
- groupKeys
14518
- });
14519
- }
14520
- } else {
14521
- if (!(currentData == null ? void 0 : currentData.cache)) {
14522
- const keysToDelete = state.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(groupKeys);
14523
- keysToDelete.forEach((keys) => {
14524
- state.lazyLoadCacheOfLoadedBatches.delete(keys);
14525
- });
14526
- this.dataSourceActions.lazyLoadCacheOfLoadedBatches = DeepMap.clone(
14527
- state.lazyLoadCacheOfLoadedBatches
14528
- );
14529
- state.originalLazyGroupData.delete(dataKeys);
14530
- this.dataSourceActions.originalLazyGroupDataChangeDetect = getChangeDetect();
14531
- }
14532
- }
14533
- }
14534
- }
14535
- toggleSortingForColumn(columnId, options) {
14536
- const col = this.getComputed().computedColumnsMap.get(columnId);
14537
- if (!col) {
14538
- return;
14539
- }
14540
- let dir = this.getSortingForColumn(columnId);
14541
- if (dir === null) {
14542
- dir = 1;
14543
- } else {
14544
- dir = dir === 1 ? -1 : null;
14545
- }
14546
- this.setSortingForColumn(columnId, dir, options);
14547
- }
14548
14548
  setSortingForColumn(columnId, dir, options) {
14549
14549
  const { computedColumnsMap } = this.getComputed();
14550
14550
  const c = computedColumnsMap.get(columnId);
@@ -16797,7 +16797,7 @@ var useLicense = (licenseKey = "") => {
16797
16797
  const valid = useMemo11(() => {
16798
16798
  let valid2 = isValidLicense(licenseKey, {
16799
16799
  publishedAt: 1624970570587,
16800
- version: "2.0.5"
16800
+ version: "2.0.6"
16801
16801
  });
16802
16802
  if (!licenseKey && !valid2 && isInsidePlayground) {
16803
16803
  return true;