Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

basic-sliding-viewport

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-sliding-viewport - npm Package Compare versions

Comparing version 0.7.6 to 0.8.0

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc