@infinite-table/infinite-react 6.0.4 → 6.0.5

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.d.ts CHANGED
@@ -89,6 +89,7 @@ declare class DeepMap<KeyType, ValueType> {
89
89
  fill(initial?: [KeyType[], ValueType][]): void;
90
90
  getValuesStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): ValueType[];
91
91
  getEntriesStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): [KeyType[], ValueType][];
92
+ getUnnestedKeysStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): KeyType[][];
92
93
  getKeysStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): KeyType[][];
93
94
  private getStartingWith;
94
95
  private getMapAt;
package/index.dev.js CHANGED
@@ -215,7 +215,7 @@ var DeepMap = class {
215
215
  depthLimit !== void 0 ? depthLimit - 1 : void 0
216
216
  ) : void 0;
217
217
  if (pair.hasOwnProperty("value")) {
218
- fn(pair.value, keys, i, next);
218
+ fn(pair.value, keys, i, next, pair);
219
219
  i++;
220
220
  } else {
221
221
  next?.();
@@ -269,6 +269,57 @@ var DeepMap = class {
269
269
  );
270
270
  return result;
271
271
  }
272
+ getUnnestedKeysStartingWith(keys, excludeSelf, depthLimit) {
273
+ const pairs = [];
274
+ const fn = (pair2) => {
275
+ pairs.push(pair2);
276
+ };
277
+ let currentMap = this.map;
278
+ let pair;
279
+ let stop = false;
280
+ if (keys.length) {
281
+ for (let i = 0, len = keys.length; i < len; i++) {
282
+ const key = keys[i];
283
+ pair = currentMap.get(key);
284
+ if (!pair || !pair.map) {
285
+ stop = true;
286
+ if (i === len - 1) {
287
+ stop = true;
288
+ break;
289
+ } else {
290
+ return [];
291
+ }
292
+ }
293
+ currentMap = pair.map;
294
+ }
295
+ } else {
296
+ if (!excludeSelf) {
297
+ const hasEmptyKey = currentMap.has(this.emptyKey);
298
+ if (hasEmptyKey) {
299
+ return [[]];
300
+ }
301
+ }
302
+ }
303
+ if (pair && pair.value !== void 0) {
304
+ if (!excludeSelf) {
305
+ fn({ ...pair, keys });
306
+ stop = true;
307
+ }
308
+ }
309
+ if (stop) {
310
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
311
+ }
312
+ this.visitWithNext(
313
+ keys,
314
+ (_value, keys2, _i, _next, pair2) => {
315
+ fn({ ...pair2, keys: keys2 });
316
+ },
317
+ currentMap,
318
+ depthLimit,
319
+ excludeSelf
320
+ );
321
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
322
+ }
272
323
  getKeysStartingWith(keys, excludeSelf, depthLimit) {
273
324
  const result = [];
274
325
  this.getStartingWith(
@@ -14618,7 +14669,7 @@ var TreeSelectionState = class {
14618
14669
  const leafCount = this.getLeafNodesCount(nodePath);
14619
14670
  let currentSelectionState = this.isSelfSelected(nodePath);
14620
14671
  const { selectionMap } = this;
14621
- const childPaths = selectionMap.getKeysStartingWith(nodePath, true).sort(shortestToLongest);
14672
+ const childPaths = selectionMap.getUnnestedKeysStartingWith(nodePath, true).sort(shortestToLongest);
14622
14673
  if (!childPaths.length) {
14623
14674
  if (currentSelectionState !== null) {
14624
14675
  const res2 = leafCount ? currentSelectionState : (
@@ -22069,7 +22120,7 @@ var useLicense = (licenseKey = "") => {
22069
22120
  }
22070
22121
  let valid2 = isValidLicense(licenseKey, {
22071
22122
  publishedAt: 1624970570587,
22072
- version: "6.0.4"
22123
+ version: "6.0.5"
22073
22124
  });
22074
22125
  if (!licenseKey && !valid2 && isInsidePlayground) {
22075
22126
  return true;
package/index.dev.mjs CHANGED
@@ -145,7 +145,7 @@ var DeepMap = class {
145
145
  depthLimit !== void 0 ? depthLimit - 1 : void 0
146
146
  ) : void 0;
147
147
  if (pair.hasOwnProperty("value")) {
148
- fn(pair.value, keys, i, next);
148
+ fn(pair.value, keys, i, next, pair);
149
149
  i++;
150
150
  } else {
151
151
  next?.();
@@ -199,6 +199,57 @@ var DeepMap = class {
199
199
  );
200
200
  return result;
201
201
  }
202
+ getUnnestedKeysStartingWith(keys, excludeSelf, depthLimit) {
203
+ const pairs = [];
204
+ const fn = (pair2) => {
205
+ pairs.push(pair2);
206
+ };
207
+ let currentMap = this.map;
208
+ let pair;
209
+ let stop = false;
210
+ if (keys.length) {
211
+ for (let i = 0, len = keys.length; i < len; i++) {
212
+ const key = keys[i];
213
+ pair = currentMap.get(key);
214
+ if (!pair || !pair.map) {
215
+ stop = true;
216
+ if (i === len - 1) {
217
+ stop = true;
218
+ break;
219
+ } else {
220
+ return [];
221
+ }
222
+ }
223
+ currentMap = pair.map;
224
+ }
225
+ } else {
226
+ if (!excludeSelf) {
227
+ const hasEmptyKey = currentMap.has(this.emptyKey);
228
+ if (hasEmptyKey) {
229
+ return [[]];
230
+ }
231
+ }
232
+ }
233
+ if (pair && pair.value !== void 0) {
234
+ if (!excludeSelf) {
235
+ fn({ ...pair, keys });
236
+ stop = true;
237
+ }
238
+ }
239
+ if (stop) {
240
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
241
+ }
242
+ this.visitWithNext(
243
+ keys,
244
+ (_value, keys2, _i, _next, pair2) => {
245
+ fn({ ...pair2, keys: keys2 });
246
+ },
247
+ currentMap,
248
+ depthLimit,
249
+ excludeSelf
250
+ );
251
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
252
+ }
202
253
  getKeysStartingWith(keys, excludeSelf, depthLimit) {
203
254
  const result = [];
204
255
  this.getStartingWith(
@@ -14567,7 +14618,7 @@ var TreeSelectionState = class {
14567
14618
  const leafCount = this.getLeafNodesCount(nodePath);
14568
14619
  let currentSelectionState = this.isSelfSelected(nodePath);
14569
14620
  const { selectionMap } = this;
14570
- const childPaths = selectionMap.getKeysStartingWith(nodePath, true).sort(shortestToLongest);
14621
+ const childPaths = selectionMap.getUnnestedKeysStartingWith(nodePath, true).sort(shortestToLongest);
14571
14622
  if (!childPaths.length) {
14572
14623
  if (currentSelectionState !== null) {
14573
14624
  const res2 = leafCount ? currentSelectionState : (
@@ -22027,7 +22078,7 @@ var useLicense = (licenseKey = "") => {
22027
22078
  }
22028
22079
  let valid2 = isValidLicense(licenseKey, {
22029
22080
  publishedAt: 1624970570587,
22030
- version: "6.0.4"
22081
+ version: "6.0.5"
22031
22082
  });
22032
22083
  if (!licenseKey && !valid2 && isInsidePlayground) {
22033
22084
  return true;
package/index.js CHANGED
@@ -215,7 +215,7 @@ var DeepMap = class {
215
215
  depthLimit !== void 0 ? depthLimit - 1 : void 0
216
216
  ) : void 0;
217
217
  if (pair.hasOwnProperty("value")) {
218
- fn(pair.value, keys, i, next);
218
+ fn(pair.value, keys, i, next, pair);
219
219
  i++;
220
220
  } else {
221
221
  next?.();
@@ -269,6 +269,57 @@ var DeepMap = class {
269
269
  );
270
270
  return result;
271
271
  }
272
+ getUnnestedKeysStartingWith(keys, excludeSelf, depthLimit) {
273
+ const pairs = [];
274
+ const fn = (pair2) => {
275
+ pairs.push(pair2);
276
+ };
277
+ let currentMap = this.map;
278
+ let pair;
279
+ let stop = false;
280
+ if (keys.length) {
281
+ for (let i = 0, len = keys.length; i < len; i++) {
282
+ const key = keys[i];
283
+ pair = currentMap.get(key);
284
+ if (!pair || !pair.map) {
285
+ stop = true;
286
+ if (i === len - 1) {
287
+ stop = true;
288
+ break;
289
+ } else {
290
+ return [];
291
+ }
292
+ }
293
+ currentMap = pair.map;
294
+ }
295
+ } else {
296
+ if (!excludeSelf) {
297
+ const hasEmptyKey = currentMap.has(this.emptyKey);
298
+ if (hasEmptyKey) {
299
+ return [[]];
300
+ }
301
+ }
302
+ }
303
+ if (pair && pair.value !== void 0) {
304
+ if (!excludeSelf) {
305
+ fn({ ...pair, keys });
306
+ stop = true;
307
+ }
308
+ }
309
+ if (stop) {
310
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
311
+ }
312
+ this.visitWithNext(
313
+ keys,
314
+ (_value, keys2, _i, _next, pair2) => {
315
+ fn({ ...pair2, keys: keys2 });
316
+ },
317
+ currentMap,
318
+ depthLimit,
319
+ excludeSelf
320
+ );
321
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
322
+ }
272
323
  getKeysStartingWith(keys, excludeSelf, depthLimit) {
273
324
  const result = [];
274
325
  this.getStartingWith(
@@ -14618,7 +14669,7 @@ var TreeSelectionState = class {
14618
14669
  const leafCount = this.getLeafNodesCount(nodePath);
14619
14670
  let currentSelectionState = this.isSelfSelected(nodePath);
14620
14671
  const { selectionMap } = this;
14621
- const childPaths = selectionMap.getKeysStartingWith(nodePath, true).sort(shortestToLongest);
14672
+ const childPaths = selectionMap.getUnnestedKeysStartingWith(nodePath, true).sort(shortestToLongest);
14622
14673
  if (!childPaths.length) {
14623
14674
  if (currentSelectionState !== null) {
14624
14675
  const res2 = leafCount ? currentSelectionState : (
@@ -22069,7 +22120,7 @@ var useLicense = (licenseKey = "") => {
22069
22120
  }
22070
22121
  let valid2 = isValidLicense(licenseKey, {
22071
22122
  publishedAt: 1624970570587,
22072
- version: "6.0.4"
22123
+ version: "6.0.5"
22073
22124
  });
22074
22125
  if (!licenseKey && !valid2 && isInsidePlayground) {
22075
22126
  return true;
package/index.mjs CHANGED
@@ -145,7 +145,7 @@ var DeepMap = class {
145
145
  depthLimit !== void 0 ? depthLimit - 1 : void 0
146
146
  ) : void 0;
147
147
  if (pair.hasOwnProperty("value")) {
148
- fn(pair.value, keys, i, next);
148
+ fn(pair.value, keys, i, next, pair);
149
149
  i++;
150
150
  } else {
151
151
  next?.();
@@ -199,6 +199,57 @@ var DeepMap = class {
199
199
  );
200
200
  return result;
201
201
  }
202
+ getUnnestedKeysStartingWith(keys, excludeSelf, depthLimit) {
203
+ const pairs = [];
204
+ const fn = (pair2) => {
205
+ pairs.push(pair2);
206
+ };
207
+ let currentMap = this.map;
208
+ let pair;
209
+ let stop = false;
210
+ if (keys.length) {
211
+ for (let i = 0, len = keys.length; i < len; i++) {
212
+ const key = keys[i];
213
+ pair = currentMap.get(key);
214
+ if (!pair || !pair.map) {
215
+ stop = true;
216
+ if (i === len - 1) {
217
+ stop = true;
218
+ break;
219
+ } else {
220
+ return [];
221
+ }
222
+ }
223
+ currentMap = pair.map;
224
+ }
225
+ } else {
226
+ if (!excludeSelf) {
227
+ const hasEmptyKey = currentMap.has(this.emptyKey);
228
+ if (hasEmptyKey) {
229
+ return [[]];
230
+ }
231
+ }
232
+ }
233
+ if (pair && pair.value !== void 0) {
234
+ if (!excludeSelf) {
235
+ fn({ ...pair, keys });
236
+ stop = true;
237
+ }
238
+ }
239
+ if (stop) {
240
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
241
+ }
242
+ this.visitWithNext(
243
+ keys,
244
+ (_value, keys2, _i, _next, pair2) => {
245
+ fn({ ...pair2, keys: keys2 });
246
+ },
247
+ currentMap,
248
+ depthLimit,
249
+ excludeSelf
250
+ );
251
+ return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
252
+ }
202
253
  getKeysStartingWith(keys, excludeSelf, depthLimit) {
203
254
  const result = [];
204
255
  this.getStartingWith(
@@ -14567,7 +14618,7 @@ var TreeSelectionState = class {
14567
14618
  const leafCount = this.getLeafNodesCount(nodePath);
14568
14619
  let currentSelectionState = this.isSelfSelected(nodePath);
14569
14620
  const { selectionMap } = this;
14570
- const childPaths = selectionMap.getKeysStartingWith(nodePath, true).sort(shortestToLongest);
14621
+ const childPaths = selectionMap.getUnnestedKeysStartingWith(nodePath, true).sort(shortestToLongest);
14571
14622
  if (!childPaths.length) {
14572
14623
  if (currentSelectionState !== null) {
14573
14624
  const res2 = leafCount ? currentSelectionState : (
@@ -22027,7 +22078,7 @@ var useLicense = (licenseKey = "") => {
22027
22078
  }
22028
22079
  let valid2 = isValidLicense(licenseKey, {
22029
22080
  publishedAt: 1624970570587,
22030
- version: "6.0.4"
22081
+ version: "6.0.5"
22031
22082
  });
22032
22083
  if (!licenseKey && !valid2 && isInsidePlayground) {
22033
22084
  return true;
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "bugs": {
26
26
  "url": "https://github.com/infinite-table/infinite-react/issues"
27
27
  },
28
- "version": "6.0.4",
28
+ "version": "6.0.5",
29
29
  "main": "index.js",
30
30
  "module": "index.mjs",
31
31
  "typings": "index.d.ts",
@@ -34,5 +34,5 @@
34
34
  },
35
35
  "license": "Commercial & Open Source",
36
36
  "//": "will be updated at build time",
37
- "publishedAt": 1730132637668
37
+ "publishedAt": 1730204782243
38
38
  }