@vaadin/component-base 24.3.0-alpha9 → 24.3.0-beta1

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.3.0-alpha9",
3
+ "version": "24.3.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,5 +42,5 @@
42
42
  "@vaadin/testing-helpers": "^0.6.0",
43
43
  "sinon": "^13.0.2"
44
44
  },
45
- "gitHead": "ea39f40613cb73b237d08d4c48b890ee7d1844cb"
45
+ "gitHead": "a197041861e1bbf8d3e966d893648f5dd462b036"
46
46
  }
@@ -68,13 +68,12 @@ export class DataProviderController extends EventTarget {
68
68
  constructor(host, { size, pageSize, isExpanded, getItemId, dataProvider, dataProviderParams }) {
69
69
  super();
70
70
  this.host = host;
71
- this.size = size;
72
71
  this.pageSize = pageSize;
73
72
  this.getItemId = getItemId;
74
73
  this.isExpanded = isExpanded;
75
74
  this.dataProvider = dataProvider;
76
75
  this.dataProviderParams = dataProviderParams;
77
- this.rootCache = this.__createRootCache();
76
+ this.rootCache = this.__createRootCache(size);
78
77
  }
79
78
 
80
79
  /**
@@ -102,17 +101,6 @@ export class DataProviderController extends EventTarget {
102
101
  return this.rootCache.isLoading;
103
102
  }
104
103
 
105
- /**
106
- * Sets the size for the root cache and recalculates the flattened size.
107
- *
108
- * @param {number} size
109
- */
110
- setSize(size) {
111
- this.size = size;
112
- this.rootCache.size = size;
113
- this.recalculateFlatSize();
114
- }
115
-
116
104
  /**
117
105
  * Sets the page size and clears the cache.
118
106
  *
@@ -144,7 +132,7 @@ export class DataProviderController extends EventTarget {
144
132
  * Clears the cache.
145
133
  */
146
134
  clearCache() {
147
- this.rootCache = this.__createRootCache();
135
+ this.rootCache = this.__createRootCache(this.rootCache.size);
148
136
  }
149
137
 
150
138
  /**
@@ -228,8 +216,8 @@ export class DataProviderController extends EventTarget {
228
216
  }
229
217
 
230
218
  /** @private */
231
- __createRootCache() {
232
- return new Cache(this.__cacheContext, this.pageSize, this.size);
219
+ __createRootCache(size) {
220
+ return new Cache(this.__cacheContext, this.pageSize, size);
233
221
  }
234
222
 
235
223
  /** @private */
package/src/define.js CHANGED
@@ -9,7 +9,7 @@ export function defineCustomElement(CustomElement) {
9
9
  if (!defined) {
10
10
  Object.defineProperty(CustomElement, 'version', {
11
11
  get() {
12
- return '24.3.0-alpha9';
12
+ return '24.3.0-beta1';
13
13
  },
14
14
  });
15
15
 
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  /**
8
- * Check if two paths match
8
+ * Check if two paths can be resolved as URLs
9
+ * with the same origin and pathname.
9
10
  */
10
11
  export declare function matchPaths(path1: string, path2: string): boolean;
package/src/url-utils.js CHANGED
@@ -5,12 +5,15 @@
5
5
  */
6
6
 
7
7
  /**
8
- * Check if two paths match
8
+ * Check if two paths can be resolved as URLs
9
+ * with the same origin and pathname.
9
10
  *
10
11
  * @param {string} path1
11
12
  * @param {string} path2
12
13
  */
13
14
  export function matchPaths(path1, path2) {
14
15
  const base = document.baseURI;
15
- return new URL(path1, base).pathname === new URL(path2, base).pathname;
16
+ const url1 = new URL(path1, base);
17
+ const url2 = new URL(path2, base);
18
+ return url1.origin === url2.origin && url1.pathname === url2.pathname;
16
19
  }
@@ -310,7 +310,9 @@ export class IronListAdapter {
310
310
  this.__preventElementUpdates = false;
311
311
  } else {
312
312
  // Already initialized, just update _virtualCount
313
+ this._updateScrollerSize();
313
314
  this._virtualCount = this.items.length;
315
+ this._render();
314
316
  }
315
317
 
316
318
  // When reducing size while invisible, iron-list does not update items, so