@lightningjs/ui
Advanced tools
Comparing version 1.3.9 to 1.3.10
# Changelog | ||
## v1.3.10 | ||
*30 may 2023* | ||
- Grid setIndex was `async` and now its `sync` as it was before `v1.3.8` | ||
- Immediate option on setIndex (and other methods) patch is now `sync` instead of an `async` (with duration: 0) | ||
## v1.3.9 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@lightningjs/ui", | ||
"version": "1.3.9", | ||
"version": "1.3.10", | ||
"description": "Standard UI components for Lightning", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -42,8 +42,12 @@ /* | ||
async setIndex(index, options = {}) { | ||
if(this._requestsEnabled && (index > this._items.length - 1)) { | ||
await this._requestMore(index); | ||
setIndex(index, options = {}) { | ||
if (this._requestsEnabled && this._requestingItems) { | ||
return true; | ||
} | ||
if (this._requestsEnabled && (index > this._items.length - 1)) { | ||
this._requestMore(index, [], options); | ||
return true; | ||
} | ||
if(this._items.length === 0) { | ||
return; | ||
return false; | ||
} | ||
@@ -59,2 +63,3 @@ const targetIndex = limitWithinRange(index, 0, this._items.length - 1); | ||
this._indexChanged({previousIndex, index: targetIndex, mainIndex, previousMainIndex, crossIndex, previousCrossIndex, lines: this._lines.length, dataLength: this._items.length}, options); | ||
return previousIndex !== targetIndex; | ||
} | ||
@@ -141,11 +146,10 @@ | ||
}); | ||
wrapper.children = newChildren; | ||
const animationDuration = immediate ? 0 : 0.2 | ||
animateItems.forEach((index) => { | ||
const item = wrapper.children[index]; | ||
item.patch({ | ||
smooth: {x: [item.assignedX, { duration: animationDuration }], y: [item.assignedY, { duration: animationDuration }]} | ||
}); | ||
if (immediate) { | ||
item.patch({ x: item.assignedX, y: item.assignedY }) | ||
} else { | ||
item.patch({ smooth: { x: item.assignedX, y: item.assignedY }}) | ||
} | ||
}); | ||
@@ -152,0 +156,0 @@ |
@@ -101,2 +101,3 @@ /* | ||
const type = typeof response; | ||
if ((Array.isArray(response) && response.length > 0) || type === 'object' || type === 'string' || type === 'number') { | ||
@@ -103,0 +104,0 @@ this.add(response); |
@@ -75,8 +75,9 @@ /* | ||
wrapper.children = newChildren; | ||
const animationDuration = immediate ? 0 : 0.2 | ||
animateItems.forEach((index) => { | ||
const item = wrapper.children[index]; | ||
item.patch({ | ||
smooth: {x: [item.assignedX, { duration: animationDuration }], y: [item.assignedY, { duration: animationDuration }]} | ||
}); | ||
if (immediate) { | ||
item.patch({ x: item.assignedX, y: item.assignedY }) | ||
} else { | ||
item.patch({ smooth: { x: item.assignedX, y: item.assignedY }}) | ||
} | ||
}) | ||
@@ -83,0 +84,0 @@ this._resizeWrapper(crossSize); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220376
3202