basic-sliding-viewport
Advanced tools
Comparing version 0.7.6 to 0.8.0
{ | ||
"name": "basic-sliding-viewport", | ||
"version": "0.7.6", | ||
"version": "0.8.0", | ||
"description": "Presents list items in a viewport such that only a single item is visible at a time. Navigating between items will be represented with a horizontal visual sliding effect.", | ||
@@ -15,4 +15,4 @@ "homepage": "https://component.kitchen", | ||
"dependencies": { | ||
"basic-element-base": "^0.7.6", | ||
"basic-spread-items": "^0.7.6" | ||
"basic-element-base": "^0.8.0", | ||
"basic-spread-items": "^0.8.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "browserify": { |
# API Documentation | ||
<a name="SlidingViewport"></a> | ||
## SlidingViewport ⇐ <code>ElementBase</code> | ||
@@ -20,12 +19,1 @@ Presents list items in a viewport such that only a single item is visible at | ||
**Extends:** <code>ElementBase</code> | ||
<a name="SlidingViewport+selectedFraction"></a> | ||
### slidingViewport.selectedFraction : <code>number</code> | ||
A fractional value indicating how far the user has currently advanced to | ||
the next/previous item. E.g., a `selectedFraction` of 3.5 indicates the | ||
user is halfway between items 3 and 4. | ||
For more details, see the [fractionalSelection](fractionalSelection.md) | ||
helper functions. | ||
**Kind**: instance property of <code>[SlidingViewport](#SlidingViewport)</code> |
@@ -0,9 +1,17 @@ | ||
import createSymbol from '../../basic-component-mixins/src/createSymbol'; | ||
import ElementBase from '../../basic-element-base/src/ElementBase'; | ||
import FractionalSelection from '../../basic-component-mixins/src/FractionalSelection'; | ||
import SpreadItems from '../../basic-spread-items/src/SpreadItems'; // jshint ignore:line | ||
import toggleClass from '../../basic-component-mixins/src/toggleClass'; | ||
import * as fractionalSelection from '../../basic-component-mixins/src/fractionalSelection'; | ||
let base = ElementBase; | ||
// Symbols for private data members on an element. | ||
const selectedItemSymbol = createSymbol('selectedItem'); | ||
let base = ElementBase.compose( | ||
FractionalSelection | ||
); | ||
/** | ||
@@ -51,18 +59,7 @@ * Presents list items in a viewport such that only a single item is visible at | ||
/** | ||
* A fractional value indicating how far the user has currently advanced to | ||
* the next/previous item. E.g., a `selectedFraction` of 3.5 indicates the | ||
* user is halfway between items 3 and 4. | ||
* | ||
* For more details, see the [fractionalSelection](fractionalSelection.md) | ||
* helper functions. | ||
* | ||
* @type {number} | ||
*/ | ||
get selectedFraction() { | ||
return this._selectedFraction; | ||
return super.selectedFraction; | ||
} | ||
set selectedFraction(value) { | ||
if ('selectedFraction' in base.prototype) { super.selectedFraction = value; } | ||
this._selectedFraction = value; | ||
this.render(); | ||
@@ -87,7 +84,7 @@ } | ||
get selectedItem() { | ||
return this._selectedItem; | ||
return this[selectedItemSymbol]; | ||
} | ||
set selectedItem(item) { | ||
if ('selectedItem' in base.prototype) { super.selectedItem = item; } | ||
this._selectedItem = item; | ||
this[selectedItemSymbol] = item; | ||
this.render(); | ||
@@ -144,5 +141,5 @@ } | ||
} | ||
let selection = fractionalSelection.elementSelection(this); | ||
let selection = FractionalSelection.helpers.elementSelection(this); | ||
let itemCount = this.items ? this.items.length : 0; | ||
let damped = fractionalSelection.dampedSelection(selection, itemCount); | ||
let damped = FractionalSelection.helpers.dampedSelection(selection, itemCount); | ||
// Use a percentage so the transform will still work if screen size changes | ||
@@ -149,0 +146,0 @@ // (e.g., if device orientation changes). |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
159275
1793
19
+ Addedbasic-component-mixins@0.8.0(transitive)
+ Addedbasic-element-base@0.8.0(transitive)
+ Addedbasic-spread-items@0.8.0(transitive)
- Removedbasic-component-mixins@0.7.6(transitive)
- Removedbasic-element-base@0.7.6(transitive)
- Removedbasic-spread-items@0.7.6(transitive)
Updatedbasic-element-base@^0.8.0
Updatedbasic-spread-items@^0.8.0