@vaadin/component-base 24.2.0-dev.538d07bdf → 24.2.0-dev.e9803eea7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/component-base",
3
- "version": "24.2.0-dev.538d07bdf",
3
+ "version": "24.2.0-dev.e9803eea7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,5 +42,5 @@
42
42
  "@vaadin/testing-helpers": "^0.4.3",
43
43
  "sinon": "^13.0.2"
44
44
  },
45
- "gitHead": "86c2fd5f37cf1240af98f7c7d752518c8d701db2"
45
+ "gitHead": "a065b79b9d5a189e457fab312cc8aff0d7f2f910"
46
46
  }
@@ -130,16 +130,6 @@ export class Cache {
130
130
  });
131
131
  }
132
132
 
133
- /**
134
- * Returns whether the given page has been loaded in the cache.
135
- *
136
- * @param {number} page
137
- * @return {boolean}
138
- */
139
- isPageLoaded(page) {
140
- return this.items[page * this.pageSize] !== undefined;
141
- }
142
-
143
133
  /**
144
134
  * Retrieves the sub-cache associated with the item at the given index
145
135
  * in the `items` array.
@@ -30,12 +30,10 @@ export class DataProviderController extends EventTarget {
30
30
 
31
31
  setPageSize(pageSize) {
32
32
  this.pageSize = pageSize;
33
- this.clearCache();
34
33
  }
35
34
 
36
35
  setDataProvider(dataProvider) {
37
36
  this.dataProvider = dataProvider;
38
- this.clearCache();
39
37
  }
40
38
 
41
39
  recalculateEffectiveSize() {
@@ -62,25 +60,17 @@ export class DataProviderController extends EventTarget {
62
60
  }
63
61
  }
64
62
 
65
- ensureFlatIndexChildrenLoaded(flatIndex) {
63
+ ensureFlatIndexHierarchy(flatIndex) {
66
64
  const { cache, item, index } = this.getFlatIndexInfo(flatIndex);
67
65
 
68
- if (item && this.isExpanded(item)) {
69
- let subCache = cache.getSubCache(index);
70
- if (!subCache) {
71
- subCache = cache.createSubCache(index);
72
- }
73
-
74
- if (!subCache.isPageLoaded(0)) {
75
- this.#loadCachePage(subCache, 0);
76
- }
66
+ if (item && this.isExpanded(item) && !cache.getSubCache(index)) {
67
+ const subCache = cache.createSubCache(index);
68
+ this.#loadCachePage(subCache, 0);
77
69
  }
78
70
  }
79
71
 
80
- ensureFirstPageLoaded() {
81
- if (!this.rootCache.isPageLoaded(0)) {
82
- this.#loadCachePage(this.rootCache, 0);
83
- }
72
+ loadFirstPage() {
73
+ this.#loadCachePage(this.rootCache, 0);
84
74
  }
85
75
 
86
76
  #createRootCache() {