@vaadin/component-base
Advanced tools
+4
-4
| { | ||
| "name": "@vaadin/component-base", | ||
| "version": "25.3.0-alpha2", | ||
| "version": "25.3.0-alpha3", | ||
| "publishConfig": { | ||
@@ -41,4 +41,4 @@ "access": "public" | ||
| "devDependencies": { | ||
| "@vaadin/chai-plugins": "25.3.0-alpha2", | ||
| "@vaadin/test-runner-commands": "25.3.0-alpha2", | ||
| "@vaadin/chai-plugins": "25.3.0-alpha3", | ||
| "@vaadin/test-runner-commands": "25.3.0-alpha3", | ||
| "@vaadin/testing-helpers": "^2.0.0", | ||
@@ -48,3 +48,3 @@ "sinon": "^22.0.0" | ||
| "customElements": "custom-elements.json", | ||
| "gitHead": "52eba6153ecf8bfaae44bcb727595e77d90b963c" | ||
| "gitHead": "ba0c4c55ea219eadd9aefe244f53e87803a066c8" | ||
| } |
@@ -19,9 +19,2 @@ /** | ||
| /** | ||
| * The number of items to display per page. | ||
| * | ||
| * @type {number} | ||
| */ | ||
| pageSize; | ||
| /** | ||
| * An array of cached items. | ||
@@ -55,2 +48,10 @@ * | ||
| /** | ||
| * The number of items per page. | ||
| * | ||
| * @type {number} | ||
| * @private | ||
| */ | ||
| #pageSize; | ||
| /** | ||
| * The number of items. | ||
@@ -129,2 +130,25 @@ * | ||
| /** | ||
| * The number of items per page. | ||
| * | ||
| * @return {number} | ||
| */ | ||
| get pageSize() { | ||
| return this.#pageSize; | ||
| } | ||
| /** | ||
| * Sets the number of items per page for this cache and its descendants. | ||
| * Changing the page size discards all pending page requests. | ||
| * | ||
| * @param {number} pageSize | ||
| */ | ||
| set pageSize(pageSize) { | ||
| this.#pageSize = pageSize; | ||
| this.pendingRequests = {}; | ||
| this.subCaches.forEach((subCache) => { | ||
| subCache.pageSize = pageSize; | ||
| }); | ||
| } | ||
| /** | ||
| * The number of items. | ||
@@ -131,0 +155,0 @@ * |
@@ -33,9 +33,2 @@ /** | ||
| /** | ||
| * A number of items to display per page. | ||
| * | ||
| * @type {number} | ||
| */ | ||
| pageSize; | ||
| /** | ||
| * A callback that returns whether the given item is expanded. | ||
@@ -82,3 +75,2 @@ * | ||
| this.host = host; | ||
| this.pageSize = pageSize; | ||
| this.getItemId = getItemId; | ||
@@ -90,3 +82,3 @@ this.isExpanded = isExpanded; | ||
| this.dataProviderParams = dataProviderParams; | ||
| this.rootCache = this.#createRootCache(size); | ||
| this.rootCache = this.#createRootCache(pageSize, size); | ||
| } | ||
@@ -101,2 +93,9 @@ | ||
| /** | ||
| * The number of items per page in the root cache. | ||
| */ | ||
| get pageSize() { | ||
| return this.rootCache.pageSize; | ||
| } | ||
| /** @private */ | ||
@@ -120,3 +119,3 @@ get #cacheContext() { | ||
| /** | ||
| * Sets the page size and clears the cache. | ||
| * Sets the number of items per page in the root cache and any of its descendants. | ||
| * | ||
@@ -126,4 +125,3 @@ * @param {number} pageSize | ||
| setPageSize(pageSize) { | ||
| this.pageSize = pageSize; | ||
| this.clearCache(); | ||
| this.rootCache.pageSize = pageSize; | ||
| } | ||
@@ -138,3 +136,2 @@ | ||
| this.dataProvider = dataProvider; | ||
| this.clearCache(); | ||
| } | ||
@@ -153,3 +150,3 @@ | ||
| clearCache() { | ||
| this.rootCache = this.#createRootCache(this.rootCache.size); | ||
| this.rootCache = this.#createRootCache(this.rootCache.pageSize, this.rootCache.size); | ||
| } | ||
@@ -249,4 +246,4 @@ | ||
| /** @private */ | ||
| #createRootCache(size) { | ||
| return new Cache(this.#cacheContext, this.pageSize, size); | ||
| #createRootCache(pageSize, size) { | ||
| return new Cache(this.#cacheContext, pageSize, size); | ||
| } | ||
@@ -262,3 +259,3 @@ | ||
| page, | ||
| pageSize: this.pageSize, | ||
| pageSize: cache.pageSize, | ||
| parentItem: cache.parentItem, | ||
@@ -265,0 +262,0 @@ }; |
+1
-1
@@ -16,3 +16,3 @@ /** | ||
| export function defineCustomElement(CustomElement, version = '25.3.0-alpha2') { | ||
| export function defineCustomElement(CustomElement, version = '25.3.0-alpha3') { | ||
| Object.defineProperty(CustomElement, 'version', { | ||
@@ -19,0 +19,0 @@ get() { |
254332
0.21%7194
0.26%