1.2.1 • Published 2 years ago

@riot-material/position-controller v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

position controller for riot-material

Installation

You can install it via nodejs

npm install @riot-material/position-controller

or download one of the bundled file

/**
 * `dist/index.amd.js`
 * `dist/index.umd.js`
 */
requirejs.config({
    paths: {
        "@riot-material/position-controller": "path/to/@riot-material/position-controller",
    },
});

require(['@riot-material/position-controller'], function (positionController) {
    // ...
});

/**
 * `dist/index.js`
 */
import positionController from "@riot-material/position-controller";

// or

import { default as positionController } from "@riot-material/position-controller";

otherwise you can include the script in your project html

<script src="@riot-material/position-controller/index.umd.js" />

and access it via

window.riotMaterial.positionController;

Methods

<default export>(element: HTMLElement):IPositionController

Interfaces

IPositionController

getPosition(): number

getSelectedIndex(): number

setSelectedIndex(index: number):IPositionController

getLength(): number

setLength(length: number):IPositionController

on(type, callback):IPositionController

off(type, callback):IPositionController

Types

PositionChangedEvent

detail: { position: number }

PositionAppliedEvent

detail: { previousIndex: number, currentIndex: number }

1.2.1

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago